summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShmuale Mark <shm.mark@gmail.com>2014-07-14 08:41:57 -0400
committerShmuale Mark <shm.mark@gmail.com>2014-07-14 09:23:57 -0400
commit3676b4b6280aff0966867792c2d1b1ffa0647b48 (patch)
tree0bc376e913f13757f51724a26c86e3ba04f4827c
parent3ee8b5ad95f6fc8d8eaf38521ae25b1fcdf256b4 (diff)
downloadcrawl-ref-3676b4b6280aff0966867792c2d1b1ffa0647b48.tar.gz
crawl-ref-3676b4b6280aff0966867792c2d1b1ffa0647b48.zip
Move more feature name data to feature-data.h.
-rw-r--r--crawl-ref/source/enum.h6
-rw-r--r--crawl-ref/source/feature-data.h346
-rw-r--r--crawl-ref/source/feature.cc2
-rw-r--r--crawl-ref/source/feature.h1
-rw-r--r--crawl-ref/source/terrain.cc179
5 files changed, 214 insertions, 320 deletions
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 0b2a4f6fbf..b2b556823c 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -1311,8 +1311,8 @@ enum dungeon_char_type
// When adding:
//
-// * New stairs/portals: update feat_stair_direction.
// * Any: Add an entry in feature-data.h for the feature.
+// * New stairs/portals: update feat_stair_direction.
// * Any: edit dat/descript/features.txt and add a
// long description if appropriate.
// * Any: check the feat_* functions in terrain.cc and make sure
@@ -1320,10 +1320,6 @@ enum dungeon_char_type
// * Any: edit dungeon.cc and add a symbol to _glyph_to_feat() for the feature,
// if you want vault maps to be able to use it. If you do, also update
// docs/develop/levels/syntax.txt with the new symbol.
-// * Any: edit terrain.cc and add the feature's name to the dngn_feature_names
-// array, if you want vault map Lua code to be able to use the
-// feature, and/or you want to be able to create the feature
-// using the "create feature by name" wizard command.
// * Any: if its enumerator comes late in the list (as is likely for new
// feature types),_cell_feat_show_colour may need a special case to
// allow it to be recoloured.
diff --git a/crawl-ref/source/feature-data.h b/crawl-ref/source/feature-data.h
index 5400dbd73d..83bdf75e35 100644
--- a/crawl-ref/source/feature-data.h
+++ b/crawl-ref/source/feature-data.h
@@ -16,8 +16,8 @@ static feature_def feat_defs[] =
{
{
- // feat, name
- DNGN_UNSEEN, "",
+ // feat, name, vaultname
+ DNGN_UNSEEN, "", "unseen",
// dchar, symbol, magic_symbol
NUM_DCHAR_TYPES, 0, 0,
// colour, map_colour, seen_colour, em_colour, seen_em_colour
@@ -27,168 +27,168 @@ static feature_def feat_defs[] =
},
{
- DNGN_EXPLORE_HORIZON, "explore horizon",
+ DNGN_EXPLORE_HORIZON, "explore horizon", "explore_horizon",
NUM_DCHAR_TYPES, 0, 0,
COLOUR_IS(BLACK),
FFT_NONE, MF_UNSEEN,
},
{
- DNGN_CLOSED_DOOR, "closed door",
+ DNGN_CLOSED_DOOR, "closed door", "closed_door",
DCHAR_DOOR_CLOSED, 0, 0,
COLOUR_IS(LIGHTGREY),
FFT_NONE, MF_DOOR,
},
{
- DNGN_RUNED_DOOR, "runed door",
+ DNGN_RUNED_DOOR, "runed door", "runed_door",
DCHAR_DOOR_CLOSED, 0, 0,
COLOUR_AND_MAP(LIGHTBLUE),
FFT_NONE, MF_DOOR,
},
{
- DNGN_SEALED_DOOR, "sealed door",
+ DNGN_SEALED_DOOR, "sealed door", "sealed_door",
DCHAR_DOOR_CLOSED, 0, 0,
COLOUR_AND_MAP(LIGHTGREEN),
FFT_NONE, MF_DOOR,
},
{
- DNGN_TREE, "tree",
+ DNGN_TREE, "tree", "tree",
DCHAR_TREE, 0, Options.char_table[ DCHAR_WALL_MAGIC ],
COLOUR_IS(ETC_TREE),
FFT_NONE, MF_WALL,
},
{
- DNGN_METAL_WALL, "metal wall",
+ DNGN_METAL_WALL, "metal wall", "metal_wall",
DCHAR_WALL, 0, Options.char_table[ DCHAR_WALL_MAGIC ],
COLOUR_IS(CYAN),
FFT_NONE, MF_WALL,
},
{
- DNGN_GREEN_CRYSTAL_WALL, "wall of green crystal",
+ DNGN_GREEN_CRYSTAL_WALL, "wall of green crystal", "green_crystal_wall",
DCHAR_WALL, 0, Options.char_table[ DCHAR_WALL_MAGIC ],
COLOUR_IS(GREEN),
FFT_NONE, MF_WALL,
},
{
- DNGN_ROCK_WALL, "rock wall",
+ DNGN_ROCK_WALL, "rock wall", "rock_wall",
DCHAR_WALL, 0, Options.char_table[ DCHAR_WALL_MAGIC ],
COLOUR_IS(ETC_ROCK),
FFT_NONE, MF_WALL,
},
{
- DNGN_SLIMY_WALL, "slime covered rock wall",
+ DNGN_SLIMY_WALL, "slime covered rock wall", "slimy_wall",
DCHAR_WALL, 0, Options.char_table[ DCHAR_WALL_MAGIC ],
COLOUR_IS(LIGHTGREEN),
FFT_NONE, MF_WALL,
},
{
- DNGN_STONE_WALL, "stone wall",
+ DNGN_STONE_WALL, "stone wall", "stone_wall",
DCHAR_WALL, 0, Options.char_table[ DCHAR_WALL_MAGIC ],
COLOUR_IS(LIGHTGREY),
FFT_NONE, MF_WALL,
},
{
- DNGN_PERMAROCK_WALL, "unnaturally hard rock wall",
+ DNGN_PERMAROCK_WALL, "unnaturally hard rock wall", "permarock_wall",
DCHAR_PERMAWALL, 0, Options.char_table[ DCHAR_WALL_MAGIC ],
COLOUR_IS(ETC_ROCK),
FFT_NONE, MF_WALL,
},
{
- DNGN_CLEAR_ROCK_WALL, "translucent rock wall",
+ DNGN_CLEAR_ROCK_WALL, "translucent rock wall", "clear_rock_wall",
DCHAR_WALL, 0, Options.char_table[ DCHAR_WALL_MAGIC ],
COLOUR_IS(LIGHTCYAN),
FFT_NONE, MF_WALL,
},
{
- DNGN_CLEAR_STONE_WALL, "translucent stone wall",
+ DNGN_CLEAR_STONE_WALL, "translucent stone wall", "clear_stone_wall",
DCHAR_WALL, 0, Options.char_table[ DCHAR_WALL_MAGIC ],
COLOUR_IS(LIGHTCYAN),
FFT_NONE, MF_WALL,
},
{
- DNGN_CLEAR_PERMAROCK_WALL, "translucent unnaturally hard rock wall",
+ DNGN_CLEAR_PERMAROCK_WALL, "translucent unnaturally hard rock wall", "clear_permarock_wall",
DCHAR_PERMAWALL, 0, Options.char_table[ DCHAR_WALL_MAGIC ],
COLOUR_IS(LIGHTCYAN),
FFT_NONE, MF_WALL,
},
{
- DNGN_GRATE, "iron grate",
+ DNGN_GRATE, "iron grate", "iron_grate",
DCHAR_GRATE, 0, Options.char_table[ DCHAR_WALL_MAGIC ],
COLOUR_IS(LIGHTBLUE),
FFT_NONE, MF_WALL,
},
{
- DNGN_OPEN_SEA, "the open sea",
+ DNGN_OPEN_SEA, "the open sea", "open_sea",
DCHAR_WALL, 0, 0,
COLOUR_IS(BLUE),
FFT_NONE, MF_DEEP_WATER,
},
{
- DNGN_LAVA_SEA, "the endless lava",
+ DNGN_LAVA_SEA, "the endless lava", "endless_lava",
DCHAR_WALL, 0, 0,
COLOUR_IS(RED),
FFT_NONE, MF_LAVA,
},
{
- DNGN_ORCISH_IDOL, "orcish idol",
+ DNGN_ORCISH_IDOL, "orcish idol", "orcish_idol",
DCHAR_STATUE, 0, 0,
COLOUR_IS(BROWN),
FFT_NONE, MF_WALL,
},
{
- DNGN_GRANITE_STATUE, "granite statue",
+ DNGN_GRANITE_STATUE, "granite statue", "granite_statue",
DCHAR_STATUE, 0, 0,
COLOUR_IS(DARKGREY),
FFT_NONE, MF_WALL,
},
{
- DNGN_MALIGN_GATEWAY, "portal to somewhere",
+ DNGN_MALIGN_GATEWAY, "portal to somewhere", "malign_gateway",
DCHAR_ARCH, 0, 0,
COLOURS(ETC_SHIMMER_BLUE, LIGHTGREY),
FFT_NONE, MF_STAIR_UP,
},
{
- DNGN_LAVA, "some lava",
+ DNGN_LAVA, "some lava", "lava",
DCHAR_WAVY, 0, 0,
COLOUR_IS(RED),
FFT_NONE, MF_LAVA,
},
{
- DNGN_DEEP_WATER, "some deep water",
+ DNGN_DEEP_WATER, "some deep water", "deep_water",
DCHAR_WAVY, 0, 0,
COLOUR_IS(BLUE),
FFT_NONE, MF_DEEP_WATER,
},
{
- DNGN_SHALLOW_WATER, "some shallow water",
+ DNGN_SHALLOW_WATER, "some shallow water", "shallow_water",
DCHAR_WAVY, 0, 0,
COLOUR_IS(CYAN),
FFT_NONE, MF_WATER,
},
{
- DNGN_FLOOR, "floor",
+ DNGN_FLOOR, "floor", "floor",
DCHAR_FLOOR, 0, Options.char_table[ DCHAR_FLOOR_MAGIC ],
COLOUR_IS(ETC_FLOOR),
FFT_NONE, MF_FLOOR,
@@ -196,7 +196,7 @@ static feature_def feat_defs[] =
#if TAG_MAJOR_VERSION == 34
{
- DNGN_BADLY_SEALED_DOOR, "",
+ DNGN_BADLY_SEALED_DOOR, "", "badly_sealed_door",
DCHAR_FLOOR, 0, Options.char_table[ DCHAR_FLOOR_MAGIC ],
COLOUR_IS(ETC_FLOOR),
FFT_NONE, MF_FLOOR,
@@ -204,335 +204,335 @@ static feature_def feat_defs[] =
#endif
{
- DNGN_EXPIRED_PORTAL, "collapsed entrance",
+ DNGN_EXPIRED_PORTAL, "collapsed entrance", "expired_portal",
DCHAR_FLOOR, 0, Options.char_table[ DCHAR_FLOOR_MAGIC ],
COLOUR_IS(BROWN),
FFT_NONE, MF_FLOOR,
},
{
- DNGN_OPEN_DOOR, "open door",
+ DNGN_OPEN_DOOR, "open door", "open_door",
DCHAR_DOOR_OPEN, 0, 0,
COLOUR_IS(LIGHTGREY),
FFT_NONE, MF_DOOR,
},
-#define TRAP(enum, name, colour)\
+#define TRAP(enum, name, vaultname, colour)\
{\
- enum, name,\
+ enum, name, vaultname,\
DCHAR_TRAP, 0, 0,\
COLOUR_AND_MAP(colour),\
FFT_NONE, MF_TRAP,\
}
-TRAP(DNGN_TRAP_MECHANICAL, "mechanical trap", LIGHTCYAN),
-TRAP(DNGN_TRAP_TELEPORT, "teleport trap", LIGHTBLUE),
-TRAP(DNGN_TRAP_ALARM, "alarm trap", LIGHTRED),
-TRAP(DNGN_TRAP_ZOT, "zot trap", LIGHTMAGENTA),
-TRAP(DNGN_PASSAGE_OF_GOLUBRIA, "passage of Golubria", GREEN),
-TRAP(DNGN_TRAP_SHAFT, "shaft", BROWN),
-TRAP(DNGN_TRAP_WEB, "web", LIGHTGREY),
+TRAP(DNGN_TRAP_MECHANICAL, "mechanical trap", "trap_mechanical", LIGHTCYAN),
+TRAP(DNGN_TRAP_TELEPORT, "teleport trap", "trap_teleport", LIGHTBLUE),
+TRAP(DNGN_TRAP_ALARM, "alarm trap", "trap_alarm", LIGHTRED),
+TRAP(DNGN_TRAP_ZOT, "zot trap", "trap_zot", LIGHTMAGENTA),
+TRAP(DNGN_PASSAGE_OF_GOLUBRIA, "passage of Golubria", "passage of golubria", GREEN),
+TRAP(DNGN_TRAP_SHAFT, "shaft", "shaft", BROWN),
+TRAP(DNGN_TRAP_WEB, "web", "trap_web", LIGHTGREY),
{
- DNGN_UNDISCOVERED_TRAP, "floor",
+ DNGN_UNDISCOVERED_TRAP, "floor", "undiscovered_trap",
DCHAR_FLOOR, 0, Options.char_table[ DCHAR_FLOOR_MAGIC ],
COLOUR_IS(ETC_FLOOR),
FFT_NONE, MF_FLOOR,
},
{
- DNGN_ENTER_SHOP, "shop",
+ DNGN_ENTER_SHOP, "shop", "enter_shop",
DCHAR_ARCH, 0, 0,
YELLOW, LIGHTGREY, YELLOW, YELLOW, LIGHTGREY,
FFT_NOTABLE, MF_FEATURE,
},
{
- DNGN_ABANDONED_SHOP, "abandoned shop",
+ DNGN_ABANDONED_SHOP, "abandoned shop", "abandoned_shop",
DCHAR_ARCH, 0, 0,
COLOUR_AND_MAP(LIGHTGREY),
FFT_NONE, MF_FLOOR,
},
{
- DNGN_STONE_ARCH, "empty arch of ancient stone",
+ DNGN_STONE_ARCH, "empty arch of ancient stone", "stone_arch",
DCHAR_ARCH, 0, 0,
COLOUR_AND_MAP(LIGHTGREY),
FFT_NONE, MF_FLOOR,
},
{
- DNGN_UNKNOWN_PORTAL, "detected shop or portal",
+ DNGN_UNKNOWN_PORTAL, "detected shop or portal", "unknown_portal",
DCHAR_ARCH, 0, 0,
COLOURS(BLACK, LIGHTGREY),
FFT_NONE, MF_PORTAL,
},
-#define STONE_STAIRS_DOWN(num)\
+#define STONE_STAIRS_DOWN(num, num2)\
{\
- DNGN_STONE_STAIRS_DOWN_##num, "stone staircase leading down",\
+ DNGN_STONE_STAIRS_DOWN_##num, "stone staircase leading down", "stone_stairs_down_"#num2,\
DCHAR_STAIRS_DOWN, 0, 0,\
RED, RED, RED, WHITE, WHITE,\
FFT_NONE, MF_STAIR_DOWN,\
}
-STONE_STAIRS_DOWN(I),
-STONE_STAIRS_DOWN(II),
-STONE_STAIRS_DOWN(III),
+STONE_STAIRS_DOWN(I, i),
+STONE_STAIRS_DOWN(II, ii),
+STONE_STAIRS_DOWN(III, iii),
-#define STONE_STAIRS_UP(num)\
+#define STONE_STAIRS_UP(num, num2)\
{\
- DNGN_STONE_STAIRS_UP_##num, "stone staircase leading up",\
+ DNGN_STONE_STAIRS_UP_##num, "stone staircase leading up", "stone_stairs_up_"#num2,\
DCHAR_STAIRS_UP, 0, 0,\
GREEN, GREEN, GREEN, WHITE, WHITE,\
FFT_NONE, MF_STAIR_UP,\
}
-STONE_STAIRS_UP(I),
-STONE_STAIRS_UP(II),
-STONE_STAIRS_UP(III),
+STONE_STAIRS_UP(I, i),
+STONE_STAIRS_UP(II, ii),
+STONE_STAIRS_UP(III, iii),
{
- DNGN_ESCAPE_HATCH_DOWN, "escape hatch in the floor",
+ DNGN_ESCAPE_HATCH_DOWN, "escape hatch in the floor", "escape_hatch_down",
DCHAR_STAIRS_DOWN, 0, 0,
COLOUR_AND_MAP(BROWN),
FFT_NONE, MF_STAIR_DOWN,
},
{
- DNGN_ESCAPE_HATCH_UP, "escape hatch in the ceiling",
+ DNGN_ESCAPE_HATCH_UP, "escape hatch in the ceiling", "escape_hatch_up",
DCHAR_STAIRS_UP, 0, 0,
COLOUR_AND_MAP(BROWN),
FFT_NONE, MF_STAIR_UP,
},
{
- DNGN_EXIT_LABYRINTH, "escape hatch in the ceiling",
+ DNGN_EXIT_LABYRINTH, "escape hatch in the ceiling", "exit_labyrinth",
DCHAR_STAIRS_UP, 0, 0,
COLOUR_AND_MAP(BROWN),
FFT_NONE, MF_STAIR_UP,
},
{
- DNGN_ENTER_LABYRINTH, "labyrinth entrance",
+ DNGN_ENTER_LABYRINTH, "labyrinth entrance", "enter_labyrinth",
DCHAR_ARCH, 0, 0,
ETC_SHIMMER_BLUE, LIGHTGREY, ETC_SHIMMER_BLUE, ETC_SHIMMER_BLUE, ETC_SHIMMER_BLUE,
(FFT_NOTABLE | FFT_EXAMINE_HINT), MF_PORTAL,
},
-#define PORTAL_ENTRANCE(enum, name, colour)\
+#define PORTAL_ENTRANCE(enum, name, vaultname, colour)\
{\
- enum, name,\
+ enum, name, vaultname,\
DCHAR_ARCH, 0, 0,\
colour, LIGHTGREY, colour, colour, colour,\
FFT_NOTABLE, MF_PORTAL,\
}
-#define PORTAL_EXIT(enum, name, colour)\
+#define PORTAL_EXIT(enum, name, vaultname, colour)\
{\
- enum, name,\
+ enum, name, vaultname,\
DCHAR_ARCH, 0, 0,\
colour, LIGHTGREY, colour, colour, colour,\
FFT_NONE, MF_PORTAL,\
}
-PORTAL_ENTRANCE(DNGN_ENTER_DIS, "gateway to the Iron City of Dis", CYAN),
-PORTAL_ENTRANCE(DNGN_ENTER_GEHENNA, "gateway to the ashen valley of Gehenna", RED),
-PORTAL_ENTRANCE(DNGN_ENTER_COCYTUS, "gateway to the freezing wastes of Cocytus", LIGHTCYAN),
-PORTAL_ENTRANCE(DNGN_ENTER_TARTARUS, "gateway to the decaying netherworld of Tartarus", MAGENTA),
-PORTAL_ENTRANCE(DNGN_ENTER_HELL, "gateway to Hell", RED),
-PORTAL_EXIT(DNGN_EXIT_HELL, "gateway back into the Dungeon", LIGHTRED),
+PORTAL_ENTRANCE(DNGN_ENTER_DIS, "gateway to the Iron City of Dis", "enter_dis", CYAN),
+PORTAL_ENTRANCE(DNGN_ENTER_GEHENNA, "gateway to the ashen valley of Gehenna", "enter_gehenna", RED),
+PORTAL_ENTRANCE(DNGN_ENTER_COCYTUS, "gateway to the freezing wastes of Cocytus", "enter_cocytus", LIGHTCYAN),
+PORTAL_ENTRANCE(DNGN_ENTER_TARTARUS, "gateway to the decaying netherworld of Tartarus", "enter_tartarus", MAGENTA),
+PORTAL_ENTRANCE(DNGN_ENTER_HELL, "gateway to Hell", "enter_hell", RED),
+PORTAL_EXIT(DNGN_EXIT_HELL, "gateway back into the Dungeon", "exit_hell", LIGHTRED),
-PORTAL_ENTRANCE(DNGN_ENTER_ABYSS, "one-way gate to the infinite horrors of the Abyss", ETC_WARP),
-PORTAL_ENTRANCE(DNGN_EXIT_THROUGH_ABYSS, "exit through the horrors of the Abyss", ETC_WARP),
-PORTAL_EXIT(DNGN_EXIT_ABYSS, "gateway leading out of the Abyss", ETC_WARP),
+PORTAL_ENTRANCE(DNGN_ENTER_ABYSS, "one-way gate to the infinite horrors of the Abyss", "enter_abyss", ETC_WARP),
+PORTAL_ENTRANCE(DNGN_EXIT_THROUGH_ABYSS, "exit through the horrors of the Abyss", "exit_through_abyss", ETC_WARP),
+PORTAL_EXIT(DNGN_EXIT_ABYSS, "gateway leading out of the Abyss", "exit_abyss", ETC_WARP),
-PORTAL_ENTRANCE(DNGN_ENTER_PANDEMONIUM, "one-way gate leading to the halls of Pandemonium", LIGHTBLUE),
-PORTAL_EXIT(DNGN_TRANSIT_PANDEMONIUM, "gate leading to another region of Pandemonium", LIGHTGREEN),
-PORTAL_EXIT(DNGN_EXIT_PANDEMONIUM, "gate leading out of Pandemonium", LIGHTBLUE),
+PORTAL_ENTRANCE(DNGN_ENTER_PANDEMONIUM, "one-way gate leading to the halls of Pandemonium", "enter_pandemonium", LIGHTBLUE),
+PORTAL_EXIT(DNGN_TRANSIT_PANDEMONIUM, "gate leading to another region of Pandemonium", "transit_pandemonium", LIGHTGREEN),
+PORTAL_EXIT(DNGN_EXIT_PANDEMONIUM, "gate leading out of Pandemonium", "exit_pandemonium", LIGHTBLUE),
-PORTAL_ENTRANCE(DNGN_ENTER_VAULTS, "gate to the Vaults", LIGHTGREEN),
-PORTAL_EXIT(DNGN_RETURN_FROM_VAULTS, "gate leading back out of this place", ETC_SHIMMER_BLUE),
+PORTAL_ENTRANCE(DNGN_ENTER_VAULTS, "gate to the Vaults", "enter_vaults", LIGHTGREEN),
+PORTAL_EXIT(DNGN_RETURN_FROM_VAULTS, "gate leading back out of this place", "return_from_vaults", ETC_SHIMMER_BLUE),
-PORTAL_ENTRANCE(DNGN_ENTER_ZOT, "gate to the Realm of Zot", MAGENTA),
-PORTAL_EXIT(DNGN_RETURN_FROM_ZOT, "gate leading back out of this place", MAGENTA),
+PORTAL_ENTRANCE(DNGN_ENTER_ZOT, "gate to the Realm of Zot", "enter_zot", MAGENTA),
+PORTAL_EXIT(DNGN_RETURN_FROM_ZOT, "gate leading back out of this place", "return_from_zot", MAGENTA),
#if TAG_MAJOR_VERSION == 34
-PORTAL_ENTRANCE(DNGN_ENTER_PORTAL_VAULT, "gate leading to a distant place", ETC_SHIMMER_BLUE),
+PORTAL_ENTRANCE(DNGN_ENTER_PORTAL_VAULT, "gate leading to a distant place", "enter_portal_vault", ETC_SHIMMER_BLUE),
#endif
-PORTAL_ENTRANCE(DNGN_ENTER_ZIGGURAT, "gateway to a ziggurat", ETC_SHIMMER_BLUE),
-PORTAL_ENTRANCE(DNGN_ENTER_BAZAAR, "gateway to a bazaar", ETC_SHIMMER_BLUE),
-PORTAL_ENTRANCE(DNGN_ENTER_TROVE, "portal to a secret trove of treasure", BLUE),
-PORTAL_ENTRANCE(DNGN_ENTER_SEWER, "glowing drain", LIGHTGREEN),
-PORTAL_ENTRANCE(DNGN_ENTER_OSSUARY, "sand-covered staircase", BROWN),
-PORTAL_ENTRANCE(DNGN_ENTER_BAILEY, "flagged portal", LIGHTRED),
-PORTAL_ENTRANCE(DNGN_ENTER_ICE_CAVE, "frozen archway", WHITE),
-PORTAL_ENTRANCE(DNGN_ENTER_VOLCANO, "dark tunnel", RED),
-PORTAL_ENTRANCE(DNGN_ENTER_WIZLAB, "magical portal", ETC_SHIMMER_BLUE),
-PORTAL_ENTRANCE(DNGN_UNUSED_ENTER_PORTAL_1, "", ETC_SHIMMER_BLUE),
+PORTAL_ENTRANCE(DNGN_ENTER_ZIGGURAT, "gateway to a ziggurat", "enter_ziggurat", ETC_SHIMMER_BLUE),
+PORTAL_ENTRANCE(DNGN_ENTER_BAZAAR, "gateway to a bazaar", "enter_bazaar", ETC_SHIMMER_BLUE),
+PORTAL_ENTRANCE(DNGN_ENTER_TROVE, "portal to a secret trove of treasure", "enter_trove", BLUE),
+PORTAL_ENTRANCE(DNGN_ENTER_SEWER, "glowing drain", "enter_sewer", LIGHTGREEN),
+PORTAL_ENTRANCE(DNGN_ENTER_OSSUARY, "sand-covered staircase", "enter_ossuary", BROWN),
+PORTAL_ENTRANCE(DNGN_ENTER_BAILEY, "flagged portal", "enter_bailey", LIGHTRED),
+PORTAL_ENTRANCE(DNGN_ENTER_ICE_CAVE, "frozen archway", "enter_ice_cave", WHITE),
+PORTAL_ENTRANCE(DNGN_ENTER_VOLCANO, "dark tunnel", "enter_volcano", RED),
+PORTAL_ENTRANCE(DNGN_ENTER_WIZLAB, "magical portal", "enter_wizlab", ETC_SHIMMER_BLUE),
+PORTAL_ENTRANCE(DNGN_UNUSED_ENTER_PORTAL_1, "", "enter_unused", ETC_SHIMMER_BLUE),
#if TAG_MAJOR_VERSION == 34
-PORTAL_EXIT(DNGN_EXIT_PORTAL_VAULT, "gate leading back out of here", ETC_SHIMMER_BLUE),
+PORTAL_EXIT(DNGN_EXIT_PORTAL_VAULT, "gate leading back out of here", "exit_portal_vault", ETC_SHIMMER_BLUE),
#endif
-PORTAL_EXIT(DNGN_EXIT_ZIGGURAT, "gate leading back out of here", ETC_SHIMMER_BLUE),
-PORTAL_EXIT(DNGN_EXIT_BAZAAR, "gate leading back out of here", ETC_SHIMMER_BLUE),
-PORTAL_EXIT(DNGN_EXIT_TROVE, "gate leading back out of here", BLUE),
-PORTAL_EXIT(DNGN_EXIT_SEWER, "gate leading back out of here", BROWN),
-PORTAL_EXIT(DNGN_EXIT_OSSUARY, "gate leading back out of here", BROWN),
-PORTAL_EXIT(DNGN_EXIT_BAILEY, "gate leading back out of here", ETC_SHIMMER_BLUE),
-PORTAL_EXIT(DNGN_EXIT_ICE_CAVE, "ice covered gate leading back out of here", WHITE),
-PORTAL_EXIT(DNGN_EXIT_VOLCANO, "rocky tunnel leading out of this place", RED),
-PORTAL_EXIT(DNGN_EXIT_WIZLAB, "portal leading out of here", ETC_SHIMMER_BLUE),
-PORTAL_EXIT(DNGN_UNUSED_EXIT_PORTAL_1, "", ETC_SHIMMER_BLUE),
-
-#define BRANCH_ENTRANCE(enum, name)\
+PORTAL_EXIT(DNGN_EXIT_ZIGGURAT, "gate leading back out of here", "exit_ziggurat", ETC_SHIMMER_BLUE),
+PORTAL_EXIT(DNGN_EXIT_BAZAAR, "gate leading back out of here", "exit_bazaar", ETC_SHIMMER_BLUE),
+PORTAL_EXIT(DNGN_EXIT_TROVE, "gate leading back out of here", "exit_trove", BLUE),
+PORTAL_EXIT(DNGN_EXIT_SEWER, "gate leading back out of here", "exit_sewer", BROWN),
+PORTAL_EXIT(DNGN_EXIT_OSSUARY, "gate leading back out of here", "exit_ossuary", BROWN),
+PORTAL_EXIT(DNGN_EXIT_BAILEY, "gate leading back out of here", "exit_bailey", ETC_SHIMMER_BLUE),
+PORTAL_EXIT(DNGN_EXIT_ICE_CAVE, "ice covered gate leading back out of here", "exit_ice_cave", WHITE),
+PORTAL_EXIT(DNGN_EXIT_VOLCANO, "rocky tunnel leading out of this place", "exit_volcano", RED),
+PORTAL_EXIT(DNGN_EXIT_WIZLAB, "portal leading out of here", "exit_wizlab", ETC_SHIMMER_BLUE),
+PORTAL_EXIT(DNGN_UNUSED_EXIT_PORTAL_1, "", "exit_unused", ETC_SHIMMER_BLUE),
+
+#define BRANCH_ENTRANCE(enum, name, vaultname)\
{\
- enum, name,\
+ enum, name, vaultname,\
DCHAR_STAIRS_DOWN, 0, 0,\
YELLOW, RED, YELLOW, YELLOW, YELLOW,\
FFT_NOTABLE, MF_STAIR_BRANCH,\
}
-#define BRANCH_EXIT(enum, name)\
+#define BRANCH_EXIT(enum, name, vaultname)\
{\
- enum, name,\
+ enum, name, vaultname,\
DCHAR_STAIRS_UP, 0, 0,\
YELLOW, GREEN, YELLOW, YELLOW, YELLOW,\
FFT_NONE, MF_STAIR_UP,\
}
{
- DNGN_EXIT_DUNGEON, "staircase leading out of the dungeon",
+ DNGN_EXIT_DUNGEON, "staircase leading out of the dungeon", "exit_dungeon",
DCHAR_STAIRS_UP, 0, 0,
LIGHTBLUE, GREEN, LIGHTBLUE, LIGHTBLUE, LIGHTBLUE,
FFT_NONE, MF_STAIR_UP,
},
{
- DNGN_ENTER_SLIME, "staircase to the Slime Pits",
+ DNGN_ENTER_SLIME, "staircase to the Slime Pits", "enter_slime_pits",
DCHAR_STAIRS_DOWN, 0, 0,
YELLOW, RED, YELLOW, YELLOW, YELLOW,
(FFT_NOTABLE | FFT_EXAMINE_HINT), MF_STAIR_BRANCH,
},
-BRANCH_EXIT(DNGN_RETURN_FROM_SLIME, "staircase back to the Lair"),
+BRANCH_EXIT(DNGN_RETURN_FROM_SLIME, "staircase back to the Lair", "return_from_slime_pits"),
{
- DNGN_ENTER_ORC, "staircase to the Orcish Mines",
+ DNGN_ENTER_ORC, "staircase to the Orcish Mines", "enter_orcish_mines",
DCHAR_STAIRS_DOWN, 0, 0,
YELLOW, RED, YELLOW, YELLOW, YELLOW,
(FFT_NOTABLE | FFT_EXAMINE_HINT), MF_STAIR_BRANCH,
},
-BRANCH_EXIT(DNGN_RETURN_FROM_ORC, "staircase back to the Dungeon"),
+BRANCH_EXIT(DNGN_RETURN_FROM_ORC, "staircase back to the Dungeon", "return_from_orcish_mines"),
#if TAG_MAJOR_VERSION == 34
-BRANCH_ENTRANCE(DNGN_ENTER_DWARF, "staircase to the Dwarven Hall"),
-BRANCH_ENTRANCE(DNGN_ENTER_FOREST, "staircase to the Enchanted Forest"),
-BRANCH_ENTRANCE(DNGN_ENTER_BLADE, "staircase to the Hall of Blades"),
-BRANCH_EXIT(DNGN_RETURN_FROM_DWARF, "staircase back to the Vaults"),
-BRANCH_EXIT(DNGN_RETURN_FROM_FOREST, "staircase back to the Vaults"),
-BRANCH_EXIT(DNGN_RETURN_FROM_BLADE, "staircase back to the Vaults"),
+BRANCH_ENTRANCE(DNGN_ENTER_DWARF, "staircase to the Dwarven Hall", "enter_dwarven_hall"),
+BRANCH_ENTRANCE(DNGN_ENTER_FOREST, "staircase to the Enchanted Forest", "enter_forest"),
+BRANCH_ENTRANCE(DNGN_ENTER_BLADE, "staircase to the Hall of Blades", "enter_hall_of_blades"),
+BRANCH_EXIT(DNGN_RETURN_FROM_DWARF, "staircase back to the Vaults", "return_from_dwarven_hall"),
+BRANCH_EXIT(DNGN_RETURN_FROM_FOREST, "staircase back to the Vaults", "return_from_forest"),
+BRANCH_EXIT(DNGN_RETURN_FROM_BLADE, "staircase back to the Vaults", "return_from_hall_of_blades"),
#endif
-BRANCH_ENTRANCE(DNGN_ENTER_LAIR, "staircase to the Lair"),
-BRANCH_EXIT(DNGN_RETURN_FROM_LAIR, "staircase back to the Dungeon"),
+BRANCH_ENTRANCE(DNGN_ENTER_LAIR, "staircase to the Lair", "enter_lair"),
+BRANCH_EXIT(DNGN_RETURN_FROM_LAIR, "staircase back to the Dungeon", "return_from_lair"),
-BRANCH_ENTRANCE(DNGN_ENTER_CRYPT, "staircase to the Crpyt"),
-BRANCH_EXIT(DNGN_RETURN_FROM_CRYPT, "staircase back to the Vaults"),
+BRANCH_ENTRANCE(DNGN_ENTER_CRYPT, "staircase to the Crpyt", "enter_crypt"),
+BRANCH_EXIT(DNGN_RETURN_FROM_CRYPT, "staircase back to the Vaults", "return_from_crypt"),
-BRANCH_ENTRANCE(DNGN_ENTER_TEMPLE, "staircase to the Ecumenical Temple"),
-BRANCH_EXIT(DNGN_RETURN_FROM_TEMPLE, "staircase back to the Dungeon"),
+BRANCH_ENTRANCE(DNGN_ENTER_TEMPLE, "staircase to the Ecumenical Temple", "enter_temple"),
+BRANCH_EXIT(DNGN_RETURN_FROM_TEMPLE, "staircase back to the Dungeon", "return_from_temple"),
-BRANCH_ENTRANCE(DNGN_ENTER_SNAKE, "staircase to the Snake Pit"),
-BRANCH_EXIT(DNGN_RETURN_FROM_SNAKE, "staircase back to the Lair"),
+BRANCH_ENTRANCE(DNGN_ENTER_SNAKE, "staircase to the Snake Pit", "enter_snake_pit"),
+BRANCH_EXIT(DNGN_RETURN_FROM_SNAKE, "staircase back to the Lair", "return_from_snake_pit"),
-BRANCH_ENTRANCE(DNGN_ENTER_ELF, "staircase to the Elven Halls"),
-BRANCH_EXIT(DNGN_RETURN_FROM_ELF, "staircase back to the Mines"),
+BRANCH_ENTRANCE(DNGN_ENTER_ELF, "staircase to the Elven Halls", "enter_elven_halls"),
+BRANCH_EXIT(DNGN_RETURN_FROM_ELF, "staircase back to the Mines", "return_from_elven_halls"),
-BRANCH_ENTRANCE(DNGN_ENTER_TOMB, "staircase to the Tomb"),
-BRANCH_EXIT(DNGN_RETURN_FROM_TOMB, "staircase back to the Crypt"),
+BRANCH_ENTRANCE(DNGN_ENTER_TOMB, "staircase to the Tomb", "enter_tomb"),
+BRANCH_EXIT(DNGN_RETURN_FROM_TOMB, "staircase back to the Crypt", "return_from_tomb"),
-BRANCH_ENTRANCE(DNGN_ENTER_SWAMP, "staircase to the Swamp"),
-BRANCH_EXIT(DNGN_RETURN_FROM_SWAMP, "staircase back to the Lair"),
+BRANCH_ENTRANCE(DNGN_ENTER_SWAMP, "staircase to the Swamp", "enter_swamp"),
+BRANCH_EXIT(DNGN_RETURN_FROM_SWAMP, "staircase back to the Lair", "return_from_swamp"),
-BRANCH_ENTRANCE(DNGN_ENTER_SHOALS, "staircase to the Shoals"),
-BRANCH_EXIT(DNGN_RETURN_FROM_SHOALS, "staircase back to the Lair"),
+BRANCH_ENTRANCE(DNGN_ENTER_SHOALS, "staircase to the Shoals", "enter_shoals"),
+BRANCH_EXIT(DNGN_RETURN_FROM_SHOALS, "staircase back to the Lair", "return_from_shoals"),
-BRANCH_ENTRANCE(DNGN_ENTER_SPIDER, "hole to the Spider Nest"),
-BRANCH_EXIT(DNGN_RETURN_FROM_SPIDER, "crawl-hole back to the Lair"),
+BRANCH_ENTRANCE(DNGN_ENTER_SPIDER, "hole to the Spider Nest", "enter_spider_nest"),
+BRANCH_EXIT(DNGN_RETURN_FROM_SPIDER, "crawl-hole back to the Lair", "return_from_spider_nest"),
-BRANCH_ENTRANCE(DNGN_ENTER_DEPTHS, "staircase to the Depths"),
-BRANCH_EXIT(DNGN_RETURN_FROM_DEPTHS, "staircase back to the Dungeon"),
+BRANCH_ENTRANCE(DNGN_ENTER_DEPTHS, "staircase to the Depths", "enter_depths"),
+BRANCH_EXIT(DNGN_RETURN_FROM_DEPTHS, "staircase back to the Dungeon", "return_from_depths"),
-#define ALTAR(enum, name, colour)\
+#define ALTAR(enum, name, vaultname, colour)\
{\
- enum, name,\
+ enum, name, vaultname,\
DCHAR_ALTAR, 0, 0,\
colour, DARKGREY, colour, colour, colour,\
FFT_NOTABLE, MF_FEATURE,\
}
-ALTAR(DNGN_UNKNOWN_ALTAR, "detected altar", BLACK),
-ALTAR(DNGN_ALTAR_ZIN, "glowing silver altar of Zin", LIGHTGREY),
-ALTAR(DNGN_ALTAR_SHINING_ONE, "glowing golden altar of the Shining One", YELLOW),
-ALTAR(DNGN_ALTAR_KIKUBAAQUDGHA, "ancient bone altar of Kikubaaqudgha", DARKGREY),
-ALTAR(DNGN_ALTAR_YREDELEMNUL, "basalt altar of Yredelemnul", ETC_UNHOLY),
-ALTAR(DNGN_ALTAR_XOM, "shimmering altar of Xom", ETC_RANDOM),
-ALTAR(DNGN_ALTAR_VEHUMET, "radiant altar of Vehumet", ETC_VEHUMET),
-ALTAR(DNGN_ALTAR_OKAWARU, "iron altar of Okawaru", CYAN),
-ALTAR(DNGN_ALTAR_MAKHLEB, "burning altar of Makhleb", ETC_FIRE),
-ALTAR(DNGN_ALTAR_SIF_MUNA, "deep blue altar of Sif Muna", BLUE),
-ALTAR(DNGN_ALTAR_TROG, "bloodstained altar of Trog", RED),
-ALTAR(DNGN_ALTAR_NEMELEX_XOBEH, "sparkling altar of Nemelex Xobeh", LIGHTMAGENTA),
-ALTAR(DNGN_ALTAR_ELYVILON, "white marble altar of Elyvilon", WHITE),
-ALTAR(DNGN_ALTAR_LUGONU, "corrupted altar of Lugonu", MAGENTA),
-ALTAR(DNGN_ALTAR_BEOGH, "roughly hewn altar of Beogh", ETC_BEOGH),
-ALTAR(DNGN_ALTAR_JIYVA, "viscous altar of Jiyva", ETC_SLIME),
-ALTAR(DNGN_ALTAR_FEDHAS, "blossoming altar of Fedhas", GREEN),
-ALTAR(DNGN_ALTAR_CHEIBRIADOS, "snail-covered altar of Cheibriados", LIGHTCYAN),
-ALTAR(DNGN_ALTAR_ASHENZARI, "shattered altar of Ashenzari", LIGHTRED),
-ALTAR(DNGN_ALTAR_DITHMENOS, "shadowy altar of Dithmenos", ETC_DITHMENOS),
-ALTAR(DNGN_ALTAR_GOZAG, "opulent altar of Gozag", ETC_GOLD), // for the Gold God!
-ALTAR(DNGN_ALTAR_QAZLAL, "stormy altar of Qazlal", ETC_ELEMENTAL),
-
-#define FOUNTAIN(enum, name, colour)\
+ALTAR(DNGN_UNKNOWN_ALTAR, "detected altar", "unknown_altar", BLACK),
+ALTAR(DNGN_ALTAR_ZIN, "glowing silver altar of Zin", "altar_zin", LIGHTGREY),
+ALTAR(DNGN_ALTAR_SHINING_ONE, "glowing golden altar of the Shining One", "altar_the_shining_one", YELLOW),
+ALTAR(DNGN_ALTAR_KIKUBAAQUDGHA, "ancient bone altar of Kikubaaqudgha", "altar_kikubaaqudgha", DARKGREY),
+ALTAR(DNGN_ALTAR_YREDELEMNUL, "basalt altar of Yredelemnul", "altar_yredelemnul", ETC_UNHOLY),
+ALTAR(DNGN_ALTAR_XOM, "shimmering altar of Xom", "altar_xom", ETC_RANDOM),
+ALTAR(DNGN_ALTAR_VEHUMET, "radiant altar of Vehumet", "altar_vehumet", ETC_VEHUMET),
+ALTAR(DNGN_ALTAR_OKAWARU, "iron altar of Okawaru", "altar_okawaru", CYAN),
+ALTAR(DNGN_ALTAR_MAKHLEB, "burning altar of Makhleb", "altar_makhleb", ETC_FIRE),
+ALTAR(DNGN_ALTAR_SIF_MUNA, "deep blue altar of Sif Muna", "altar_sif_muna", BLUE),
+ALTAR(DNGN_ALTAR_TROG, "bloodstained altar of Trog", "altar_trog", RED),
+ALTAR(DNGN_ALTAR_NEMELEX_XOBEH, "sparkling altar of Nemelex Xobeh", "altar_nemelex_xobeh", LIGHTMAGENTA),
+ALTAR(DNGN_ALTAR_ELYVILON, "white marble altar of Elyvilon", "altar_elyvilon", WHITE),
+ALTAR(DNGN_ALTAR_LUGONU, "corrupted altar of Lugonu", "altar_lugonu", MAGENTA),
+ALTAR(DNGN_ALTAR_BEOGH, "roughly hewn altar of Beogh", "altar_beogh", ETC_BEOGH),
+ALTAR(DNGN_ALTAR_JIYVA, "viscous altar of Jiyva", "altar_jiyva", ETC_SLIME),
+ALTAR(DNGN_ALTAR_FEDHAS, "blossoming altar of Fedhas", "altar_fedhas", GREEN),
+ALTAR(DNGN_ALTAR_CHEIBRIADOS, "snail-covered altar of Cheibriados", "altar_cheibriados", LIGHTCYAN),
+ALTAR(DNGN_ALTAR_ASHENZARI, "shattered altar of Ashenzari", "altar_ashenzari", LIGHTRED),
+ALTAR(DNGN_ALTAR_DITHMENOS, "shadowy altar of Dithmenos", "altar_dithmenos", ETC_DITHMENOS),
+ALTAR(DNGN_ALTAR_GOZAG, "opulent altar of Gozag", "altar_gozag", ETC_GOLD), // for the Gold God!
+ALTAR(DNGN_ALTAR_QAZLAL, "stormy altar of Qazlal", "altar_qazlal", ETC_ELEMENTAL),
+
+#define FOUNTAIN(enum, name, vaultname, colour)\
{\
- enum, name,\
+ enum, name, vaultname,\
DCHAR_FOUNTAIN, 0, 0,\
COLOUR_IS(colour),\
FFT_NONE, MF_FEATURE,\
}
-FOUNTAIN(DNGN_FOUNTAIN_BLUE, "fountain of clear blue water", BLUE),
-FOUNTAIN(DNGN_FOUNTAIN_SPARKLING, "fountain of sparkling water", LIGHTBLUE),
-FOUNTAIN(DNGN_FOUNTAIN_BLOOD, "fountain of blood", RED),
-FOUNTAIN(DNGN_DRY_FOUNTAIN, "dry fountain", LIGHTGREY),
+FOUNTAIN(DNGN_FOUNTAIN_BLUE, "fountain of clear blue water", "fountain_blue", BLUE),
+FOUNTAIN(DNGN_FOUNTAIN_SPARKLING, "fountain of sparkling water", "fountain_sparkling", LIGHTBLUE),
+FOUNTAIN(DNGN_FOUNTAIN_BLOOD, "fountain of blood", "fountain_blood", RED),
+FOUNTAIN(DNGN_DRY_FOUNTAIN, "dry fountain", "dry_fountain", LIGHTGREY),
#if TAG_MAJOR_VERSION == 34
-FOUNTAIN(DNGN_DRY_FOUNTAIN_BLUE, "dry fountain", LIGHTGREY),
-FOUNTAIN(DNGN_DRY_FOUNTAIN_SPARKLING, "dry fountain", LIGHTGREY),
-FOUNTAIN(DNGN_DRY_FOUNTAIN_BLOOD, "dry fountain", LIGHTGREY),
+FOUNTAIN(DNGN_DRY_FOUNTAIN_BLUE, "dry fountain", "non-fountain_blue", LIGHTGREY),
+FOUNTAIN(DNGN_DRY_FOUNTAIN_SPARKLING, "dry fountain", "non-fountain_sparkling", LIGHTGREY),
+FOUNTAIN(DNGN_DRY_FOUNTAIN_BLOOD, "dry fountain", "non-fountain_blood", LIGHTGREY),
#endif
{
- DNGN_TELEPORTER, "short-range portal",
+ DNGN_TELEPORTER, "short-range portal", "teleporter",
DCHAR_TELEPORTER, 0, 0,
COLOUR_AND_MAP(YELLOW),
FFT_NONE, MF_FEATURE,
},
{
- DNGN_SEALED_STAIRS_UP, "sealed passage leading up",
+ DNGN_SEALED_STAIRS_UP, "sealed passage leading up", "sealed_stair_up",
DCHAR_STAIRS_UP, 0, 0,
COLOUR_AND_MAP(LIGHTGREEN),
FFT_NONE, MF_STAIR_UP,
},
{
- DNGN_SEALED_STAIRS_DOWN, "sealed passage leading down",
+ DNGN_SEALED_STAIRS_DOWN, "sealed passage leading down", "sealed_stair_down",
DCHAR_STAIRS_DOWN, 0, 0,
COLOUR_AND_MAP(LIGHTGREEN),
FFT_NONE, MF_STAIR_DOWN,
},
{
- DNGN_ABYSSAL_STAIR, "gateway leading deeper into the Abyss",
+ DNGN_ABYSSAL_STAIR, "gateway leading deeper into the Abyss", "abyssal_stair",
DCHAR_STAIRS_DOWN, 0, 0,
COLOUR_AND_MAP(LIGHTCYAN),
FFT_NONE, MF_STAIR_BRANCH,
diff --git a/crawl-ref/source/feature.cc b/crawl-ref/source/feature.cc
index cfd4138503..c3344a53cb 100644
--- a/crawl-ref/source/feature.cc
+++ b/crawl-ref/source/feature.cc
@@ -23,7 +23,7 @@ static feature_def invis_fd, cloud_fd;
void init_fd(feature_def &fd)
{
fd.feat = DNGN_UNSEEN;
- fd.name = "";
+ fd.name = fd.vaultname = "";
fd.dchar = NUM_DCHAR_TYPES;
fd.symbol = fd.magic_symbol = 0;
fd.colour = fd.seen_colour = fd.em_colour = fd.seen_em_colour = BLACK;
diff --git a/crawl-ref/source/feature.h b/crawl-ref/source/feature.h
index 90c66fb7ee..d22104e838 100644
--- a/crawl-ref/source/feature.h
+++ b/crawl-ref/source/feature.h
@@ -7,6 +7,7 @@ struct feature_def
{
dungeon_feature_type feat;
const char* name;
+ const char* vaultname; // used for KFEAT and &(
dungeon_char_type dchar; // used for creating symbol
ucs_t symbol; // symbol used for seen terrain
ucs_t magic_symbol; // symbol used for magic-mapped terrain
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index b8ff2eef2b..ebc0798d40 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -1503,146 +1503,27 @@ string stair_climb_verb(dungeon_feature_type feat)
return "pass through";
}
-static const char *dngn_feature_names[] =
-{
-"unseen", "closed_door", "runed_door", "sealed_door",
-"tree", "metal_wall", "green_crystal_wall", "rock_wall",
-"slimy_wall", "stone_wall", "permarock_wall",
-"clear_rock_wall", "clear_stone_wall", "clear_permarock_wall", "iron_grate",
-"open_sea", "endless_lava", "orcish_idol",
-"granite_statue", "malign_gateway", "", "", "", "", "", "", "", "", "", "",
-
-// DNGN_MINMOVE
-"lava", "deep_water",
-
-// DNGN_MINWALK
-"shallow_water", "floor", "open_door",
-"trap_mechanical", "trap_teleport", "shaft", "trap_web",
-"undiscovered_trap", "enter_shop", "abandoned_shop",
-
-"stone_stairs_down_i", "stone_stairs_down_ii",
-"stone_stairs_down_iii", "escape_hatch_down", "stone_stairs_up_i",
-"stone_stairs_up_ii", "stone_stairs_up_iii", "escape_hatch_up",
-
-"enter_dis", "enter_gehenna", "enter_cocytus",
-"enter_tartarus", "enter_abyss", "exit_abyss",
-#if TAG_MAJOR_VERSION > 34
-"abyssal_stair",
-#endif
-"stone_arch", "enter_pandemonium", "exit_pandemonium",
-"transit_pandemonium", "exit_dungeon", "exit_through_abyss",
-"exit_hell", "enter_hell", "enter_labyrinth",
-"teleporter",
-#if TAG_MAJOR_VERSION == 34
-"enter_portal_vault", "exit_portal_vault",
-#endif
-"expired_portal",
-
-#if TAG_MAJOR_VERSION == 34
-"enter_dwarven_hall",
-#endif
-"enter_orcish_mines", "enter_lair",
-"enter_slime_pits", "enter_vaults", "enter_crypt",
-#if TAG_MAJOR_VERSION == 34
-"enter_hall_of_blades",
-#endif
-"enter_zot", "enter_temple",
-"enter_snake_pit", "enter_elven_halls", "enter_tomb",
-"enter_swamp", "enter_shoals", "enter_spider_nest",
-#if TAG_MAJOR_VERSION == 34
-"enter_forest",
-#endif
-"enter_depths",
-
-#if TAG_MAJOR_VERSION == 34
-"return_from_dwarven_hall",
-#endif
-"return_from_orcish_mines",
-"return_from_lair", "return_from_slime_pits",
-"return_from_vaults", "return_from_crypt",
-#if TAG_MAJOR_VERSION == 34
-"return_from_hall_of_blades",
-#endif
-"return_from_zot",
-"return_from_temple", "return_from_snake_pit",
-"return_from_elven_halls", "return_from_tomb",
-"return_from_swamp", "return_from_shoals", "return_from_spider_nest",
-#if TAG_MAJOR_VERSION == 34
-"return_from_forest",
-#endif
-"return_from_depths",
-
-"altar_zin", "altar_the_shining_one", "altar_kikubaaqudgha",
-"altar_yredelemnul", "altar_xom", "altar_vehumet",
-"altar_okawaru", "altar_makhleb", "altar_sif_muna", "altar_trog",
-"altar_nemelex_xobeh", "altar_elyvilon", "altar_lugonu",
-"altar_beogh", "altar_jiyva", "altar_fedhas", "altar_cheibriados",
-"altar_ashenzari", "altar_dithmenos",
-#if TAG_MAJOR_VERSION > 34
-"altar_gozag", "altar_qazlal", "", "", "", "", "", "",
-#endif
-
-"fountain_blue", "fountain_sparkling", "fountain_blood",
-#if TAG_MAJOR_VERSION == 34
-"non-fountain_blue", "non-fountain_sparkling", "non-fountain_blood",
-#endif
-"dry_fountain",
-
-"explore_horizon",
-"unknown_altar", "unknown_portal",
-
-#if TAG_MAJOR_VERSION == 34
-"abyssal_stair",
-"badly_sealed_door",
-#endif
-
-"sealed_stair_up",
-"sealed_stair_down",
-
-"trap_alarm",
-"trap_zot",
-"passage_of_golubria",
-
-"enter_ziggurat",
-"enter_bazaar",
-"enter_trove",
-"enter_sewer",
-"enter_ossuary",
-"enter_bailey",
-"enter_ice_cave",
-"enter_volcano",
-"enter_wizlab",
-"enter_unused",
-"exit_ziggurat",
-"exit_bazaar",
-"exit_trove",
-"exit_sewer",
-"exit_ossuary",
-"exit_bailey",
-"exit_ice_cave",
-"exit_volcano",
-"exit_wizlab",
-"exit_labyrinth",
-"exit_unused",
-
-#if TAG_MAJOR_VERSION == 34
-"altar_gozag",
-"altar_qazlal",
-#endif
-};
-
+/** Find the feature with this name.
+ *
+ * @param name The name (not the user-visible one) to be matched.
+ * @returns DNGN_UNSEEN if name is "", DNGN_FLOOR if the name is for a
+ * dead/forbidden god, and the first entry in the enum with a
+ * matching name otherwise.
+ */
dungeon_feature_type dungeon_feature_by_name(const string &name)
{
- COMPILE_CHECK(ARRAYSZ(dngn_feature_names) == NUM_FEATURES);
-
if (name.empty())
return DNGN_UNSEEN;
- for (unsigned i = 0; i < ARRAYSZ(dngn_feature_names); ++i)
+ for (unsigned i = 0; i < NUM_FEATURES; ++i)
{
- if (dngn_feature_names[i] == name)
+ dungeon_feature_type feat = static_cast<dungeon_feature_type>(i);
+
+ if (!is_valid_feature_type(feat))
+ continue;
+
+ if (get_feature_def(feat).vaultname == name)
{
- dungeon_feature_type feat = static_cast<dungeon_feature_type>(i);
if (feat_is_altar(feat)
&& is_unavailable_god(feat_altar_god(feat)))
@@ -1657,29 +1538,45 @@ dungeon_feature_type dungeon_feature_by_name(const string &name)
return DNGN_UNSEEN;
}
+/** Find feature names that contain this name.
+ *
+ * @param name The string to be matched.
+ * @returns a list of matching names.
+ */
vector<string> dungeon_feature_matches(const string &name)
{
vector<string> matches;
- COMPILE_CHECK(ARRAYSZ(dngn_feature_names) == NUM_FEATURES);
if (name.empty())
return matches;
- for (unsigned i = 0; i < ARRAYSZ(dngn_feature_names); ++i)
- if (strstr(dngn_feature_names[i], name.c_str()))
- matches.push_back(dngn_feature_names[i]);
+ for (unsigned i = 0; i < NUM_FEATURES; ++i)
+ {
+ dungeon_feature_type feat = static_cast<dungeon_feature_type>(i);
+
+ if (!is_valid_feature_type(feat))
+ continue;
+
+ const char *featname = get_feature_def(feat).vaultname;
+ if (strstr(featname, name.c_str()))
+ matches.push_back(featname);
+ }
return matches;
}
+/** Get the lua/wizmode name for a feature.
+ *
+ * @param rfeat The feature type to be found.
+ * @returns NULL if rfeat is not defined, the vaultname of the corresponding
+ * feature_def otherwise.
+ */
const char *dungeon_feature_name(dungeon_feature_type rfeat)
{
- const unsigned feat = rfeat;
-
- if (feat >= ARRAYSZ(dngn_feature_names))
+ if (!is_valid_feature_type(rfeat))
return NULL;
- return dngn_feature_names[feat];
+ return get_feature_def(rfeat).vaultname;
}
void destroy_wall(const coord_def& p)