private void SendDodge(Character self, float staminaCost, Vector3 _direction) { float f = (float)At.GetValue(typeof(CharacterStats), self.Stats, "m_stamina"); if (f >= staminaCost) { At.SetValue(f - staminaCost, typeof(CharacterStats), self.Stats, "m_stamina"); At.SetValue(0, typeof(Character), self, "m_dodgeAllowedInAction"); if (self.CharacterCamera && self.CharacterCamera.InZoomMode) { self.SetZoomMode(false); } self.ForceCancel(false, true); self.ResetCastType(); (self as Photon.MonoBehaviour).photonView.RPC("SendDodgeTriggerTrivial", PhotonTargets.All, new object[] { _direction }); At.Call(self, "ActionPerformed", new object[] { false }); (self as MonoBehaviour).Invoke("ResetDodgeTrigger", 0.5f); } }
private IEnumerator StopBlockingCoroutine(Character character) { yield return(new WaitForSeconds(0.05f)); // 50ms wait (1 or 2 frames) At.Call(character, "StopBlocking", null); At.SetValue(false, typeof(Character), character, "m_blockDesired"); }
public static bool Prefix(CharacterStats __instance, ref float _staminaConsumed, Character ___m_character) { if ((bool)CombatOverhaul.config.GetValue(Settings.Stamina_Burn_Offset)) { Character m_character = (Character)At.GetValue(typeof(CharacterStats), __instance, "m_character"); float m_timeOfLastStamUse = (float)At.GetValue(typeof(CharacterStats), __instance, "m_timeOfLastStamUse"); float beforeMultStamina; //1x stamina (before setting applied) float staminaCostMult = 0.01f * (float)CombatOverhaul.config.GetValue(Settings.Weapon_Stamina_Cost_Stat); if (staminaCostMult >= 1f) { beforeMultStamina = _staminaConsumed / (staminaCostMult); } else { beforeMultStamina = _staminaConsumed * staminaCostMult; } float m_stamina = (float)At.GetValue(typeof(CharacterStats), __instance, "m_stamina"); float totalStaminaUse = (_staminaConsumed) - (beforeMultStamina); if (m_character.IsPhotonPlayerLocal) { At.SetValue(m_stamina - totalStaminaUse, typeof(CharacterStats), __instance, "m_stamina"); _staminaConsumed = beforeMultStamina; } } return(true); }
private IEnumerator DodgeLateFix(Character character) { yield return(new WaitForSeconds(0.25f)); while (!character.NextIsLocomotion) { yield return(null); } At.SetValue(false, typeof(Character), character, "m_dodging"); }
public static bool Prefix(Character __instance, int _type, int _id = 0) { var self = __instance; if (self.IsLocalPlayer && (bool)CombatOverhaul.config.GetValue(Settings.Attack_Cancels_Blocking) && !self.IsAI && self.Blocking) { Instance.StartCoroutine(Instance.StopBlockingCoroutine(self)); At.Call(self, "StopBlocking", null); At.SetValue(false, typeof(Character), self, "m_blockDesired"); } return(true); }
public static bool Prefix(CharacterStats __instance) { var self = __instance; if (At.GetValue(typeof(CharacterStats), self, "m_timeOfLastStamUse") is float timeOfLast && Time.time - timeOfLast > (float)CombatOverhaul.config.GetValue(Settings.Stamina_Regen_Delay) && At.GetValue(typeof(CharacterStats), self, "m_stamina") is float m_stamina && At.GetValue(typeof(CharacterStats), self, "m_character") is Character character && !character.Blocking) { float regen = (float)CombatOverhaul.config.GetValue(Settings.Extra_Stamina_Regen) * Time.deltaTime; float newStamina = Mathf.Clamp(m_stamina + regen, 0, self.ActiveMaxStamina); At.SetValue(newStamina, typeof(CharacterStats), self, "m_stamina"); } return(true); }
public static bool Prefix(Character __instance, Vector3 _direction) { var self = __instance; if (!(bool)CombatOverhaul.config.GetValue(Settings.Custom_Bag_Burden)) { return(true); } if (self.CurrentWeapon) { if (self.HasDodgeDirection) { self.Animator.SetFloat("DodgeBlend", !self.DodgeRestricted ? 0.0f : Instance.GetDodgeRestriction(self)); } } self.Animator.SetTrigger("Dodge"); if (self.CurrentlyChargingAttack) { //self.SendCancelCharging(); At.Call(self, "SendCancelCharging", new object[0]); } // get sound player with null coalescing operator (At.GetValue(typeof(Character), self, "m_dodgeSoundPlayer") as SoundPlayer)?.Play(false); //self.m_dodging = true; At.SetValue(true, typeof(Character), self, "m_dodging"); //self.StopBlocking(); At.Call(self, "StopBlocking", new object[0]); // null coalescing OnDodgeEvent invoke self.OnDodgeEvent?.Invoke(); if (At.GetValue(typeof(Character), self, "m_characterSoundManager") is CharacterSoundManager charSounds) { Global.AudioManager.PlaySoundAtPosition(charSounds.GetDodgeSound(), self.transform, 0f, 1f, 1f, 1f, 1f); } self.SendMessage("DodgeTrigger", _direction, SendMessageOptions.DontRequireReceiver); return(false); }
private void StaggerAttacker(Character self, Animator m_animator, Character _dealerChar) { // Debug.Log(self.Name + " blocked the attack. Shield stability: " + m_shieldStability); At.SetValue(Character.HurtType.NONE, typeof(Character), self, "m_hurtType"); if (self.InLocomotion) { m_animator.SetTrigger("BlockHit"); } if ((bool)CombatOverhaul.config.GetValue(Settings.Blocking_Staggers_Attacker)) { // Debug.Log("autoknocking " + _dealerChar.Name); if (_dealerChar.CurrentWeapon.Type != Weapon.WeaponType.Bow) { _dealerChar.AutoKnock(false, new Vector3(0, 0, 0)); } } }
public static bool Prefix(Character __instance) { var self = __instance; if (At.GetValue(typeof(Character), self, "m_stability") is float m_stability && At.GetValue(typeof(Character), self, "m_timeOfLastStabilityHit") is float m_timeOfLastStabilityHit && At.GetValue(typeof(Character), self, "m_shieldStability") is float m_shieldStability && At.GetValue(typeof(Character), self, "m_knockbackCount") is float m_knockbackCount) { // ----------- original method, unchanged other than to reflect custom values ------------- if ((bool)CombatOverhaul.config.GetValue(Settings.No_Stability_Regen_When_Blocking) && self.Blocking) // no stability regen while blocking! otherwise too op { return(false); } float num = Time.time - m_timeOfLastStabilityHit; if (num > (float)CombatOverhaul.config.GetValue(Settings.Stability_Regen_Delay)) { if (m_stability < 100f) { var num2 = Mathf.Clamp(m_stability + (self.StabilityRegen * (float)CombatOverhaul.config.GetValue(Settings.Stability_Regen_Speed)) * Time.deltaTime, 0f, 100f); At.SetValue(num2, typeof(Character), self, "m_stability"); } else if (m_shieldStability < 50f) { var num2 = Mathf.Clamp(m_shieldStability + self.StabilityRegen * Time.deltaTime, 0f, 50f); At.SetValue(num2, typeof(Character), self, "m_shieldStability"); } if (num > (float)CombatOverhaul.config.GetValue(Settings.Enemy_AutoKD_Reset_Time)) { bool flag = m_knockbackCount > 0; var num2 = Mathf.Clamp(m_knockbackCount - Time.deltaTime, 0f, 4f); At.SetValue(num2, typeof(Character), self, "m_knockbackCount"); if (flag && num2 <= 0) { // Debug.Log("Resetting AI stagger count for " + self.Name); } } } } return(false); }
private void StaggerAttacker(Character self, Animator m_animator, Character _dealerChar) { String m_nameLocKey = (String)At.GetValue(typeof(Character), self, "m_nameLocKey"); String m_name = (String)At.GetValue(typeof(Character), self, "m_name"); // Debug.Log(self.Name + " blocked the attack. Shield stability: " + m_shieldStability); At.SetValue(Character.HurtType.NONE, typeof(Character), self, "m_hurtType"); if (self.InLocomotion) { m_animator.SetTrigger("BlockHit"); } if ((bool)CombatOverhaul.config.GetValue(Settings.Blocking_Staggers_Attacker)) { // Debug.Log("autoknocking " + _dealerChar.Name); if (_dealerChar.CurrentWeapon.Type != Weapon.WeaponType.Bow) { bool ShouldBounce = true; if (!(bool)CombatOverhaul.config.GetValue(Settings.BossShieldBounce)) { ShouldBounce = (int)EnemyClass.getEnemyLevel(_dealerChar) < (int)EnemyLevel.MINIBOSS; } if ((bool)CombatOverhaul.config.GetValue(Settings.OneHBounceOnly)) { if (_dealerChar.CurrentWeapon.TwoHanded && EnemyClass.getEnemyLevel(_dealerChar) != EnemyLevel.WEAKLING) { ShouldBounce = false; //2h weapons should not bounce off shields } } if (ShouldBounce) { _dealerChar.AutoKnock(false, new Vector3(0, 0, 0)); } } } }
// actual function to set an enemy's stats private void SetEnemyMods(ModConfig _config, CharacterStats _stats, Character m_character) { if (m_character == null || !m_character.IsAI || m_character.Faction == Character.Factions.Player) { //Debug.Log("trying to set stats for a null character, or a non-AI character"); return; } if (FixedEnemies.Contains(m_character.UID)) { // Debug.Log("Fixed enemies already contains " + m_character.Name); return; } var m_staminaUseModiifers = new Stat(1f); m_staminaUseModiifers.AddMultiplierStack(new StatStack("MyStat", -0.9f)); if ((bool)_config.GetValue(Settings.Enemy_Balancing)) { string stackSource = "CombatOverhaul"; if (!PhotonNetwork.isNonMasterClientInRoom) { // set health modifier var healthTag = TagSourceManager.Instance.GetTag("77"); // 77 = max health var healthStack = new StatStack(stackSource, (float)_config.GetValue(Settings.Enemy_Health) - 1); _stats.RemoveStatStack(healthTag, stackSource, true); _stats.AddStatStack(healthTag, healthStack, true); At.SetValue(_stats.CurrentHealth * (float)_config.GetValue(Settings.Enemy_Health), typeof(CharacterStats), _stats, "m_health"); } // set impact resistance var impactTag = TagSourceManager.Instance.GetTag("84"); // 84 = impact res _stats.RemoveStatStack(impactTag, stackSource, false); var impactStack = new StatStack(stackSource, (float)_config.GetValue(Settings.Enemy_ImpactRes)); _stats.AddStatStack(impactTag, impactStack, false); // damage bonus var damageTag = TagSourceManager.Instance.GetTag("96"); // 96 = all damage bonus _stats.RemoveStatStack(damageTag, stackSource, true); var damageStack = new StatStack(stackSource, (float)_config.GetValue(Settings.Enemy_Damages) * 0.01f); _stats.AddStatStack(damageTag, damageStack, true); // impact modifier var impactModifier = At.GetValue(typeof(CharacterStats), _stats, "m_impactModifier") as Stat; impactModifier.RemoveStack(stackSource, true); impactModifier.AddStack(new StatStack(stackSource, (float)_config.GetValue(Settings.Enemy_ImpactDmg) * 0.01f), true); for (int i = 0; i < 6; i++) { // damage resistance (Capped at 99, unless already 100) float currentRes = m_character.Stats.GetDamageResistance((DamageType.Types)i); if (currentRes < 100) { var valueToSet = (float)_config.GetValue(Settings.Enemy_Resistances); if (currentRes + valueToSet >= 99) { valueToSet = 99 - currentRes; } int tag = 113 + i; // 113 to 118 = damage resistance stats var damageResTag = TagSourceManager.Instance.GetTag(tag.ToString()); _stats.RemoveStatStack(damageResTag, stackSource, true); var resStack = new StatStack(stackSource, valueToSet); _stats.AddStatStack(damageResTag, resStack, false); } } } if ((bool)_config.GetValue(Settings.All_Enemies_Allied)) { m_character.ChangeFaction(Character.Factions.Bandits); m_character.TargetingSystem.AlliedToSameFaction = true; Character.Factions[] targets = new Character.Factions[] { Character.Factions.Player }; At.SetValue(targets, typeof(TargetingSystem), m_character.TargetingSystem, "TargetableFactions"); // fix skills foreach (var uid in m_character.Inventory.SkillKnowledge.GetLearnedActiveSkillUIDs()) { if (ItemManager.Instance.GetItem(uid) is Skill skill) { foreach (Shooter shooter in skill.GetComponentsInChildren <Shooter>()) { shooter.Setup(targets, shooter.transform.parent); } } } } FixedEnemies.Add(m_character.UID); }
// called from RPC manager public void SetSyncInfo(bool modsEnabled, bool enemiesAllied, bool customStats, float healthModifier, float damageModifier, float impactRes, float damageRes, float impactDmg) { m_currentHostUID = CharacterManager.Instance.GetWorldHostCharacter()?.UID; //Debug.Log("Received sync from host uid: " + m_currentHostUID); this.m_currentSyncInfos = new ModConfig { ModName = "CombatOverhaul_Sync", SettingsVersion = 1.0, Settings = new List <BBSetting> { new BoolSetting { Name = Settings.All_Enemies_Allied, m_value = enemiesAllied, DefaultValue = false, }, new BoolSetting { Name = Settings.Enemy_Balancing, m_value = customStats }, new FloatSetting { Name = Settings.Enemy_Health, m_value = healthModifier }, new FloatSetting { Name = Settings.Enemy_Damages, m_value = damageModifier }, new FloatSetting { Name = Settings.Enemy_Resistances, m_value = damageRes }, new FloatSetting { Name = Settings.Enemy_ImpactRes, m_value = impactRes }, new FloatSetting { Name = Settings.Enemy_ImpactDmg, m_value = impactDmg }, } }; // manually fix the settings dictionary since we are not using ModConfig.Register() var dict = new Dictionary <string, BBSetting>(); foreach (var setting in m_currentSyncInfos.Settings) { dict.Add(setting.Name, setting); } At.SetValue(dict, typeof(ModConfig), m_currentSyncInfos, "m_Settings"); if (modsEnabled) { //Debug.Log("Updating all current characters"); foreach (Character c in CharacterManager.Instance.Characters.Values.Where(x => x.IsAI)) { SetEnemyMods(m_currentSyncInfos, c.Stats, c); } } }
public static bool Prefix(Character __instance, Vector3 _direction) { var self = __instance; // only use this hook for local players. return orig everything else if (self.IsAI || !self.IsPhotonPlayerLocal) { return(true); } float staminaCost = (float)CombatOverhaul.config.GetValue(Settings.Custom_Dodge_Cost); if (self.Inventory.SkillKnowledge.GetItemFromItemID(8205130)) // feather dodge { staminaCost *= 0.5f; } // if dodge cancelling is NOT enabled, just do a normal dodge check. if (!(bool)CombatOverhaul.config.GetValue(Settings.Dodge_Cancelling)) { if (At.GetValue(typeof(Character), self, "m_currentlyChargingAttack") is bool m_currentlyChargingAttack && At.GetValue(typeof(Character), self, "m_preparingToSleep") is bool m_preparingToSleep && At.GetValue(typeof(Character), self, "m_nextIsLocomotion") is bool m_nextIsLocomotion && At.GetValue(typeof(Character), self, "m_dodgeAllowedInAction") is int m_dodgeAllowedInAction) { if (self.Stats.MovementSpeed > 0f && !m_preparingToSleep && (!self.LocomotionAction || m_currentlyChargingAttack) && (m_nextIsLocomotion || m_dodgeAllowedInAction > 0)) { if (!self.Dodging) { Instance.SendDodge(self, staminaCost, _direction); } return(false); } } } else // cancelling enabled. check if we should allow the dodge { if (Instance.PlayerLastHitTimes.ContainsKey(self.UID) && Time.time - Instance.PlayerLastHitTimes[self.UID] < (float)CombatOverhaul.config.GetValue(Settings.Dodge_DelayAfterHit)) { // Debug.Log("Player has hit within the last few seconds. Dodge not allowed!"); return(false); } Character.HurtType hurtType = (Character.HurtType)At.GetValue(typeof(Character), self, "m_hurtType"); // manual fix (game sometimes does not reset HurtType to NONE when animation ends. float timeout = (float)CombatOverhaul.config.GetValue(Settings.Dodge_DelayAfterStagger); if (hurtType == Character.HurtType.Knockdown) { timeout = (float)CombatOverhaul.config.GetValue(Settings.Dodge_DelayAfterKD); } if ((float)At.GetValue(typeof(Character), self, "m_timeOfLastStabilityHit") is float lasthit && Time.time - lasthit > timeout) { hurtType = Character.HurtType.NONE; At.SetValue(hurtType, typeof(Character), self, "m_hurtType"); } // if we're not currently dodging or staggered, force an animation cancel dodge (provided we have enough stamina). if (!self.Dodging && hurtType == Character.HurtType.NONE) { Instance.SendDodge(self, staminaCost, _direction); } // send a fix to force m_dodging to false after a short delay. // this is a fix for if the player dodges while airborne, the game wont reset their m_dodging to true when they land. Instance.StartCoroutine(Instance.DodgeLateFix(self)); } return(false); }
public static bool Prefix(Character __instance, float _knockValue, float _angle, bool _block, Character _dealerChar) { var self = __instance; var _base = self as Photon.MonoBehaviour; if (At.GetValue(typeof(Character), self, "m_impactImmune") is bool m_impactImmune && At.GetValue(typeof(Character), self, "m_shieldStability") is float m_shieldStability && At.GetValue(typeof(Character), self, "m_stability") is float m_stability && At.GetValue(typeof(Character), self, "m_knockbackCount") is float m_knockbackCount && At.GetValue(typeof(Character), self, "m_knockHurtAllowed") is bool m_knockHurtAllowed && At.GetValue(typeof(Character), self, "m_currentlyChargingAttack") is bool m_currentlyChargingAttack && At.GetValue(typeof(Character), self, "m_animator") is Animator m_animator) { // Begin actual stability hit function var hit = _knockValue; if (hit < 0) { hit = 0; } if (!m_impactImmune && hit > 0f) { //Debug.Log("--------- " + self.Name + " ---------"); // check stagger immunity dictionary (custom) float lastStagger = -1; if (Instance.LastStaggerTimes.ContainsKey(self.UID)) { lastStagger = Instance.LastStaggerTimes[self.UID]; } // if you run out of stamina and get hit, you will always get staggered. (unchanged, except to reflect custom stagger threshold) if (self.Stats.CurrentStamina < 1f) { float hitToStagger = m_shieldStability + m_stability - (100 - (float)CombatOverhaul.config.GetValue(Settings.Stagger_Threshold)); if (hit < hitToStagger) { hit = hitToStagger; } //Debug.LogError("Stamina autostagger called! hitToStagger: " + hitToStagger + ", hit: " + hit); } At.SetValue(Time.time, typeof(Character), self, "m_timeOfLastStabilityHit"); // Debug.Log("Set " + Time.time + " as character's last stability hit"); if (self.CharacterCamera != null && hit > 0f) { self.CharacterCamera.Hit(hit * 6f); } // check shield stability if blocking (unchanged) if (_block && m_shieldStability > 0f) { if (hit > m_shieldStability) { var num2 = m_stability - (hit - m_shieldStability); At.SetValue(num2, typeof(Character), self, "m_stability"); m_stability = num2; } var num3 = Mathf.Clamp(m_shieldStability - hit, 0f, 50f); At.SetValue(num3, typeof(Character), self, "m_shieldStability"); m_shieldStability = num3; } // check non-blocking stability (unchanged) else { var num2 = Mathf.Clamp(m_stability - hit, 0f, 100f); At.SetValue(num2, typeof(Character), self, "m_stability"); m_stability = num2; } // if hit takes us below knockdown threshold, or if AI auto-knockdown stagger count was reached... if (m_stability <= (float)CombatOverhaul.config.GetValue(Settings.Knockdown_Threshold) || (self.IsAI && m_knockbackCount >= (float)CombatOverhaul.config.GetValue(Settings.Enemy_AutoKD_Count))) { //Debug.LogError("Knockdown! Hit Value: " + _knockValue + ", current stability: " + m_stability); if ((!self.IsAI && _base.photonView.isMine) || (self.IsAI && (_dealerChar == null || _dealerChar.photonView.isMine))) { _base.photonView.RPC("SendKnock", PhotonTargets.All, new object[] { true, m_stability }); } else { At.Call(self, "Knock", new object[] { true }); } At.SetValue(0f, typeof(Character), self, "m_stability"); m_stability = 0f; if (self.IsPhotonPlayerLocal) { self.BlockInput(false); } } // else if hit is a stagger... else if (m_stability <= (float)CombatOverhaul.config.GetValue(Settings.Stagger_Threshold) && (Time.time - lastStagger > (float)CombatOverhaul.config.GetValue(Settings.Stagger_Immunity_Period))) { // Debug.LogWarning("Stagger! Hit Value: " + _knockValue + ", current stability: " + m_stability); // update Stagger Immunity dictionary if (!Instance.LastStaggerTimes.ContainsKey(self.UID)) { Instance.LastStaggerTimes.Add(self.UID, Time.time); } else { Instance.LastStaggerTimes[self.UID] = Time.time; } if ((!self.IsAI && _base.photonView.isMine) || (self.IsAI && (_dealerChar == null || _dealerChar.photonView.isMine))) { _base.photonView.RPC("SendKnock", PhotonTargets.All, new object[] { false, m_stability }); } else { At.Call(self, "Knock", new object[] { false }); } if (self.IsPhotonPlayerLocal && _block) { self.BlockInput(false); } } // else if we are not blocking... else if (!_block) { // Debug.Log("Value: " + _knockValue + ", new stability: " + m_stability); if (m_knockHurtAllowed) { At.SetValue(Character.HurtType.Hurt, typeof(Character), self, "m_hurtType"); if (m_currentlyChargingAttack) { self.CancelCharging(); } m_animator.SetTrigger("Knockhurt"); _base.StopCoroutine("KnockhurtRoutine"); MethodInfo _knockhurtRoutine = self.GetType().GetMethod("KnockhurtRoutine", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); IEnumerator _knockEnum = (IEnumerator)_knockhurtRoutine.Invoke(self, new object[] { hit }); _base.StartCoroutine(_knockEnum); } if (m_stability <= (float)CombatOverhaul.config.GetValue(Settings.Stagger_Immunity_Period)) { // Debug.LogError(self.Name + " would have staggered. Current delta: " + (Time.time - lastStagger)); } } else // hit was blocked and no stagger { Instance.StaggerAttacker(self, m_animator, _dealerChar); } m_animator.SetInteger("KnockAngle", (int)_angle); self.StabilityHitCall?.Invoke(); } else if (!m_impactImmune && _block) // hit dealt 0 impact and was blocked { Instance.StaggerAttacker(self, m_animator, _dealerChar); } } return(false); }
public static bool Prefix(Character __instance) { var self = __instance; if (At.GetValue(typeof(Character), self, "m_stability") is float m_stability && At.GetValue(typeof(Character), self, "m_timeOfLastStabilityHit") is float m_timeOfLastStabilityHit && At.GetValue(typeof(Character), self, "m_shieldStability") is float m_shieldStability && At.GetValue(typeof(Character), self, "m_knockbackCount") is float m_knockbackCount) { String m_nameLocKey = (String)At.GetValue(typeof(Character), self, "m_nameLocKey"); String m_name = (String)At.GetValue(typeof(Character), self, "m_name"); // ----------- original method, unchanged other than to reflect custom values ------------- if ((bool)CombatOverhaul.config.GetValue(Settings.No_Stability_Regen_When_Blocking) && self.Blocking) // no stability regen while blocking! otherwise too op { return(false); } float num = Time.time - m_timeOfLastStabilityHit; if (num > (float)CombatOverhaul.config.GetValue(Settings.Stability_Regen_Delay)) { if (m_stability < 100f && !(bool)CombatOverhaul.config.GetValue(Settings.Poise)) { var num2 = Mathf.Clamp(m_stability + (self.StabilityRegen * (float)CombatOverhaul.config.GetValue(Settings.Stability_Regen_Speed)) * Time.deltaTime, 0f, 100f); At.SetValue(num2, typeof(Character), self, "m_stability"); } else if (m_shieldStability < 50f) { var num2 = Mathf.Clamp(m_shieldStability + self.StabilityRegen * Time.deltaTime, 0f, 50f); At.SetValue(num2, typeof(Character), self, "m_shieldStability"); } if (num > (float)CombatOverhaul.config.GetValue(Settings.Enemy_AutoKD_Reset_Time)) { bool flag = m_knockbackCount > 0; var num2 = Mathf.Clamp(m_knockbackCount - Time.deltaTime, 0f, 4f); if ((bool)CombatOverhaul.config.GetValue(Settings.BossPoise)) { if ((int)EnemyClass.getEnemyLevel(self) < (int)EnemyLevel.MINIBOSS) { At.SetValue(num2, typeof(Character), self, "m_knockbackCount"); } } else { At.SetValue(num2, typeof(Character), self, "m_knockbackCount"); } if (flag && num2 <= 0) { // Debug.Log("Resetting AI stagger count for " + self.Name); } } } if ((bool)CombatOverhaul.config.GetValue(Settings.Poise)) { if (num > (float)CombatOverhaul.config.GetValue(Settings.PoiseResetTime)) { bool resetStability = false; if ((bool)CombatOverhaul.config.GetValue(Settings.BossPoise)) { //Minibosses do NOT regenerate stamina. if ((int)EnemyClass.getEnemyLevel(self) < (int)EnemyLevel.MINIBOSS) { resetStability = true; } } else { resetStability = true; } //Initially for readability, allowing display of stability hurt on a stagger actually meant (even badly) coordinated strikes knocked down too much. if (resetStability /*&& num > 0.25*/) { At.SetValue(100f, typeof(Character), self, "m_stability"); } } } } return(false); }