v0.9.1: improved code that determines time taken to eat food
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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)){
|
||||
|
||||
Reference in New Issue
Block a user