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-04-21 19:19:01 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-21 19:19:01 +0000
commit0fdc8a1b6c767621ecd18567d62ab24f9a104510 (patch)
tree9af4f04217f1c291536ddcd87c26a05e1e9205d3 /crawl-ref/source/xom.cc
parent1be8dfb3f21190bd60d27a8fc37259d9ada9304b (diff)
downloadcrawl-ref-0fdc8a1b6c767621ecd18567d62ab24f9a104510.tar.gz
crawl-ref-0fdc8a1b6c767621ecd18567d62ab24f9a104510.zip
Xom doesn't even attempt to do the teleportation journey if the player
is wearing a randart that prevents teleportation. Spells don't face any such restriction seeing as the direct call of your_spells() bypasses the randart check. Also, a few more spacing cleanups. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9673 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r--crawl-ref/source/xom.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index bf0ff04478..47f5ef2293 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -1667,6 +1667,10 @@ static bool _xom_is_good(int sever, int tension)
}
else if (x_chance_in_y(11, sever) && you.level_type != LEVEL_ABYSS)
{
+ // Try something else if teleportation is impossible.
+ if (scan_randarts(RAP_PREVENT_TELEPORTATION))
+ return (false);
+
// This is not very interesting if the level is already fully
// explored (presumably cleared). Even then, it may occasionally
// happen.
@@ -2662,6 +2666,10 @@ static bool _xom_is_bad(int sever, int tension)
}
else if (x_chance_in_y(7, sever) && you.level_type != LEVEL_ABYSS)
{
+ // Try something else if teleportation is impossible.
+ if (scan_randarts(RAP_PREVENT_TELEPORTATION))
+ return (false);
+
// This is not particularly exciting if the level is already fully
// explored (presumably cleared). If Xom is feeling nasty this
// is likelier to happen if the level is unexplored.