Cleaned up IVoiced-related code.
Added Volume control and descriptions to Voiced. Streamline voice checks in WorldUtils and DeathSounds.
This commit is contained in:
@@ -40,13 +40,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (e.Warhead == null)
|
||||
return;
|
||||
|
||||
var cp = self.CenterPosition;
|
||||
|
||||
foreach (var voiced in self.TraitsImplementing<IVoiced>())
|
||||
if (info.DeathTypes.Contains(e.Warhead.DeathType) ||
|
||||
(!info.DeathTypes.Any() && !self.Info.Traits.WithInterface<DeathSoundsInfo>()
|
||||
.Any(dsi => dsi.DeathTypes.Contains(e.Warhead.DeathType))))
|
||||
voiced.PlayVoiceLocal(info.DeathSound, self, self.Owner.Country.Race, cp, info.VolumeMultiplier);
|
||||
if (info.DeathTypes.Contains(e.Warhead.DeathType) || (!info.DeathTypes.Any() &&
|
||||
!self.Info.Traits.WithInterface<DeathSoundsInfo>().Any(dsi => dsi.DeathTypes.Contains(e.Warhead.DeathType))))
|
||||
foreach (var voiced in self.TraitsImplementing<IVoiced>())
|
||||
voiced.PlayVoiceLocal(self, info.DeathSound, self.Owner.Country.Race, info.VolumeMultiplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user