v0.3.1: refactored resting based on new functionality. Hitting full HP now interrupts resting.
This commit is contained in:
@@ -88,7 +88,7 @@ public class Hunger extends Buff implements Hero.Doom {
|
||||
if (newLevel >= STARVING) {
|
||||
|
||||
GLog.n( TXT_STARVING );
|
||||
hero.restoreHealth = false;
|
||||
hero.resting = false;
|
||||
hero.damage( 1, this );
|
||||
statusUpdated = true;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class MagicalSleep extends Buff {
|
||||
public boolean act(){
|
||||
if (target instanceof Hero) {
|
||||
target.HP = Math.min(target.HP+1, target.HT);
|
||||
((Hero) target).restoreHealth = true;
|
||||
((Hero) target).resting = true;
|
||||
if (target.HP == target.HT) {
|
||||
GLog.p("You wake up feeling refreshed and healthy.");
|
||||
detach();
|
||||
@@ -72,7 +72,7 @@ public class MagicalSleep extends Buff {
|
||||
public void detach() {
|
||||
target.paralysed = false;
|
||||
if (target instanceof Hero)
|
||||
((Hero) target).restoreHealth = false;
|
||||
((Hero) target).resting = false;
|
||||
super.detach();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,9 @@ public class Regeneration extends Buff {
|
||||
|
||||
if (target.HP < target.HT && !((Hero)target).isStarving()) {
|
||||
target.HP += 1;
|
||||
if (target.HP == target.HT){
|
||||
((Hero)target).resting = false;
|
||||
}
|
||||
}
|
||||
|
||||
ChaliceOfBlood.chaliceRegen regenBuff = Dungeon.hero.buff( ChaliceOfBlood.chaliceRegen.class);
|
||||
|
||||
Reference in New Issue
Block a user