From 8b360b634738ea8a953d92660b452e92862d9cda Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sun, 8 Nov 2009 12:50:20 -0600 Subject: 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). --- crawl-ref/source/spells4.cc | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'crawl-ref/source/spells4.cc') 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) -- cgit v1.2.3-54-g00ecf