Shift "XXX Lost" notification onto a trait. Hook up "Structure Lost" (cnc) and "Airborne Unit Lost" (ra).

This commit is contained in:
Paul Chote
2010-08-01 01:00:41 +12:00
parent 45e54e1ca8
commit d416f0be5c
10 changed files with 138 additions and 206 deletions

View File

@@ -19,15 +19,8 @@ namespace OpenRA.Traits
public object Create( ActorInitializer init ) { return new Unit(); }
}
public class Unit : INotifyDamage, IRadarSignature
{
public void Damaged(Actor self, AttackInfo e)
{
if (e.DamageState == DamageState.Dead)
if (self.Owner == self.World.LocalPlayer)
Sound.PlayVoice("Lost", self);
}
public class Unit : IRadarSignature
{
public IEnumerable<int2> RadarSignatureCells(Actor self)
{
yield return self.Location;