Merge pull request #5242 from reaperrr/deathsounds-followup

Made DeathSounds and their InfDeath relation fully customizable
This commit is contained in:
Paul Chote
2014-05-17 23:24:44 +12:00
27 changed files with 210 additions and 92 deletions

View File

@@ -38,7 +38,7 @@ namespace OpenRA.GameRules
[Desc("Size of the explosion. provide 2 values for a ring effect (outer/inner).")]
public readonly int[] Size = { 0, 0 };
[Desc("Infantry death animation to use")]
public readonly int InfDeath = 1;
public readonly string InfDeath = "1";
[Desc("Sound to play on impact.")]
public readonly string ImpactSound = null;
[Desc("Sound to play on impact with water")]

View File

@@ -296,7 +296,7 @@ namespace OpenRA
}
// Returns true if played successfully
public static bool PlayPredefined(Player p, Actor voicedUnit, string type, string definition, string variant, bool attenuateVolume)
public static bool PlayPredefined(Player p, Actor voicedUnit, string type, string definition, string variant, bool relative, WPos pos, float volumeModifier, bool attenuateVolume)
{
if (definition == null)
return false;
@@ -350,8 +350,8 @@ namespace OpenRA
if (!string.IsNullOrEmpty(name) && (p == null || p == p.World.LocalPlayer))
soundEngine.Play2D(sounds[name],
false, true, WPos.Zero,
InternalSoundVolume, attenuateVolume);
false, relative, pos,
(InternalSoundVolume * volumeModifier), attenuateVolume);
return true;
}
@@ -366,10 +366,10 @@ namespace OpenRA
return false;
var type = mi.Voice.ToLowerInvariant();
return PlayPredefined(null, voicedUnit, type, phrase, variant, true);
return PlayPredefined(null, voicedUnit, type, phrase, variant, true, WPos.Zero, 1f, true);
}
public static bool PlayVoiceLocal(string phrase, Actor voicedUnit, string variant, WPos pos)
public static bool PlayVoiceLocal(string phrase, Actor voicedUnit, string variant, WPos pos, float volume)
{
if (voicedUnit == null || phrase == null)
return false;
@@ -379,7 +379,7 @@ namespace OpenRA
return false;
var type = mi.Voice.ToLowerInvariant();
return PlayPredefined(null, voicedUnit, type, phrase, variant, true);
return PlayPredefined(null, voicedUnit, type, phrase, variant, false, pos, volume, true);
}
public static bool PlayNotification(Player player, string type, string notification, string variant)
@@ -387,7 +387,7 @@ namespace OpenRA
if (type == null || notification == null)
return false;
return PlayPredefined(player, null, type.ToLowerInvariant(), notification, variant, false);
return PlayPredefined(player, null, type.ToLowerInvariant(), notification, variant, true, WPos.Zero, 1f, false);
}
}