summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-09 23:30:47 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-09 23:30:47 -0600
commitf72939d2821579a1c8da6202efe6cb6cc351fee4 (patch)
treea48bf3ffd5971df09f656f29c202bd36abaf703d /crawl-ref/source
parent43e85458c7c6205645f844153f2569cb200ee206 (diff)
downloadcrawl-ref-f72939d2821579a1c8da6202efe6cb6cc351fee4.tar.gz
crawl-ref-f72939d2821579a1c8da6202efe6cb6cc351fee4.zip
Fix a genus check for blink frogs, and species checks for giant spores.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/godabil.cc6
-rw-r--r--crawl-ref/source/mon-behv.cc10
2 files changed, 9 insertions, 7 deletions
diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc
index c7fc683a3f..0605fddac1 100644
--- a/crawl-ref/source/godabil.cc
+++ b/crawl-ref/source/godabil.cc
@@ -1270,7 +1270,7 @@ static int _lugonu_warp_monster(coord_def where, int pow, int, actor *)
}
const int damage = 1 + random2(pow / 6);
- if (mon->type == MONS_BLINK_FROG)
+ if (mons_genus(mon->type) == MONS_BLINK_FROG)
mon->heal(damage, false);
else if (!mon->check_res_magic(pow))
{
@@ -1286,7 +1286,7 @@ static int _lugonu_warp_monster(coord_def where, int pow, int, actor *)
static void _lugonu_warp_area(int pow)
{
- apply_area_around_square( _lugonu_warp_monster, you.pos(), pow );
+ apply_area_around_square(_lugonu_warp_monster, you.pos(), pow);
}
void lugonu_bends_space()
@@ -1294,7 +1294,7 @@ void lugonu_bends_space()
const int pow = 4 + skill_bump(SK_INVOCATIONS);
const bool area_warp = random2(pow) > 9;
- mprf("Space bends %saround you!", area_warp? "sharply " : "");
+ mprf("Space bends %saround you!", area_warp ? "sharply " : "");
if (area_warp)
_lugonu_warp_area(pow);
diff --git a/crawl-ref/source/mon-behv.cc b/crawl-ref/source/mon-behv.cc
index a15ea7e2e9..7e5188a40f 100644
--- a/crawl-ref/source/mon-behv.cc
+++ b/crawl-ref/source/mon-behv.cc
@@ -1192,13 +1192,13 @@ void handle_behaviour(monsters *mon)
&& you.pet_target != MHITNOT
&& (mon->foe == MHITNOT || mon->foe == MHITYOU)
&& !mon->berserk()
- && mon->mons_species() != MONS_GIANT_SPORE)
+ && mon->type != MONS_GIANT_SPORE)
{
mon->foe = you.pet_target;
}
// Instead, berserkers attack nearest monsters.
- if ((mon->berserk() || mon->mons_species() == MONS_GIANT_SPORE)
+ if ((mon->berserk() || mon->type == MONS_GIANT_SPORE)
&& (mon->foe == MHITNOT || isFriendly && mon->foe == MHITYOU))
{
// Intelligent monsters prefer to attack the player,
@@ -1280,12 +1280,14 @@ void handle_behaviour(monsters *mon)
case BEH_LURK:
case BEH_SEEK:
- // No foe? Then wander or seek the player.
+ // No foe? Then wander or seek the player.
if (mon->foe == MHITNOT)
{
if (crawl_state.arena || !proxPlayer || isNeutral || patrolling
|| mon->type == MONS_GIANT_SPORE)
+ {
new_beh = BEH_WANDER;
+ }
else
{
new_foe = MHITYOU;
@@ -1762,7 +1764,7 @@ void behaviour_event(monsters *mon, mon_event_type event, int src,
break;
}
- // Avoid moving friendly giant spores out of BEH_WANDER
+ // Avoid moving friendly giant spores out of BEH_WANDER.
if (mon->friendly() && mon->type == MONS_GIANT_SPORE)
break;