Added 'Health' and 'PreviousHealth' to the AttackInfo (so we can know how many 'real' damage is done!)

This commit is contained in:
geckosoft
2010-10-29 00:22:59 +13:00
committed by Chris Forbes
parent 1a011276bf
commit 2640603f6c
2 changed files with 6 additions and 2 deletions

View File

@@ -96,7 +96,9 @@ namespace OpenRA.Traits
DamageState = this.DamageState, DamageState = this.DamageState,
PreviousDamageState = oldState, PreviousDamageState = oldState,
DamageStateChanged = this.DamageState != oldState, DamageStateChanged = this.DamageState != oldState,
Warhead = warhead Warhead = warhead,
PreviousHealth = hp + damage < 0 ? 0 : hp + damage,
Health = hp
}); });
if (hp <= 0) if (hp <= 0)

View File

@@ -29,7 +29,9 @@ namespace OpenRA.Traits
public int Damage; public int Damage;
public DamageState DamageState; public DamageState DamageState;
public DamageState PreviousDamageState; public DamageState PreviousDamageState;
public bool DamageStateChanged; public bool DamageStateChanged;
public int PreviousHealth;
public int Health;
} }
public interface ITick { void Tick(Actor self); } public interface ITick { void Tick(Actor self); }