summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/abl-show.cc19
-rw-r--r--crawl-ref/source/debug.cc4
-rw-r--r--crawl-ref/source/food.cc8
3 files changed, 25 insertions, 6 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index 374c117c78..01fdcc17f5 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -935,6 +935,25 @@ static bool activate_talent(const talent& tal)
return (false);
}
+ // don't insta-starve the player
+ // (happens at 100, losing consciousness possible from 500 downward)
+ if (hungerCheck)
+ {
+ const int expected_hunger = you.hunger - abil.food_cost * 2;
+#ifdef DEBUG_DIAGNOSTICS
+ mprf(MSGCH_DIAGNOSTICS,
+ "hunger: %d, max. food_cost: %d, expected hunger: %d",
+ you.hunger, abil.food_cost * 2, expected_hunger);
+#endif
+ // safety margin for natural hunger, mutations etc.
+ if (expected_hunger <= 150
+ && !yesno("Invoking this ability might make you starve to death. "
+ "Continue anyway?", false, 'n'))
+ {
+ crawl_state.zero_turns_taken();
+ return (false);
+ }
+ }
// no turning back now... {dlb}
if (random2avg(100, 3) < tal.fail)
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 40c9214223..944e479159 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -1001,7 +1001,7 @@ void create_spec_object()
class_wanted = OBJ_JEWELLERY;
else if (keyin == '!')
class_wanted = OBJ_POTIONS;
- else if (keyin == ':')
+ else if (keyin == ':' || keyin == '+')
class_wanted = OBJ_BOOKS;
else if (keyin == '|')
class_wanted = OBJ_STAVES;
@@ -1009,7 +1009,7 @@ void create_spec_object()
class_wanted = OBJ_ORBS;
else if (keyin == '}' || keyin == '{')
class_wanted = OBJ_MISCELLANY;
- else if (keyin == 'X')
+ else if (keyin == 'X' || keyin == '&')
class_wanted = OBJ_CORPSES;
else if (keyin == '%')
class_wanted = OBJ_FOOD;
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index a5fb1e1ddb..da11ab593a 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -633,16 +633,16 @@ static bool food_change(bool suppress_message)
learned_something_new(TUT_YOU_STARVING);
you.check_awaken(500);
break;
- case HS_HUNGRY:
- mpr("You are feeling hungry.", MSGCH_FOOD);
+ case HS_NEAR_STARVING:
+ mpr("You are near starving.", 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);
+ case HS_HUNGRY:
+ mpr("You are feeling hungry.", MSGCH_FOOD);
learned_something_new(TUT_YOU_HUNGRY);
break;
default: