This commit is contained in:
Chris Forbes
2010-01-03 22:18:01 +13:00
2 changed files with 12 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ namespace OpenRa.Game.Traits
// Return-to-sender logic
int2 chronoshiftOrigin;
int chronoshiftReturnTicks = 0;
public Chronoshiftable(Actor self) { }
public void Tick(Actor self)
@@ -46,9 +46,14 @@ namespace OpenRa.Game.Traits
var movement = self.traits.WithInterface<IMovement>().FirstOrDefault();
if (order.OrderString == "Chronoshift" && movement.CanEnterCell(order.TargetLocation))
{
// Set up return-to-sender info
chronoshiftOrigin = self.Location;
chronoshiftReturnTicks = (int)(Rules.General.ChronoDuration * 60 * 25);
// TODO: Kill cargo if Rules.General.ChronoKillCargo says so
// Set up the teleport
Game.controller.CancelInputMode();
self.CancelActivity();
self.QueueActivity(new Activities.Teleport(order.TargetLocation));
@@ -56,6 +61,11 @@ namespace OpenRa.Game.Traits
foreach (var a in Game.world.Actors.Where(a => a.traits.Contains<ChronoshiftPaletteEffect>()))
a.traits.Get<ChronoshiftPaletteEffect>().DoChronoshift();
// Play chronosphere active anim
var chronosphere = Game.world.Actors.Where(a => a.Owner == order.Subject.Owner && a.traits.Contains<Chronosphere>()).FirstOrDefault();
if (chronosphere != null)
chronosphere.traits.Get<RenderBuilding>().PlayCustomAnim(chronosphere, "active");
}
}

View File

@@ -138,7 +138,7 @@ Recoil=3
[LST]
Description=Transport
WaterBound=yes
Traits=Unit, Mobile, RenderUnit, Chronoshiftable
Traits=Unit, Mobile, RenderUnit
LongDesc=General-purpose naval transport.\nCan carry infantry and tanks.\n Unarmed
[PT]
Description=Gunboat