summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-08 12:50:20 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-08 12:56:39 -0600
commit8b360b634738ea8a953d92660b452e92862d9cda (patch)
treeba25098b00d61747ef0364359b2411e17fd2555d /crawl-ref/source/spells4.cc
parentde0dc3b6beb967abb1123db5dc5da3c0125946af (diff)
downloadcrawl-ref-8b360b634738ea8a953d92660b452e92862d9cda.tar.gz
crawl-ref-8b360b634738ea8a953d92660b452e92862d9cda.zip
Move blink frogs into their own genus, in order to make checks for both
blink frogs and Prince Ribbit in blink frog form consistent (i.e., so if Prince Ribbit is polymorphed into another form, he'll no longer erroneously act like a blink frog in some cases).
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc34
1 files changed, 16 insertions, 18 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index c560435d5e..44db4ff667 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -854,39 +854,37 @@ void cast_discharge(int pow)
// Really this is just applying the best of Band/Warp weapon/Warp field
// into a spell that gives the "make monsters go away" benefit without
-// the insane damage potential. -- bwr
+// the insane damage potential. - bwr
int disperse_monsters(coord_def where, int pow, int, actor *)
{
- monsters *defender = monster_at(where);
- if (defender == NULL)
- return 0;
+ monsters *mon = monster_at(where);
+ if (!mon)
+ return (0);
- if (defender->type == MONS_BLINK_FROG
- || defender->type == MONS_PRINCE_RIBBIT)
+ if (mons_genus(mon->type) == MONS_BLINK_FROG)
{
- simple_monster_message(defender, " resists.");
- return 1;
+ simple_monster_message(mon, " resists.");
+ return (1);
}
- else if (defender->check_res_magic(pow))
+ else if (mon->check_res_magic(pow))
{
- // XXX Note that this might affect magic-immunes!
+ // XXX: Note that this might affect magic-immunes!
if (coinflip())
{
- simple_monster_message(defender, " partially resists.");
- monster_blink(defender);
+ simple_monster_message(mon, " partially resists.");
+ monster_blink(mon);
}
else
- simple_monster_message(defender, " resists.");
-
- return 1;
+ simple_monster_message(mon, " resists.");
+ return (1);
}
else
{
- monster_teleport( defender, true );
- return 1;
+ monster_teleport(mon, true);
+ return (1);
}
- return 0;
+ return (0);
}
void cast_dispersal(int pow)