summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-08 17:03:29 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-08 17:03:29 +0000
commita037f108ca04b0aa9246b90c6254c6d3e7eb1999 (patch)
treeba33eaed15f737aa53a330d313238eeabb85876f /crawl-ref/source/spells3.cc
parent1ae58f4e6c97657d8777457da0a78adaa19c6b17 (diff)
downloadcrawl-ref-a037f108ca04b0aa9246b90c6254c6d3e7eb1999.tar.gz
crawl-ref-a037f108ca04b0aa9246b90c6254c6d3e7eb1999.zip
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
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc64
1 files changed, 64 insertions, 0 deletions
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;