public DamageData(FarmUnit source, FarmUnit target) { if (target.IsTower && target.Unit.HealthPercentage > 10) { this.AutoAttackDamage = 0; } else { this.AutoAttackDamage = source.GetDamage(target); } }
public DamageInfo(FarmUnit unit, FarmUnit target) { this.Unit = unit; this.Delay = unit.GetAttackDelay(target); this.PredictedHealth = target.GetPredictedHealth(unit, this.Delay); if (this.PredictedHealth <= 0) { this.IsValid = false; return; } this.MinDamage = unit.GetDamage(target); this.IsInAttackRange = unit.Unit.Distance(target.Unit) < unit.Unit.GetAttackRange(target.Unit); }