From 3f80cfb900d7fed4e4dca0c89af68cb15dfcda52 Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 23 Jun 2008 01:56:31 +0000 Subject: Refix Xom's mixed summons. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6062 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/xom.cc | 50 +++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 21ce200a73..e1a4012a7a 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -494,27 +494,41 @@ static bool xom_is_good(int sever) if (!is_demonic) numdifferent++; - // Mark factions hostile as appropriate. - beh_type beha = BEH_FRIENDLY; - unsigned short hitting = you.pet_target; - - if (hostiletype == 3 - || (is_demonic && hostiletype == 1) - || (!is_demonic && hostiletype == 2)) - { - beha = BEH_HOSTILE; - hitting = MHITYOU; - } - summons[i] = create_monster( - mgen_data(mon, beha, 3, - you.pos(), hitting, MG_FORCE_BEH, GOD_XOM)); + mgen_data(mon, BEH_FRIENDLY, 3, + you.pos(), you.pet_target, MG_FORCE_BEH, GOD_XOM)); if (summons[i] != -1) success = true; } + for (int i = 0; i < numdemons; ++i) + { + if (summons[i] != -1) + { + if (numdifferent != numdemons && numdifferent > 0 + && hostiletype != 0) + { + monsters *mon = &menv[i]; + const bool is_demonic = (mons_holiness(mon) == MH_DEMONIC); + + // Mark factions hostile as appropriate. + if (hostiletype == 3 + || (is_demonic && hostiletype == 1) + || (!is_demonic && hostiletype == 2)) + { + mon->attitude = ATT_HOSTILE; + behaviour_event(mon, ME_ALERT, MHITYOU); + } + } + + player_angers_monster(&menv[summons[i]]); + } + } + + delete[] summons; + if (success) { if (numdifferent == numdemons) @@ -524,16 +538,8 @@ static bool xom_is_good(int sever) else god_speaks(GOD_XOM, _get_xom_speech("multiple summons")); - for (int i = 0; i < numdemons; ++i) - { - if (summons[i] != -1) - player_angers_monster(&menv[summons[i]]); - } - done = true; } - - delete[] summons; } else if (random2(sever) <= 4) { -- cgit v1.2.3-54-g00ecf