Fixing whitespace
This commit is contained in:
@@ -179,12 +179,12 @@ namespace OpenRa.Game
|
|||||||
return Cursor.Deploy;
|
return Cursor.Deploy;
|
||||||
else
|
else
|
||||||
return Cursor.DeployBlocked;
|
return Cursor.DeployBlocked;
|
||||||
case "Deploy": return Cursor.Deploy;
|
case "Deploy": return Cursor.Deploy;
|
||||||
case "Chronoshift":
|
case "Chronoshift":
|
||||||
if (movement.CanEnterCell(location))
|
if (movement.CanEnterCell(location))
|
||||||
return Cursor.Chronoshift;
|
return Cursor.Chronoshift;
|
||||||
else
|
else
|
||||||
return Cursor.MoveBlocked;
|
return Cursor.MoveBlocked;
|
||||||
case "Enter": return Cursor.Enter;
|
case "Enter": return Cursor.Enter;
|
||||||
case "Deliver": return Cursor.Enter;
|
case "Deliver": return Cursor.Enter;
|
||||||
case "Infiltrate": return Cursor.Enter;
|
case "Infiltrate": return Cursor.Enter;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace OpenRa.Game
|
|||||||
public static Cursor Deploy { get { return new Cursor("deploy"); } }
|
public static Cursor Deploy { get { return new Cursor("deploy"); } }
|
||||||
public static Cursor Enter { get { return new Cursor("enter"); } }
|
public static Cursor Enter { get { return new Cursor("enter"); } }
|
||||||
public static Cursor DeployBlocked { get { return new Cursor("deploy-blocked"); } }
|
public static Cursor DeployBlocked { get { return new Cursor("deploy-blocked"); } }
|
||||||
public static Cursor Chronoshift { get { return new Cursor("chrono"); } }
|
public static Cursor Chronoshift { get { return new Cursor("chrono"); } }
|
||||||
public static Cursor C4 { get { return new Cursor("c4"); } }
|
public static Cursor C4 { get { return new Cursor("c4"); } }
|
||||||
public static Cursor Capture { get { return new Cursor("capture"); } }
|
public static Cursor Capture { get { return new Cursor("capture"); } }
|
||||||
public static Cursor Heal { get { return new Cursor("heal"); } }
|
public static Cursor Heal { get { return new Cursor("heal"); } }
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace OpenRa.Game
|
|||||||
public static InfoLoader<VoiceInfo> VoiceInfo;
|
public static InfoLoader<VoiceInfo> VoiceInfo;
|
||||||
public static InfoLoader<SupportPowerInfo> SupportPowerInfo;
|
public static InfoLoader<SupportPowerInfo> SupportPowerInfo;
|
||||||
public static GeneralInfo General;
|
public static GeneralInfo General;
|
||||||
public static AftermathInfo Aftermath;
|
public static AftermathInfo Aftermath;
|
||||||
public static TechTree TechTree;
|
public static TechTree TechTree;
|
||||||
public static Map Map;
|
public static Map Map;
|
||||||
public static TileSet TileSet;
|
public static TileSet TileSet;
|
||||||
@@ -48,7 +48,7 @@ namespace OpenRa.Game
|
|||||||
General = new GeneralInfo();
|
General = new GeneralInfo();
|
||||||
FieldLoader.Load(General, AllRules.GetSection("General"));
|
FieldLoader.Load(General, AllRules.GetSection("General"));
|
||||||
|
|
||||||
Aftermath = new AftermathInfo();
|
Aftermath = new AftermathInfo();
|
||||||
if (useAftermath)
|
if (useAftermath)
|
||||||
FieldLoader.Load(Aftermath, AllRules.GetSection("Aftermath"));
|
FieldLoader.Load(Aftermath, AllRules.GetSection("Aftermath"));
|
||||||
|
|
||||||
|
|||||||
@@ -6,24 +6,24 @@ using OpenRa.Game.GameRules;
|
|||||||
|
|
||||||
namespace OpenRa.Game.Traits.Activities
|
namespace OpenRa.Game.Traits.Activities
|
||||||
{
|
{
|
||||||
class Teleport : IActivity
|
class Teleport : IActivity
|
||||||
{
|
{
|
||||||
public IActivity NextActivity { get; set; }
|
public IActivity NextActivity { get; set; }
|
||||||
|
|
||||||
int2 destination;
|
int2 destination;
|
||||||
|
|
||||||
public Teleport(int2 destination)
|
public Teleport(int2 destination)
|
||||||
{
|
{
|
||||||
this.destination = destination;
|
this.destination = destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IActivity Tick(Actor self)
|
public IActivity Tick(Actor self)
|
||||||
{
|
{
|
||||||
var mobile = self.traits.Get<Mobile>();
|
var mobile = self.traits.Get<Mobile>();
|
||||||
mobile.TeleportTo(self, destination);
|
mobile.TeleportTo(self, destination);
|
||||||
return NextActivity;
|
return NextActivity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Cancel(Actor self) { }
|
public void Cancel(Actor self) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,52 +4,52 @@ using OpenRa.Game.Orders;
|
|||||||
|
|
||||||
namespace OpenRa.Game.Traits
|
namespace OpenRa.Game.Traits
|
||||||
{
|
{
|
||||||
class ChronoshiftDeploy : IOrder, ISpeedModifier, ITick, IPips
|
class ChronoshiftDeploy : IOrder, ISpeedModifier, ITick, IPips
|
||||||
{
|
{
|
||||||
public ChronoshiftDeploy(Actor self) { }
|
public ChronoshiftDeploy(Actor self) { }
|
||||||
int remainingChargeTime = 0; // How long until we can chronoshift again?
|
int remainingChargeTime = 0; // How long until we can chronoshift again?
|
||||||
int chargeTime = (int)(Rules.Aftermath.ChronoTankDuration * 60 * 25); // How long between shifts?
|
int chargeTime = (int)(Rules.Aftermath.ChronoTankDuration * 60 * 25); // How long between shifts?
|
||||||
|
|
||||||
public void Tick(Actor self)
|
|
||||||
{
|
|
||||||
if (remainingChargeTime > 0)
|
|
||||||
remainingChargeTime--;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
|
public void Tick(Actor self)
|
||||||
{
|
{
|
||||||
if (mi.Button == MouseButton.Left) return null;
|
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 new Order("Deploy", self, null, int2.Zero, null);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResolveOrder(Actor self, Order order)
|
public void ResolveOrder(Actor self, Order order)
|
||||||
{
|
{
|
||||||
if (order.OrderString == "Deploy" && remainingChargeTime <= 0)
|
if (order.OrderString == "Deploy" && remainingChargeTime <= 0)
|
||||||
{
|
{
|
||||||
Game.controller.orderGenerator = new TeleportOrderGenerator(self);
|
Game.controller.orderGenerator = new TeleportOrderGenerator(self);
|
||||||
self.CancelActivity();
|
self.CancelActivity();
|
||||||
}
|
}
|
||||||
|
|
||||||
var movement = self.traits.WithInterface<IMovement>().FirstOrDefault();
|
var movement = self.traits.WithInterface<IMovement>().FirstOrDefault();
|
||||||
if (order.OrderString == "Chronoshift" && movement.CanEnterCell(order.TargetLocation))
|
if (order.OrderString == "Chronoshift" && movement.CanEnterCell(order.TargetLocation))
|
||||||
{
|
{
|
||||||
Game.controller.CancelInputMode();
|
Game.controller.CancelInputMode();
|
||||||
self.CancelActivity();
|
self.CancelActivity();
|
||||||
self.QueueActivity(new Activities.Teleport(order.TargetLocation));
|
self.QueueActivity(new Activities.Teleport(order.TargetLocation));
|
||||||
Sound.Play("chrotnk1.aud");
|
Sound.Play("chrotnk1.aud");
|
||||||
remainingChargeTime = chargeTime;
|
remainingChargeTime = chargeTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float GetSpeedModifier()
|
public float GetSpeedModifier()
|
||||||
{
|
{
|
||||||
return (Game.controller.orderGenerator is TeleportOrderGenerator) ? 0f : 1f;
|
return (Game.controller.orderGenerator is TeleportOrderGenerator) ? 0f : 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display 5 pips indicating the current charge status
|
// Display 5 pips indicating the current charge status
|
||||||
public IEnumerable<PipType> GetPips()
|
public IEnumerable<PipType> GetPips()
|
||||||
{
|
{
|
||||||
@@ -78,5 +78,5 @@ namespace OpenRa.Game.Traits
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,16 +12,16 @@ namespace OpenRa.Game.Traits
|
|||||||
|
|
||||||
public void Attacking(Actor self)
|
public void Attacking(Actor self)
|
||||||
{
|
{
|
||||||
if (remainingUncloakTime <= 0)
|
if (remainingUncloakTime <= 0)
|
||||||
OnCloak();
|
OnCloak();
|
||||||
|
|
||||||
remainingUncloakTime = (int)(Rules.General.SubmergeDelay * 60 * 25);
|
remainingUncloakTime = (int)(Rules.General.SubmergeDelay * 60 * 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<Renderable>
|
public IEnumerable<Renderable>
|
||||||
ModifyRender(Actor self, IEnumerable<Renderable> rs)
|
ModifyRender(Actor self, IEnumerable<Renderable> rs)
|
||||||
{
|
{
|
||||||
if (remainingUncloakTime > 0)
|
if (remainingUncloakTime > 0)
|
||||||
return rs;
|
return rs;
|
||||||
|
|
||||||
if (self.Owner == Game.LocalPlayer)
|
if (self.Owner == Game.LocalPlayer)
|
||||||
@@ -32,8 +32,8 @@ namespace OpenRa.Game.Traits
|
|||||||
|
|
||||||
public void Tick(Actor self)
|
public void Tick(Actor self)
|
||||||
{
|
{
|
||||||
if (remainingUncloakTime > 0)
|
if (remainingUncloakTime > 0)
|
||||||
if (--remainingUncloakTime <= 0)
|
if (--remainingUncloakTime <= 0)
|
||||||
OnUncloak();
|
OnUncloak();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ using OpenRa.Game.Graphics;
|
|||||||
|
|
||||||
namespace OpenRa.Game.Traits
|
namespace OpenRa.Game.Traits
|
||||||
{
|
{
|
||||||
class Submarine : IRenderModifier, INotifyAttack, ITick, INotifyDamage
|
class Submarine : IRenderModifier, INotifyAttack, ITick, INotifyDamage
|
||||||
{
|
{
|
||||||
int remainingSurfaceTime = 2; /* setup for initial dive */
|
int remainingSurfaceTime = 2; /* setup for initial dive */
|
||||||
|
|
||||||
public Submarine(Actor self) { }
|
public Submarine(Actor self) { }
|
||||||
|
|
||||||
void DoSurface()
|
void DoSurface()
|
||||||
{
|
{
|
||||||
@@ -18,36 +18,36 @@ namespace OpenRa.Game.Traits
|
|||||||
remainingSurfaceTime = (int)(Rules.General.SubmergeDelay * 60 * 25);
|
remainingSurfaceTime = (int)(Rules.General.SubmergeDelay * 60 * 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Attacking(Actor self) { DoSurface(); }
|
public void Attacking(Actor self) { DoSurface(); }
|
||||||
public void Damaged(Actor self, AttackInfo e) { DoSurface(); }
|
public void Damaged(Actor self, AttackInfo e) { DoSurface(); }
|
||||||
|
|
||||||
public IEnumerable<Renderable>
|
public IEnumerable<Renderable>
|
||||||
ModifyRender(Actor self, IEnumerable<Renderable> rs)
|
ModifyRender(Actor self, IEnumerable<Renderable> rs)
|
||||||
{
|
{
|
||||||
if (remainingSurfaceTime > 0)
|
if (remainingSurfaceTime > 0)
|
||||||
return rs;
|
return rs;
|
||||||
|
|
||||||
if (self.Owner == Game.LocalPlayer)
|
if (self.Owner == Game.LocalPlayer)
|
||||||
return rs.Select(a => a.WithPalette(PaletteType.Shadow));
|
return rs.Select(a => a.WithPalette(PaletteType.Shadow));
|
||||||
else
|
else
|
||||||
return new Renderable[] { };
|
return new Renderable[] { };
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick(Actor self)
|
public void Tick(Actor self)
|
||||||
{
|
{
|
||||||
if (remainingSurfaceTime > 0)
|
if (remainingSurfaceTime > 0)
|
||||||
if (--remainingSurfaceTime <= 0)
|
if (--remainingSurfaceTime <= 0)
|
||||||
OnDive();
|
OnDive();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnSurface()
|
void OnSurface()
|
||||||
{
|
{
|
||||||
Sound.Play("subshow1.aud");
|
Sound.Play("subshow1.aud");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnDive()
|
void OnDive()
|
||||||
{
|
{
|
||||||
Sound.Play("subshow1.aud"); /* is this the right sound?? */
|
Sound.Play("subshow1.aud"); /* is this the right sound?? */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user