unit-lost sounds through voice

This commit is contained in:
Chris Forbes
2010-07-20 17:39:35 +12:00
parent cb44844639
commit 2684284c27
4 changed files with 35 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ namespace OpenRA.Traits
public readonly int ROT = 255;
public readonly int Speed = 1;
public object Create( ActorInitializer init ) { return new Unit( init.self ); }
public object Create( ActorInitializer init ) { return new Unit(); }
}
public class Unit : INotifyDamage
@@ -26,14 +26,11 @@ namespace OpenRA.Traits
[Sync]
public int Altitude;
public Unit(Actor self) { }
public void Damaged(Actor self, AttackInfo e)
{
var eva = self.World.WorldActor.Info.Traits.Get<EvaAlertsInfo>();
if (e.DamageState == DamageState.Dead)
Sound.PlayToPlayer(self.Owner,
self.Info.Traits.Get<OwnedActorInfo>().WaterBound ? eva.NavalUnitLost : eva.UnitLost);
Sound.PlayVoice("Lost", self);
}
}
}