From a9bfa553fc542ad88a527fca42b6c55f2e9cd7d4 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 6 Aug 2016 00:36:20 +0100 Subject: [PATCH] Support multiple death animation variants. --- OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs index 89c9a9f186..55986f8f92 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs @@ -42,9 +42,9 @@ namespace OpenRA.Mods.Common.Traits.Render public readonly bool CrushedPaletteIsPlayerPalette = false; [FieldLoader.LoadUsing("LoadDeathTypes")] - [Desc("Death animation to use for each damage type (defined on the warheads).", + [Desc("Death animations to use for each damage type (defined on the warheads).", "Is only used if UseDeathTypeSuffix is `True`.")] - public readonly Dictionary DeathTypes = new Dictionary(); + public readonly Dictionary DeathTypes = new Dictionary(); [Desc("Sequence to use when the actor is killed by some non-standard means (e.g. suicide).")] [SequenceReference] public readonly string FallbackSequence = null; @@ -54,8 +54,8 @@ namespace OpenRA.Mods.Common.Traits.Render var md = yaml.ToDictionary(); return md.ContainsKey("DeathTypes") - ? md["DeathTypes"].ToDictionary(my => FieldLoader.GetValue("(value)", my.Value)) - : new Dictionary(); + ? md["DeathTypes"].ToDictionary(my => FieldLoader.GetValue("(value)", my.Value)) + : new Dictionary(); } public object Create(ActorInitializer init) { return new WithDeathAnimation(init.Self, this); } @@ -99,7 +99,7 @@ namespace OpenRA.Mods.Common.Traits.Render if (damageType == null) return; - sequence += Info.DeathTypes[damageType]; + sequence += Info.DeathTypes[damageType].Random(self.World.SharedRandom); } SpawnDeathAnimation(self, self.CenterPosition, rs.GetImage(self), sequence, palette);