diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-22 15:53:37 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-22 15:53:37 +0000 |
commit | 2a73bdc6a3be5efa46dfdf32bb86edfcf5d0bd4c (patch) | |
tree | 8f0fc9dad7bcda05c27e23aca77ec987ed21c8c5 /crawl-ref/source/spells4.cc | |
parent | 9a1e7565ec8802a38a9649744920923fc262dff7 (diff) | |
download | crawl-ref-2a73bdc6a3be5efa46dfdf32bb86edfcf5d0bd4c.tar.gz crawl-ref-2a73bdc6a3be5efa46dfdf32bb86edfcf5d0bd4c.zip |
Improve player beam tracer for firing through friendlies:
* name the monster you're firing through ("your goblin zombie")
* use maximum possible range
* make it work for spells and abilities, as well
Still todo:
* apply the same logic to firing missiles
* don't prompt for monsters that wouldn't be harmed
(e.g. living allies for Dispel Undead, etc.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5177 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r-- | crawl-ref/source/spells4.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index a2cf1ee5e6..3004edbfe8 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -2636,21 +2636,24 @@ int cast_apportation(int pow) return (done); } -void cast_sandblast(int pow, bolt &beam) +bool cast_sandblast(int pow, bolt &beam) { bool big = 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); + big = (wpn.base_type == OBJ_MISSILES + && (wpn.sub_type == MI_STONE || wpn.sub_type == MI_LARGE_ROCK)); } - if (big) + bool success = zapping(big ? ZAP_SANDBLAST + : ZAP_SMALL_SANDBLAST, pow, beam, true); + + if (big && success) dec_inv_item_quantity( you.equip[EQ_WEAPON], 1 ); - zapping(big ? ZAP_SANDBLAST : ZAP_SMALL_SANDBLAST, pow, beam); + return (success); } void cast_condensation_shield(int pow) |