diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-28 02:45:24 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-28 02:45:24 +0000 |
commit | 1093f24b6ad30905f85b22ea676abc5899ee243a (patch) | |
tree | 43f17860a8fccb962daa47348e89e8d5e6267bb1 /crawl-ref/source/xom.cc | |
parent | d0e22192444cc1a233c24d234cc71c77b35f4c38 (diff) | |
download | crawl-ref-1093f24b6ad30905f85b22ea676abc5899ee243a.tar.gz crawl-ref-1093f24b6ad30905f85b22ea676abc5899ee243a.zip |
Handle it properly when Xom tries to send mutiple summons and fails.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4721 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r-- | crawl-ref/source/xom.cc | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 9f056c8932..5c70544472 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -510,6 +510,8 @@ static bool xom_is_good(int sever) int *summons = new int[numdemons]; + bool success = false; + for (int i = 0; i < numdemons; i++) { monster_type mon = xom_random_demon(sever); @@ -523,9 +525,13 @@ static bool xom_is_good(int sever) summons[i] = create_monster(mon, 3, BEH_GOD_GIFT, you.x_pos, you.y_pos, you.pet_target, MONS_PROGRAM_BUG); + + if (summons[i] != -1) + success = true; } - if (numdifferent != numdemons && numdifferent > 0 && hostiletype != 0) + if (success && numdifferent != numdemons && numdifferent > 0 + && hostiletype != 0) { for (int i = 0; i < numdemons; ++i) { @@ -548,14 +554,17 @@ static bool xom_is_good(int sever) delete[] summons; - if (numdifferent == numdemons) - god_speaks(GOD_XOM, _get_xom_speech("multiple holy summons")); - else if (numdifferent > 0) - god_speaks(GOD_XOM, _get_xom_speech("multiple mixed summons")); - else - god_speaks(GOD_XOM, _get_xom_speech("multiple summons")); + if (success) + { + if (numdifferent == numdemons) + god_speaks(GOD_XOM, _get_xom_speech("multiple holy summons")); + else if (numdifferent > 0) + god_speaks(GOD_XOM, _get_xom_speech("multiple mixed summons")); + else + god_speaks(GOD_XOM, _get_xom_speech("multiple summons")); - done = true; + done = true; + } } else if (random2(sever) <= 4) { |