From 76045c6d3d8d2fb15acf777d5998ef26aab764fa Mon Sep 17 00:00:00 2001 From: dolorous Date: Tue, 20 Nov 2007 03:35:47 +0000 Subject: Add various patches of mine: [1824221] don't give Yred-worshipping demonspawn the "raise dead" mutation [1829258] remove wrongly hardcoded exp-draining resistance for undead [1829691] typo fixes [1830030] clean up random god servant handling [1829890] fix divine retribution messages, generalize berserker summoning git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2877 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells2.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/spells2.cc') diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 5b1f6b5350..00bfd13163 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1480,12 +1480,13 @@ void summon_ice_beast_etc(int pow, int ibc, bool divine_gift) false, false, false, true); } // end summon_ice_beast_etc() -// Trog sends some fighting buddies for his followers -void summon_berserker() +// Trog sends some fighting buddies for his followers (or enemies if +// god_gift is false) +bool summon_berserker(int pow, bool god_gift) { - beh_type beha = BEH_GOD_GIFT; - int pow = you.piety + random2(you.piety/4) - random2(you.piety/4); + beh_type beha = (god_gift) ? BEH_GOD_GIFT : BEH_HOSTILE; int numsc = std::min(2 + (random2(pow) / 4), 6); + bool success = false; monster_type mon = MONS_TROLL; @@ -1540,6 +1541,8 @@ void summon_berserker() if (mons != -1) { + success = true; + monsters *summon = &menv[mons]; summon->go_berserk(false); mon_enchant berserk = summon->get_ench(ENCH_BERSERK); @@ -1553,6 +1556,8 @@ void summon_berserker() summon->update_ench(berserk); summon->update_ench(abj); } + + return success; } // end summon_berserker() bool summon_swarm( int pow, bool unfriendly, bool god_gift ) -- cgit v1.2.3-54-g00ecf