diff options
-rw-r--r-- | crawl-ref/source/religion.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/spells2.cc | 56 | ||||
-rw-r--r-- | crawl-ref/source/spells2.h | 20 | ||||
-rw-r--r-- | crawl-ref/source/spells3.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/spells3.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/stuff.cc | 2 |
7 files changed, 58 insertions, 39 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index be64bf1df9..5ef8ff212c 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -3132,8 +3132,8 @@ static bool _zin_retribution() } else { - bool success = summon_swarm(you.experience_level * 20, - true, true, true); + bool success = cast_summon_swarm(you.experience_level * 20, + true, true, true); simple_god_message(success ? " sends a plague down upon you!" : "'s plague fails to arrive.", diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 0e4d767e12..0d1a70149d 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1714,8 +1714,8 @@ bool cast_summon_scorpions(int pow, bool god_gift) return (success); } -bool summon_swarm(int pow, bool god_gift, bool force_hostile, - bool quiet) +bool cast_summon_swarm(int pow, bool god_gift, bool force_hostile, + bool quiet) { bool success = false; @@ -1788,7 +1788,7 @@ bool summon_swarm(int pow, bool god_gift, bool force_hostile, { success = true; - if (!god_gift && !quiet) + if (!quiet) { mprf("A swarming creature appears!%s", friendly ? "" : " It doesn't look very happy."); @@ -1796,7 +1796,35 @@ bool summon_swarm(int pow, bool god_gift, bool force_hostile, } } - if (!god_gift && !quiet && !success) + if (!quiet && !success) + canned_msg(MSG_NOTHING_HAPPENS); + + return (success); +} + +bool cast_call_imp(int pow, bool god_gift) +{ + bool success = false; + + monster_type mon = (one_chance_in(3)) ? MONS_WHITE_IMP : + (one_chance_in(7)) ? MONS_SHADOW_IMP + : MONS_IMP; + + const int dur = std::min(2 + (random2(pow) / 4), 6); + + if (create_monster( + mgen_data(mon, BEH_FRIENDLY, dur, you.pos(), + you.pet_target, + god_gift ? MF_GOD_GIFT : 0)) != -1) + { + success = true; + + mpr((mon == MONS_WHITE_IMP) ? "A beastly little devil appears in a puff of frigid air." : + (mon == MONS_SHADOW_IMP) ? "A shadowy apparition takes form in the air." + : "A beastly little devil appears in a puff of flame."); + } + + if (!success) canned_msg(MSG_NOTHING_HAPPENS); return (success); @@ -1969,26 +1997,6 @@ bool summon_general_creature(int pow, bool quiet, monster_type mon, switch (mon) { - case MONS_BUTTERFLY: - 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; - - case MONS_WHITE_IMP: - msg = "A beastly little devil appears in a puff of frigid air."; - break; - - case MONS_SHADOW_IMP: - msg = "A shadowy apparition takes form in the air."; - break; - case MONS_JACKAL: case MONS_HOUND: case MONS_WARG: diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h index d06a3b2e3b..153f8fa485 100644 --- a/crawl-ref/source/spells2.h +++ b/crawl-ref/source/spells2.h @@ -136,6 +136,19 @@ bool cast_summon_butterflies(int pow, bool god_gift = false); bool cast_summon_scorpions(int pow, bool god_gift = false); +// last updated 24may2000 {dlb} +/* *********************************************************************** + * called from: ability - religion - spell + * *********************************************************************** */ +bool cast_summon_swarm(int pow, bool god_gift = false, + bool force_hostile = false, bool quiet = false); + +// last updated 24may2000 {dlb} +/* *********************************************************************** + * called from: ability - spell + * *********************************************************************** */ +bool cast_call_imp(int pow, bool god_gift = false); + bool summon_general_creature_spell(spell_type spell, int pow, bool god_gift = false); @@ -159,13 +172,6 @@ void summon_small_mammals(int pow); bool summon_berserker(int pow, bool force_hostile = false); -// last updated 24may2000 {dlb} -/* *********************************************************************** - * called from: ability - religion - spell - * *********************************************************************** */ -bool summon_swarm(int pow, bool god_gift = false, bool force_hostile = false, - bool quiet = false); - // last updated 24may2000 {dlb} /* *********************************************************************** diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 210628e0e1..e9392ec444 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -472,7 +472,8 @@ void simulacrum(int power) } } -bool dancing_weapon(int pow, bool force_hostile, bool quiet) +bool dancing_weapon(int pow, bool force_hostile, + bool quiet_fail) { bool success = true; @@ -516,7 +517,7 @@ bool dancing_weapon(int pow, bool force_hostile, bool quiet) { destroy_item(i); - if (!quiet) + if (!quiet_fail) { if (wpn != -1) mpr("Your weapon vibrates crazily for a second."); diff --git a/crawl-ref/source/spells3.h b/crawl-ref/source/spells3.h index 5d55317366..74fdbcddd1 100644 --- a/crawl-ref/source/spells3.h +++ b/crawl-ref/source/spells3.h @@ -82,7 +82,8 @@ bool project_noise(void); /* *********************************************************************** * called from: religion - spell * *********************************************************************** */ -bool dancing_weapon(int pow, bool force_hostile = false, bool quiet = false); +bool dancing_weapon(int pow, bool force_hostile = false, + bool quiet_fail = false); // updated 24may2000 {dlb} diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index a561062fbc..11fda070a0 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -1484,11 +1484,14 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail) break; case SPELL_SUMMON_SWARM: - summon_swarm(powc); + cast_summon_swarm(powc); break; - // Remember that most holy spells don't yet use powc! case SPELL_CALL_IMP: + cast_call_imp(powc); + break; + + // Remember that most holy spells don't yet use powc! case SPELL_SUMMON_DEMON: case SPELL_DEMONIC_HORDE: case SPELL_CALL_CANINE_FAMILIAR: diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index 7b25581bd2..7d7689d49c 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -688,7 +688,7 @@ void redraw_screen(void) // STEPDOWN FUNCTION to replace conditional chains in spells2.cc 12jan2000 {dlb} // it is a bit more extensible and optimizes the logical structure, as well -// usage: summon_swarm() summon_undead() summon_scorpions() summon_things() +// usage: cast_summon_swarm() summon_undead() summon_scorpions() summon_things() // ex(1): stepdown_value (foo, 2, 2, 6, 8) replaces the following block: // |