summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/transfor.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-12 16:55:43 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-12 16:55:43 +0000
commit659553d325a49df4870dcfa18af7f9bece5cbf16 (patch)
treea91a34276297d5e773cad2beb02b71aba63e5c1f /crawl-ref/source/transfor.cc
parentdae63e7aa1492355fa025d4a18f638ea9cc59553 (diff)
downloadcrawl-ref-659553d325a49df4870dcfa18af7f9bece5cbf16.tar.gz
crawl-ref-659553d325a49df4870dcfa18af7f9bece5cbf16.zip
* Automate all the notetaking I always do when testing Xom.
NOTE_DEBUG_XOM might be a tiny bit technical or spoily, but at the same time I like the results and think this flag could actually be turned into an option to autonote all Xom effects, so I've left it on in this commit, in case someone else is playtesting Xom. * Fix a monster polymorphing into an (invisible) unseen horror naming it. * Reactivate autopickup if you kill an invisible monster or see an invisible monster become visible. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9598 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/transfor.cc')
-rw-r--r--crawl-ref/source/transfor.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc
index 35aa8c5f1d..3eb69e744c 100644
--- a/crawl-ref/source/transfor.cc
+++ b/crawl-ref/source/transfor.cc
@@ -30,6 +30,7 @@ REVISION("$Rev$");
#include "state.h"
#include "stuff.h"
#include "traps.h"
+#include "xom.h"
static void _extra_hp(int amount_extra);
@@ -153,7 +154,7 @@ static void _unwear_equipment_slot(equipment_type eqslot)
}
static void _remove_equipment(const std::set<equipment_type>& removed,
- bool meld = true)
+ bool meld = true, bool mutation = false)
{
// Meld items into you in (reverse) order. (std::set is a sorted container)
std::set<equipment_type>::const_iterator iter;
@@ -172,7 +173,16 @@ static void _remove_equipment(const std::set<equipment_type>& removed,
_unwear_equipment_slot(e);
if (unequip)
+ {
you.equip[e] = -1;
+
+ if (mutation)
+ {
+ // A mutation made us not only lose an equipment slot
+ // but actually removed a worn item: Funny!
+ xom_is_stimulated(is_artefact(*equip) ? 255 : 128);
+ }
+ }
}
}
@@ -261,11 +271,11 @@ void unmeld_one_equip(equipment_type eq)
_unmeld_equipment(e);
}
-void remove_one_equip(equipment_type eq, bool meld)
+void remove_one_equip(equipment_type eq, bool meld, bool mutation)
{
std::set<equipment_type> r;
r.insert(eq);
- _remove_equipment(r, meld);
+ _remove_equipment(r, meld, mutation);
}
static bool _tran_may_meld_cursed(int transformation)