v0.3.1: allowed resting while hungry
This commit is contained in:
parent
79c12e11b5
commit
272d4834b3
|
@ -88,6 +88,7 @@ public class Hunger extends Buff implements Hero.Doom {
|
||||||
if (newLevel >= STARVING) {
|
if (newLevel >= STARVING) {
|
||||||
|
|
||||||
GLog.n( TXT_STARVING );
|
GLog.n( TXT_STARVING );
|
||||||
|
hero.restoreHealth = false;
|
||||||
hero.damage( 1, this );
|
hero.damage( 1, this );
|
||||||
statusUpdated = true;
|
statusUpdated = true;
|
||||||
|
|
||||||
|
|
|
@ -430,7 +430,7 @@ public class Hero extends Char {
|
||||||
if (curAction == null) {
|
if (curAction == null) {
|
||||||
|
|
||||||
if (restoreHealth) {
|
if (restoreHealth) {
|
||||||
if (isStarving() || HP >= HT || Dungeon.level.locked) {
|
if (HP >= HT || Dungeon.level.locked) {
|
||||||
restoreHealth = false;
|
restoreHealth = false;
|
||||||
} else {
|
} else {
|
||||||
spend( TIME_TO_REST ); next();
|
spend( TIME_TO_REST ); next();
|
||||||
|
@ -909,10 +909,10 @@ public class Hero extends Char {
|
||||||
if (buff(TimekeepersHourglass.timeStasis.class) != null)
|
if (buff(TimekeepersHourglass.timeStasis.class) != null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
restoreHealth = false;
|
if (!(src instanceof Hunger || src instanceof Viscosity.DeferedDamage) && damageInterrupt) {
|
||||||
|
|
||||||
if (!(src instanceof Hunger || src instanceof Viscosity.DeferedDamage) && damageInterrupt)
|
|
||||||
interrupt();
|
interrupt();
|
||||||
|
restoreHealth = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.buff(Drowsy.class) != null){
|
if (this.buff(Drowsy.class) != null){
|
||||||
Buff.detach(this, Drowsy.class);
|
Buff.detach(this, Drowsy.class);
|
||||||
|
|
|
@ -103,7 +103,7 @@ public class HeroSprite extends CharSprite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
sleeping = ((Hero)ch).restoreHealth;
|
sleeping = ch.isAlive() && ((Hero)ch).restoreHealth;
|
||||||
|
|
||||||
super.update();
|
super.update();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user