summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-cast.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-07 14:05:46 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-07 14:05:46 +0000
commitcfda69d1ae94baf5e41b318ffd00dd227f8ddf69 (patch)
tree8bf2606134d56b1a58e1206d2d7331fe3a0518db /crawl-ref/source/spl-cast.cc
parentfa0e36a06cd154cc1d529dd7645ae47fab8af000 (diff)
downloadcrawl-ref-cfda69d1ae94baf5e41b318ffd00dd227f8ddf69.tar.gz
crawl-ref-cfda69d1ae94baf5e41b318ffd00dd227f8ddf69.zip
Spell power strings now reflect power caps.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1413 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r--crawl-ref/source/spl-cast.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index cfe6a670da..c92df53d2e 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -207,7 +207,7 @@ char list_spells(void)
// 35--48 is the spell schools
gotoxy(51, wherey());
- cprintf("%s",spell_power_to_string(calc_spell_power(spell,true)));
+ cprintf("%s", spell_power_string(spell));
//gotoxy(58, wherey());
gotoxy(65, wherey());
@@ -3510,8 +3510,14 @@ const char* failure_rate_to_string( int fail )
: "Perfect";
}
-const char* spell_power_to_string( int power )
+const char* spell_power_string( spell_type spell )
{
+ const int powercap = spell_power_cap(spell);
+ if ( powercap == 0 )
+ return "N/A";
+ const int power = calc_spell_power(spell, true);
+ if ( power >= powercap )
+ return "Maximum";
return
(power > 100) ? "Enormous" :
(power > 90) ? "Huge" :