Add an INotifyKilled interface, which is what most things that used INotifyDamaged actually cared about.

This commit is contained in:
Paul Chote
2011-04-16 10:58:35 +12:00
parent d9fc84b55e
commit 1c2574f4f4
22 changed files with 135 additions and 185 deletions

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Render
public override object Create(ActorInitializer init) { return new RenderInfantry(init.self, this); }
}
public class RenderInfantry : RenderSimple, INotifyAttack, INotifyDamage, INotifyIdle
public class RenderInfantry : RenderSimple, INotifyAttack, INotifyKilled, INotifyIdle
{
public enum AnimationState
{
@@ -117,14 +117,11 @@ namespace OpenRA.Mods.RA.Render
}
}
public void Damaged(Actor self, AttackInfo e)
public void Killed(Actor self, AttackInfo e)
{
if (e.DamageState == DamageState.Dead)
{
var death = e.Warhead != null ? e.Warhead.InfDeath : 0;
Sound.PlayVoice("Die", self, self.Owner.Country.Race);
self.World.AddFrameEndTask(w => w.Add(new Corpse(self, death)));
}
var death = e.Warhead != null ? e.Warhead.InfDeath : 0;
Sound.PlayVoice("Die", self, self.Owner.Country.Race);
self.World.AddFrameEndTask(w => w.Add(new Corpse(self, death)));
}
}
}