unhack that a bit; delayed damage works

This commit is contained in:
Chris Forbes
2010-04-01 18:30:55 +13:00
parent cefee4b1d2
commit dda6a939f1
3 changed files with 21 additions and 5 deletions

View File

@@ -69,6 +69,19 @@ namespace OpenRA
(int)GetDamageToInflict(victim, args, warhead, firepowerModifier), warhead);
}
public static void DoImpacts(ProjectileArgs args, int2 visualLocation)
{
foreach (var warhead in args.weapon.Warheads)
{
Action a = () => DoImpact(warhead, args, visualLocation);
if (warhead.Delay > 0)
args.firedBy.World.AddFrameEndTask(
w => w.Add(new DelayedAction(warhead.Delay, a)));
else
a();
}
}
static float GetMaximumSpread(WeaponInfo weapon, WarheadInfo warhead, float modifier)
{
return (int)(warhead.Spread * Math.Log(Math.Abs(weapon.Damage * modifier), 2));