Shift "XXX Lost" notification onto a trait. Hook up "Structure Lost" (cnc) and "Airborne Unit Lost" (ra).
This commit is contained in:
@@ -21,7 +21,6 @@ namespace OpenRA.GameRules
|
||||
public readonly string[] Move = { };
|
||||
public readonly string[] Attack = null;
|
||||
public readonly string[] Die = { };
|
||||
public readonly string[] Lost = { };
|
||||
|
||||
public readonly Lazy<Dictionary<string, VoicePool>> Pools;
|
||||
|
||||
@@ -36,7 +35,6 @@ namespace OpenRA.GameRules
|
||||
{ "Move", new VoicePool(Move) },
|
||||
{ "Attack", new VoicePool( Attack ?? Move ) },
|
||||
{ "Die", new VoicePool(Die) },
|
||||
{ "Lost", new VoicePool(Lost) },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user