merged
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user