add a ripple animation based on the move flash

This commit is contained in:
Matthias Mailänder
2014-07-03 19:15:04 +02:00
parent 43bca0e73d
commit f60fefd5f5

View File

@@ -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());
});