diff --git a/OpenRA.Mods.Common/Traits/Sound/AnnounceOnBuild.cs b/OpenRA.Mods.Common/Traits/Sound/AnnounceOnBuild.cs index f2fb745b6f..09dedfa6b2 100644 --- a/OpenRA.Mods.Common/Traits/Sound/AnnounceOnBuild.cs +++ b/OpenRA.Mods.Common/Traits/Sound/AnnounceOnBuild.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits public class AnnounceOnBuildInfo : ITraitInfo { [Desc("Voice to use when built/trained.")] - public readonly string BuildVoice = "Build"; + [VoiceReference] public readonly string Voice = "Build"; public object Create(ActorInitializer init) { return new AnnounceOnBuild(init.Self, this); } } @@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Traits public void BuildingComplete(Actor self) { - self.PlayVoice(info.BuildVoice); + self.PlayVoice(info.Voice); } } } diff --git a/OpenRA.Mods.Common/Traits/Sound/AnnounceOnKill.cs b/OpenRA.Mods.Common/Traits/Sound/AnnounceOnKill.cs index 64713a8b82..f29b2141c0 100644 --- a/OpenRA.Mods.Common/Traits/Sound/AnnounceOnKill.cs +++ b/OpenRA.Mods.Common/Traits/Sound/AnnounceOnKill.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits public readonly int Interval = 5; [Desc("Voice to use when killing something.")] - public readonly string KillVoice = "Kill"; + [VoiceReference] public readonly string Voice = "Kill"; public object Create(ActorInitializer init) { return new AnnounceOnKill(init.Self, this); } } @@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits if (e.DamageState == DamageState.Dead && damaged != e.Attacker) { if (self.World.WorldTick - lastAnnounce > info.Interval * 25) - self.PlayVoice(info.KillVoice); + self.PlayVoice(info.Voice); lastAnnounce = self.World.WorldTick; } diff --git a/OpenRA.Mods.Common/Traits/Sound/DeathSounds.cs b/OpenRA.Mods.Common/Traits/Sound/DeathSounds.cs index 30671a9133..9148956259 100644 --- a/OpenRA.Mods.Common/Traits/Sound/DeathSounds.cs +++ b/OpenRA.Mods.Common/Traits/Sound/DeathSounds.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits public class DeathSoundsInfo : ITraitInfo { [Desc("Death notification voice.")] - public readonly string DeathSound = "Die"; + [VoiceReference] public readonly string Voice = "Die"; [Desc("Multiply volume with this factor.")] public readonly float VolumeMultiplier = 1f; @@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits return; if (info.DeathTypes.Intersect(e.Warhead.DamageTypes).Any()) - self.PlayVoiceLocal(info.DeathSound, info.VolumeMultiplier); + self.PlayVoiceLocal(info.Voice, info.VolumeMultiplier); } } } \ No newline at end of file diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index ee98153315..327de1f4de 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -1175,6 +1175,21 @@ namespace OpenRA.Mods.Common.UtilityCommands Console.WriteLine("See RA and C&C bridge huts or crates for reference."); } + if (engineVersion < 20150620) + { + if (depth == 2) + { + if (node.Key == "DeathSound") + node.Key = "Voice"; + + if (node.Key == "KillVoice") + node.Key = "Voice"; + + if (node.Key == "BuildVoice") + node.Key = "Voice"; + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } } diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index fc2fcffbad..eda347fe1b 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -236,10 +236,10 @@ DeathSounds@NORMAL: DeathTypes: DefaultDeath, BulletDeath, SmallExplosionDeath, ExplosionDeath DeathSounds@BURNED: - DeathSound: Burned + Voice: Burned DeathTypes: FireDeath DeathSounds@POISONED: - DeathSound: Poisoned + Voice: Poisoned DeathTypes: TiberiumDeath UpgradeManager: MustBeDestroyed: diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index ea91a963e9..77ed4c8a75 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -229,10 +229,10 @@ DeathSounds@NORMAL: DeathTypes: DefaultDeath, BulletDeath, SmallExplosionDeath, ExplosionDeath DeathSounds@BURNED: - DeathSound: Burned + Voice: Burned DeathTypes: FireDeath DeathSounds@ZAPPED: - DeathSound: Zapped + Voice: Zapped DeathTypes: ElectricityDeath Parachutable: ParachuteOffset: 0,0,427 diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml index 1bca90d77a..b4b0a5f050 100644 --- a/mods/ts/rules/defaults.yaml +++ b/mods/ts/rules/defaults.yaml @@ -270,10 +270,10 @@ DeathSounds@NORMAL: DeathTypes: BulletDeath, SmallExplosionDeath, ExplosionDeath DeathSounds@BURNED: - DeathSound: Burned + Voice: Burned DeathTypes: FireDeath DeathSounds@ZAPPED: - DeathSound: Zapped + Voice: Zapped DeathTypes: EnergyDeath UpgradeManager: Cloak@CLOAKGENERATOR: