summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/wiz-mon.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2013-05-25 17:43:28 -0400
committerNeil Moore <neil@s-z.org>2013-05-25 17:43:28 -0400
commitd6e4736e389e68db612a0ef362af4c0920225e35 (patch)
tree15c006d3c01ac4ddeef9ae6bde9074bf7d2bea5b /crawl-ref/source/wiz-mon.cc
parentc2c73efecfadc65ed005282cc4046e1ebc74256f (diff)
downloadcrawl-ref-d6e4736e389e68db612a0ef362af4c0920225e35.tar.gz
crawl-ref-d6e4736e389e68db612a0ef362af4c0920225e35.zip
Dump monster inventory in x&D
It doesn't name the slots but does give the slot numbers, like the spells: dump. Arguably slot names would be more useful here, though.
Diffstat (limited to 'crawl-ref/source/wiz-mon.cc')
-rw-r--r--crawl-ref/source/wiz-mon.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/crawl-ref/source/wiz-mon.cc b/crawl-ref/source/wiz-mon.cc
index 0021b2d1cd..47c1116cd6 100644
--- a/crawl-ref/source/wiz-mon.cc
+++ b/crawl-ref/source/wiz-mon.cc
@@ -683,6 +683,30 @@ void debug_stethoscope(int mon)
if (found_spell)
mprf(MSGCH_DIAGNOSTICS, "spells: %s", spl.str().c_str());
+ ostringstream inv;
+ bool found_item = false;
+ for (int k = 0; k < NUM_MONSTER_SLOTS; ++k)
+ {
+ if (mons.inv[k] != NON_ITEM)
+ {
+ if (found_item)
+ inv << ", ";
+
+ found_item = true;
+
+ inv << k << ": ";
+
+ if (mons.inv[k] >= MAX_ITEMS)
+ inv << " buggy item";
+ else
+ inv << item_base_name(mitm[mons.inv[k]]);
+
+ inv << " (" << static_cast<int>(mons.inv[k]) << ")";
+ }
+ }
+ if (found_item)
+ mprf(MSGCH_DIAGNOSTICS, "inv: %s", inv.str().c_str());
+
if (mons_is_ghost_demon(mons.type))
{
ASSERT(mons.ghost.get());