From 385999dce9c1c4eaadaf5df9399e5077025e1859 Mon Sep 17 00:00:00 2001 From: Gustas <37534529+PunkPun@users.noreply.github.com> Date: Fri, 3 Jan 2025 14:39:21 +0200 Subject: [PATCH] Add sound to capturable blink --- OpenRA.Mods.Common/Traits/CapturableProgressBlink.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/CapturableProgressBlink.cs b/OpenRA.Mods.Common/Traits/CapturableProgressBlink.cs index d7900d2855..84f278f54f 100644 --- a/OpenRA.Mods.Common/Traits/CapturableProgressBlink.cs +++ b/OpenRA.Mods.Common/Traits/CapturableProgressBlink.cs @@ -22,6 +22,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Number of ticks to wait between repeating blinks.")] public readonly int Interval = 50; + [Desc("Sound to play at the same time the actor blinks.")] + public readonly string Sound = null; + public override object Create(ActorInitializer init) { return new CapturableProgressBlink(this); } } @@ -68,6 +71,9 @@ namespace OpenRA.Mods.Common.Traits foreach (var captor in captors) if (captor.Owner == captorOwner) self.World.Add(new FlashTarget(captor, captorOwner.Color)); + + if (Info.Sound != null) + Game.Sound.Play(SoundType.World, Info.Sound, self.CenterPosition); } if (++tick >= Info.Interval)