public override UnitDamage AddDamage(FarmUnit target, float attackStartTime, bool addNext, bool forceRanged) { UnitDamage nextDamage; var damage = target.IncomingDamage.Find(x => x.IsPredicted && x.Source.Equals(this)); damage?.Delete(); if (this.Unit.IsRanged) { damage = new RangedDamage(this, target, attackStartTime, 138, 0.048f); nextDamage = new RangedDamage(damage); } else { damage = new MeleeDamage(this, target, attackStartTime, 0.036f); nextDamage = new MeleeDamage(damage); } target.IncomingDamage.Add(damage); if (addNext) { target.IncomingDamage.Add(nextDamage); } return(damage); }
public override UnitDamage AddDamage(FarmUnit target, float attackStartTime, bool addNext, bool forceRanged) { var damage = new RangedDamage(this, target, attackStartTime, 0, 0.15f, -0.3f); target.IncomingDamage.Add(damage); return(damage); }