private void DealDamage(int damageAmount, int critChance = 0) { int modifiedDamage = Mathf.Clamp(CalculateModifiedDamage(damageAmount, critChance), 0, 999999); BattleData battleData = FindObjectOfType <BattleData>(); CharacterData character = battleData.GetCharacter(); if (battleData.GetPersonalShieldStacks() > 0) { battleData.ConsumePersonalShieldStack(); } else { character.TakeDamage(modifiedDamage); } if (modifiedDamage > 0) { SelfDamage(FindObjectOfType <ConfigData>().GetPlayerStatusEffects().GetRetaliateStacks()); } }