summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.cc
diff options
context:
space:
mode:
authorShmuale Mark <shm.mark@gmail.com>2014-06-19 16:05:04 -0400
committerShmuale Mark <shm.mark@gmail.com>2014-06-22 10:03:45 -0400
commit465957cba490a2a9d5444a64523572a90cfb837f (patch)
tree536c94ce0702e60217120aa2bb27325aff1b8f2d /crawl-ref/source/itemprop.cc
parent393eda0d444702a7eda580e6c363bbdcaba8d54e (diff)
downloadcrawl-ref-465957cba490a2a9d5444a64523572a90cfb837f.tar.gz
crawl-ref-465957cba490a2a9d5444a64523572a90cfb837f.zip
The great mon-stuff migration.
A good deal of functions move to the two new files, mon-poly and mon-message. Of the others, some go to where they are used, some to mon-util, and a few are made member methods of monster. This probably breaks Xcode compilation, and I'm not able to test the changes I made to MSVC that will (hopefully) keep it working.
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r--crawl-ref/source/itemprop.cc31
1 files changed, 30 insertions, 1 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 32a0e85774..69c8593ff1 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -28,7 +28,6 @@
#include "misc.h"
#include "mon-death.h"
#include "mon-util.h"
-#include "mon-stuff.h"
#include "notes.h"
#include "options.h"
#include "player.h"
@@ -2590,6 +2589,36 @@ int item_mass(const item_def &item)
return (unit_mass > 0) ? unit_mass : 0;
}
+bool is_item_jelly_edible(const item_def &item)
+{
+ // Don't eat artefacts.
+ if (is_artefact(item))
+ return false;
+
+ // Don't eat mimics.
+ if (item.flags & ISFLAG_MIMIC)
+ return false;
+
+ // Shouldn't eat stone things
+ // - but what about wands and rings?
+ if (item.base_type == OBJ_MISSILES
+ && (item.sub_type == MI_STONE || item.sub_type == MI_LARGE_ROCK))
+ {
+ return false;
+ }
+
+ // Don't eat special game items.
+ if (item.base_type == OBJ_ORBS
+ || (item.base_type == OBJ_MISCELLANY
+ && (item.sub_type == MISC_RUNE_OF_ZOT
+ || item.sub_type == MISC_HORN_OF_GERYON)))
+ {
+ return false;
+ }
+
+ return true;
+}
+
equipment_type get_item_slot(const item_def& item)
{
return get_item_slot(item.base_type, item.sub_type);