remove the default impl of QueueAttack; implement it in AttackFrontal and AttackLeap

This commit is contained in:
Bob
2010-11-13 14:59:33 +13:00
parent caae95f12e
commit 04e05d9aed
3 changed files with 25 additions and 10 deletions

View File

@@ -181,16 +181,7 @@ namespace OpenRA.Mods.RA
return (order.OrderString == "Attack") ? "Attack" : null;
}
protected virtual void QueueAttack(Actor self, Target newTarget)
{
var weapon = ChooseWeaponForTarget(newTarget);
if (weapon != null)
self.QueueActivity(
new Activities.Attack(
newTarget,
Math.Max(0, (int)weapon.Info.Range)));
}
protected abstract void QueueAttack(Actor self, Target newTarget);
public bool HasAnyValidWeapons(Target t) { return Weapons.Any(w => w.IsValidAgainst(self.World, t)); }
public float GetMaximumRange() { return Weapons.Max(w => w.Info.Range); }