Adds PlayVoice, PlayVoiceLocal and HasVoice to ActorExts.
Makes Cargo unload voice customisable.
This commit is contained in:
@@ -19,8 +19,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
public void BuildingComplete(Actor self)
|
||||
{
|
||||
foreach (var voiced in self.TraitsImplementing<IVoiced>())
|
||||
voiced.PlayVoice(self, "Build", self.Owner.Country.Race);
|
||||
self.PlayVoice(self, "Build", self.Owner.Country.Race);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (e.DamageState == DamageState.Dead && damaged != e.Attacker)
|
||||
{
|
||||
if (self.World.WorldTick - lastAnnounce > info.Interval * 25)
|
||||
foreach (var voiced in self.TraitsImplementing<IVoiced>())
|
||||
voiced.PlayVoice(self, "Kill", self.Owner.Country.Race);
|
||||
self.PlayVoice(self, "Kill", self.Owner.Country.Race);
|
||||
|
||||
lastAnnounce = self.World.WorldTick;
|
||||
}
|
||||
|
||||
@@ -42,8 +42,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
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);
|
||||
self.PlayVoiceLocal(self, info.DeathSound, self.Owner.Country.Race, info.VolumeMultiplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user