diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-07 04:14:40 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-07 04:14:40 +0000 |
commit | 8f9adf5d26be96c03eca477ef2a5e3fe20827ef2 (patch) | |
tree | dc48a634387eb07b789858f2df48dda1579af2c3 /crawl-ref/source/spells2.cc | |
parent | 35180d844ba8e0177c6d214358453e8e81c07082 (diff) | |
download | crawl-ref-8f9adf5d26be96c03eca477ef2a5e3fe20827ef2.tar.gz crawl-ref-8f9adf5d26be96c03eca477ef2a5e3fe20827ef2.zip |
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
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r-- | crawl-ref/source/spells2.cc | 45 |
1 files changed, 26 insertions, 19 deletions
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) { |