public void ReceiveAbilityDamage(int damage, AttackData data) { int finalDamage = 0; int resistance = creatureData.resistance; float damageMod = data.GetTypeMatchUp(creatureData.creatureType); if (data.HasFlag(AttackData.AttackFlags.IgnoreResistances)) { resistance = 0; } if (data.HasFlag(AttackData.AttackFlags.IgnoreType)) { damageMod = 1; } finalDamage = Mathf.Clamp(damage - Mathf.FloorToInt(resistance / damageMod), 1, 100000); currentHealth -= finalDamage; UpdateUI(); }