summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-11-09 22:42:20 -0500
committerCharles Otto <ottochar@gmail.com>2009-11-09 22:43:13 -0500
commit81177ef944594f12f3493189b70e6ea34debf4a3 (patch)
treeb3a002f711a374457feb435f11c4e21dfb55c097
parentc314b43fca597936cdb17bf7a8151cdfe33b8b04 (diff)
downloadcrawl-ref-81177ef944594f12f3493189b70e6ea34debf4a3.tar.gz
crawl-ref-81177ef944594f12f3493189b70e6ea34debf4a3.zip
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).
-rw-r--r--crawl-ref/source/effects.cc4
-rw-r--r--crawl-ref/source/godabil.cc7
-rw-r--r--crawl-ref/source/mon-behv.cc7
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);