oops; forgot about the mouse buttons

This commit is contained in:
Chris Forbes
2009-12-28 20:06:10 +13:00
parent 8054292e17
commit e80d59e851
3 changed files with 19 additions and 8 deletions

View File

@@ -8,10 +8,13 @@ namespace OpenRa.Game.Traits
{
class EngineerCapture : IOrder
{
public const int EngineerDamage = 300;
public const int EngineerDamage = 300; // todo: push into rules, as a weapon
public EngineerCapture(Actor self) { }
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
{
if (mi.Button != MouseButton.Right) return null;
if (underCursor == null) return null;
if (!underCursor.traits.Contains<Building>()) return null;
@@ -26,7 +29,7 @@ namespace OpenRa.Game.Traits
if (order.OrderString == "Enter" || order.OrderString == "Capture")
{
self.CancelActivity();
self.QueueActivity(new Move(order.TargetActor, 2));
self.QueueActivity(new Move(order.TargetActor, 1));
self.QueueActivity(new CaptureBuilding(order.TargetActor));
}
}