summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-21 11:04:22 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-21 11:04:22 +0000
commit6d641e67f004a7dc483e3590a1ecbde0e3ccd455 (patch)
treeeace8fd0e325bb31d2a09e75385877cb5cc2f548
parent50bf4fcc442d34d21754b9170255b70c6cafe080 (diff)
downloadcrawl-ref-6d641e67f004a7dc483e3590a1ecbde0e3ccd455.tar.gz
crawl-ref-6d641e67f004a7dc483e3590a1ecbde0e3ccd455.zip
Allow testers to force-feed corpses to ghouls and necrophages.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8650 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/debug.cc11
-rw-r--r--crawl-ref/source/mon-util.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 81bcfb5151..23fcd675bb 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -4965,6 +4965,13 @@ void wizard_give_monster_item(monsters *mon)
case OBJ_MISCELLANY:
mon_slot = MSLOT_MISCELLANY;
break;
+ case OBJ_CORPSES:
+ if (!mons_eats_corpses(mon))
+ {
+ mpr("That type of monster doesn't eat corpses.");
+ return;
+ }
+ break;
default:
mpr("You can't give that type of item to a monster.");
return;
@@ -4972,6 +4979,7 @@ void wizard_give_monster_item(monsters *mon)
// Shouldn't we be using MONUSE_MAGIC_ITEMS?
if (item_use == MONUSE_STARTING_EQUIPMENT
+ && item.base_type != OBJ_CORPSES
&& !mons_is_unique( mon->type ))
{
switch(mon_slot)
@@ -4998,7 +5006,8 @@ void wizard_give_monster_item(monsters *mon)
// Move monster's old item to player's inventory as last step.
int old_eq = NON_ITEM;
bool unequipped = false;
- if (mon->inv[mon_slot] != NON_ITEM
+ if (item.base_type != OBJ_CORPSES
+ && mon->inv[mon_slot] != NON_ITEM
&& !items_stack(item, mitm[mon->inv[mon_slot]]))
{
old_eq = mon->inv[mon_slot];
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index d050af4bcb..842518314f 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -777,6 +777,7 @@ bool mons_is_evil_or_unholy(const monsters *mon);
bool mons_is_icy(int mc);
bool mons_is_skeletal(int mc);
bool mons_has_lifeforce(const monsters *mon);
+bool mons_eats_corpses(const monsters *m);
monster_type mons_genus(int mc);
monster_type mons_species(int mc);