diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-03 06:06:18 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-03 06:06:18 +0000 |
commit | fa61313c503ba66c00ad5ab4fc75dd032fb76a34 (patch) | |
tree | 4f886f07bbc419e84bed067240f4937e10fe77da /crawl-ref | |
parent | 00ebc7f2bdc8179b97d6d4eb004996af80f1a0b0 (diff) | |
download | crawl-ref-fa61313c503ba66c00ad5ab4fc75dd032fb76a34.tar.gz crawl-ref-fa61313c503ba66c00ad5ab4fc75dd032fb76a34.zip |
Jellies could eat the Horn of Geryon, fixed (jarpiain).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1406 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 746fba0a52..1d1d3e0292 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -3795,6 +3795,32 @@ static bool monster_wants_weapon(const monsters *monster, const item_def &weap) return (true); } +static bool is_item_jelly_edible(const item_def &item) +{ + // don't eat artefacts (note that unrandarts are randarts) + if (is_fixed_artefact(item) || is_random_artefact(item)) + 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); +} + //--------------------------------------------------------------- // // handle_pickup @@ -3826,28 +3852,9 @@ static bool handle_pickup(monsters *monster) { int quant = mitm[item].quantity; - // don't eat artefacts (note that unrandarts are randarts) - if (is_fixed_artefact(mitm[item]) || - is_random_artefact(mitm[item])) - continue; - - // shouldn't eat stone things - // - but what about wands and rings? - if (mitm[item].base_type == OBJ_MISSILES - && (mitm[item].sub_type == MI_STONE - || mitm[item].sub_type == MI_LARGE_ROCK)) - { - continue; - } - - // don't eat special game items - if (mitm[item].base_type == OBJ_ORBS - || (mitm[item].base_type == OBJ_MISCELLANY - && mitm[item].sub_type == MISC_RUNE_OF_ZOT)) - { + if (!is_item_jelly_edible(mitm[item])) continue; - } - + if (mitm[igrd[monster->x][monster->y]].base_type != OBJ_GOLD) { if (quant > max_eat - eaten) |