summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/xom.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-23 01:56:31 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-23 01:56:31 +0000
commit3f80cfb900d7fed4e4dca0c89af68cb15dfcda52 (patch)
treefe3fd9423ce991bb54f0b2908cb3960f521cd5f7 /crawl-ref/source/xom.cc
parent0b3a6d81250aab917ed00bbd6d0e6a116feb5753 (diff)
downloadcrawl-ref-3f80cfb900d7fed4e4dca0c89af68cb15dfcda52.tar.gz
crawl-ref-3f80cfb900d7fed4e4dca0c89af68cb15dfcda52.zip
Refix Xom's mixed summons.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6062 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r--crawl-ref/source/xom.cc50
1 files changed, 28 insertions, 22 deletions
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)
{