v0.3.5: various logic fixes to accommodate chars that are 0 hp, but not dead.

This commit is contained in:
Evan Debenham 2016-03-25 17:25:10 -04:00
parent 4bc69be53e
commit dd08be8d97
3 changed files with 6 additions and 3 deletions

View File

@ -274,7 +274,10 @@ public abstract class Char extends Actor {
CharSprite.NEGATIVE, CharSprite.NEGATIVE,
Integer.toString( dmg ) ); Integer.toString( dmg ) );
} }
if (HP <= 0) {
if (HP < 0) HP = 0;
if (!isAlive()) {
die( src ); die( src );
} }
} }

View File

@ -34,7 +34,7 @@ public class Regeneration extends Buff {
if (target.HP < target.HT && !((Hero)target).isStarving()) { if (target.HP < target.HT && !((Hero)target).isStarving()) {
LockedFloor lock = target.buff(LockedFloor.class); LockedFloor lock = target.buff(LockedFloor.class);
if (lock == null || lock.regenOn()) { if (target.HP > 0 && (lock == null || lock.regenOn())) {
target.HP += 1; target.HP += 1;
if (target.HP == target.HT) { if (target.HP == target.HT) {
((Hero) target).resting = false; ((Hero) target).resting = false;

View File

@ -176,7 +176,7 @@ public class StatusPane extends Component {
float shield = Dungeon.hero.SHLD; float shield = Dungeon.hero.SHLD;
float max = Math.max(health+shield, Dungeon.hero.HT); float max = Math.max(health+shield, Dungeon.hero.HT);
if (health == 0) { if (!Dungeon.hero.isAlive()) {
avatar.tint( 0x000000, 0.6f ); avatar.tint( 0x000000, 0.6f );
blood.on = false; blood.on = false;
} else if ((health/Dungeon.hero.HT) < 0.25f) { } else if ((health/Dungeon.hero.HT) < 0.25f) {