summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/acr.cc11
-rw-r--r--crawl-ref/source/beam.cc4
-rw-r--r--crawl-ref/source/dat/descript/features.txt5
-rw-r--r--crawl-ref/source/debug.cc3
-rw-r--r--crawl-ref/source/delay.cc2
-rw-r--r--crawl-ref/source/directn.cc6
-rw-r--r--crawl-ref/source/dungeon.cc11
-rw-r--r--crawl-ref/source/enum.h15
-rw-r--r--crawl-ref/source/files.cc2
-rw-r--r--crawl-ref/source/luadgn.cc9
-rw-r--r--crawl-ref/source/maps.cc4
-rw-r--r--crawl-ref/source/menu.cc4
-rw-r--r--crawl-ref/source/misc.cc5
-rw-r--r--crawl-ref/source/monplace.cc4
-rw-r--r--crawl-ref/source/monstuff.cc12
-rw-r--r--crawl-ref/source/player.cc1
-rw-r--r--crawl-ref/source/player.h1
-rw-r--r--crawl-ref/source/spells4.cc2
-rw-r--r--crawl-ref/source/terrain.cc10
-rw-r--r--crawl-ref/source/terrain.h2
-rw-r--r--crawl-ref/source/tilepick.cc3
-rw-r--r--crawl-ref/source/tilereg.cc14
-rw-r--r--crawl-ref/source/travel.cc6
-rw-r--r--crawl-ref/source/tutorial.cc3
-rw-r--r--crawl-ref/source/view.cc5
-rw-r--r--crawl-ref/source/xom.cc4
26 files changed, 87 insertions, 61 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index a2253fb330..5eab34eb2d 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -2951,7 +2951,8 @@ static void _open_door(coord_def move, bool check_confused)
// If there's only one door to open, don't ask.
if ((!check_confused || !you.confused()) && move.origin())
{
- if (_check_adjacent(DNGN_CLOSED_DOOR, move) == 0)
+ if (_check_adjacent(DNGN_CLOSED_DOOR, move) == 0
+ && _check_adjacent(DNGN_DETECTED_SECRET_DOOR, move) == 0)
{
mpr("There's nothing to open.");
return;
@@ -3024,7 +3025,7 @@ static void _open_door(coord_def move, bool check_confused)
const dungeon_feature_type feat =
in_bounds(doorpos) ? grd(doorpos) : DNGN_UNSEEN;
- if (feat != DNGN_CLOSED_DOOR)
+ if (!grid_is_closed_door(feat))
{
switch (feat)
{
@@ -3039,7 +3040,7 @@ static void _open_door(coord_def move, bool check_confused)
}
}
- if (grd(doorpos) == DNGN_CLOSED_DOOR)
+ if (grid_is_closed_door(grd(doorpos)))
{
std::set<coord_def> all_door;
find_connected_range(doorpos, DNGN_CLOSED_DOOR,
@@ -3256,6 +3257,7 @@ static void _close_door(coord_def move)
i != all_door.end(); ++i)
{
const coord_def& dc = *i;
+ // Once opened, formerly secret doors become normal doors.
grd(dc) = DNGN_CLOSED_DOOR;
// Even if some of the door is out of LOS once it's closed (or even
// if some of it is out of LOS when it's open), we want the entire
@@ -3283,6 +3285,7 @@ static void _close_door(coord_def move)
switch (feat)
{
case DNGN_CLOSED_DOOR:
+ case DNGN_DETECTED_SECRET_DOOR:
mpr("It's already closed!"); break;
default:
mpr("There isn't anything that you can close there!"); break;
@@ -3690,7 +3693,7 @@ static void _move_player(coord_def move)
}
// BCR - Easy doors single move
- if (targ_grid == DNGN_CLOSED_DOOR && Options.easy_open && !attacking)
+ if (Options.easy_open && !attacking && grid_is_closed_door(targ_grid))
{
_open_door(move.x, move.y, false);
you.prev_move = move;
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 744a90480f..502b4f18f5 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -4734,7 +4734,7 @@ mon_resist_type bolt::try_enchant_monster(monsters *mon)
{
if (mons_immune_magic(mon))
return (MON_UNAFFECTED);
-
+
if (flavour != BEAM_POLYMORPH || !mons_is_shapeshifter(mon))
if (check_mons_resist_magic(mon, ench_power))
return (MON_RESIST);
@@ -5426,7 +5426,7 @@ void bolt::determine_affected_cells(explosion_map& m, const coord_def& delta,
// Check to see if we're blocked by a wall.
if (grid_is_wall(dngn_feat)
|| dngn_feat == DNGN_SECRET_DOOR
- || dngn_feat == DNGN_CLOSED_DOOR)
+ || grid_is_closed_door(dngn_feat))
{
// Special case: explosion originates from rock/statue
// (e.g. Lee's Rapid Deconstruction) - in this case, ignore
diff --git a/crawl-ref/source/dat/descript/features.txt b/crawl-ref/source/dat/descript/features.txt
index 8521e991cb..76ff27e430 100644
--- a/crawl-ref/source/dat/descript/features.txt
+++ b/crawl-ref/source/dat/descript/features.txt
@@ -5,6 +5,11 @@ A bloodstained altar of Trog
%%%%
A burning altar of Makhleb
%%%%
+A closed detected secret door
+
+A wooden door, cunningly hidden. It used to be a secret door but at least for you it's not a secret anymore.
+To open it, try simply walking into it, or press 'O'.
+%%%%
A closed door
A wooden door. To open it, try simply walking into it, or press 'O'.
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index b3dba47d50..f563134ecf 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -5197,7 +5197,7 @@ static void _debug_destroy_doors()
for (int x = 0; x < GXM; ++x)
{
const dungeon_feature_type feat = grd[x][y];
- if (feat == DNGN_CLOSED_DOOR || feat == DNGN_SECRET_DOOR)
+ if (feat == DNGN_SECRET_DOOR || grid_is_closed_door(feat))
grd[x][y] = DNGN_FLOOR;
}
}
@@ -6959,6 +6959,7 @@ static bool mg_do_build_level(int niters)
switch (grd[x][y])
{
case DNGN_SECRET_DOOR:
+ case DNGN_DETECTED_SECRET_DOOR: // paranoia
grd[x][y] = DNGN_CLOSED_DOOR;
break;
default:
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index f83feb33f3..55b6114ac2 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -1181,6 +1181,8 @@ static void _finish_delay(const delay_queue_item &delay)
case DNGN_SECRET_DOOR: // oughtn't happen
case DNGN_CLOSED_DOOR: // open the door
+ case DNGN_DETECTED_SECRET_DOOR:
+ // Once opened, former secret doors become normal doors.
grd(pass) = DNGN_OPEN_DOOR;
break;
}
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index bf16ea1fbd..86ef9b0ee1 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -2598,6 +2598,8 @@ static std::string _base_feature_desc(dungeon_feature_type grid,
return ("unnaturally hard rock wall");
case DNGN_CLOSED_DOOR:
return ("closed door");
+ case DNGN_DETECTED_SECRET_DOOR:
+ return ("detected secret door");
case DNGN_METAL_WALL:
return ("metal wall");
case DNGN_GREEN_CRYSTAL_WALL:
@@ -2881,7 +2883,7 @@ std::string feature_description(const coord_def& where, bool bloody,
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_is_closed_door(grid))
{
std::set<coord_def> all_door;
find_connected_identical(where, grd(where), all_door);
@@ -2890,6 +2892,8 @@ std::string feature_description(const coord_def& where, bool bloody,
std::string desc = adj;
desc += (grid == DNGN_OPEN_DOOR) ? "open " : "closed ";
+ if (grid == DNGN_DETECTED_SECRET_DOOR)
+ desc += "detected secret ";
desc += noun;
if (bloody)
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 1c4a49e9a4..5403924f7d 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -1719,7 +1719,7 @@ static void _check_doors()
for (int x = 1; x < GXM-1; x++)
for (int y = 1; y < GYM-1; y++)
{
- if (grd[x][y] != DNGN_CLOSED_DOOR)
+ if (!grid_is_closed_door(grd[x][y]))
continue;
int solid_count = 0;
@@ -1736,7 +1736,8 @@ static void _check_doors()
if (grid_is_solid( grd[x][y + 1] ))
solid_count++;
- grd[x][y] = ((solid_count < 2) ? DNGN_FLOOR : DNGN_CLOSED_DOOR);
+ grd[x][y] = (solid_count < 2 ? DNGN_FLOOR
+ : DNGN_CLOSED_DOOR);
}
}
@@ -3136,8 +3137,8 @@ static void _make_trail(int xs, int xr, int ys, int yr, int corrlength,
static int _good_door_spot(int x, int y)
{
- if ((!grid_is_solid(grd[x][y]) && grd[x][y] < DNGN_ENTER_PANDEMONIUM)
- || grd[x][y] == DNGN_CLOSED_DOOR)
+ if (!grid_is_solid(grd[x][y]) && grd[x][y] < DNGN_ENTER_PANDEMONIUM
+ || grid_is_closed_door(grd[x][y]))
{
return 1;
}
@@ -3931,7 +3932,7 @@ static void _dig_vault_loose( vault_placement &place,
static bool _grid_needs_exit(int x, int y)
{
return (!grid_is_solid(x, y)
- || grd[x][y] == DNGN_CLOSED_DOOR
+ || grid_is_closed_door(grd[x][y])
|| grd[x][y] == DNGN_SECRET_DOOR);
}
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 46bbccfca1..63eb56de81 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -946,16 +946,17 @@ enum dungeon_feature_type
{
DNGN_UNSEEN, // 0
DNGN_CLOSED_DOOR,
+ DNGN_DETECTED_SECRET_DOOR,
DNGN_SECRET_DOOR,
DNGN_WAX_WALL,
- DNGN_METAL_WALL,
- DNGN_GREEN_CRYSTAL_WALL, // 5
+ DNGN_METAL_WALL, // 5
+ DNGN_GREEN_CRYSTAL_WALL,
DNGN_ROCK_WALL,
DNGN_STONE_WALL,
- DNGN_PERMAROCK_WALL, // 8 - for undiggable walls
- DNGN_CLEAR_ROCK_WALL, // 9 - Transparent
- DNGN_CLEAR_STONE_WALL, // 10 - Transparent
- DNGN_CLEAR_PERMAROCK_WALL, // 11 - Transparent
+ DNGN_PERMAROCK_WALL, // 9 - for undiggable walls
+ DNGN_CLEAR_ROCK_WALL, // 10 - transparent walls
+ DNGN_CLEAR_STONE_WALL,
+ DNGN_CLEAR_PERMAROCK_WALL,
// Lowest/highest grid value which is a wall.
DNGN_MINWALL = DNGN_WAX_WALL,
@@ -975,7 +976,7 @@ enum dungeon_feature_type
DNGN_MAX_NONREACH = DNGN_CLEAR_PERMAROCK_WALL,
// Can be seen through and reached past.
- DNGN_ORCISH_IDOL = 12,
+ DNGN_ORCISH_IDOL = 15,
DNGN_GRANITE_STATUE = 21, // 21
DNGN_STATUE_RESERVED,
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 47adcea3bb..2ee53f8df8 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -633,8 +633,6 @@ static void _fill_player_doll(player_save_info &p, const std::string &dollfile)
{
if (strcmp(fbuf, "net") == 0)
p.held_in_net = true;
-// else if (strncmp(fbuf, "floor=", 6) == 0)
-// sscanf(fbuf, "floor=%d", &p.floor_tile);
}
}
fclose(fdoll);
diff --git a/crawl-ref/source/luadgn.cc b/crawl-ref/source/luadgn.cc
index 465e9e894a..012b58788c 100644
--- a/crawl-ref/source/luadgn.cc
+++ b/crawl-ref/source/luadgn.cc
@@ -1354,10 +1354,11 @@ static int dgn_colour_at(lua_State *ls)
const char *dngn_feature_names[] =
{
- "unseen", "closed_door", "secret_door", "wax_wall", "metal_wall",
- "green_crystal_wall", "rock_wall", "stone_wall", "permarock_wall",
- "clear_rock_wall", "clear_stone_wall", "clear_permarock_wall",
- "orcish_idol", "", "", "", "", "", "", "", "",
+ "unseen", "closed_door", "detected_secret_door", "secret_door",
+ "wax_wall", "metal_wall", "green_crystal_wall", "rock_wall", "stone_wall",
+ "permarock_wall",
+ "clear_rock_wall", "clear_stone_wall", "clear_permarock_wall", "", "",
+ "orcish_idol", "", "", "", "", "",
"granite_statue", "statue_reserved_1", "statue_reserved_2",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc
index d24790f89f..dacf18fede 100644
--- a/crawl-ref/source/maps.cc
+++ b/crawl-ref/source/maps.cc
@@ -188,9 +188,9 @@ static bool _may_overwrite_feature(const dungeon_feature_type grid,
if (!grid_is_opaque(grid)
&& grid != DNGN_FLOOR
&& grid != DNGN_SHALLOW_WATER
- && grid != DNGN_CLOSED_DOOR
&& grid != DNGN_OPEN_DOOR
- && grid != DNGN_SECRET_DOOR)
+ && grid != DNGN_SECRET_DOOR
+ && !grid_is_closed_door(grid))
{
return (false);
}
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index f918a079a7..bc58a60c23 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -849,10 +849,6 @@ bool PlayerMenuEntry::get_tiles(std::vector<tile_def>& tileset) const
const player_save_info &player = *static_cast<player_save_info*>( data );
dolls_data equip_doll = player.doll;
-// int feat = player.floor_tile;
-// if (feat > 0 && feat < TILE_MAIN_MAX)
-// tileset.push_back(tile_def(feat, TEX_DUNGEON));
-
// FIXME: A lot of code duplication from DungeonRegion::pack_doll().
int p_order[TILEP_PART_MAX] =
{
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 840ada4c60..b33c0c0c93 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2993,7 +2993,10 @@ void reveal_secret_door(const coord_def& p)
ASSERT(grd(p) == DNGN_SECRET_DOOR);
dungeon_feature_type door = grid_secret_door_appearance(p);
- grd(p) = grid_is_opaque(door) ? DNGN_CLOSED_DOOR : DNGN_OPEN_DOOR;
+ // Former secret doors become known but are still hidden to monsters
+ // until opened.
+ grd(p) = grid_is_opaque(door) ? DNGN_DETECTED_SECRET_DOOR
+ : DNGN_OPEN_DOOR;
viewwindow(true, false);
learned_something_new(TUT_SEEN_SECRET_DOOR, p);
}
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 93d59b44a8..212a8147f4 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -3065,7 +3065,7 @@ bool monster_pathfind::mons_traversable(const coord_def p)
return (false);
// Monsters that can't open doors won't be able to pass them.
- if (grd(p) == DNGN_CLOSED_DOOR || grd(p) == DNGN_SECRET_DOOR)
+ if (grid_is_closed_door(grd(p)) || grd(p) == DNGN_SECRET_DOOR)
{
if (mons_is_zombified(mons))
{
@@ -3120,7 +3120,7 @@ int monster_pathfind::mons_travel_cost(coord_def npos)
ASSERT(grid_distance(pos, npos) <= 1);
// Doors need to be opened.
- if (grd(npos) == DNGN_CLOSED_DOOR || grd(npos) == DNGN_SECRET_DOOR)
+ if (grid_is_closed_door(grd(npos)) || grd(npos) == DNGN_SECRET_DOOR)
return 2;
const int montype = mons_is_zombified(mons) ? mons_zombie_base(mons)
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 48145777e5..6cdd673b91 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -8116,8 +8116,7 @@ static void _mons_open_door(monsters* monster, const coord_def &pos)
bool was_seen = false;
std::set<coord_def> all_door;
- find_connected_range(pos, DNGN_CLOSED_DOOR, DNGN_SECRET_DOOR,
- all_door);
+ find_connected_range(pos, DNGN_CLOSED_DOOR, DNGN_SECRET_DOOR, all_door);
get_door_description(all_door.size(), &adj, &noun);
for (std::set<coord_def>::iterator i = all_door.begin();
@@ -8511,7 +8510,7 @@ static bool _monster_move(monsters *monster)
// Normal/smart monsters know about secret doors
// (they _live_ in the dungeon!)
if (grd(newpos) == DNGN_CLOSED_DOOR
- || grd(newpos) == DNGN_SECRET_DOOR && mons_intel(monster) >= I_NORMAL)
+ || grid_is_secret_door(grd(newpos)) && mons_intel(monster) >= I_NORMAL)
{
if (mons_is_zombified(monster))
{
@@ -8530,10 +8529,11 @@ static bool _monster_move(monsters *monster)
} // endif - secret/closed doors
// Jellies eat doors. Yum!
+ // (Jellies don't realize secret doors make good eating.)
if ((grd(newpos) == DNGN_CLOSED_DOOR || grd(newpos) == DNGN_OPEN_DOOR)
- && mons_itemuse(monster) == MONUSE_EATS_ITEMS
- // Doors with permarock marker cannot be eaten.
- && !feature_marker_at(newpos, DNGN_PERMAROCK_WALL))
+ && mons_itemuse(monster) == MONUSE_EATS_ITEMS
+ // Doors with permarock marker cannot be eaten.
+ && !feature_marker_at(newpos, DNGN_PERMAROCK_WALL))
{
grd(newpos) = DNGN_FLOOR;
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 0bbc88ac34..377bd8bfe3 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -6058,7 +6058,6 @@ player_save_info player_save_info::operator=(const player& rhs)
class_name = rhs.class_name;
religion = rhs.religion;
#ifdef USE_TILE
-// floor_tile = 0;
held_in_net = false;
#endif
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index 29930a22fd..e2ab61cd5b 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -38,7 +38,6 @@ struct player_save_info
god_type religion;
#ifdef USE_TILE
dolls_data doll;
-// int floor_tile;
bool held_in_net;
#endif
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index c0904d16e2..e59ebe9d88 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -227,6 +227,7 @@ static int _shatter_walls(coord_def where, int pow, int, actor *)
break;
case DNGN_CLOSED_DOOR:
+ case DNGN_DETECTED_SECRET_DOOR:
case DNGN_OPEN_DOOR:
if (see_grid(where))
mpr("A door shatters!");
@@ -1658,6 +1659,7 @@ bool cast_fragmentation(int pow, const dist& spd)
case DNGN_OPEN_DOOR:
case DNGN_CLOSED_DOOR:
+ case DNGN_DETECTED_SECRET_DOOR:
// Doors always blow up, stone arches never do (would cause problems).
grd(spd.target) = DNGN_FLOOR;
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index 09ee06a4f5..25c601d57c 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -188,6 +188,16 @@ bool grid_is_solid(const coord_def &c)
return (grid_is_solid(grd(c)));
}
+bool grid_is_closed_door(dungeon_feature_type grid)
+{
+ return (grid == DNGN_CLOSED_DOOR || grid == DNGN_DETECTED_SECRET_DOOR);
+}
+
+bool grid_is_secret_door(dungeon_feature_type grid)
+{
+ return (grid == DNGN_SECRET_DOOR || grid == DNGN_DETECTED_SECRET_DOOR);
+}
+
bool grid_is_rock(dungeon_feature_type grid)
{
return (grid == DNGN_ORCISH_IDOL
diff --git a/crawl-ref/source/terrain.h b/crawl-ref/source/terrain.h
index 8de51fba08..5da7239b91 100644
--- a/crawl-ref/source/terrain.h
+++ b/crawl-ref/source/terrain.h
@@ -26,6 +26,8 @@ bool grid_is_opaque(dungeon_feature_type grid);
bool grid_is_solid(dungeon_feature_type grid);
bool grid_is_solid(int x, int y);
bool grid_is_solid(const coord_def &c);
+bool grid_is_closed_door(dungeon_feature_type grid);
+bool grid_is_secret_door(dungeon_feature_type grid);
bool grid_is_rock(dungeon_feature_type grid);
bool grid_is_permarock(dungeon_feature_type grid);
bool grid_is_stone_stair(dungeon_feature_type grid);
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index 61909dc33e..2477c3cab9 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -2347,6 +2347,7 @@ int tileidx_feature(int object, int gx, int gy)
case DNGN_STONE_WALL:
return TILE_DNGN_STONE_WALL;
case DNGN_CLOSED_DOOR:
+ case DNGN_DETECTED_SECRET_DOOR: // same tile
return TILE_DNGN_CLOSED_DOOR;
case DNGN_METAL_WALL:
return TILE_DNGN_METAL_WALL;
@@ -3954,7 +3955,7 @@ void tile_init_flavour(const coord_def &gc)
env.tile_flv(gc).wall = env.tile_default.wall + wall_rnd;
}
- if (grd(gc) == DNGN_CLOSED_DOOR || grd(gc) == DNGN_OPEN_DOOR)
+ if (grd(gc) == DNGN_OPEN_DOOR || grid_is_closed_door(grd(gc)))
{
// Check for horizontal gates.
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 1d99c60697..cc015ab602 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -265,15 +265,15 @@ void DungeonRegion::pack_background(unsigned int bg, int x, int y)
m_buf_dngn.add(flv.floor, x, y);
}
- if (bg & TILE_FLAG_BLOOD)
+ m_buf_dngn.add(bg_idx, x, y);
+
+ if (bg & TILE_FLAG_BLOOD && bg_idx > TILE_DNGN_UNSEEN)
{
tile_flavour &flv = env.tile_flv[x + m_cx_to_gx][y + m_cy_to_gy];
int offset = flv.special % tile_dngn_count(TILE_BLOOD);
m_buf_dngn.add(TILE_BLOOD + offset, x, y);
}
- m_buf_dngn.add(bg_idx, x, y);
-
if (bg & TILE_FLAG_HALO)
m_buf_dngn.add(TILE_HALO, x, y);
@@ -577,14 +577,6 @@ void save_doll_file(FILE *dollf)
tilep_print_parts(fbuf, result.parts, true);
fprintf(dollf, "%s\n", fbuf);
-// const coord_def c = you.pos();
-// int feat = tileidx_feature(grd(c), c.x, c.y);
-// if (feat == TILE_FLOOR_NORMAL)
-// feat = env.tile_flv(c).floor;
-// else if (feat == TILE_WALL_NORMAL)
-// feat = env.tile_flv(c).wall;
-// fprintf(dollf, "floor=%d\n", feat);
-
if (you.attribute[ATTR_HELD] > 0)
fprintf(dollf, "net\n");
}
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index d8e1344545..2f64bdfb19 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -208,7 +208,7 @@ inline bool is_trap(const coord_def& c)
// This is done, so traps etc. will usually be circumvented where possible.
inline int feature_traverse_cost(dungeon_feature_type feature)
{
- if (feature == DNGN_SHALLOW_WATER || feature == DNGN_CLOSED_DOOR)
+ if (feature == DNGN_SHALLOW_WATER || grid_is_closed_door(feature))
return 2;
else if (grid_is_trap(feature))
return 3;
@@ -654,7 +654,10 @@ void init_travel_terrain_check(bool check_race_equip)
_set_pass_feature(DNGN_TRAP_NATURAL, trav);
if (!player_can_open_doors())
+ {
_set_pass_feature(DNGN_CLOSED_DOOR, IMPASSABLE);
+ _set_pass_feature(DNGN_DETECTED_SECRET_DOOR, IMPASSABLE);
+ }
}
else
{
@@ -695,6 +698,7 @@ void initialise_travel()
}
// A few special cases...
traversable_terrain[DNGN_CLOSED_DOOR] =
+ traversable_terrain[DNGN_DETECTED_SECRET_DOOR] =
traversable_terrain[DNGN_SHALLOW_WATER] = TRAVERSABLE;
}
diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc
index e8388a1ce9..dc2d8b6798 100644
--- a/crawl-ref/source/tutorial.cc
+++ b/crawl-ref/source/tutorial.cc
@@ -4283,6 +4283,7 @@ static void _tutorial_describe_feature(int x, int y)
break;
case DNGN_CLOSED_DOOR:
+ case DNGN_DETECTED_SECRET_DOOR:
if (!Options.tut_explored)
{
ostr << "\nTo avoid accidentally opening a door you'd rather "
@@ -4609,7 +4610,7 @@ void tutorial_observe_cell(const coord_def& gc)
learned_something_new(TUT_SEEN_ALTAR, gc);
else if (is_feature('^', gc))
learned_something_new(TUT_SEEN_TRAP, gc);
- else if (grd(gc) == DNGN_CLOSED_DOOR)
+ else if (grid_is_closed_door(grd(gc)))
learned_something_new(TUT_SEEN_DOOR, gc);
else if (grd(gc) == DNGN_ENTER_SHOP)
learned_something_new(TUT_SEEN_SHOP, gc);
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 57f95c23da..20345fb91a 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -3915,13 +3915,13 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg,
bool open = true;
- if (grid_is_solid(grd(*ri)) && grd(*ri) != DNGN_CLOSED_DOOR)
+ if (grid_is_solid(grd(*ri)) && !grid_is_closed_door(grd(*ri)))
{
open = false;
for (adjacent_iterator ai(*ri); ai; ++ai)
{
if (map_bounds(*ai) && (!grid_is_opaque(grd(*ai))
- || grd(*ai) == DNGN_CLOSED_DOOR))
+ || grid_is_closed_door(grd(*ai))))
{
open = true;
break;
@@ -4223,6 +4223,7 @@ void init_feature_table( void )
break;
case DNGN_CLOSED_DOOR:
+ case DNGN_DETECTED_SECRET_DOOR:
Feature[i].dchar = DCHAR_DOOR_CLOSED;
Feature[i].colour = LIGHTGREY;
Feature[i].minimap = MF_DOOR;
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 968e5976c9..78310ba4a3 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -368,13 +368,13 @@ static int _exploration_estimate(bool seen_only = false)
}
bool open = true;
- if (grid_is_solid(grd(pos)) && grd(pos) != DNGN_CLOSED_DOOR)
+ if (grid_is_solid(grd(pos)) && !grid_is_closed_door(grd(pos)))
{
open = false;
for (adjacent_iterator ai(pos); ai; ++ai)
{
if (map_bounds(*ai) && (!grid_is_opaque(grd(*ai))
- || grd(*ai) == DNGN_CLOSED_DOOR))
+ || grid_is_closed_door(grd(*ai))))
{
open = true;
break;