infantry deaths (handled by Corpse effect)
This commit is contained in:
@@ -3,10 +3,12 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRa.Game.Graphics;
|
||||
using OpenRa.Game.GameRules;
|
||||
using OpenRa.Game.Effects;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class RenderInfantry : RenderSimple, INotifyAttack
|
||||
class RenderInfantry : RenderSimple, INotifyAttack, INotifyDamageEx
|
||||
{
|
||||
public RenderInfantry(Actor self)
|
||||
: base(self)
|
||||
@@ -57,5 +59,13 @@ namespace OpenRa.Game.Traits
|
||||
{
|
||||
yield return Util.Centered(self, anim.Image, self.CenterLocation);
|
||||
}
|
||||
|
||||
public void Damaged(Actor self, int damage, WarheadInfo warhead)
|
||||
{
|
||||
if (self.Health <= 0)
|
||||
Game.world.AddFrameEndTask(w => w.Add(new Corpse(self, warhead.InfDeath)));
|
||||
}
|
||||
|
||||
public void Damaged(Actor self, DamageState ds) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRa.Game.Graphics;
|
||||
using OpenRa.Game.GameRules;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
@@ -37,7 +38,7 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
public void Damaged(Actor self, DamageState ds) { currentDs = ds; }
|
||||
|
||||
public void Damaged(Actor self, int damage)
|
||||
public void Damaged(Actor self, int damage, WarheadInfo warhead)
|
||||
{
|
||||
if (currentDs != DamageState.Half) return;
|
||||
if (!isSmoking)
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace OpenRa.Game.Traits
|
||||
interface ITick { void Tick(Actor self); }
|
||||
interface IRender { IEnumerable<Tuple<Sprite, float2, int>> Render(Actor self); }
|
||||
interface INotifyDamage { void Damaged(Actor self, DamageState ds); }
|
||||
interface INotifyDamageEx : INotifyDamage { void Damaged(Actor self, int damage); }
|
||||
interface INotifyDamageEx : INotifyDamage { void Damaged(Actor self, int damage, WarheadInfo warhead); }
|
||||
interface INotifyBuildComplete { void BuildingComplete (Actor self); }
|
||||
interface IOrder
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user