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 +++++++++---- crawl-ref/source/spl-cast.h | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source') 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))]); } diff --git a/crawl-ref/source/spl-cast.h b/crawl-ref/source/spl-cast.h index a16a3d8b7a..51cf0865d4 100644 --- a/crawl-ref/source/spl-cast.h +++ b/crawl-ref/source/spl-cast.h @@ -84,6 +84,6 @@ int spell_power_bars(spell_type spell); std::string spell_power_string(spell_type spell); std::string spell_range_string(spell_type spell); std::string spell_schools_string(spell_type spell); -const char* spell_hunger_string( spell_type spell ); +const char* spell_hunger_string(spell_type spell); #endif -- cgit v1.2.3-54-g00ecf