(FR, but I consider it a bug)
Players will now be prompted whether they want to use an ability if there's a chance its food_cost might make them starve to death.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3474 c06c8d41-db1a-0410-9941-cceddc491573
ARORC5GJNHLAPL2MJ3PUYIAR55ETDDAPXYSYH4OBMXHADNWSGYPAC
// 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);
}
}