private void UpdateVitals(CharacterStats stats, VitalsInfo ratios, ModConfig config) { float _hp, _hpb, _sp, _spb, _mp, _mpb; stats.RefreshVitalMaxStat(); if (!(bool)config.GetValue(Settings.GameBehaviour) && stats.GetComponent <Character>().IsLocalPlayer) { _hp = SaveManager.Instance.GetCharacterSave(stats.GetComponent <Character>().UID).PSave.Health; _hpb = SaveManager.Instance.GetCharacterSave(stats.GetComponent <Character>().UID).PSave.BurntHealth; _sp = SaveManager.Instance.GetCharacterSave(stats.GetComponent <Character>().UID).PSave.Stamina; _spb = SaveManager.Instance.GetCharacterSave(stats.GetComponent <Character>().UID).PSave.BurntStamina; _mp = SaveManager.Instance.GetCharacterSave(stats.GetComponent <Character>().UID).PSave.Mana; _mpb = SaveManager.Instance.GetCharacterSave(stats.GetComponent <Character>().UID).PSave.BurntMana; } else { _hp = stats.MaxHealth * ratios.HealthRatio; _hpb = stats.MaxHealth * ratios.BurntHealthRatio; _sp = stats.MaxStamina * ratios.StaminaRatio; _spb = stats.MaxStamina * ratios.BurntStaminaRatio; _mp = stats.MaxMana * ratios.ManaRatio; _mpb = stats.MaxMana * ratios.BurntManaRatio; } stats.SetHealth(_hp); AT.SetValue(_hpb, typeof(CharacterStats), stats, "m_burntHealth"); AT.SetValue(_sp, typeof(CharacterStats), stats, "m_stamina"); AT.SetValue(_spb, typeof(CharacterStats), stats, "m_burntStamina"); stats.SetMana(_mp); AT.SetValue(_mpb, typeof(CharacterStats), stats, "m_burntMana"); }
//util public static void PseudoRegister(ModConfig config) { Dictionary <string, BBSetting> _dict = new Dictionary <string, BBSetting>(); foreach (BBSetting _bbs in config.Settings) { _dict.Add(_bbs.Name, _bbs); } AT.SetValue(_dict, typeof(ModConfig), config, "m_Settings"); }