diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-09 16:02:32 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-09 16:02:32 +0000 |
commit | cf3c0bb3c21f28a112f691bdbf9189bb579dc4c4 (patch) | |
tree | 8a0f01497bb33790029b30fe711cd06c4ce74c70 /crawl-ref/source/spells2.cc | |
parent | 214d0f6490fb4409dfd51ca4a62f78fcba59bff6 (diff) | |
download | crawl-ref-cf3c0bb3c21f28a112f691bdbf9189bb579dc4c4.tar.gz crawl-ref-cf3c0bb3c21f28a112f691bdbf9189bb579dc4c4.zip |
Add still more summoning-related cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5655 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r-- | crawl-ref/source/spells2.cc | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 4a04ba9aa5..8a37908ef8 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1849,22 +1849,18 @@ bool summon_berserker(int pow, bool god_gift, bool force_hostile) } static bool _summon_holy_being_wrapper(int pow, bool god_gift, - holy_being_class_type hbct) + monster_type mon) { bool success = false; - monster_type mon = summon_any_holy_being(hbct); - const int dur = std::min(2 + (random2(pow) / 4), 6); - mprf("You open a gate to %s's realm!", - (mon == MONS_DAEVA) ? god_name(GOD_SHINING_ONE).c_str() - : god_name(GOD_ZIN).c_str()); + const int monster = + create_monster( + mgen_data(mon, BEH_FRIENDLY, dur, you.pos(), + you.pet_target, + (god_gift ? MG_GOD_GIFT : 0) | MG_FORCE_BEH)); - int monster = create_monster( - mgen_data(mon, BEH_FRIENDLY, dur, you.pos(), - you.pet_target, - god_gift ? MG_GOD_GIFT : 0)); if (monster != -1) { success = true; @@ -1875,19 +1871,29 @@ static bool _summon_holy_being_wrapper(int pow, bool god_gift, mprf("You are momentarily dazzled by a brilliant %s light.", (mon == MONS_DAEVA) ? "golden" : "white"); + + player_angers_monster(&menv[monster]); } return (success); } +static bool _summon_holy_being_wrapper(int pow, bool god_gift, + holy_being_class_type hbct) +{ + monster_type mon = summon_any_holy_being(hbct); + + return _summon_holy_being_wrapper(pow, god_gift, mon); +} + // Zin sends an angel for a follower. bool summon_guardian(int pow, bool god_gift) { - return _summon_holy_being_wrapper(pow, god_gift, HOLY_BEING_ANGEL); + return _summon_holy_being_wrapper(pow, god_gift, MONS_ANGEL); } // TSO sends a daeva for a follower. bool summon_daeva(int pow, bool god_gift) { - return _summon_holy_being_wrapper(pow, god_gift, HOLY_BEING_DAEVA); + return _summon_holy_being_wrapper(pow, god_gift, MONS_DAEVA); } |