crude approximation, but it works.

This commit is contained in:
Chris Forbes
2009-12-28 19:33:10 +13:00
parent 436b261abf
commit 804a21443d
5 changed files with 46 additions and 5 deletions

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenRa.Game.Effects;
namespace OpenRa.Game.Traits.Activities
{
@@ -18,11 +19,8 @@ namespace OpenRa.Game.Traits.Activities
public IActivity Tick(Actor self)
{
if (target == null || target.IsDead) return NextActivity;
// 1. run to adj tile
// 2. spawn timed demolition (for +3/4s)
// 3. run away --- where?
return this;
Game.world.AddFrameEndTask(w => w.Add(new Demolition(self, target, 25 * 2)));
return NextActivity;
}
public void Cancel(Actor self) { target = null; NextActivity = null; }

View File

@@ -24,7 +24,9 @@ namespace OpenRa.Game.Traits
if (order.OrderString == "C4")
{
self.CancelActivity();
self.QueueActivity(new Move(order.TargetActor, 2));
self.QueueActivity(new Demolish(order.TargetActor));
self.QueueActivity(new Move(self.Location, 0));
}
}
}