summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-08 22:05:53 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-08 22:05:53 +0000
commitd6f431bb5de6afdcbb2c80b9c238837e52fa2cb5 (patch)
tree723b77f90169e691db36b55f0669990c64c5f853 /crawl-ref/source/spells3.cc
parent1369c022c2e037a3b78eb7f10f2f3df524370df3 (diff)
downloadcrawl-ref-d6f431bb5de6afdcbb2c80b9c238837e52fa2cb5.tar.gz
crawl-ref-d6f431bb5de6afdcbb2c80b9c238837e52fa2cb5.zip
Move summon_demon_type() to spells3.cc as well.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5613 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index ead8d17a10..415f38f39c 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -532,6 +532,34 @@ bool cast_summon_greater_demon(int pow, bool god_gift)
return (success);
}
+// Makhleb or Kikubaaqudgha sends a demonic buddy (or enemy) for a
+// follower.
+bool summon_demon_type(monster_type mon, int pow, bool god_gift)
+{
+ bool success = false;
+
+ const int dur = std::min(2 + (random2(pow) / 4), 6);
+
+ const bool friendly = (random2(pow) > 3);
+
+ if (create_monster(
+ mgen_data(mon,
+ friendly ? BEH_FRIENDLY : BEH_HOSTILE,
+ dur, you.pos(),
+ friendly ? you.pet_target : MHITYOU,
+ god_gift ? MF_GOD_GIFT : 0)) != -1)
+ {
+ success = true;
+
+ mprf("A demon appears!%s",
+ friendly ? "" : " It doesn't look very happy.");
+ }
+ else
+ canned_msg(MSG_NOTHING_HAPPENS);
+
+ return (success);
+}
+
bool cast_summon_horrible_things(int pow, bool god_gift)
{
if (one_chance_in(3)