Add a camera to the nuke.

This commit is contained in:
Paul Chote
2014-04-06 19:57:46 +12:00
parent 51363fd724
commit 56586cb4b5
5 changed files with 36 additions and 0 deletions

View File

@@ -32,6 +32,16 @@ namespace OpenRA.Mods.RA
[Desc("Descend immediately on the target, with half the FlightDelay")] [Desc("Descend immediately on the target, with half the FlightDelay")]
public readonly bool SkipAscent = false; public readonly bool SkipAscent = false;
[ActorReference]
[Desc("Actor to spawn before detonation")]
public readonly string CameraActor = null;
[Desc("Amount of time before detonation to spawn the camera")]
public readonly int CameraSpawnAdvance = 25;
[Desc("Amount of time after detonation to remove the camera")]
public readonly int CameraRemoveDelay = 25;
public override object Create(ActorInitializer init) { return new NukePower(init.self, this); } public override object Create(ActorInitializer init) { return new NukePower(init.self, this); }
} }
@@ -68,6 +78,21 @@ namespace OpenRA.Mods.RA
self.CenterPosition + body.LocalToWorld(npi.SpawnOffset), self.CenterPosition + body.LocalToWorld(npi.SpawnOffset),
order.TargetLocation.CenterPosition, order.TargetLocation.CenterPosition,
npi.FlightVelocity, npi.FlightDelay, npi.SkipAscent))); npi.FlightVelocity, npi.FlightDelay, npi.SkipAscent)));
if (npi.CameraActor != null)
{
var camera = self.World.CreateActor(false, npi.CameraActor, new TypeDictionary
{
new LocationInit(order.TargetLocation),
new OwnerInit(self.Owner),
});
camera.QueueActivity(new Wait(npi.CameraSpawnAdvance + npi.CameraRemoveDelay));
camera.QueueActivity(new RemoveSelf());
Action addCamera = () => self.World.AddFrameEndTask(w => w.Add(camera));
self.World.AddFrameEndTask(w => w.Add(new DelayedAction(npi.FlightDelay - npi.CameraSpawnAdvance, addCamera)));
}
} }
} }
} }

View File

@@ -499,6 +499,7 @@ TMPL:
DisplayBeacon: True DisplayBeacon: True
BeaconPoster: atomic BeaconPoster: atomic
DisplayRadarPing: True DisplayRadarPing: True
CameraActor: camera
SupportPowerChargeBar: SupportPowerChargeBar:
GUN: GUN:

View File

@@ -98,6 +98,7 @@ PALACEH:
SpawnOffset: -512,1c171,0 SpawnOffset: -512,1c171,0
DisplayBeacon: True DisplayBeacon: True
DisplayRadarPing: True DisplayRadarPing: True
CameraActor: camera
CanPowerDown: CanPowerDown:
DisabledOverlay: DisabledOverlay:
RequiresPower: RequiresPower:

View File

@@ -115,3 +115,11 @@ SPICEBLOOM:
Terrain: Spice Terrain: Spice
BodyOrientation: BodyOrientation:
CAMERA:
Immobile:
OccupiesSpace: false
Health:
HP: 1000
RevealsShroud:
Range: 8c0
BodyOrientation:

View File

@@ -40,6 +40,7 @@ MSLO:
DisplayBeacon: True DisplayBeacon: True
DisplayRadarPing: True DisplayRadarPing: True
BeaconPoster: atomicon BeaconPoster: atomicon
CameraActor: camera
CanPowerDown: CanPowerDown:
RequiresPower: RequiresPower:
DisabledOverlay: DisabledOverlay: