diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 900acd40a2..6ec27b3bee 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -11,7 +11,6 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.IO; using System.Linq; namespace OpenRA.Mods.Common.UtilityCommands @@ -868,7 +867,7 @@ namespace OpenRA.Mods.Common.UtilityCommands var rearmSound = minelayerFields.FirstOrDefault(rs => rs.Key == "RearmSound"); var minelayerRearmSound = rearmSound != null ? FieldLoader.GetValue("RearmSound", rearmSound.Value.Value) : "minelay1.aud"; - limitedAmmoFields.Add(new MiniYamlNode("RearmSound", minelayerRearmSound.ToString())); + limitedAmmoFields.Add(new MiniYamlNode("RearmSound", minelayerRearmSound)); minelayerFields.Remove(rearmSound); } } @@ -1001,6 +1000,22 @@ namespace OpenRA.Mods.Common.UtilityCommands node.Value.Nodes.RemoveAll(p => p.Key == "Voice"); } + if (engineVersion < 20150524) + { + // Replace numbers with strings for DeathSounds.DeathType + if (node.Key.StartsWith("DeathSounds")) + { + var deathTypes = node.Value.Nodes.FirstOrDefault(x => x.Key == "DeathTypes"); + if (deathTypes != null) + { + var types = FieldLoader.GetValue("DeathTypes", deathTypes.Value.Value); + deathTypes.Value.Value = string.Join(", ", types.Select(type => "DeathType" + type)); + + RenameDamageTypes(deathTypes); + } + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } } @@ -1420,7 +1435,7 @@ namespace OpenRA.Mods.Common.UtilityCommands } } - if (engineVersion < 20150517) + if (engineVersion < 20150524) { // Remove DeathType from DamageWarhead if (node.Key.StartsWith("Warhead") && node.Value.Value == "SpreadDamage") diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index 5e80f469ca..3f8dc4df36 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -233,13 +233,13 @@ Range: 1 ScriptTriggers: DeathSounds@NORMAL: - DeathTypes: 1, 2, 3, 4 + DeathTypes: DefaultDeath, BulletDeath, SmallExplosionDeath, ExplosionDeath DeathSounds@BURNED: DeathSound: Burned - DeathTypes: 5 + DeathTypes: FireDeath DeathSounds@POISONED: DeathSound: Poisoned - DeathTypes: 6 + DeathTypes: TiberiumDeath GainsStatUpgrades: SelfHealing@ELITE: Step: 2 diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index 6d372857f9..12c8b23997 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -230,7 +230,7 @@ Huntable: ScriptTriggers: DeathSounds: - DeathTypes: 1, 2, 3, 4 + DeathTypes: ExplosionDeath, SoundDeath, SmallExplosionDeath, BulletDeath Parachutable: FallRate: 130 GainsStatUpgrades: diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index 838f96df80..32e980eb24 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -210,13 +210,13 @@ Upgrades: hospitalheal Prerequisites: hosp DeathSounds@NORMAL: - DeathTypes: 1, 2, 3, 4 + DeathTypes: DefaultDeath, BulletDeath, SmallExplosionDeath, ExplosionDeath DeathSounds@BURNED: DeathSound: Burned - DeathTypes: 5 + DeathTypes: FireDeath DeathSounds@ZAPPED: DeathSound: Zapped - DeathTypes: 6 + DeathTypes: ElectricityDeath Parachutable: ParachuteOffset: 0,0,427 KilledOnImpassableTerrain: true diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml index eb1e565ff2..ad6e0547e2 100644 --- a/mods/ts/rules/defaults.yaml +++ b/mods/ts/rules/defaults.yaml @@ -241,13 +241,13 @@ Huntable: ScriptTriggers: DeathSounds@NORMAL: - DeathTypes: 1, 2, 3 + DeathTypes: BulletDeath, SmallExplosionDeath, ExplosionDeath DeathSounds@BURNED: DeathSound: Burned - DeathTypes: 5 + DeathTypes: FireDeath DeathSounds@ZAPPED: DeathSound: Zapped - DeathTypes: 6 + DeathTypes: EnergyDeath UpgradeManager: Cloak@CLOAKGENERATOR: UpgradeTypes: cloakgenerator