From 4280a22a63e04ff5634bdf0e356185a617351289 Mon Sep 17 00:00:00 2001 From: dolorous Date: Sat, 7 Jun 2008 05:46:10 +0000 Subject: Consolidate "Call Canine Familiar" into summon_general_creature(). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5525 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells2.cc | 8 ++++++ crawl-ref/source/spells4.cc | 38 --------------------------- crawl-ref/source/spells4.h | 1 - crawl-ref/source/spl-cast.cc | 61 +++++++++++++++++++++++++++++++++----------- 4 files changed, 54 insertions(+), 54 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 8da2a64d40..59e99518f9 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1565,6 +1565,14 @@ bool summon_general_creature(int pow, bool quiet, monster_type mon, msg = "A shadowy apparition takes form in the air."; break; + case MONS_JACKAL: + case MONS_HOUND: + case MONS_WARG: + case MONS_WOLF: + case MONS_WAR_DOG: + msg = "A canine appears!"; + break; + case MONS_ICE_BEAST: msg = "A chill wind blows around you."; break; diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 6553e65e4b..3e8b87b4f0 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -414,44 +414,6 @@ void cast_detect_secret_doors(int pow) mprf("You detect %s", (found > 0) ? "secret doors!" : "nothing."); } // end cast_detect_secret_doors() -void cast_summon_large_mammal(int pow) -{ - monster_type mon; - const int temp_rand = random2(pow); - - if (temp_rand < 10) - mon = MONS_JACKAL; - else if (temp_rand < 15) - mon = MONS_HOUND; - else - { - switch (temp_rand % 7) - { - case 0: - if (one_chance_in(you.species == SP_HILL_ORC ? 3 : 6)) - mon = MONS_WARG; - else - mon = MONS_WOLF; - break; - case 1: - case 2: - mon = MONS_WAR_DOG; - break; - case 3: - case 4: - mon = MONS_HOUND; - break; - default: - mon = MONS_JACKAL; - break; - } - } - - create_monster( - mgen_data( mon, BEH_FRIENDLY, 3, - you.pos(), you.pet_target )); -} - void cast_sticks_to_snakes(int pow) { monster_type mon = MONS_PROGRAM_BUG; diff --git a/crawl-ref/source/spells4.h b/crawl-ref/source/spells4.h index a4bb6cfe45..a2e5ec61f5 100644 --- a/crawl-ref/source/spells4.h +++ b/crawl-ref/source/spells4.h @@ -50,7 +50,6 @@ void cast_silence(int pow); void cast_sticks_to_snakes(int pow); void cast_chain_lightning( int pow ); void cast_conjure_ball_lightning(int pow); -void cast_summon_large_mammal(int pow); void cast_tame_beasts(int pow); void cast_dispersal(int pow); void cast_snake_charm(int pow); diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 348177804c..f0c1d84d19 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -1492,29 +1492,32 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) case SPELL_CALL_IMP: case SPELL_SUMMON_DEMON: case SPELL_DEMONIC_HORDE: + case SPELL_CALL_CANINE_FAMILIAR: case SPELL_SUMMON_ICE_BEAST: case SPELL_SUMMON_UGLY_THING: 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 || spell == SPELL_DEMONIC_HORDE - || spell == SPELL_SUMMON_UGLY_THING) ? 3 : - (spell == SPELL_SUMMON_DRAGON) ? 5 - : -1; + int unfriendly = (spell == SPELL_SUMMON_DEMON + || spell == SPELL_DEMONIC_HORDE + || spell == SPELL_CALL_CANINE_FAMILIAR + || spell == SPELL_SUMMON_UGLY_THING) ? 3 : + (spell == SPELL_SUMMON_DRAGON) ? 5 + : -1; int numsc = - (spell == SPELL_SUMMON_BUTTERFLIES) ? 3 - : -1; + (spell == SPELL_SUMMON_BUTTERFLIES) ? 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_DEMONIC_HORDE) ? 7 + random2(5) + : 1; for (int i = 0; i < how_many; ++i) { @@ -1539,6 +1542,38 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) : DEMON_COMMON); break; + case SPELL_CALL_CANINE_FAMILIAR: + { + const int chance = random2(powc); + if (chance < 10) + mon = MONS_JACKAL; + else if (chance < 15) + mon = MONS_HOUND; + else + { + switch (chance % 7) + { + case 0: + if (one_chance_in(you.species == SP_HILL_ORC ? 3 : 6)) + mon = MONS_WARG; + else + mon = MONS_WOLF; + break; + case 1: + case 2: + mon = MONS_WAR_DOG; + break; + case 3: + case 4: + mon = MONS_HOUND; + break; + default: + mon = MONS_JACKAL; + break; + } + } + } + case SPELL_SUMMON_ICE_BEAST: mon = MONS_ICE_BEAST; break; @@ -1914,10 +1949,6 @@ spret_type your_spells( spell_type spell, int powc, bool allow_fail ) cast_sticks_to_snakes(powc); break; - case SPELL_CALL_CANINE_FAMILIAR: - cast_summon_large_mammal(powc); - break; - case SPELL_TAME_BEASTS: cast_tame_beasts(powc); break; -- cgit v1.2.3-54-g00ecf