summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/xom.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-15 09:21:50 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-15 09:21:50 +0000
commit1b94af7d48228ba637b4b0648ff7adabe521c2c5 (patch)
treef4ba25db86e7d2521f5367beaa1059adeae01ce7 /crawl-ref/source/xom.cc
parent6e5f05d27bd0f6cc12028f970d79f9fc3d2b6ff9 (diff)
downloadcrawl-ref-1b94af7d48228ba637b4b0648ff7adabe521c2c5.tar.gz
crawl-ref-1b94af7d48228ba637b4b0648ff7adabe521c2c5.zip
* 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
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r--crawl-ref/source/xom.cc38
1 files changed, 25 insertions, 13 deletions
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.");
}
}
}