summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/item_use.cc9
-rw-r--r--crawl-ref/source/item_use.h2
-rw-r--r--crawl-ref/source/transfor.cc18
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)
{