Chronosphere animation and don't shift LST

This commit is contained in:
Paul Chote
2010-01-03 22:07:16 +13:00
parent 39e2bd37ac
commit de1ae72229
2 changed files with 14 additions and 2 deletions

View File

@@ -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");
}
}

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