v0.9.1: improved code that determines time taken to eat food

This commit is contained in:
Evan Debenham
2020-11-18 13:15:46 -05:00
parent 157b2cab44
commit 9263fa90f0
2 changed files with 9 additions and 3 deletions

View File

@@ -164,8 +164,6 @@ public enum Talent {
Buff.affect(hero, Hunger.class).affectHunger(bonusSatiety, true);
}
if (hero.hasTalent(INVIGORATING_MEAL)){
//eating food takes 1 turn, instead of 3
hero.spend(-2);
//effectively 1/2 turns of haste
Buff.affect( hero, Haste.class, 0.67f+hero.pointsInTalent(INVIGORATING_MEAL));
}

View File

@@ -81,13 +81,21 @@ public class Food extends Item {
SpellSprite.show( hero, SpellSprite.FOOD );
Sample.INSTANCE.play( Assets.Sounds.EAT );
hero.spend( TIME_TO_EAT );
hero.spend( eatingTime() );
Statistics.foodEaten++;
Badges.validateFoodEaten();
}
}
protected float eatingTime(){
if (Dungeon.hero.hasTalent(Talent.INVIGORATING_MEAL)){
return TIME_TO_EAT - 2;
} else {
return TIME_TO_EAT;
}
}
protected void satisfy( Hero hero ){
if (Dungeon.isChallenged(Challenges.NO_FOOD)){