diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-07 05:59:19 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-07 05:59:19 +0000 |
commit | 8aa5902ba1473e7fc5fa7bb9f2d55a01258090c6 (patch) | |
tree | 469875eff8b27e5ac1cf0be787e949e7aacc837f /crawl-ref | |
parent | 4280a22a63e04ff5634bdf0e356185a617351289 (diff) | |
download | crawl-ref-8aa5902ba1473e7fc5fa7bb9f2d55a01258090c6.tar.gz crawl-ref-8aa5902ba1473e7fc5fa7bb9f2d55a01258090c6.zip |
Do the same for "Summon Scorpions".
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5526 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/spells2.cc | 28 | ||||
-rw-r--r-- | crawl-ref/source/spells2.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 27 |
3 files changed, 23 insertions, 34 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 59e99518f9..75cf0030a2 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1509,28 +1509,6 @@ void summon_animals(int pow) } } -void summon_scorpions(int pow) -{ - int numsc = 1 + random2(pow) / 10 + random2(pow) / 10; - - numsc = stepdown_value(numsc, 2, 2, 6, 8); //see stuff.cc - 12jan2000 {dlb} - - for (int scount = 0; scount < numsc; ++scount) - { - bool friendly = (random2(pow) > 3); - - if (create_monster( - mgen_data(MONS_SCORPION, - friendly ? BEH_FRIENDLY : BEH_HOSTILE, - 3, you.pos(), - friendly ? you.pet_target : MHITYOU)) != -1) - { - mprf("A scorpion appears.%s", - friendly ? "" : " It doesn't look very happy."); - } - } -} // end summon_scorpions() - bool summon_general_creature(int pow, bool quiet, monster_type mon, beh_type beha, int unfriendly, int numsc, bool god_gift) @@ -1553,6 +1531,10 @@ bool summon_general_creature(int pow, bool quiet, monster_type mon, msg = "A butterfly appears."; break; + case MONS_SCORPION: + msg = "A scorpion appears."; + break; + case MONS_IMP: msg = "A beastly little devil appears in a puff of flame."; break; @@ -1625,7 +1607,7 @@ bool summon_general_creature(int pow, bool quiet, monster_type mon, if (mon == MONS_DAEVA) summon->flags |= MF_ATT_CHANGE_ATTEMPT; } - else if (!quiet) + else canned_msg(MSG_NOTHING_HAPPENS); return (success); diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h index ef6d4534ef..3a3a284b48 100644 --- a/crawl-ref/source/spells2.h +++ b/crawl-ref/source/spells2.h @@ -141,8 +141,6 @@ bool summon_general_creature(int pow, bool quiet, monster_type mon, /* *********************************************************************** * called from: spell * *********************************************************************** */ -void summon_scorpions(int pow); - void summon_animals(int pow); diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index f0c1d84d19..92181f942d 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -1498,12 +1498,15 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) case SPELL_SUMMON_GUARDIAN: case SPELL_SUMMON_DAEVA: { - bool quiet = (spell == SPELL_SUMMON_BUTTERFLIES + bool quiet = + (spell == SPELL_SUMMON_BUTTERFLIES || spell == SPELL_CALL_CANINE_FAMILIAR); monster_type mon = MONS_PROGRAM_BUG; - int unfriendly = (spell == SPELL_SUMMON_DEMON + int unfriendly = + (spell == SPELL_SUMMON_SCORPIONS + || spell == SPELL_SUMMON_DEMON || spell == SPELL_DEMONIC_HORDE || spell == SPELL_CALL_CANINE_FAMILIAR || spell == SPELL_SUMMON_UGLY_THING) ? 3 : @@ -1511,13 +1514,15 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) : -1; int numsc = - (spell == SPELL_SUMMON_BUTTERFLIES) ? 3 - : -1; + (spell == SPELL_SUMMON_BUTTERFLIES + || spell == SPELL_SUMMON_SCORPIONS) ? 3 + : -1; int how_many = - (spell == SPELL_SUMMON_BUTTERFLIES) ? std::max(15, 4 + random2(3) + random2(powc) / 10) : - (spell == SPELL_DEMONIC_HORDE) ? 7 + random2(5) - : 1; + (spell == SPELL_SUMMON_BUTTERFLIES) ? std::max(15, 4 + random2(3) + random2(powc) / 10) : + (spell == SPELL_SUMMON_SCORPIONS) ? stepdown_value(1 + random2(powc) / 10 + random2(powc) / 10, 2, 2, 6, 8) : + (spell == SPELL_DEMONIC_HORDE) ? 7 + random2(5) + : 1; for (int i = 0; i < how_many; ++i) { @@ -1527,6 +1532,10 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) mon = MONS_BUTTERFLY; break; + case SPELL_SUMMON_SCORPIONS: + mon = MONS_SCORPION; + break; + case SPELL_CALL_IMP: mon = (one_chance_in(3)) ? MONS_WHITE_IMP : (one_chance_in(7)) ? MONS_SHADOW_IMP @@ -1602,8 +1611,8 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) break; } - summon_general_creature(powc, quiet, mon, BEH_FRIENDLY, unfriendly, - numsc, false); + summon_general_creature(powc, quiet, mon, BEH_FRIENDLY, + unfriendly, numsc, false); } break; } |