summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-07 23:44:02 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-07 23:44:02 +0000
commitcdd74d0b4618ad1f8f02ee18036283c6c2214b3d (patch)
tree10aad41074679ccdf7d78a953171482e81bc53a8 /crawl-ref/source/directn.cc
parentf4d7abfdc292ea48cc3fcd1a8c98e0f22abd28f6 (diff)
downloadcrawl-ref-cdd74d0b4618ad1f8f02ee18036283c6c2214b3d.tar.gz
crawl-ref-cdd74d0b4618ad1f8f02ee18036283c6c2214b3d.zip
Actually replace sold out shops with the new feature DNGN_ABANDONED_SHOP.
This makes comparisons much easier and also avoids giving away information about far away shops being opened/closed. (This was only an issue if a shop only held blood potions that rotted away, but still.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7775 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc31
1 files changed, 14 insertions, 17 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index a2f96ef24a..d6d09117d8 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -1573,11 +1573,8 @@ std::string get_terse_square_desc(const coord_def &gc)
{
if (is_terrain_seen(gc))
{
- desc = feature_description(gc, false, DESC_PLAIN, false);
- if (!see_grid(gc))
- {
- desc = "[" + desc + "]";
- }
+ desc = "[" + feature_description(gc, false, DESC_PLAIN, false)
+ + "]";
is_feature = true;
}
else
@@ -2193,10 +2190,12 @@ static void _describe_feature(const coord_def& where, bool oos)
return;
dungeon_feature_type grid = grd(where);
- if ( grid == DNGN_SECRET_DOOR )
+ if (grid == DNGN_SECRET_DOOR)
grid = grid_secret_door_appearance(where);
- std::string desc = feature_description(grid);
+ std::string desc;
+ desc = feature_description(grid);
+
if (desc.length())
{
if (oos)
@@ -2429,6 +2428,8 @@ std::string raw_feature_description(dungeon_feature_type grid,
return ("natural trap");
case DNGN_ENTER_SHOP:
return ("shop");
+ case DNGN_ABANDONED_SHOP:
+ return ("abandoned shop");
case DNGN_ENTER_LABYRINTH:
return ("labyrinth entrance");
case DNGN_ENTER_DIS:
@@ -2575,10 +2576,10 @@ std::string feature_description(const coord_def& where, bool bloody,
description_level_type dtype, bool add_stop)
{
dungeon_feature_type grid = grd(where);
- if ( grid == DNGN_SECRET_DOOR )
+ if (grid == DNGN_SECRET_DOOR)
grid = grid_secret_door_appearance(where);
- if ( grid == DNGN_OPEN_DOOR || grid == DNGN_CLOSED_DOOR )
+ if (grid == DNGN_OPEN_DOOR || grid == DNGN_CLOSED_DOOR)
{
std::set<coord_def> all_door;
find_connected_identical(where, grd(where), all_door);
@@ -2602,16 +2603,12 @@ std::string feature_description(const coord_def& where, bool bloody,
case DNGN_TRAP_NATURAL:
return (feature_description(grid, get_trap_type(where), bloody,
dtype, add_stop));
+ case DNGN_ABANDONED_SHOP:
+ return thing_do_grammar(dtype, add_stop, false, "An abandoned shop");
+
case DNGN_ENTER_SHOP:
- {
- std::string desc = "";
- if (shop_is_closed(where))
- {
- desc = "An abandoned shop";
- return thing_do_grammar(dtype, add_stop, false, desc);
- }
return shop_name(where, add_stop);
- }
+
case DNGN_ENTER_PORTAL_VAULT:
return (thing_do_grammar(
dtype, add_stop, false,