diff --git a/OpenRA.Mods.Common/Effects/Beacon.cs b/OpenRA.Mods.Common/Effects/Beacon.cs index 623d9068f0..03049e3a52 100644 --- a/OpenRA.Mods.Common/Effects/Beacon.cs +++ b/OpenRA.Mods.Common/Effects/Beacon.cs @@ -34,25 +34,25 @@ namespace OpenRA.Mods.Common.Effects int arrowSpeed = 50; // Player-placed beacons are removed after a delay - public Beacon(Player owner, WPos position, int duration, string palettePrefix) + public Beacon(Player owner, WPos position, int duration, string palettePrefix, string beaconCollection, string arrowSprite, string circleSprite) { this.owner = owner; this.position = position; this.palettePrefix = palettePrefix; - arrow = new Animation(owner.World, "beacon"); - circles = new Animation(owner.World, "beacon"); + arrow = new Animation(owner.World, beaconCollection); + circles = new Animation(owner.World, beaconCollection); - arrow.Play("arrow"); - circles.Play("circles"); + arrow.Play(arrowSprite); + circles.Play(circleSprite); if (duration > 0) owner.World.Add(new DelayedAction(duration, () => owner.World.Remove(this))); } // Support power beacons are expected to clean themselves up - public Beacon(Player owner, WPos position, string palettePrefix, string posterCollection, string posterType, string posterPalette, string clockSequence, Func clockFraction) - : this(owner, position, -1, palettePrefix) + public Beacon(Player owner, WPos position, string palettePrefix, string posterCollection, string posterType, string posterPalette, string arrowSequence, string circleSequence, + string clockSequence, Func clockFraction) : this(owner, position, -1, palettePrefix, posterCollection, arrowSequence, circleSequence) { this.posterPalette = posterPalette; diff --git a/OpenRA.Mods.Common/Scripting/Global/BeaconGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/BeaconGlobal.cs index 14cb7fe87b..30b998c14e 100644 --- a/OpenRA.Mods.Common/Scripting/Global/BeaconGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/BeaconGlobal.cs @@ -27,9 +27,10 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Creates a new beacon that stays for the specified time at the specified WPos. " + "Does not remove player set beacons, nor gets removed by placing them.")] - public Beacon New(Player owner, WPos position, int duration = 30 * 25, bool showRadarPings = true, string palettePrefix = "player") + public Beacon New(Player owner, WPos position, int duration = 30 * 25, bool showRadarPings = true, + string palettePrefix = "player", string beaconCollection = "beacon", string arrowSequence = "arrow", string circleSequence = "circle") { - var playerBeacon = new Beacon(owner, position, duration, palettePrefix); + var playerBeacon = new Beacon(owner, position, duration, palettePrefix, beaconCollection, arrowSequence, circleSequence); owner.PlayerActor.World.AddFrameEndTask(w => w.Add(playerBeacon)); if (showRadarPings && radarPings != null) diff --git a/OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs b/OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs index cafec3fad9..8448c85e9a 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs @@ -19,8 +19,14 @@ namespace OpenRA.Mods.Common.Traits public readonly int Duration = 30 * 25; public readonly string NotificationType = "Sounds"; public readonly string Notification = "Beacon"; + + [PaletteReference(true)] public readonly string PalettePrefix = "player"; + public readonly string BeaconImage = "beacon"; + [SequenceReference("BeaconImage")] public readonly string ArrowSequence = "arrow"; + [SequenceReference("BeaconImage")] public readonly string CircleSequence = "circles"; + public object Create(ActorInitializer init) { return new PlaceBeacon(init.Self, this); } } @@ -50,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits if (playerBeacon != null) self.World.Remove(playerBeacon); - playerBeacon = new Beacon(self.Owner, pos, info.Duration, info.PalettePrefix); + playerBeacon = new Beacon(self.Owner, pos, info.Duration, info.PalettePrefix, info.BeaconImage, info.ArrowSequence, info.CircleSequence); self.World.Add(playerBeacon); if (self.Owner.IsAlliedWith(self.World.RenderPlayer)) diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/AirstrikePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/AirstrikePower.cs index c4a2a848e0..8af698d990 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/AirstrikePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/AirstrikePower.cs @@ -173,6 +173,8 @@ namespace OpenRA.Mods.Common.Traits Info.BeaconImage, Info.BeaconPoster, Info.BeaconPosterPalette, + Info.ArrowSequence, + Info.CircleSequence, Info.ClockSequence, () => 1 - ((distanceTestActor.CenterPosition - target).HorizontalLength - info.BeaconDistanceOffset.Length) * 1f / distance); diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs index 8c929a60e7..0c004ead3d 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs @@ -138,6 +138,8 @@ namespace OpenRA.Mods.Common.Traits Info.BeaconImage, Info.BeaconPoster, Info.BeaconPosterPalette, + Info.ArrowSequence, + Info.CircleSequence, Info.ClockSequence, () => missile.FractionComplete); diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs index 2d7f8a9126..f5289d485f 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs @@ -51,6 +51,9 @@ namespace OpenRA.Mods.Common.Traits [PaletteReference] public readonly string BeaconPosterPalette = "chrome"; [SequenceReference("BeaconImage")] public readonly string ClockSequence = "clock"; + [SequenceReference("BeaconImage")] public readonly string ArrowSequence = "arrow"; + [SequenceReference("BeaconImage")] public readonly string CircleSequence = "circles"; + public readonly bool DisplayRadarPing = false; [Desc("Measured in ticks.")] diff --git a/OpenRA.Mods.RA/Traits/SupportPowers/ParatroopersPower.cs b/OpenRA.Mods.RA/Traits/SupportPowers/ParatroopersPower.cs index 01f7b53cb2..48a6221f29 100644 --- a/OpenRA.Mods.RA/Traits/SupportPowers/ParatroopersPower.cs +++ b/OpenRA.Mods.RA/Traits/SupportPowers/ParatroopersPower.cs @@ -208,6 +208,8 @@ namespace OpenRA.Mods.RA.Traits Info.BeaconImage, Info.BeaconPoster, Info.BeaconPosterPalette, + Info.ArrowSequence, + Info.CircleSequence, Info.ClockSequence, () => 1 - ((distanceTestActor.CenterPosition - target).HorizontalLength - info.BeaconDistanceOffset.Length) * 1f / distance);