diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-11 19:51:55 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-11 19:51:55 +0000 |
commit | 807feb82ade2f6ad782bb6e81c30abfcc0741544 (patch) | |
tree | e4fdf8f197ae8ccc756b6d90a14589a52b62d192 /crawl-ref/source/items.cc | |
parent | dc24fce640225bfc22bfb7410a9b01c24801becc (diff) | |
download | crawl-ref-807feb82ade2f6ad782bb6e81c30abfcc0741544.tar.gz crawl-ref-807feb82ade2f6ad782bb6e81c30abfcc0741544.zip |
Fix for 1805138: wands of draining no longer leak information when the
bolt misses.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2442 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r-- | crawl-ref/source/items.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 7e873542d2..1e5d7cb6cc 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -3206,6 +3206,33 @@ bool item_def::launched_by(const item_def &launcher) const return (sub_type == mt || (mt == MI_STONE && sub_type == MI_SLING_BULLET)); } +int item_def::zap() const +{ + if (base_type != OBJ_WANDS) + return ZAP_DEBUGGING_RAY; + + zap_type result; + switch (sub_type) + { + case WAND_ENSLAVEMENT: result = ZAP_ENSLAVEMENT; break; + case WAND_DRAINING: result = ZAP_NEGATIVE_ENERGY; break; + case WAND_DISINTEGRATION: result = ZAP_DISINTEGRATION; break; + + case WAND_RANDOM_EFFECTS: + result = static_cast<zap_type>(random2(16)); + if ( one_chance_in(20) ) + result = ZAP_NEGATIVE_ENERGY; + if ( one_chance_in(17) ) + result = ZAP_ENSLAVEMENT; + break; + + default: + result = static_cast<zap_type>(sub_type); + break; + } + return result; +} + int item_def::index() const { return (this - mitm.buffer()); |