Aura.Channel.Skills.SkillHelper.HandleDefenseProtection C# (CSharp) Méthode

HandleDefenseProtection() public static méthode

Reduces damage by target's defense and protection.
public static HandleDefenseProtection ( Creature target, float &damage, bool defense = true, bool protection = true ) : void
target Aura.Channel.World.Entities.Creature
damage float
defense bool
protection bool
Résultat void
		public static void HandleDefenseProtection(Creature target, ref float damage, bool defense = true, bool protection = true)
		{
			if (defense)
				damage = Math.Max(1, damage - target.Defense);
			if (protection && damage > 1)
				damage = Math.Max(1, damage - (damage * target.Protection));
		}