From 4f86bfa5a02da4400537f6fdfbda81a41aa85c5f Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Thu, 24 Sep 2009 18:41:59 -0500 Subject: Apply anonymous patch in [2836447], with a few tweaks, to fix spell hunger descriptions. --- crawl-ref/source/spl-cast.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/spl-cast.cc') diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index b2a24c538d..d32187743f 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -2296,16 +2296,21 @@ static unsigned int _breakpoint_rank(int val, const int breakpoints[], return result; } -const char* spell_hunger_string( spell_type spell ) +const char* spell_hunger_string(spell_type spell) { if (you.is_undead == US_UNDEAD) - return "N/A"; + return ("N/A"); const int hunger = spell_hunger(spell); + + // Spell hunger is "Fruit" if casting the spell five times costs at + // most one "Fruit". const char* hunger_descriptions[] = { - "None", "Grape", "Apple", "Choko", "Ration" + "None", "Sultana", "Strawberry", "Choko", "Honeycomb", "Ration" }; - const int breakpoints[] = { 1, 25, 150, 500 }; + + const int breakpoints[] = { 1, 15, 41, 121, 401 }; + return (hunger_descriptions[_breakpoint_rank(hunger, breakpoints, ARRAYSZ(breakpoints))]); } -- cgit v1.2.3-54-g00ecf