From effc642c045cbb51b129dd1e6534f2241ab6c51b Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 20 Dec 2009 18:18:11 +1300 Subject: [PATCH] death sounds for infantry --- OpenRa.Game/GameRules/VoiceInfo.cs | 6 ++++-- OpenRa.Game/Sound.cs | 6 ++++++ OpenRa.Game/Traits/RenderInfantry.cs | 3 +++ progress.txt | 2 +- units.ini | 7 +++++++ 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/OpenRa.Game/GameRules/VoiceInfo.cs b/OpenRa.Game/GameRules/VoiceInfo.cs index 7e4dfa6393..509a0d57e7 100644 --- a/OpenRa.Game/GameRules/VoiceInfo.cs +++ b/OpenRa.Game/GameRules/VoiceInfo.cs @@ -11,9 +11,10 @@ namespace OpenRa.Game.GameRules { public readonly string[] SovietVariants = { ".aud" }; public readonly string[] AlliedVariants = { ".aud" }; - public readonly string[] Select = {}; - public readonly string[] Move = {}; + public readonly string[] Select = { }; + public readonly string[] Move = { }; public readonly string[] Attack = null; + public readonly string[] Die = { }; public readonly Lazy> Pools; @@ -25,6 +26,7 @@ namespace OpenRa.Game.GameRules { "Select", new VoicePool(Select) }, { "Move", new VoicePool(Move) }, { "Attack", new VoicePool( Attack ?? Move ) }, + { "Die", new VoicePool(Die) }, }); } } diff --git a/OpenRa.Game/Sound.cs b/OpenRa.Game/Sound.cs index 7dbde0c6ba..70dac031c0 100644 --- a/OpenRa.Game/Sound.cs +++ b/OpenRa.Game/Sound.cs @@ -49,6 +49,12 @@ namespace OpenRa.Game if (clip == null) return; + if (clip.Contains(".")) /* no variants! */ + { + Play(clip); + return; + } + var variants = (voicedUnit.Owner.Race == Race.Soviet) ? vi.SovietVariants : vi.AlliedVariants; diff --git a/OpenRa.Game/Traits/RenderInfantry.cs b/OpenRa.Game/Traits/RenderInfantry.cs index 735577a635..bffadb4ea5 100644 --- a/OpenRa.Game/Traits/RenderInfantry.cs +++ b/OpenRa.Game/Traits/RenderInfantry.cs @@ -78,7 +78,10 @@ namespace OpenRa.Game.Traits public void Damaged(Actor self, AttackInfo e) { if (e.DamageState == DamageState.Dead) + { + Sound.PlayVoice("Die", self); Game.world.AddFrameEndTask(w => w.Add(new Corpse(self, e.Warhead.InfDeath))); + } } } } diff --git a/progress.txt b/progress.txt index ae4fc3f186..d31ae62e3b 100644 --- a/progress.txt +++ b/progress.txt @@ -1,7 +1,7 @@ Ground Units: -All Infantry No death sounds, no idle animations +All Infantry No idle animations E1 Range is wrong. E2 Grenade origin is wrong, grenades are too accurate. E3 AA weapon doesn't work. diff --git a/units.ini b/units.ini index 245669f100..84f54896b8 100755 --- a/units.ini +++ b/units.ini @@ -688,6 +688,7 @@ SovietVariants=.r01,.r03 AlliedVariants=.v01,.v03 Select=await1,ready,report1,yessir1 Move=ackno,affirm1,noprob,overout,ritaway,roger,ugotit +Die=dedman1.aud,dedman2.aud,dedman3.aud,dedman4.aud,dedman5.aud,dedman6.aud,dedman7.aud,dedman8.aud,dedman10.aud [VehicleVoice] SovietVariants=.r00,.r02 @@ -698,29 +699,35 @@ Move=ackno,affirm1 [EngineerVoice] Select=eengin1,eyessir1 Move=eaffirm1,emovout1 +Die=dedman1.aud,dedman2.aud,dedman3.aud,dedman4.aud,dedman5.aud,dedman6.aud,dedman7.aud,dedman8.aud,dedman10.aud [MedicVoice] Select=mrespon1,myessir1 Move=maffirm1,mmovout1 +Die=dedman1.aud,dedman2.aud,dedman3.aud,dedman4.aud,dedman5.aud,dedman6.aud,dedman7.aud,dedman8.aud,dedman10.aud [TanyaVoice] Select=yo1,yes1,yeah1 Move=rokroll1,onit1,cmon1 Attack=tuffguy1,bombit1,gotit1 +Die=tandeth1 [DogVoice] Select= Move=dogy1 Attack=dogg5p,dogw3px +Die=dogw5,dogw6,dogw7 [SpyVoice] Select=syessir1,scomnd1 Move=sonway1,sindeed1 Attack=sking1 +Die=dedman1.aud,dedman2.aud,dedman3.aud,dedman4.aud,dedman5.aud,dedman6.aud,dedman7.aud,dedman8.aud,dedman10.aud [ThiefVoice] Select=swhat1,syeah1 Move=saffirm1,smout1,sokay1 +Die=dedman1.aud,dedman2.aud,dedman3.aud,dedman4.aud,dedman5.aud,dedman6.aud,dedman7.aud,dedman8.aud,dedman10.aud [CivilianMaleVoice] Select=guyyeah1