From cdd74d0b4618ad1f8f02ee18036283c6c2214b3d Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 7 Dec 2008 23:44:02 +0000 Subject: 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 --- crawl-ref/source/directn.cc | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'crawl-ref/source/directn.cc') 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 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, -- cgit v1.2.3-54-g00ecf