Add beacon/radar ping placements for nukes/ion cannons/chronospheres/iron curtains.
This commit is contained in:
@@ -30,6 +30,11 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public readonly bool DisplayTimer = false;
|
||||
|
||||
public readonly bool DisplayBeacon = false;
|
||||
public readonly int BeaconDuration = 10 * 25;
|
||||
public readonly string BeaconPalettePrefix = "player";
|
||||
public readonly bool DisplayRadarPing = false;
|
||||
|
||||
public readonly string OrderName;
|
||||
public abstract object Create(ActorInitializer init);
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Effects;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
@@ -23,13 +25,16 @@ namespace OpenRA.Mods.RA
|
||||
public class SupportPowerManager : ITick, IResolveOrder
|
||||
{
|
||||
public readonly Actor self;
|
||||
public Dictionary<string, SupportPowerInstance> Powers = new Dictionary<string, SupportPowerInstance>();
|
||||
public readonly Dictionary<string, SupportPowerInstance> Powers = new Dictionary<string, SupportPowerInstance>();
|
||||
|
||||
public readonly DeveloperMode DevMode;
|
||||
public readonly Lazy<RadarPings> RadarPings;
|
||||
|
||||
public readonly DeveloperMode devMode;
|
||||
public SupportPowerManager(ActorInitializer init)
|
||||
{
|
||||
self = init.self;
|
||||
devMode = init.self.Trait<DeveloperMode>();
|
||||
DevMode = init.self.Trait<DeveloperMode>();
|
||||
RadarPings = Lazy.New(() => init.world.WorldActor.TraitOrDefault<RadarPings>());
|
||||
|
||||
init.world.ActorAdded += ActorAdded;
|
||||
init.world.ActorRemoved += ActorRemoved;
|
||||
@@ -148,7 +153,7 @@ namespace OpenRA.Mods.RA
|
||||
if (Active)
|
||||
{
|
||||
var power = Instances.First();
|
||||
if (Manager.devMode.FastCharge && RemainingTime > 25)
|
||||
if (Manager.DevMode.FastCharge && RemainingTime > 25)
|
||||
RemainingTime = 25;
|
||||
|
||||
if (RemainingTime > 0) --RemainingTime;
|
||||
@@ -187,6 +192,20 @@ namespace OpenRA.Mods.RA
|
||||
RemainingTime = TotalTime;
|
||||
notifiedCharging = notifiedReady = false;
|
||||
|
||||
if (power.Info.DisplayBeacon)
|
||||
power.self.World.Add(new Beacon(
|
||||
order.Player,
|
||||
order.TargetLocation.CenterPosition,
|
||||
power.Info.BeaconDuration,
|
||||
power.Info.BeaconPalettePrefix));
|
||||
|
||||
if (power.Info.DisplayRadarPing && Manager.RadarPings != null)
|
||||
Manager.RadarPings.Value.Add(
|
||||
() => order.Player.IsAlliedWith(power.self.World.RenderPlayer),
|
||||
order.TargetLocation.CenterPosition,
|
||||
order.Player.Color.RGB,
|
||||
power.Info.BeaconDuration);
|
||||
|
||||
if (Info.OneShot)
|
||||
Disabled = true;
|
||||
}
|
||||
|
||||
@@ -445,6 +445,8 @@ EYE:
|
||||
LaunchSound: ion1.aud
|
||||
SelectTargetSound: select1.aud
|
||||
InsufficientPowerSound: nopower1.aud
|
||||
DisplayBeacon: True
|
||||
DisplayRadarPing: True
|
||||
SupportPowerChargeBar:
|
||||
|
||||
TMPL:
|
||||
@@ -483,6 +485,8 @@ TMPL:
|
||||
LaunchSound: nuklnch1.aud
|
||||
IncomingSound: nuke1.aud
|
||||
MissileWeapon: atomic
|
||||
DisplayBeacon: True
|
||||
DisplayRadarPing: True
|
||||
SupportPowerChargeBar:
|
||||
|
||||
GUN:
|
||||
|
||||
@@ -96,6 +96,8 @@ PALACEH:
|
||||
IncomingSound:
|
||||
MissileWeapon: atomic
|
||||
SpawnOffset: -512,1c171,0
|
||||
DisplayBeacon: True
|
||||
DisplayRadarPing: True
|
||||
CanPowerDown:
|
||||
RequiresPower:
|
||||
SupportPowerChargeBar:
|
||||
|
||||
@@ -37,6 +37,8 @@ MSLO:
|
||||
MissileWeapon: atomic
|
||||
SpawnOffset: 0,427,0
|
||||
DisplayTimer: True
|
||||
DisplayBeacon: True
|
||||
DisplayRadarPing: True
|
||||
CanPowerDown:
|
||||
RequiresPower:
|
||||
SupportPowerChargeBar:
|
||||
@@ -224,6 +226,7 @@ IRON:
|
||||
InsufficientPowerSound: nopowr1.aud
|
||||
BeginChargeSound: ironchg1.aud
|
||||
EndChargeSound: ironrdy1.aud
|
||||
DisplayRadarPing: True
|
||||
SupportPowerChargeBar:
|
||||
|
||||
PDOX:
|
||||
@@ -264,6 +267,7 @@ PDOX:
|
||||
EndChargeSound: chrordy1.aud
|
||||
Duration: 20
|
||||
KillCargo: yes
|
||||
DisplayRadarPing: True
|
||||
SupportPowerChargeBar:
|
||||
-AcceptsSupplies:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user