death sounds for infantry
This commit is contained in:
@@ -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) },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user