summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/direct.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-17 14:16:52 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-17 14:16:52 +0000
commita9a5ce7479fc6358f96aadad9654d35f2a573782 (patch)
treec1c30d02f940fc10fd80f729ce712fe0fee8fc07 /crawl-ref/source/direct.cc
parent3893b36195d2345f1a24a42fd5ed31cd72a8f501 (diff)
downloadcrawl-ref-a9a5ce7479fc6358f96aadad9654d35f2a573782.tar.gz
crawl-ref-a9a5ce7479fc6358f96aadad9654d35f2a573782.zip
x on the level-map changes travel exclusion radius. Radius steps are 1, 4 and
8. Travel cache version also changes. [1738213] describe_floor() now uses feature_description instead of rolling its own. This does produce redundant messages when stepping into shallow water, but I think we can live with that. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1591 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/direct.cc')
-rw-r--r--crawl-ref/source/direct.cc48
1 files changed, 39 insertions, 9 deletions
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index 16aa831cf4..62a445b2fa 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -1207,6 +1207,39 @@ std::vector<dungeon_feature_type> features_by_desc(const text_pattern &pattern)
return (features);
}
+void describe_floor()
+{
+ const int grid = grd(you.pos());
+
+ std::string prefix = "There is ";
+ std::string feat;
+ std::string suffix = " here.";
+ switch (grid)
+ {
+ case DNGN_FLOOR:
+ return;
+
+ case DNGN_ENTER_SHOP:
+ prefix = "There is an entrance to ";
+ break;
+
+ default:
+ break;
+ }
+
+ feat = feature_description(you.x_pos, you.y_pos);
+ if (feat.empty())
+ return;
+ if (grid != DNGN_ENTER_SHOP)
+ feat[0] = tolower(feat[0]);
+ if (ends_with(feat, "."))
+ feat = feat.substr(0, feat.length() - 1);
+
+ mpr((prefix + feat + suffix).c_str());
+ if (grid == DNGN_ENTER_LABYRINTH)
+ mpr("Beware, for starvation awaits!");
+}
+
std::string feature_description(int grid)
{
switch (grid)
@@ -1285,7 +1318,7 @@ std::string feature_description(int grid)
case DNGN_ENTER_TARTARUS:
return ("A gateway to the decaying netherworld of Tartarus.");
case DNGN_ENTER_ABYSS:
- return ("A gateway to the infinite Abyss.");
+ return ("A one-way gate to the infinite horrors of the Abyss.");
case DNGN_EXIT_ABYSS:
return ("A gateway leading out of the Abyss.");
case DNGN_STONE_ARCH:
@@ -1390,15 +1423,14 @@ std::string feature_description(int grid)
std::string feature_description(int mx, int my)
{
- int trf; // used for trap type??
-
const int grid = grd[mx][my];
- std::string desc = feature_description(grid);
switch (grid)
{
case DNGN_TRAP_MECHANICAL:
case DNGN_TRAP_MAGICAL:
case DNGN_TRAP_III:
+ {
+ int trf;
for (trf = 0; trf < MAX_TRAPS; trf++)
{
if (env.trap[trf].x == mx
@@ -1438,17 +1470,15 @@ std::string feature_description(int mx, int my)
case TRAP_NEEDLE:
return ("A needle trap.");
default:
- mpr("An undefined trap. Huh?");
error_message_to_player();
- break;
+ return ("An undefined trap.");
}
- break;
+ }
case DNGN_ENTER_SHOP:
return (shop_name(mx, my));
default:
- break;
+ return (feature_description(grid));
}
- return (desc);
}
static void describe_mons_enchantment(const monsters &mons,