summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/food.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r--crawl-ref/source/food.cc83
1 files changed, 69 insertions, 14 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index f72ef2cf80..260100732d 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -543,37 +543,92 @@ static bool food_change(bool suppress_message)
// get new hunger state
if (you.hunger <= 1000)
newstate = HS_STARVING;
+ else if (you.hunger <= 1533)
+ newstate = HS_NEAR_STARVING;
+ else if (you.hunger <= 2066)
+ newstate = HS_VERY_HUNGRY;
else if (you.hunger <= 2600)
newstate = HS_HUNGRY;
else if (you.hunger < 7000)
newstate = HS_SATIATED;
- else if (you.hunger < 11000)
+ else if (you.hunger < 9000)
newstate = HS_FULL;
+ else if (you.hunger < 11000)
+ newstate = HS_VERY_FULL;
if (newstate != you.hunger_state)
{
+ char oldstate = you.hunger_state;
state_changed = true;
you.hunger_state = newstate;
set_redraw_status( REDRAW_HUNGER );
// Stop the travel command, if it's in progress and we just got hungry
- if (newstate < HS_SATIATED)
- interrupt_activity( AI_HUNGRY );
+ if (Options.detailed_hunger)
+ {
+ if (newstate < HS_SATIATED)
+ interrupt_activity( AI_HUNGRY );
+ }
+ else
+ {
+ // Don't interrupt on changing from hungry to very hungry
+ // or very hungry to near starving if they don't want
+ // detailed hunger info.
+ if (newstate == HS_STARVING ||
+ (newstate < HS_SATIATED && oldstate >= HS_SATIATED))
+ interrupt_activity( AI_HUNGRY );
+
+ // Don't inform user of changing from hungry to very hungry
+ // or very hungry to near starving if they don't want
+ // detailed hunger info.
+ if (newstate < HS_SATIATED && oldstate < HS_SATIATED &&
+ newstate != HS_STARVING)
+ suppress_message = true;
+ }
if (suppress_message == false)
{
- switch (you.hunger_state)
+ if (Options.detailed_hunger)
{
- case HS_STARVING:
- mpr("You are starving!", MSGCH_FOOD);
- learned_something_new(TUT_YOU_STARVING);
- break;
- case HS_HUNGRY:
- mpr("You are feeling hungry.", MSGCH_FOOD);
- learned_something_new(TUT_YOU_HUNGRY);
- break;
- default:
- break;
+ switch (you.hunger_state)
+ {
+ case HS_STARVING:
+ mpr("You are starving!", MSGCH_FOOD);
+ learned_something_new(TUT_YOU_STARVING);
+ break;
+ case HS_HUNGRY:
+ mpr("You are feeling hungry.", MSGCH_FOOD);
+ learned_something_new(TUT_YOU_HUNGRY);
+ break;
+ case HS_VERY_HUNGRY:
+ mpr("You are feeling very hungry.", MSGCH_FOOD);
+ learned_something_new(TUT_YOU_HUNGRY);
+ break;
+ case HS_NEAR_STARVING:
+ mpr("You are near starving.", MSGCH_FOOD);
+ learned_something_new(TUT_YOU_HUNGRY);
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ {
+ switch (you.hunger_state)
+ {
+ case HS_STARVING:
+ mpr("You are starving!", MSGCH_FOOD);
+ learned_something_new(TUT_YOU_STARVING);
+ break;
+ case HS_HUNGRY:
+ case HS_VERY_HUNGRY:
+ case HS_NEAR_STARVING:
+ mpr("You are feeling hungry.", MSGCH_FOOD);
+ learned_something_new(TUT_YOU_HUNGRY);
+ break;
+ default:
+ break;
+ }
}
}
}