diff --git a/OpenRA.Mods.Cnc/Projectiles/IonCannon.cs b/OpenRA.Mods.Cnc/Projectiles/IonCannon.cs index e710ebf7f9..1f4a81dcc5 100644 --- a/OpenRA.Mods.Cnc/Projectiles/IonCannon.cs +++ b/OpenRA.Mods.Cnc/Projectiles/IonCannon.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Cnc.Effects int weaponDelay; bool impacted = false; - public IonCannon(Player firedBy, WeaponInfo weapon, World world, CPos location, string effect, string palette, int delay) + public IonCannon(Player firedBy, WeaponInfo weapon, World world, CPos location, string effect, string sequence, string palette, int delay) { this.firedBy = firedBy; this.weapon = weapon; @@ -37,7 +37,7 @@ namespace OpenRA.Mods.Cnc.Effects weaponDelay = delay; target = Target.FromCell(world, location); anim = new Animation(world, effect); - anim.PlayThen("idle", () => Finish(world)); + anim.PlayThen(sequence, () => Finish(world)); } public void Tick(World world) diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithDeliveryAnimation.cs b/OpenRA.Mods.Cnc/Traits/Render/WithDeliveryAnimation.cs index 6676a486ed..b58f701964 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithDeliveryAnimation.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithDeliveryAnimation.cs @@ -18,9 +18,9 @@ namespace OpenRA.Mods.Cnc.Traits.Render [Desc("Building animation to play when ProductionAirdrop is used to deliver units.")] public class WithDeliveryAnimationInfo : ITraitInfo, Requires { - public readonly string ActiveSequence = "active"; + [SequenceReference] public readonly string ActiveSequence = "active"; - public readonly string IdleSequence = "idle"; + [SequenceReference] public readonly string IdleSequence = "idle"; public object Create(ActorInitializer init) { return new WithDeliveryAnimation(init.Self, this); } } diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithRoof.cs b/OpenRA.Mods.Cnc/Traits/Render/WithRoof.cs index 7659e31c49..6540366e7f 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithRoof.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithRoof.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render [Desc("Provides an overlay for the Tiberian Dawn hover craft.")] public class WithRoofInfo : ITraitInfo, Requires { - public readonly string Sequence = "roof"; + [SequenceReference] public readonly string Sequence = "roof"; public object Create(ActorInitializer init) { return new WithRoof(init.Self, this); } } diff --git a/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs b/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs index 34e995c31d..44ac999112 100644 --- a/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs +++ b/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs @@ -27,8 +27,12 @@ namespace OpenRA.Mods.Cnc.Traits [Desc("Amount of time to keep the camera alive")] public readonly int CameraRemoveDelay = 25; - [Desc("Effect sequence to display")] + [Desc("Effect sequence sprite image")] public readonly string Effect = "ionsfx"; + + [Desc("Effect sequence to display")] + [SequenceReference("Effect")] public readonly string EffectSequence = "idle"; + [PaletteReference] public readonly string EffectPalette = "effect"; [Desc("Which weapon to fire"), WeaponReference] @@ -60,7 +64,7 @@ namespace OpenRA.Mods.Cnc.Traits self.World.AddFrameEndTask(w => { Game.Sound.Play(Info.LaunchSound, self.World.Map.CenterOfCell(order.TargetLocation)); - w.Add(new IonCannon(self.Owner, info.WeaponInfo, w, order.TargetLocation, info.Effect, info.EffectPalette, info.WeaponDelay)); + w.Add(new IonCannon(self.Owner, info.WeaponInfo, w, order.TargetLocation, info.Effect, info.EffectSequence, info.EffectPalette, info.WeaponDelay)); if (info.CameraActor == null) return;