Fixing whitespace
This commit is contained in:
@@ -4,52 +4,52 @@ using OpenRa.Game.Orders;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class ChronoshiftDeploy : IOrder, ISpeedModifier, ITick, IPips
|
||||
{
|
||||
public ChronoshiftDeploy(Actor self) { }
|
||||
int remainingChargeTime = 0; // How long until we can chronoshift again?
|
||||
int chargeTime = (int)(Rules.Aftermath.ChronoTankDuration * 60 * 25); // How long between shifts?
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
if (remainingChargeTime > 0)
|
||||
remainingChargeTime--;
|
||||
}
|
||||
class ChronoshiftDeploy : IOrder, ISpeedModifier, ITick, IPips
|
||||
{
|
||||
public ChronoshiftDeploy(Actor self) { }
|
||||
int remainingChargeTime = 0; // How long until we can chronoshift again?
|
||||
int chargeTime = (int)(Rules.Aftermath.ChronoTankDuration * 60 * 25); // How long between shifts?
|
||||
|
||||
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
|
||||
{
|
||||
if (mi.Button == MouseButton.Left) return null;
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
if (remainingChargeTime > 0)
|
||||
remainingChargeTime--;
|
||||
}
|
||||
|
||||
else if (xy == self.Location && remainingChargeTime <= 0)
|
||||
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
|
||||
{
|
||||
if (mi.Button == MouseButton.Left) return null;
|
||||
|
||||
else if (xy == self.Location && remainingChargeTime <= 0)
|
||||
return new Order("Deploy", self, null, int2.Zero, null);
|
||||
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void ResolveOrder(Actor self, Order order)
|
||||
{
|
||||
if (order.OrderString == "Deploy" && remainingChargeTime <= 0)
|
||||
{
|
||||
public void ResolveOrder(Actor self, Order order)
|
||||
{
|
||||
if (order.OrderString == "Deploy" && remainingChargeTime <= 0)
|
||||
{
|
||||
Game.controller.orderGenerator = new TeleportOrderGenerator(self);
|
||||
self.CancelActivity();
|
||||
}
|
||||
|
||||
self.CancelActivity();
|
||||
}
|
||||
|
||||
var movement = self.traits.WithInterface<IMovement>().FirstOrDefault();
|
||||
if (order.OrderString == "Chronoshift" && movement.CanEnterCell(order.TargetLocation))
|
||||
{
|
||||
{
|
||||
Game.controller.CancelInputMode();
|
||||
self.CancelActivity();
|
||||
self.QueueActivity(new Activities.Teleport(order.TargetLocation));
|
||||
Sound.Play("chrotnk1.aud");
|
||||
remainingChargeTime = chargeTime;
|
||||
}
|
||||
}
|
||||
|
||||
public float GetSpeedModifier()
|
||||
{
|
||||
return (Game.controller.orderGenerator is TeleportOrderGenerator) ? 0f : 1f;
|
||||
}
|
||||
|
||||
self.QueueActivity(new Activities.Teleport(order.TargetLocation));
|
||||
Sound.Play("chrotnk1.aud");
|
||||
remainingChargeTime = chargeTime;
|
||||
}
|
||||
}
|
||||
|
||||
public float GetSpeedModifier()
|
||||
{
|
||||
return (Game.controller.orderGenerator is TeleportOrderGenerator) ? 0f : 1f;
|
||||
}
|
||||
|
||||
// Display 5 pips indicating the current charge status
|
||||
public IEnumerable<PipType> GetPips()
|
||||
{
|
||||
@@ -78,5 +78,5 @@ namespace OpenRa.Game.Traits
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user