From a037f108ca04b0aa9246b90c6254c6d3e7eb1999 Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 8 Jun 2008 17:03:29 +0000 Subject: Reorganize spells a bit. "Summon Horrible Things" is now in spells3.cc, with the other unholy spells. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5600 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells2.cc | 64 --------------------------------------------- crawl-ref/source/spells2.h | 17 ------------ crawl-ref/source/spells3.cc | 64 +++++++++++++++++++++++++++++++++++++++++++++ crawl-ref/source/spells3.h | 13 +-------- 4 files changed, 65 insertions(+), 93 deletions(-) diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 059b613961..0b1326f41a 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -2202,70 +2202,6 @@ bool cast_summon_wraiths(int pow, bool god_gift) return (success); } -bool summon_horrible_things(int pow, bool god_gift) -{ - if (one_chance_in(3) - && !lose_stat(STAT_INTELLIGENCE, 1, true, "summoning horrible things")) - { - mpr("Your call goes unanswered."); - return (false); - } - - int how_many_small = - stepdown_value(2 + (random2(pow) / 10) + (random2(pow) / 10), - 2, 2, 6, -1); - int how_many_big = 0; - - // No more than 2 tentacled monstrosities. - while (how_many_small > 2 && how_many_big < 2 && one_chance_in(3)) - { - how_many_small -= 2; - how_many_big++; - } - - // No more than 8 summons. - how_many_small = std::min(8, how_many_small); - how_many_big = std::min(8, how_many_big); - - int count = 0; - - while (how_many_big > 0) - { - if (create_monster( - mgen_data(MONS_TENTACLED_MONSTROSITY, BEH_FRIENDLY, 6, - you.pos(), you.pet_target, - god_gift ? MF_GOD_GIFT : 0)) != -1) - { - count++; - } - - how_many_big--; - } - - while (how_many_small > 0) - { - if (create_monster( - mgen_data(MONS_ABOMINATION_LARGE, BEH_FRIENDLY, 6, - you.pos(), you.pet_target, - god_gift ? MF_GOD_GIFT : 0)) != -1) - { - count++; - } - - how_many_small--; - } - - if (count > 0) - { - mprf("Some Thing%s answered your call!", - (count > 1) ? "s" : ""); - return (true); - } - - mpr("Your call goes unanswered."); - return (false); -} - bool cast_summon_dragon(int pow, bool god_gift) { // Removed the chance of multiple dragons... one should be more diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h index 7e2af16f3b..f7204a2b65 100644 --- a/crawl-ref/source/spells2.h +++ b/crawl-ref/source/spells2.h @@ -153,31 +153,17 @@ bool cast_summon_swarm(int pow, bool god_gift = false, * called from: ability - spell * *********************************************************************** */ bool cast_call_imp(int pow, bool god_gift = false); - bool cast_call_canine_familiar(int pow, bool god_gift = false); - bool summon_lesser_demon(int pow, bool god_gift = false); - bool summon_common_demon(int pow, bool god_gift = false); - bool summon_greater_demon(int pow, bool god_gift = false); - bool cast_summon_demon(int pow, bool god_gift = false); - bool cast_demonic_horde(int pow, bool god_gift = false); - bool cast_summon_ice_beast(int pow, bool god_gift = false); - bool cast_summon_ugly_thing(int pow, bool god_gift = false); - bool cast_summon_greater_demon(int pow, bool god_gift = false); - bool cast_summon_wraiths(int pow, bool god_gift = false); - -bool summon_horrible_things(int pow, bool god_gift = false); - bool cast_summon_dragon(int pow, bool god_gift = false); - bool cast_conjure_ball_lightning(int pow, bool god_gift = false); // last updated 24may2000 {dlb} @@ -192,12 +178,9 @@ bool dancing_weapon(int pow, bool god_gift = false, bool force_hostile = false, * called from: ability - spell * *********************************************************************** */ bool summon_demon_type(monster_type mon, int pow, bool god_gift = false); - bool summon_berserker(int pow, bool god_gift = false, bool force_hostile = false); - bool summon_guardian(int pow, bool god_gift = false); - bool summon_daeva(int pow, bool god_gift = false); // last updated 24may2000 {dlb} diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 231bb6ad8a..da68826e52 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -478,6 +478,70 @@ bool simulacrum(int pow, bool god_gift) return (false); } +bool summon_horrible_things(int pow, bool god_gift) +{ + if (one_chance_in(3) + && !lose_stat(STAT_INTELLIGENCE, 1, true, "summoning horrible things")) + { + mpr("Your call goes unanswered."); + return (false); + } + + int how_many_small = + stepdown_value(2 + (random2(pow) / 10) + (random2(pow) / 10), + 2, 2, 6, -1); + int how_many_big = 0; + + // No more than 2 tentacled monstrosities. + while (how_many_small > 2 && how_many_big < 2 && one_chance_in(3)) + { + how_many_small -= 2; + how_many_big++; + } + + // No more than 8 summons. + how_many_small = std::min(8, how_many_small); + how_many_big = std::min(8, how_many_big); + + int count = 0; + + while (how_many_big > 0) + { + if (create_monster( + mgen_data(MONS_TENTACLED_MONSTROSITY, BEH_FRIENDLY, 6, + you.pos(), you.pet_target, + god_gift ? MF_GOD_GIFT : 0)) != -1) + { + count++; + } + + how_many_big--; + } + + while (how_many_small > 0) + { + if (create_monster( + mgen_data(MONS_ABOMINATION_LARGE, BEH_FRIENDLY, 6, + you.pos(), you.pet_target, + god_gift ? MF_GOD_GIFT : 0)) != -1) + { + count++; + } + + how_many_small--; + } + + if (count > 0) + { + mprf("Some Thing%s answered your call!", + (count > 1) ? "s" : ""); + return (true); + } + + mpr("Your call goes unanswered."); + return (false); +} + bool cast_death_channel(int pow) { bool success = false; diff --git a/crawl-ref/source/spells3.h b/crawl-ref/source/spells3.h index a887a91a1b..159d6aea76 100644 --- a/crawl-ref/source/spells3.h +++ b/crawl-ref/source/spells3.h @@ -111,19 +111,8 @@ bool remove_curse(bool suppress_msg); * called from: spell * *********************************************************************** */ bool cast_sublimation_of_blood(int pow); - - -// updated Oct 2 -- bwr -/* *********************************************************************** - * called from: spell - * *********************************************************************** */ bool simulacrum(int pow, bool god_gift = false); - - -// updated 24may2000 {dlb} -/* *********************************************************************** - * called from: spell - spells1 - * *********************************************************************** */ +bool summon_horrible_things(int pow, bool god_gift = false); bool cast_death_channel(int pow); -- cgit v1.2.3-54-g00ecf