From e104efe7e42dbd793859761d7508f68f70bb1bca Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 8 Jun 2008 05:21:59 +0000 Subject: Move cast_summon_butterflies() to the right place. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5585 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells2.cc | 46 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'crawl-ref/source/spells2.cc') diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index a04069c929..fb40b02738 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1466,6 +1466,29 @@ void summon_animals(int pow) } } +bool cast_summon_butterflies(int pow, bool god_gift) +{ + bool success = false; + + const int how_many = std::max(15, 4 + random2(3) + random2(pow) / 10); + + for (int i = 0; i < how_many; ++i) + { + if (create_monster( + mgen_data(MONS_BUTTERFLY, BEH_FRIENDLY, 3, + you.pos(), you.pet_target, + god_gift ? MF_GOD_GIFT : 0)) != -1) + { + success = true; + } + } + + if (!success) + canned_msg(MSG_NOTHING_HAPPENS); + + return (success); +} + //jmf: beefed up higher-level casting of this (formerly lame) spell bool cast_summon_small_mammals(int pow, bool god_gift) { @@ -1522,29 +1545,6 @@ bool cast_summon_small_mammals(int pow, bool god_gift) return (success); } -bool cast_summon_butterflies(int pow, bool god_gift) -{ - bool success = false; - - const int how_many = std::max(15, 4 + random2(3) + random2(pow) / 10); - - for (int i = 0; i < how_many; ++i) - { - if (create_monster( - mgen_data(MONS_BUTTERFLY, BEH_FRIENDLY, 3, - you.pos(), you.pet_target, - god_gift ? MF_GOD_GIFT : 0)) != -1) - { - success = true; - } - } - - if (!success) - canned_msg(MSG_NOTHING_HAPPENS); - - return (success); -} - bool cast_summon_scorpions(int pow, bool god_gift) { bool success = false; -- cgit v1.2.3-54-g00ecf