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-20 18:01:09 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-20 18:01:09 +0000
commitd9dd888a10a3087d3ec5cf82364cfd6495abd3e4 (patch)
tree6acddf0f589891b2925f7653208ba2e29d1478d6 /crawl-ref/source/xom.cc
parentbb3b8b8286b84de95546d1121d0c305bbdc85851 (diff)
downloadcrawl-ref-d9dd888a10a3087d3ec5cf82364cfd6495abd3e4.tar.gz
crawl-ref-d9dd888a10a3087d3ec5cf82364cfd6495abd3e4.zip
* Fix database search crashing on pandemonium demons/player ghost.
* Make Xom say e.g. "gate" for the repel stair effect if there's only a gate nearby. * Weapons of vampiricism have no effect on summoned creatures, as is already the case for Vampire bites and the Vampiric Draining spell. * Make berserking monsters immune to fear. (The sanctuary still works.) * General clean-up. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9669 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r--crawl-ref/source/xom.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 72e8ae3f51..bf0ff04478 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -2463,6 +2463,7 @@ static bool _repel_stairs()
}
std::vector<coord_def> stairs_avail;
+ bool real_stairs = false;
for (radius_iterator ri(you.pos(), LOS_RADIUS, false, true); ri; ++ri)
{
dungeon_feature_type feat = grd(*ri);
@@ -2470,6 +2471,8 @@ static bool _repel_stairs()
&& feat != DNGN_ENTER_SHOP)
{
stairs_avail.push_back(*ri);
+ if (grid_is_staircase(feat))
+ real_stairs = true;
}
}
@@ -2477,8 +2480,17 @@ static bool _repel_stairs()
if (stairs_avail.empty())
return (false);
- god_speaks(GOD_XOM,
- _get_xom_speech("repel stairs").c_str());
+ // Don't mention staircases if there aren't any nearby.
+ std::string stair_msg = _get_xom_speech("repel stairs");
+ if (!real_stairs && stair_msg.find("@staircase@") != std::string::npos)
+ {
+ std::string feat_name = "gate";
+ if (grid_is_escape_hatch(grd(stairs_avail[0])))
+ feat_name = "escape hatch";
+ stair_msg = replace_all(stair_msg, "@staircase@", feat_name);
+ }
+
+ god_speaks(GOD_XOM, stair_msg.c_str());
you.duration[DUR_REPEL_STAIRS_MOVE] = 1000;