minelayer maybe works
This commit is contained in:
33
OpenRa.Game/Traits/Minelayer.cs
Normal file
33
OpenRa.Game/Traits/Minelayer.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class Minelayer : IOrder
|
||||
{
|
||||
public Minelayer(Actor self) { }
|
||||
|
||||
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
|
||||
{
|
||||
// todo: check for ammo
|
||||
if (mi.Button == MouseButton.Right && underCursor == self)
|
||||
return new Order("DeployMine", self, null, int2.Zero, null);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void ResolveOrder(Actor self, Order order)
|
||||
{
|
||||
if (order.OrderString == "DeployMine")
|
||||
{
|
||||
// todo: check for and adjust ammo
|
||||
// todo: delay a bit?
|
||||
|
||||
Game.world.AddFrameEndTask(
|
||||
w => w.Add(new Actor(Rules.UnitInfo[self.Info.Primary], self.Location, self.Owner)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user