From 81177ef944594f12f3493189b70e6ea34debf4a3 Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Mon, 9 Nov 2009 22:42:20 -0500 Subject: Allied giant spore behavior tweaks Make allied spores consistently ignore 't' commands, also make them wander unless they spot an enemy (instead of following you around until they find an enemy). --- crawl-ref/source/effects.cc | 4 ++-- crawl-ref/source/godabil.cc | 7 +++++++ crawl-ref/source/mon-behv.cc | 7 ++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index d00e4eec61..d1332a4607 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -2456,7 +2456,7 @@ static void _set_friendly_foes(bool allow_patrol = false) { monsters *mon(&menv[i]); if (!mon->alive() || !mons_near(mon) || !mon->friendly() - || mon->mons_species() == MONS_GIANT_SPORE) + || mon->type == MONS_GIANT_SPORE) { continue; } @@ -2479,7 +2479,7 @@ static void _set_allies_patrol_point(bool clear = false) continue; // Berserking monsters cannot be ordered around. - if (mon->berserk()) + if (mon->berserk() || mon->type == MONS_GIANT_SPORE) continue; mon->patrol_point = (clear ? coord_def(0, 0) : mon->pos()); diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc index 61eb747fce..c7fc683a3f 100644 --- a/crawl-ref/source/godabil.cc +++ b/crawl-ref/source/godabil.cc @@ -962,7 +962,14 @@ int corpse_spores(beh_type behavior) MG_FORCE_PLACE)); if (rc!=-1) + { env.mons[rc].flags |= MF_ATT_CHANGE_ATTEMPT; + if(behavior == BEH_FRIENDLY) + { + env.mons[rc].behaviour = BEH_WANDER; + env.mons[rc].foe = MHITNOT; + } + } if (mons_skeleton(stack_it->plus)) turn_corpse_into_skeleton(*stack_it); diff --git a/crawl-ref/source/mon-behv.cc b/crawl-ref/source/mon-behv.cc index 812a796fb7..a15ea7e2e9 100644 --- a/crawl-ref/source/mon-behv.cc +++ b/crawl-ref/source/mon-behv.cc @@ -1283,7 +1283,8 @@ void handle_behaviour(monsters *mon) // No foe? Then wander or seek the player. if (mon->foe == MHITNOT) { - if (crawl_state.arena || !proxPlayer || isNeutral || patrolling) + if (crawl_state.arena || !proxPlayer || isNeutral || patrolling + || mon->type == MONS_GIANT_SPORE) new_beh = BEH_WANDER; else { @@ -1761,6 +1762,10 @@ void behaviour_event(monsters *mon, mon_event_type event, int src, break; } + // Avoid moving friendly giant spores out of BEH_WANDER + if (mon->friendly() && mon->type == MONS_GIANT_SPORE) + break; + if (mon->asleep() && mons_near(mon)) remove_auto_exclude(mon, true); -- cgit v1.2.3-54-g00ecf