summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/food.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-17 02:55:58 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-17 02:55:58 +0000
commit0bc00794625760f93f2d1fd20a78d02aaa7299f9 (patch)
tree871ae18ee6f478dc7c331bf95011a9efa183a6fc /crawl-ref/source/food.cc
parent27a123d67702ee2b24b29df5374cb9a95f53d5af (diff)
downloadcrawl-ref-0bc00794625760f93f2d1fd20a78d02aaa7299f9.tar.gz
crawl-ref-0bc00794625760f93f2d1fd20a78d02aaa7299f9.zip
A handful of new game options:
menu_colour_prefix_id, if set to true, causes the identification state of an object to be prefixed to the string menu colour regexes are matched against (but does not alter the string displayed on the screen). menu_colour_prefix_class, if set to true, prefixes the object's base type to the string menu colour regexes are matched against. user_note_prefix can be set to a string which will be prefixed to manual user notes when they are displayed, to make them easier to find. detailed_hunger, if set to true, will cause three new informational-only hunger states to be displayed: near starving, very hungry and very full. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2121 c06c8d41-db1a-0410-9941-cceddc491573
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;
+ }
}
}
}