exposed GetDamageState(); fixed TSLA anim to use it

This commit is contained in:
Chris Forbes
2009-12-31 13:11:00 +13:00
parent b1f7aea1ca
commit c11c4eb4a0
4 changed files with 5 additions and 8 deletions

View File

@@ -119,7 +119,7 @@ namespace OpenRa.Game
public bool IsDead { get { return Health <= 0; } } public bool IsDead { get { return Health <= 0; } }
DamageState GetDamageState() public DamageState GetDamageState()
{ {
if (Health <= 0) return DamageState.Dead; if (Health <= 0) return DamageState.Dead;
var halfStrength = Info.Strength * Rules.General.ConditionYellow; var halfStrength = Info.Strength * Rules.General.ConditionYellow;

View File

@@ -15,9 +15,9 @@ namespace OpenRa.Game.Traits
public void Attacking(Actor self) public void Attacking(Actor self)
{ {
var prev = anim.CurrentSequence.Name; var prefix = self.GetDamageState() == DamageState.Half ? "damaged-" : "";
Sound.Play("tslachg2.aud"); Sound.Play("tslachg2.aud");
anim.PlayThen("active", () => anim.PlayRepeating(prev)); anim.PlayThen(prefix + "active", () => anim.PlayRepeating(prefix + "idle"));
} }
} }
} }

View File

@@ -28,7 +28,7 @@ namespace OpenRa.Game.Traits
{ {
if (doneBuilding) if (doneBuilding)
yield return new Renderable(roof.Image, yield return new Renderable(roof.Image,
24f * (float2)self.Location, self.Owner.Palette, 2); Game.CellSize * (float2)self.Location, self.Owner.Palette, 2);
} }
public void Tick(Actor self) public void Tick(Actor self)

View File

@@ -31,16 +31,13 @@ HARV Works
ARTY Works ARTY Works
Helicopters Helicopters
- Repair/rearm doesn't work - Repair as FIX doesn't work
TRAN Cargo doesn't work TRAN Cargo doesn't work
HELI Weapon offsets wrong HELI Weapon offsets wrong
HIND Weapon offsets wrong HIND Weapon offsets wrong
Planes Planes
- AFLD reservations don't work
- Rearm doesn't work (should happen when on AFLD)
- Repair at FIX doesn't work [fix doesn't work?] - Repair at FIX doesn't work [fix doesn't work?]
- Planes damage themselves (should never happen; these are AG weapons)
YAK Ammo/ROF are funky YAK Ammo/ROF are funky
MIG Ammo/ROF are funky MIG Ammo/ROF are funky