summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/direct.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-26 03:33:48 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-26 03:33:48 +0000
commitfb8a93f2f70b9c3325bd2377ac5ccaf5f0f18ef5 (patch)
tree16490035b35cca20e3ad6b8bc9088291053d4d7b /crawl-ref/source/direct.cc
parent965e4db66a7feb43e2232e2633e57ab74a6a9c7a (diff)
downloadcrawl-ref-fb8a93f2f70b9c3325bd2377ac5ccaf5f0f18ef5.tar.gz
crawl-ref-fb8a93f2f70b9c3325bd2377ac5ccaf5f0f18ef5.zip
Suppress unnecessary "Floor." lines when looking around and targeting.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2581 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/direct.cc')
-rw-r--r--crawl-ref/source/direct.cc38
1 files changed, 29 insertions, 9 deletions
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index a05d27bdf4..fdf92d5029 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -1959,6 +1959,9 @@ std::string get_monster_desc(const monsters *mon, bool full_desc,
static void describe_cell(int mx, int my)
{
bool mimic_item = false;
+ bool monster_described = false;
+ bool cloud_described = false;
+ bool item_described = false;
if (mx == you.x_pos && my == you.y_pos)
mpr("You.", MSGCH_EXAMINE_FILTER);
@@ -1987,15 +1990,20 @@ static void describe_cell(int mx, int my)
describe_monster(&menv[i]);
if (mons_is_mimic( menv[i].type ))
+ {
mimic_item = true;
+ item_described = true;
+ }
+ else
+ monster_described = true;
#if DEBUG_DIAGNOSTICS
stethoscope(i);
#endif
if (Options.tutorial_left && tutorial_monster_interesting(&menv[i]))
{
- std::string msg = "(Press <w>v<lightgray> for more information.)";
- print_formatted_paragraph(msg, get_number_of_cols());
+ std::string msg = "(Press <w>v<lightgray> for more information.)";
+ print_formatted_paragraph(msg, get_number_of_cols());
}
}
@@ -2008,7 +2016,10 @@ static void describe_cell(int mx, int my)
const int cloud_inspected = env.cgrid[mx][my];
const cloud_type ctype = (cloud_type) env.cloud[cloud_inspected].type;
- mprf(MSGCH_EXAMINE, "There is a cloud of %s here.", cloud_name(ctype).c_str());
+ mprf(MSGCH_EXAMINE, "There is a cloud of %s here.",
+ cloud_name(ctype).c_str());
+
+ cloud_described = true;
}
int targ_item = igrd[ mx ][ my ];
@@ -2030,6 +2041,7 @@ static void describe_cell(int mx, int my)
mprf( MSGCH_FLOOR_ITEMS,
"There is something else lying underneath.");
}
+ item_described = true;
}
std::string feature_desc = feature_description(mx, my);
@@ -2060,14 +2072,22 @@ static void describe_cell(int mx, int my)
}
else
{
- if (interesting_feature(grd[mx][my]))
+ const dungeon_feature_type feat = grd[mx][my];
+
+ if (interesting_feature(feat))
feature_desc += " (Press 'v' for more information.)";
-
+
+ // Suppress "Floor." if there's something on that square that we've
+ // already described.
+ if ((feat == DNGN_FLOOR || feat == DNGN_FLOOR_SPECIAL)
+ && (monster_described || item_described || cloud_described))
+ return;
+
msg_channel_type channel = MSGCH_EXAMINE;
- if (grd[mx][my] == DNGN_FLOOR
- || grd[mx][my] == DNGN_FLOOR_SPECIAL
- || grd[mx][my] == DNGN_SHALLOW_WATER
- || grd[mx][my] == DNGN_DEEP_WATER)
+ if (feat == DNGN_FLOOR
+ || feat == DNGN_FLOOR_SPECIAL
+ || feat == DNGN_SHALLOW_WATER
+ || feat == DNGN_DEEP_WATER)
{
channel = MSGCH_EXAMINE_FILTER;
}