diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-24 02:49:12 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-24 02:49:12 +0000 |
commit | 843b4276d600c3f88f9603b9d0deea9eb1152398 (patch) | |
tree | da82015e3f8e22e9d77601901fbae74f96e6e1e3 /crawl-ref/source/xom.cc | |
parent | 8758dd6926fb6cf08d1d3e2de9155605a01ec06a (diff) | |
download | crawl-ref-843b4276d600c3f88f9603b9d0deea9eb1152398.tar.gz crawl-ref-843b4276d600c3f88f9603b9d0deea9eb1152398.zip |
Clean up Xom's single summoning routines again.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6097 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r-- | crawl-ref/source/xom.cc | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 6ae2941d4a..7f8b6ed449 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -570,14 +570,9 @@ static bool _xom_is_good(int sever) const bool is_demonic = (mons_class_holiness(mon) == MH_DEMONIC); // If we have a non-demon, Xom got it someplace else, so use - // different messages. + // different messages below. bool different = !is_demonic; - if (different) - god_speaks(GOD_XOM, _get_xom_speech("single holy summon")); - else - god_speaks(GOD_XOM, _get_xom_speech("single summon")); - beh_type beha = BEH_FRIENDLY; unsigned short hitting = you.pet_target; @@ -588,14 +583,21 @@ static bool _xom_is_good(int sever) hitting = MHITYOU; } - if (create_monster( - mgen_data(mon, beha, 6, - you.pos(), hitting, 0, GOD_XOM)) == -1) + int summons = create_monster( + mgen_data(mon, beha, 6, + you.pos(), hitting, MG_FORCE_BEH, GOD_XOM)); + + if (summons != -1) { - god_speaks(GOD_XOM, "\"No, forget it.\""); - } + if (different) + god_speaks(GOD_XOM, _get_xom_speech("single holy summon")); + else + god_speaks(GOD_XOM, _get_xom_speech("single summon")); - done = true; + player_angers_monster(&menv[summons]); + + done = true; + } } else if (random2(sever) <= 7) { @@ -659,14 +661,9 @@ static bool _xom_is_good(int sever) const bool is_demonic = (mons_class_holiness(mon) == MH_DEMONIC); // If we have a non-demon, Xom got it someplace else, so use - // different messages. + // different messages below. bool different = !is_demonic; - if (different) - god_speaks(GOD_XOM, _get_xom_speech("single major holy summon")); - else - god_speaks(GOD_XOM, _get_xom_speech("single major demon summon")); - beh_type beha = BEH_FRIENDLY; unsigned short hitting = you.pet_target; @@ -677,15 +674,22 @@ static bool _xom_is_good(int sever) hitting = MHITYOU; } - if (create_monster( - mgen_data(_xom_random_demon(sever, one_chance_in(8)), - beha, 0, - you.pos(), hitting, 0, GOD_XOM)) == -1) + int summons = create_monster( + mgen_data(_xom_random_demon(sever, one_chance_in(8)), + beha, 0, + you.pos(), hitting, MG_FORCE_BEH, GOD_XOM)); + + if (summons != -1) { - god_speaks(GOD_XOM, "\"No, forget it.\""); - } + if (different) + god_speaks(GOD_XOM, _get_xom_speech("single major holy summon")); + else + god_speaks(GOD_XOM, _get_xom_speech("single major demon summon")); - done = true; + player_angers_monster(&menv[summons]); + + done = true; + } } else if (random2(sever) <= 11) { |