From f60fefd5f52dc1b05d10fd1a9908f449085fc19f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 3 Jul 2014 19:15:04 +0200 Subject: [PATCH] add a ripple animation based on the move flash --- OpenRA.Mods.RA/SupportPowers/SonarPulsePower.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenRA.Mods.RA/SupportPowers/SonarPulsePower.cs b/OpenRA.Mods.RA/SupportPowers/SonarPulsePower.cs index f484a69261..01293151ce 100755 --- a/OpenRA.Mods.RA/SupportPowers/SonarPulsePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/SonarPulsePower.cs @@ -8,6 +8,7 @@ */ #endregion +using OpenRA.Effects; using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Effects; using OpenRA.Primitives; @@ -24,6 +25,9 @@ namespace OpenRA.Mods.RA public readonly string SonarPing = "sonpulse.aud"; + public readonly string RippleSequence = "moveflsh"; + public readonly string RipplePalette = "moveflash"; + public override object Create(ActorInitializer init) { return new SonarPulsePower(init.self, this); } } @@ -45,7 +49,12 @@ namespace OpenRA.Mods.RA new LocationInit(order.TargetLocation), new OwnerInit(self.Owner), }); + Sound.Play(info.SonarPing, sonar.CenterPosition); + + if (!string.IsNullOrEmpty(info.RippleSequence) && !string.IsNullOrEmpty(info.RipplePalette)) + w.Add(new SpriteEffect(sonar.CenterPosition, w, info.RippleSequence, info.RipplePalette)); + sonar.QueueActivity(new Wait(info.SonarDuration)); sonar.QueueActivity(new RemoveSelf()); });