summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells2.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-30 19:08:31 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-30 19:08:31 +0000
commit450f6fd14fe0c09e89ad90eac2a9a6ee9521af69 (patch)
treee0fe406b53cd28215f3e5c1c5c00ff541bc32ad6 /crawl-ref/source/spells2.cc
parent5680f596aa91070a0a580947e7115f01bbf130fd (diff)
downloadcrawl-ref-450f6fd14fe0c09e89ad90eac2a9a6ee9521af69.tar.gz
crawl-ref-450f6fd14fe0c09e89ad90eac2a9a6ee9521af69.zip
Add various holy being-related cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7312 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r--crawl-ref/source/spells2.cc30
1 files changed, 19 insertions, 11 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 6f22a8fa27..5d32629448 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -1614,11 +1614,9 @@ bool summon_berserker(int pow, god_type god, bool force_hostile)
return (true);
}
-static bool _summon_holy_being_wrapper(int pow, god_type god,
- monster_type mon, bool quiet)
+static bool _summon_holy_being_wrapper(god_type god, monster_type mon, int dur,
+ bool friendly, bool quiet)
{
- const int dur = std::min(2 + (random2(pow) / 4), 6);
-
const int monster =
create_monster(
mgen_data(mon, BEH_FRIENDLY, dur,
@@ -1633,25 +1631,35 @@ static bool _summon_holy_being_wrapper(int pow, god_type god,
if (!quiet)
{
- mprf("You are momentarily dazzled by a brilliant %s light.",
- (mon == MONS_DAEVA) ? "golden"
- : "white");
+ mprf("You are momentarily dazzled by a brilliant %slight.",
+ (mon == MONS_DAEVA) ? "golden " :
+ (mon == MONS_ANGEL) ? "white "
+ : "");
}
+
player_angers_monster(&menv[monster]);
return (true);
}
// TSO sends an angel for a follower.
-bool summon_angel(int pow, god_type god, bool quiet)
+bool summon_angel(int pow, god_type god, bool quiet,
+ bool force_hostile, bool permanent)
{
- return _summon_holy_being_wrapper(pow, god, MONS_ANGEL, quiet);
+ int dur = !permanent ? std::min(2 + (random2(pow) / 4), 6) : 0;
+
+ return _summon_holy_being_wrapper(god, MONS_ANGEL, dur, !force_hostile,
+ quiet);
}
// TSO sends a daeva for a follower.
-bool summon_daeva(int pow, god_type god, bool quiet)
+bool summon_daeva(int pow, god_type god, bool quiet,
+ bool force_hostile, bool permanent)
{
- return _summon_holy_being_wrapper(pow, god, MONS_DAEVA, quiet);
+ int dur = !permanent ? std::min(2 + (random2(pow) / 4), 6) : 0;
+
+ return _summon_holy_being_wrapper(god, MONS_DAEVA, dur, !force_hostile,
+ quiet);
}
bool cast_tukimas_dance(int pow, god_type god,