summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index fc94aec174..f07710234b 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -2345,19 +2345,23 @@ int cast_apportation(int pow)
return (done);
}
-bool cast_sandblast(int pow, bolt &beam)
+bool wielding_rocks()
{
- bool big = false;
-
+ bool rc = false;
if (you.weapon())
{
const item_def& wpn(*you.weapon());
- big = (wpn.base_type == OBJ_MISSILES
- && (wpn.sub_type == MI_STONE || wpn.sub_type == MI_LARGE_ROCK));
+ rc = (wpn.base_type == OBJ_MISSILES
+ && (wpn.sub_type == MI_STONE || wpn.sub_type == MI_LARGE_ROCK));
}
+ return (rc);
+}
- bool success = zapping(big ? ZAP_SANDBLAST
- : ZAP_SMALL_SANDBLAST, pow, beam, true);
+bool cast_sandblast(int pow, bolt &beam)
+{
+ const bool big = wielding_rocks();
+ const bool success = zapping(big ? ZAP_SANDBLAST
+ : ZAP_SMALL_SANDBLAST, pow, beam, true);
if (big && success)
dec_inv_item_quantity( you.equip[EQ_WEAPON], 1 );