Chronosphere animation and don't shift LST
This commit is contained in:
@@ -14,7 +14,7 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
// Screen fade logic
|
||||
int animationTick = 0;
|
||||
int animationLength = 10;
|
||||
int animationLength = 20;
|
||||
bool animationStarted = false;
|
||||
|
||||
public Chronoshiftable(Actor self) { }
|
||||
@@ -61,14 +61,26 @@ 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));
|
||||
Sound.Play("chrono2.aud");
|
||||
|
||||
// Start the screen-fade animation
|
||||
animationStarted = true;
|
||||
|
||||
// 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