voicepool to avoid annoying me with the same sound over and over... and units now have a voice assigned.

This commit is contained in:
Chris Forbes
2009-10-24 16:07:23 +13:00
parent aa784d446c
commit ea3526a238
5 changed files with 52 additions and 3 deletions

View File

@@ -18,13 +18,21 @@ namespace OpenRa.Game
{
this.Unit = unit;
this.Destination = destination;
}
string GetVoiceSuffix()
{
var suffixes = new[] { ".r01", ".r03" };
return suffixes[Unit.traits.Get<Traits.Mobile>().Voice];
}
public override void Apply( bool leftMouseButton )
{
if (leftMouseButton) return;
if (Game.LocalPlayer == Unit.Owner)
Game.PlaySound("ackno.r00", false);
Game.PlaySound(Game.SovietVoices.First.GetNext() + GetVoiceSuffix(), false);
var mobile = Unit.traits.Get<Traits.Mobile>();
mobile.destination = Destination;
mobile.desiredFacing = null;