public override bool Act() { FinnalDamage finnalDamage = Self.CorrectDamage(originDamage); foreach (var target in UnitManager.Instance.GetUnits(Self, Targets)) { target.TakeDamage(finnalDamage); } return(true); }
public float DamageCheck(FinnalDamage finnalDamage) { float resistanceRate = ResistanceRate.FixedValue - finnalDamage.penetrate.PenetrateRate; resistanceRate = Math.Max(0, resistanceRate); resistanceRate /= 100f; float resistanceStatic = ResistanceStatic.FixedValue - finnalDamage.penetrate.PenetrateStatic; resistanceStatic = Math.Max(0, resistanceStatic); return(finnalDamage.damage * (1 - resistanceRate) - resistanceStatic); }
//单位受到伤害 public void TakeDamage(FinnalDamage finnalDamage) { float TakedNumber = resistanceGroup.GetResistance(finnalDamage.damageType).DamageCheck(finnalDamage); LoseLife(TakedNumber); }