summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-util.cc
diff options
context:
space:
mode:
authorevktalo <evktalo@users.sourceforge.net>2009-09-30 23:37:28 +0300
committerevktalo <evktalo@users.sourceforge.net>2009-09-30 23:37:28 +0300
commitaf0464fd0a5d5d3e815121c2497dc769803f5a7d (patch)
tree6ec702f2c239a2a71fd29baeda29c6c2fec76554 /crawl-ref/source/spl-util.cc
parent9bf7b8a11fe8dab07b560cc6def6ffb52313e823 (diff)
downloadcrawl-ref-af0464fd0a5d5d3e815121c2497dc769803f5a7d.tar.gz
crawl-ref-af0464fd0a5d5d3e815121c2497dc769803f5a7d.zip
Added Sandblast to the list of Vehumet-boosted spells. Tweaked int spell_range accordingly. (thanks amacleod) Also forgot to thank rob for co-hacking the Vehumet check.
Signed-off-by: evktalo <evktalo@users.sourceforge.net>
Diffstat (limited to 'crawl-ref/source/spl-util.cc')
-rw-r--r--crawl-ref/source/spl-util.cc25
1 files changed, 8 insertions, 17 deletions
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index 0cb60d16af..05c623631c 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -984,25 +984,20 @@ int spell_power_cap(spell_type spell)
return (_seekspell(spell)->power_cap);
}
-// Sandblast range is 1 if not wielding rocks, 2 if you are.
-static int _sandblast_range(int pow, bool real_cast)
-{
- int res = 1;
-
- if (wielding_rocks())
- res = 2;
-
- return (res);
-}
-
-
int spell_range(spell_type spell, int pow, bool real_cast, bool player_spell)
{
int minrange = _seekspell(spell)->min_range;
int maxrange = _seekspell(spell)->max_range;
ASSERT(maxrange >= minrange);
- if(player_spell
+ // Sandblast is a special case.
+ if ((spell == SPELL_SANDBLAST) && wielding_rocks())
+ {
+ minrange++;
+ maxrange++;
+ }
+
+ if(player_spell
&& vehumet_supports_spell(spell)
&& you.religion == GOD_VEHUMET
&& !player_under_penance()
@@ -1015,10 +1010,6 @@ int spell_range(spell_type spell, int pow, bool real_cast, bool player_spell)
minrange++;
}
- // Some cases need to be handled specially.
- if (spell == SPELL_SANDBLAST)
- return _sandblast_range(pow, real_cast);
-
if (minrange == maxrange)
return minrange;