From 8f9adf5d26be96c03eca477ef2a5e3fe20827ef2 Mon Sep 17 00:00:00 2001 From: dolorous Date: Sat, 7 Jun 2008 04:14:40 +0000 Subject: Consolidate "Summon Butterflies" into summon_general_creature(). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5521 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spl-cast.cc | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'crawl-ref/source/spl-cast.cc') diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 74ed682f28..e444d5c53d 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -1488,22 +1488,32 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) break; // Remember that most holy spells don't yet use powc! + case SPELL_SUMMON_BUTTERFLIES: case SPELL_CALL_IMP: case SPELL_SUMMON_DEMON: case SPELL_DEMONIC_HORDE: case SPELL_SUMMON_ICE_BEAST: + case SPELL_SUMMON_UGLY_THING: case SPELL_SUMMON_GUARDIAN: case SPELL_SUMMON_DAEVA: - case SPELL_SUMMON_UGLY_THING: { monster_type mon = MONS_PROGRAM_BUG; - int how_many = (spell == SPELL_DEMONIC_HORDE) ? 7 + random2(5) - : 1; + int numsc = + (spell == SPELL_SUMMON_BUTTERFLIES) ? 3 + : std::min(2 + (random2(powc) / 4), 6); + int how_many = + (spell == SPELL_SUMMON_BUTTERFLIES) ? std::max(15, 4 + random2(3) + random2(powc) / 10) : + (spell == SPELL_DEMONIC_HORDE) ? 7 + random2(5) + : 1; for (int i = 0; i < how_many; ++i) { switch (spell) { + case SPELL_SUMMON_BUTTERFLIES: + mon = MONS_BUTTERFLY; + break; + case SPELL_CALL_IMP: mon = (one_chance_in(3)) ? MONS_WHITE_IMP : (one_chance_in(7)) ? MONS_SHADOW_IMP @@ -1515,24 +1525,14 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) if (i == 0) mpr("You open a gate to Pandemonium!"); mon = summon_any_demon( - (spell == SPELL_DEMONIC_HORDE) ? DEMON_LESSER - : DEMON_COMMON); + (spell == SPELL_DEMONIC_HORDE) ? DEMON_LESSER + : DEMON_COMMON); break; case SPELL_SUMMON_ICE_BEAST: mon = MONS_ICE_BEAST; break; - case SPELL_SUMMON_GUARDIAN: - mon = MONS_ANGEL; - break; - - case SPELL_SUMMON_DAEVA: - mon = MONS_DAEVA; - break; - - // Starting here, there's a chance of monsters' being - // unfriendly. case SPELL_SUMMON_UGLY_THING: { const int chance = std::max(6 - (powc / 12), 1); @@ -1541,11 +1541,19 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) break; } + case SPELL_SUMMON_GUARDIAN: + mon = MONS_ANGEL; + break; + + case SPELL_SUMMON_DAEVA: + mon = MONS_DAEVA; + break; + default: break; } - summon_general_creature(powc, mon, BEH_FRIENDLY, false); + summon_general_creature(powc, mon, BEH_FRIENDLY, numsc, false); } break; } @@ -1936,10 +1944,6 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) cast_forescry(powc); break; - case SPELL_SUMMON_BUTTERFLIES: - cast_summon_butterflies(powc); - break; - case SPELL_EXCRUCIATING_WOUNDS: if (!brand_weapon(SPWPN_PAIN, powc)) canned_msg(MSG_SPELL_FIZZLES); -- cgit v1.2.3-54-g00ecf