diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-15 18:31:03 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-15 18:31:03 +0000 |
commit | c607f86c3013a65b0888227c8f6385ce72ce0177 (patch) | |
tree | 8b616564b3e07abeafe0d407e08b873f99482f54 /crawl-ref | |
parent | 3363a19596a74e799fe35c3e0cf59f82fe56664f (diff) | |
download | crawl-ref-c607f86c3013a65b0888227c8f6385ce72ce0177.tar.gz crawl-ref-c607f86c3013a65b0888227c8f6385ce72ce0177.zip |
Fix 2018757: Bat form not deactivating jewellery effects
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6564 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/item_use.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/item_use.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/transfor.cc | 18 |
3 files changed, 20 insertions, 9 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index f77688b29e..00eb067077 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -3166,9 +3166,9 @@ bool puton_ring(int slot, bool prompt_finger) return (false); return puton_item(item_slot, prompt_finger); -} // end puton_ring() +} -void jewellery_remove_effects(item_def &item) +void jewellery_remove_effects(item_def &item, bool mesg) { // The ring/amulet must already be removed from you.equip at this point. @@ -3177,7 +3177,8 @@ void jewellery_remove_effects(item_def &item) const bool old_showuncursed = Options.show_uncursed; Options.show_uncursed = false; - mprf("You remove %s.", item.name(DESC_NOCAP_YOUR).c_str() ); + if (mesg) + mprf("You remove %s.", item.name(DESC_NOCAP_YOUR).c_str() ); Options.show_uncursed = old_showuncursed; @@ -3246,7 +3247,7 @@ void jewellery_remove_effects(item_def &item) if (is_random_artefact(item)) unuse_randart(item); - // must occur after ring is removed -- bwr + // Must occur after ring is removed. -- bwr calc_mp(); } diff --git a/crawl-ref/source/item_use.h b/crawl-ref/source/item_use.h index 8bc8662938..c2c0c0aced 100644 --- a/crawl-ref/source/item_use.h +++ b/crawl-ref/source/item_use.h @@ -84,7 +84,7 @@ void examine_object(void); * called from: acr * *********************************************************************** */ bool puton_ring(int slot = -1, bool prompt_finger = true); - +void jewellery_remove_effects(item_def &item, bool mesg = true); // last updated 12may2000 {dlb} /* *********************************************************************** diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc index 8e9887071b..77a578a875 100644 --- a/crawl-ref/source/transfor.cc +++ b/crawl-ref/source/transfor.cc @@ -22,6 +22,7 @@ #include "delay.h" #include "it_use2.h" +#include "item_use.h" #include "itemprop.h" #include "items.h" #include "misc.h" @@ -99,7 +100,7 @@ bool remove_equipment(std::set<equipment_type> removed) canned_msg(MSG_EMPTY_HANDED); } - // Remove items in order (std::set is a sorted container) + // Remove items in order. (std::set is a sorted container) std::set<equipment_type>::const_iterator iter; for (iter = removed.begin(); iter != removed.end(); ++iter) { @@ -110,12 +111,21 @@ bool remove_equipment(std::set<equipment_type> removed) mprf("%s falls away.", you.inv[you.equip[e]].name(DESC_CAP_YOUR).c_str()); - unwear_armour( you.equip[e] ); - you.equip[e] = -1; + if (e == EQ_LEFT_RING || e == EQ_RIGHT_RING || e == EQ_AMULET) + { + item_def &ring = you.inv[you.equip[e]]; + you.equip[e] = -1; + jewellery_remove_effects(ring, false); + } + else // armour + { + unwear_armour( you.equip[e] ); + you.equip[e] = -1; + } } return (true); -} // end remove_equipment() +} bool remove_one_equip(equipment_type eq) { |