From 450f6fd14fe0c09e89ad90eac2a9a6ee9521af69 Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 30 Oct 2008 19:08:31 +0000 Subject: 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 --- crawl-ref/source/spells2.cc | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'crawl-ref/source/spells2.cc') 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, -- cgit v1.2.3-54-g00ecf