death sounds for infantry

This commit is contained in:
Chris Forbes
2009-12-20 18:18:11 +13:00
parent b08e1e9350
commit effc642c04
5 changed files with 21 additions and 3 deletions

View File

@@ -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<Dictionary<string, VoicePool>> 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) },
});
}
}

View File

@@ -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;

View File

@@ -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)));
}
}
}
}