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);
|
Buff.affect(hero, Hunger.class).affectHunger(bonusSatiety, true);
|
||||||
}
|
}
|
||||||
if (hero.hasTalent(INVIGORATING_MEAL)){
|
if (hero.hasTalent(INVIGORATING_MEAL)){
|
||||||
//eating food takes 1 turn, instead of 3
|
|
||||||
hero.spend(-2);
|
|
||||||
//effectively 1/2 turns of haste
|
//effectively 1/2 turns of haste
|
||||||
Buff.affect( hero, Haste.class, 0.67f+hero.pointsInTalent(INVIGORATING_MEAL));
|
Buff.affect( hero, Haste.class, 0.67f+hero.pointsInTalent(INVIGORATING_MEAL));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class Food extends Item {
|
|||||||
SpellSprite.show( hero, SpellSprite.FOOD );
|
SpellSprite.show( hero, SpellSprite.FOOD );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.EAT );
|
Sample.INSTANCE.play( Assets.Sounds.EAT );
|
||||||
|
|
||||||
hero.spend( TIME_TO_EAT );
|
hero.spend( eatingTime() );
|
||||||
|
|
||||||
Statistics.foodEaten++;
|
Statistics.foodEaten++;
|
||||||
Badges.validateFoodEaten();
|
Badges.validateFoodEaten();
|
||||||
@@ -89,6 +89,14 @@ public class Food extends Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 ){
|
protected void satisfy( Hero hero ){
|
||||||
if (Dungeon.isChallenged(Challenges.NO_FOOD)){
|
if (Dungeon.isChallenged(Challenges.NO_FOOD)){
|
||||||
Buff.affect(hero, Hunger.class).satisfy(energy/3f);
|
Buff.affect(hero, Hunger.class).satisfy(energy/3f);
|
||||||
|
|||||||
Reference in New Issue
Block a user