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/spells2.cc | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'crawl-ref/source/spells2.cc') diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index a5c9679dac..71cc2f3e80 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1532,52 +1532,56 @@ void summon_scorpions(int pow) } // end summon_scorpions() bool summon_general_creature(int pow, monster_type mon, beh_type beha, - bool god_gift) + int numsc, bool god_gift) { - int numsc = std::min(2 + (random2(pow) / 4), 6); unsigned short hitting = (beha == BEH_FRIENDLY) ? you.pet_target : MHITYOU; bool success = false; + std::string msg = ""; + switch (mon) { + case MONS_BUTTERFLY: + break; + case MONS_IMP: + msg = "A beastly little devil appears in a puff of flame."; + break; + case MONS_WHITE_IMP: - case MONS_SHADOW_IMP: - { - const char *where = (mon == MONS_SHADOW_IMP) ? "the shadows" : - (mon == MONS_WHITE_IMP) ? "a puff of frigid air" - : "a puff of flame"; + msg = "A beastly little devil appears in a puff of frigid air."; + break; - mprf("A beastly little devil appears in %s.", where); + case MONS_SHADOW_IMP: + msg = "A shadowy apparition takes form in the air."; break; - } case MONS_ICE_BEAST: - mpr("A chill wind blows around you."); + msg = "A chill wind blows around you."; break; case MONS_ANGEL: - mpr("You open a gate to Zin's realm!"); + msg = "You open a gate to Zin's realm!"; break; case MONS_DAEVA: - mpr("You are momentarily dazzled by a brilliant golden light."); + msg = "You are momentarily dazzled by a brilliant golden light."; break; case MONS_UGLY_THING: case MONS_VERY_UGLY_THING: default: { - bool friendly = (random2(pow) > 3); - const char *what = (mon == MONS_VERY_UGLY_THING) ? " very ugly thing" : - (mon == MONS_UGLY_THING) ? "n ugly thing" - : " demon"; + msg = (mon == MONS_VERY_UGLY_THING) ? "A very ugly thing appears." : + (mon == MONS_UGLY_THING) ? "An ugly thing appears." + : "A demon appears!"; - mprf("A%s appears.%s", what, - friendly ? "" : " It doesn't look very happy."); + bool friendly = (random2(pow) > 3); if (!friendly) { + msg += " It doesn't look very happy."; + beha = BEH_HOSTILE; hitting = MHITYOU; } @@ -1595,6 +1599,9 @@ bool summon_general_creature(int pow, monster_type mon, beh_type beha, { success = true; + if (msg != "") + mprf("%s", msg.c_str()); + monsters *summon = &menv[monster]; if (mon == MONS_DAEVA) @@ -1685,7 +1692,7 @@ bool summon_berserker(int pow, beh_type beha, bool god_gift) } return (success); -} // end summon_berserker() +} bool summon_swarm(int pow, beh_type beha, bool god_gift) { -- cgit v1.2.3-54-g00ecf