Move support power beacons into Airstrike/Nuke.
This allows each instance to close over the individual beacons. Fixes #5455.
This commit is contained in:
@@ -13,6 +13,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.Mods.RA.Activities;
|
using OpenRA.Mods.RA.Activities;
|
||||||
using OpenRA.Mods.RA.Air;
|
using OpenRA.Mods.RA.Air;
|
||||||
|
using OpenRA.Mods.RA.Effects;
|
||||||
using OpenRA.Primitives;
|
using OpenRA.Primitives;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
|
||||||
@@ -54,6 +55,20 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
base.Activate(self, order, manager);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
var info = Info as AirstrikePowerInfo;
|
var info = Info as AirstrikePowerInfo;
|
||||||
var attackFacing = Util.QuantizeFacing(self.World.SharedRandom.Next(256), info.QuantizedFacings) * (256 / info.QuantizedFacings);
|
var attackFacing = Util.QuantizeFacing(self.World.SharedRandom.Next(256), info.QuantizedFacings) * (256 / info.QuantizedFacings);
|
||||||
var attackRotation = WRot.FromFacing(attackFacing);
|
var attackRotation = WRot.FromFacing(attackFacing);
|
||||||
|
|||||||
@@ -68,6 +68,20 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
base.Activate(self, order, manager);
|
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))
|
if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
|
||||||
Sound.Play(Info.LaunchSound);
|
Sound.Play(Info.LaunchSound);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -31,11 +31,12 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public readonly bool DisplayTimer = false;
|
public readonly bool DisplayTimer = false;
|
||||||
|
|
||||||
|
[Desc("Beacons are only supported on the Airstrike and Nuke powers")]
|
||||||
public readonly bool DisplayBeacon = false;
|
public readonly bool DisplayBeacon = false;
|
||||||
public readonly int BeaconDuration = 10 * 25;
|
|
||||||
public readonly string BeaconPalettePrefix = "player";
|
public readonly string BeaconPalettePrefix = "player";
|
||||||
public readonly string BeaconPoster = null;
|
public readonly string BeaconPoster = null;
|
||||||
public readonly string BeaconPosterPalette = "chrome";
|
public readonly string BeaconPosterPalette = "chrome";
|
||||||
|
|
||||||
public readonly bool DisplayRadarPing = false;
|
public readonly bool DisplayRadarPing = false;
|
||||||
public readonly int RadarPingDuration = 5 * 25;
|
public readonly int RadarPingDuration = 5 * 25;
|
||||||
|
|
||||||
@@ -49,7 +50,6 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
public readonly Actor self;
|
public readonly Actor self;
|
||||||
public readonly SupportPowerInfo Info;
|
public readonly SupportPowerInfo Info;
|
||||||
protected Beacon beacon;
|
|
||||||
protected RadarPing ping;
|
protected RadarPing ping;
|
||||||
|
|
||||||
public SupportPower(Actor self, SupportPowerInfo info)
|
public SupportPower(Actor self, SupportPowerInfo info)
|
||||||
@@ -70,25 +70,14 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public virtual void Activate(Actor self, Order order, SupportPowerManager manager)
|
public virtual void Activate(Actor self, Order order, SupportPowerManager manager)
|
||||||
{
|
{
|
||||||
if (Info.DisplayBeacon)
|
|
||||||
{
|
|
||||||
beacon = new Beacon(
|
|
||||||
order.Player,
|
|
||||||
order.TargetLocation.CenterPosition,
|
|
||||||
Info.BeaconDuration,
|
|
||||||
Info.BeaconPalettePrefix,
|
|
||||||
Info.BeaconPoster,
|
|
||||||
Info.BeaconPosterPalette);
|
|
||||||
|
|
||||||
self.World.Add(beacon);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Info.DisplayRadarPing && manager.RadarPings != null)
|
if (Info.DisplayRadarPing && manager.RadarPings != null)
|
||||||
|
{
|
||||||
ping = manager.RadarPings.Value.Add(
|
ping = manager.RadarPings.Value.Add(
|
||||||
() => order.Player.IsAlliedWith(self.World.RenderPlayer),
|
() => order.Player.IsAlliedWith(self.World.RenderPlayer),
|
||||||
order.TargetLocation.CenterPosition,
|
order.TargetLocation.CenterPosition,
|
||||||
order.Player.Color.RGB,
|
order.Player.Color.RGB,
|
||||||
Info.RadarPingDuration);
|
Info.RadarPingDuration);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual IOrderGenerator OrderGenerator(string order, SupportPowerManager manager)
|
public virtual IOrderGenerator OrderGenerator(string order, SupportPowerManager manager)
|
||||||
|
|||||||
Reference in New Issue
Block a user