v0.3.0: slight refactor to hunger
This commit is contained in:
parent
2367283bf6
commit
a222efa406
|
@ -125,6 +125,7 @@ public class Hunger extends Buff implements Hero.Doom {
|
|||
GLog.n("The cursed horn steals some of the food energy as you eat.");
|
||||
}
|
||||
|
||||
if (!Dungeon.isChallenged(Challenges.NO_FOOD))
|
||||
reduceHunger( energy );
|
||||
}
|
||||
|
||||
|
@ -135,12 +136,12 @@ public class Hunger extends Buff implements Hero.Doom {
|
|||
else if (level < HUNGRY)
|
||||
energy *= 0.75f;
|
||||
|
||||
if (!Dungeon.isChallenged(Challenges.NO_FOOD))
|
||||
reduceHunger( energy );
|
||||
}
|
||||
|
||||
private void reduceHunger( float energy ) {
|
||||
if (Dungeon.isChallenged(Challenges.NO_FOOD))
|
||||
return;
|
||||
//directly interacts with hunger, no checks.
|
||||
public void reduceHunger( float energy ) {
|
||||
|
||||
level -= energy;
|
||||
if (level < 0) {
|
||||
|
|
|
@ -798,7 +798,7 @@ public class Hero extends Char {
|
|||
|
||||
Hunger hunger = buff( Hunger.class );
|
||||
if (hunger != null && !hunger.isStarving()) {
|
||||
hunger.satisfy( -Hunger.STARVING / 10 );
|
||||
hunger.reduceHunger( -Hunger.STARVING / 10 );
|
||||
}
|
||||
|
||||
Buff buff = buff(TimekeepersHourglass.timeFreeze.class);
|
||||
|
|
|
@ -48,7 +48,7 @@ public class Metabolism extends Glyph {
|
|||
|
||||
if (hunger != null && !hunger.isStarving()) {
|
||||
|
||||
hunger.satisfy( -Hunger.STARVING / 10 );
|
||||
hunger.reduceHunger( -Hunger.STARVING / 10 );
|
||||
BuffIndicator.refreshHero();
|
||||
|
||||
defender.HP += healing;
|
||||
|
|
|
@ -109,7 +109,7 @@ public class Pickaxe extends Weapon {
|
|||
|
||||
Hunger hunger = hero.buff( Hunger.class );
|
||||
if (hunger != null && !hunger.isStarving()) {
|
||||
hunger.satisfy( -Hunger.STARVING / 10 );
|
||||
hunger.reduceHunger( -Hunger.STARVING / 10 );
|
||||
BuffIndicator.refreshHero();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user