diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-16 14:04:41 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-16 14:04:41 +0000 |
commit | 1f328a8c326b0a2ff99dbf776b17b7375cb8061b (patch) | |
tree | 0a27b29014d204da48f254f7915fbe8a562659c1 | |
parent | 1a6c94ae92a619e3612a0359d97d4498f2adeba8 (diff) | |
download | crawl-ref-1f328a8c326b0a2ff99dbf776b17b7375cb8061b.tar.gz crawl-ref-1f328a8c326b0a2ff99dbf776b17b7375cb8061b.zip |
Fix compile, a few minor changes (mostly commenting), and
fix 1856365: wandering mushrooms "turns to fight".
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4256 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/mon-util.cc | 26 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 11 |
2 files changed, 23 insertions, 14 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 8033a83300..3f2f71c123 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -3286,6 +3286,8 @@ bool monsters::pickup_armour(item_def &item, int near, bool force) return false; // XXX: Very simplistic armour evaluation for the moment. + // Because of the way wants_armour() is handled above, this armour exchange + // currently only takes place if forced by wizard mode. if (const item_def *existing_armour = slot_item(eq)) { if (!force && existing_armour->armour_rating() >= item.armour_rating()) @@ -3436,12 +3438,10 @@ bool monsters::pickup_misc(item_def &item, int near) return pickup(item, MSLOT_MISCELLANY, near); } +// Jellies are handled elsewhere, in _handle_pickup()) in monstuff.cc. bool monsters::pickup_item(item_def &item, int near, bool force) { - // Never pick up stuff when we're in battle. -// if (!force && (behaviour != BEH_WANDER || attitude == ATT_NEUTRAL)) -// return (false); - + // Equipping stuff can be forced when initially equipping monsters. if (!force) { if (attitude == ATT_NEUTRAL) @@ -3465,12 +3465,17 @@ bool monsters::pickup_item(item_def &item, int near, bool force) { return false; } + + if (behaviour == BEH_FLEE + && (itype == OBJ_WEAPONS || itype == OBJ_MISSILES)) + { + return (false); + } } - // Jellies are not handled here. switch (item.base_type) { - // pickup some stuff only if WANDERING + // Pickup some stuff only if WANDERING. case OBJ_ARMOUR: return pickup_armour(item, near, force); case OBJ_CORPSES: @@ -3479,16 +3484,13 @@ bool monsters::pickup_item(item_def &item, int near, bool force) return pickup_misc(item, near); case OBJ_GOLD: return pickup_gold(item, near); - // other types can always be picked up - // (barring other checks depending on subtype, of course) + // Fleeing monsters won't pick up these. case OBJ_WEAPONS: - if (behaviour == BEH_FLEEING) - return false; return pickup_weapon(item, near, force); case OBJ_MISSILES: - if (behaviour == BEH_FLEEING) - return false; return pickup_missile(item, near, force); + // Other types can always be picked up + // (barring other checks depending on subtype, of course). case OBJ_WANDS: return pickup_wand(item, near); case OBJ_SCROLLS: diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 66e634673e..15c51418c6 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -2048,10 +2048,14 @@ void behaviour_event( monsters *mon, int event, int src, break; case ME_SCARE: - // Berserking monsters don't flee + // Berserking monsters don't flee. if (mon->has_ench(ENCH_BERSERK)) break; + // Neither do wandering mushrooms. + if (mon->type == MONS_WANDERING_MUSHROOM) + break; + mon->foe = src; mon->behaviour = BEH_FLEE; // assume monsters know where to run from, even @@ -2062,6 +2066,9 @@ void behaviour_event( monsters *mon, int event, int src, break; case ME_CORNERED: + if (mon->type == MONS_WANDERING_MUSHROOM) + break; + // just set behaviour.. foe doesn't change. if (mon->behaviour != BEH_CORNERED && !mon->has_ench(ENCH_FEAR)) simple_monster_message(mon, " turns to fight!"); @@ -6241,7 +6248,7 @@ forget_it: } if (monster->type == MONS_ROTTING_DEVIL - || monster->type == MONS_CURSE_TOE) + || monster->type == MONS_CURSE_TOE) { place_cloud( CLOUD_MIASMA, monster->x, monster->y, 2 + random2(3), monster->kill_alignment() ); |