Add clock overlay to support power beacons.
This commit is contained in:
@@ -68,20 +68,6 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
base.Activate(self, order, manager);
|
||||
|
||||
Beacon beacon = null;
|
||||
if (Info.DisplayBeacon)
|
||||
{
|
||||
beacon = new Beacon(
|
||||
order.Player,
|
||||
order.TargetLocation.CenterPosition,
|
||||
-1,
|
||||
Info.BeaconPalettePrefix,
|
||||
Info.BeaconPoster,
|
||||
Info.BeaconPosterPalette);
|
||||
|
||||
self.World.Add(beacon);
|
||||
}
|
||||
|
||||
if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
|
||||
Sound.Play(Info.LaunchSound);
|
||||
else
|
||||
@@ -91,10 +77,12 @@ namespace OpenRA.Mods.RA
|
||||
var rb = self.Trait<RenderSimple>();
|
||||
rb.PlayCustomAnim(self, "active");
|
||||
|
||||
self.World.AddFrameEndTask(w => w.Add(new NukeLaunch(self.Owner, npi.MissileWeapon,
|
||||
var missile = new NukeLaunch(self.Owner, npi.MissileWeapon,
|
||||
self.CenterPosition + body.LocalToWorld(npi.SpawnOffset),
|
||||
order.TargetLocation.CenterPosition,
|
||||
npi.FlightVelocity, npi.FlightDelay, npi.SkipAscent)));
|
||||
npi.FlightVelocity, npi.FlightDelay, npi.SkipAscent);
|
||||
|
||||
self.World.AddFrameEndTask(w => w.Add(missile));
|
||||
|
||||
if (npi.CameraActor != null)
|
||||
{
|
||||
@@ -111,15 +99,29 @@ namespace OpenRA.Mods.RA
|
||||
self.World.AddFrameEndTask(w => w.Add(new DelayedAction(npi.FlightDelay - npi.CameraSpawnAdvance, addCamera)));
|
||||
}
|
||||
|
||||
if (beacon != null)
|
||||
if (Info.DisplayBeacon)
|
||||
{
|
||||
var beacon = new Beacon(
|
||||
order.Player,
|
||||
order.TargetLocation.CenterPosition,
|
||||
Info.BeaconPalettePrefix,
|
||||
Info.BeaconPoster,
|
||||
Info.BeaconPosterPalette,
|
||||
() => missile.FractionComplete
|
||||
);
|
||||
|
||||
|
||||
Action removeBeacon = () => self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
w.Remove(beacon);
|
||||
beacon = null;
|
||||
});
|
||||
|
||||
self.World.AddFrameEndTask(w => w.Add(new DelayedAction(npi.FlightDelay - npi.BeaconRemoveAdvance, removeBeacon)));
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
w.Add(beacon);
|
||||
w.Add(new DelayedAction(npi.FlightDelay - npi.BeaconRemoveAdvance, removeBeacon));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user