Drags death sounds out of RenderInfantry into a separate DeathSounds trait.

Play death sounds with a new PlayVoiceLocal so they don't use full volume regardless of position relative to camera.
Adds option for alternative burn and zap death sounds.
Renames RenderInfantry's UseInfantryDeath trait to SpawnsCorpse.

Removes hack from ra desert shellmap.
This commit is contained in:
reaperrr
2014-05-02 15:14:29 +02:00
parent 1a432e9e9e
commit 18e37e4216
10 changed files with 82 additions and 10 deletions

View File

@@ -367,6 +367,19 @@ namespace OpenRA
var type = mi.Voice.ToLowerInvariant();
return PlayPredefined(null, voicedUnit, type, phrase, variant, true);
}
public static bool PlayVoiceLocal(string phrase, Actor voicedUnit, string variant, WPos pos)
{
if (voicedUnit == null || phrase == null)
return false;
var mi = voicedUnit.Info.Traits.GetOrDefault<SelectableInfo>();
if (mi == null || mi.Voice == null)
return false;
var type = mi.Voice.ToLowerInvariant();
return PlayPredefined(null, voicedUnit, type, phrase, variant, true);
}
public static bool PlayNotification(Player player, string type, string notification, string variant)
{