From 1b94af7d48228ba637b4b0648ff7adabe521c2c5 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 15 Jan 2009 09:21:50 +0000 Subject: * Clean up duration handling some more. * Fix Xom confusing unconfusable monsters (plants!) - Xom may be Xom but even he has to follow some rules. * Add a message for shortlasting durations when cast since they miss out on the "transformation about to time out" message. * Add Eino's description for Death's Door. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8459 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/xom.cc | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'crawl-ref/source/xom.cc') diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 1d10b81805..bec45e8d9e 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -771,16 +771,21 @@ static bool _xom_is_good(int sever, int tension) { monster = &menv[i]; - if (monster->type == -1 || !mons_near(monster) || mons_wont_attack(monster) || one_chance_in(20)) + if (monster->type == -1 || !mons_near(monster) + || mons_wont_attack(monster) + || !mons_class_is_confusable(monster->type) + || one_chance_in(20)) + { continue; + } if (monster->add_ench(mon_enchant(ENCH_CONFUSION, 0, KC_FRIENDLY, random2(sever)))) { if (!done) god_speaks(GOD_XOM, _get_xom_speech("confusion").c_str()); + + simple_monster_message(monster, " looks rather confused."); done = true; - if (player_monster_visible( monster )) - simple_monster_message(monster, " looks rather confused."); } } } @@ -970,16 +975,17 @@ static bool _xom_is_good(int sever, int tension) if (!done) god_speaks(GOD_XOM, _get_xom_speech("rearrange the pieces").c_str()); - done = true; - if (confusem) { - if (monster->add_ench(mon_enchant(ENCH_CONFUSION, 0, KC_FRIENDLY, random2(sever)))) + if (mons_class_is_confusable(monster->type) + && monster->add_ench(mon_enchant(ENCH_CONFUSION, 0, + KC_FRIENDLY, random2(sever)))) { - if (player_monster_visible(monster)) - simple_monster_message(monster, " looks rather confused."); + simple_monster_message(monster, + " looks rather confused."); } } + done = true; } // If he blinked at least one monster, blink the player, @@ -991,7 +997,7 @@ static bool _xom_is_good(int sever, int tension) else if (x_chance_in_y(11, sever) && (you.level_type != LEVEL_ABYSS)) { // The Xom teleportation train takes you on instant teleportation to - // a few random areas, stopping randomly but mostly likely in an area + // a few random areas, stopping randomly but most likely in an area // that is not dangerous to you. god_speaks(GOD_XOM, _get_xom_speech("teleportation journey").c_str()); do @@ -1722,12 +1728,18 @@ static bool _xom_is_bad(int sever, int tension) { monster = &menv[i]; - if (monster->type == -1 || !mons_near(monster) || one_chance_in(20)) + if (monster->type == -1 || !mons_near(monster) + || !mons_class_is_confusable(monster->type) + || one_chance_in(20)) + { continue; + } - if (monster->add_ench(mon_enchant(ENCH_CONFUSION, 0, KC_FRIENDLY, random2(sever)))) { - if (player_monster_visible(monster)) - simple_monster_message(monster, " looks rather confused."); + if (monster->add_ench(mon_enchant(ENCH_CONFUSION, 0, + KC_FRIENDLY, random2(sever)))) + { + simple_monster_message(monster, + " looks rather confused."); } } } -- cgit v1.2.3-54-g00ecf