diff options
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/chardump.cc | 16 | ||||
-rw-r--r-- | crawl-ref/source/dat/clua/ziggurat.lua | 1 | ||||
-rw-r--r-- | crawl-ref/source/dat/crypt.des | 4 | ||||
-rw-r--r-- | crawl-ref/source/dat/hells.des | 2 | ||||
-rw-r--r-- | crawl-ref/source/dat/hive.des | 1 | ||||
-rw-r--r-- | crawl-ref/source/dat/lair.des | 2 | ||||
-rw-r--r-- | crawl-ref/source/dat/levdes.vim | 2 | ||||
-rw-r--r-- | crawl-ref/source/dat/shoals.des | 4 | ||||
-rw-r--r-- | crawl-ref/source/dat/vaults.des | 4 | ||||
-rw-r--r-- | crawl-ref/source/dat/zot.des | 9 | ||||
-rw-r--r-- | crawl-ref/source/dungeon.cc | 126 | ||||
-rw-r--r-- | crawl-ref/source/dungeon.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/place.cc | 13 | ||||
-rw-r--r-- | crawl-ref/source/place.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/player.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/tags.cc | 8 | ||||
-rw-r--r-- | crawl-ref/source/tags.h | 3 |
17 files changed, 189 insertions, 14 deletions
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc index 99bfe4cd94..8e2b12749b 100644 --- a/crawl-ref/source/chardump.cc +++ b/crawl-ref/source/chardump.cc @@ -28,6 +28,7 @@ #include "artefact.h" #include "debug.h" #include "describe.h" +#include "dungeon.h" #include "hiscores.h" #include "initfile.h" #include "itemprop.h" @@ -80,6 +81,7 @@ static void _sdump_newline(dump_params &); static void _sdump_overview(dump_params &); static void _sdump_hiscore(dump_params &); static void _sdump_monster_list(dump_params &); +static void _sdump_vault_list(dump_params &); static void _sdump_separator(dump_params &); #ifdef CLUA_BINDINGS static void _sdump_lua(dump_params &); @@ -133,6 +135,7 @@ static dump_section_handler dump_handlers[] = { { "overview", _sdump_overview }, { "hiscore", _sdump_hiscore }, { "monlist", _sdump_monster_list }, + { "vaults", _sdump_vault_list }, // Conveniences for the .crawlrc artist. { "", _sdump_newline }, @@ -1142,6 +1145,19 @@ static void _sdump_monster_list(dump_params &par) par.text += "\n\n"; } +static void _sdump_vault_list(dump_params &par) +{ + if (par.full_id || par.se +#ifdef WIZARD + || you.wizard +#endif + ) + { + par.text += "Vault maps used:\n\n"; + par.text += dump_vault_maps(); + } +} + static void _sdump_mutations(dump_params &par) { std::string &text(par.text); diff --git a/crawl-ref/source/dat/clua/ziggurat.lua b/crawl-ref/source/dat/clua/ziggurat.lua index 74e7029b3e..ba35595d70 100644 --- a/crawl-ref/source/dat/clua/ziggurat.lua +++ b/crawl-ref/source/dat/clua/ziggurat.lua @@ -119,6 +119,7 @@ end function ziggurat_level(e) e.tags("ziggurat") e.tags("allow_dup") + e.tags("no_dump") e.orient("encompass") if crawl.game_started() then diff --git a/crawl-ref/source/dat/crypt.des b/crawl-ref/source/dat/crypt.des index 7c883eb520..bd0fb16f45 100644 --- a/crawl-ref/source/dat/crypt.des +++ b/crawl-ref/source/dat/crypt.des @@ -784,6 +784,7 @@ PLACE: Tomb:1 BFLAGS: no_tele_control ORIENT: encompass +TAGS: no_dump # SHUFFLE: ([{, AB), ]}, FIJKL/fijkl, _- SUBST: A=|*, B=|* @@ -885,6 +886,7 @@ NAME: tomb_2 PLACE: Tomb:2 # Can be rotated! ORIENT: encompass +TAGS: no_dump # NSUBST: A = [ / ' SHUFFLE: Ww/Yy/Zz, Uu/Vv, Qq/Rr/Ss @@ -992,7 +994,7 @@ ENDMAP NAME: tomb_3 PLACE: Tomb:3 ORIENT: encompass -TAGS: no_rotate +TAGS: no_rotate no_dump # SUBST: ' : " $ ':80 SUBST: ' = " $ diff --git a/crawl-ref/source/dat/hells.des b/crawl-ref/source/dat/hells.des index 6122bc4027..2506875d95 100644 --- a/crawl-ref/source/dat/hells.des +++ b/crawl-ref/source/dat/hells.des @@ -317,7 +317,7 @@ ENDMAP NAME: vestibule_of_hell PLACE: Hell ORIENT: encompass -TAGS: no_rotate +TAGS: no_rotate no_dump MARKER: D=feat:enter_dis MARKER: G=feat:enter_gehenna MARKER: C=feat:enter_cocytus diff --git a/crawl-ref/source/dat/hive.des b/crawl-ref/source/dat/hive.des index 73a175718a..dea4ab62ae 100644 --- a/crawl-ref/source/dat/hive.des +++ b/crawl-ref/source/dat/hive.des @@ -476,6 +476,7 @@ ENDMAP NAME: beehive PLACE: Hive:2 ORIENT: encompass +TAGS: no_dump MONS: queen bee, killer bee, killer bee larva, plant, yellow wasp MONS: random, random KITEM: R = w:2 honeycomb / w:1 royal jelly diff --git a/crawl-ref/source/dat/lair.des b/crawl-ref/source/dat/lair.des index 3b921d8780..cce7bc7266 100644 --- a/crawl-ref/source/dat/lair.des +++ b/crawl-ref/source/dat/lair.des @@ -716,7 +716,7 @@ ENDMAP NAME: slime_pit PLACE: Slime:6 ORIENT: encompass -TAGS: no_rotate +TAGS: no_rotate no_dump MONS: the royal jelly MONS: acid blob MONS: great orb of eyes / nothing diff --git a/crawl-ref/source/dat/levdes.vim b/crawl-ref/source/dat/levdes.vim index b46c67d2b7..465d23f946 100644 --- a/crawl-ref/source/dat/levdes.vim +++ b/crawl-ref/source/dat/levdes.vim @@ -55,7 +55,7 @@ syn keyword desDeclarator NAME: ORIENT: DEPTH: PLACE: MONS: FLAGS: default-depth syn keyword desOrientation encompass north south east west northeast northwest southeast southwest float syn keyword desOrientation no_hmirror no_vmirror no_rotate syn keyword desOrientation entry pan lab bazaar allow_dup dummy mini_float minotaur -syn keyword desOrientation no_pool_fixup no_wall_fixup no_monster_gen generate_awake no_item_gen no_tele_control not_mappable no_magic_map no_secret_doors generate_loot +syn keyword desOrientation no_pool_fixup no_wall_fixup no_monster_gen generate_awake no_item_gen no_tele_control not_mappable no_magic_map no_secret_doors generate_loot no_dump syn keyword desOrientation Temple Orc Elf Lair Swamp Shoal Slime Snake Hive Vault Blade Crypt Tomb Hell Dis Geh Coc Tar syn keyword desOrientation D: contained diff --git a/crawl-ref/source/dat/shoals.des b/crawl-ref/source/dat/shoals.des index 8928e8009d..4983347ecd 100644 --- a/crawl-ref/source/dat/shoals.des +++ b/crawl-ref/source/dat/shoals.des @@ -238,7 +238,7 @@ ENDMAP # # Shoal:$ is hand-hacked to force lots of minivaults. NAME: shoalhut_rune -TAGS: shoal_rune water_ok +TAGS: shoal_rune water_ok no_dump SHUFFLE: ABCD SUBST: A:x, B:x, C:x=, D=+ LROCKTILE: wall_vines @@ -258,7 +258,7 @@ ENDMAP # Shoal:$ is hand-hacked to force lots of minivaults. NAME: shoalhut_norune DEPTH: Shoal:$ -TAGS: allow_dup water_ok shoal +TAGS: allow_dup water_ok shoal no_dump SHUFFLE: ABCD SUBST: A:x, B:x, C:x=, D=+ MAP diff --git a/crawl-ref/source/dat/vaults.des b/crawl-ref/source/dat/vaults.des index 660fcd70bf..a037fc0d31 100644 --- a/crawl-ref/source/dat/vaults.des +++ b/crawl-ref/source/dat/vaults.des @@ -281,7 +281,7 @@ ENDMAP NAME: vaults_vault PLACE: Vault:8 ORIENT: encompass -TAGS: no_rotate +TAGS: no_rotate no_dump # # the rune's spot, occassionally put nasty on the rune NSUBST: O = O / o @@ -408,7 +408,7 @@ ENDMAP NAME: hall_of_blades PLACE: Blade ORIENT: north -TAGS: no_rotate +TAGS: no_rotate no_dump MONS: dancing weapon SHUFFLE: cv MAP diff --git a/crawl-ref/source/dat/zot.des b/crawl-ref/source/dat/zot.des index 8a8329cc40..a416dd2543 100644 --- a/crawl-ref/source/dat/zot.des +++ b/crawl-ref/source/dat/zot.des @@ -330,6 +330,7 @@ ENDMAP NAME: hall_of_Zot PLACE: Zot:5 ORIENT: north +TAGS: no_dump LFLAGS: no_tele_control MARKER: Z = lua:item_pickup_change_flags { \ level_flags="!no_tele_control", item="Orb of Zot" \ @@ -410,7 +411,7 @@ ENDMAP NAME: hall_of_Zot_1 PLACE: Zot:1 -TAGS: transparent +TAGS: transparent no_dump ORIENT: float LFLOORCOL: lightgrey LROCKCOL: lightgrey @@ -422,7 +423,7 @@ ENDMAP NAME: hall_of_Zot_2 PLACE: Zot:2 -TAGS: transparent +TAGS: transparent no_dump ORIENT: float LFLOORCOL: lightgrey LROCKCOL: blue @@ -434,7 +435,7 @@ ENDMAP NAME: hall_of_Zot_3 PLACE: Zot:3 -TAGS: transparent +TAGS: transparent no_dump ORIENT: float LFLOORCOL: blue LROCKCOL: lightblue @@ -446,7 +447,7 @@ ENDMAP NAME: hall_of_Zot_4 PLACE: Zot:4 -TAGS: transparent +TAGS: transparent no_dump ORIENT: float LFLOORCOL: lightblue LROCKCOL: magenta diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 4e3d68f95d..528fe317f4 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -56,6 +56,9 @@ #include "cio.h" // for cancelable_get_line() #endif +#define YOU_DUNGEON_VAULTS_KEY "you_dungeon_vaults_key" +#define YOU_PORTAL_VAULT_MAPS_KEY "you_portal_vault_maps_key" + spec_room lua_special_room_spec; int lua_special_room_level; @@ -235,6 +238,9 @@ static bool use_random_maps = true; static bool dgn_check_connectivity = false; static int dgn_zones = 0; +static CrawlHashTable _you_vault_list; +static std::string _portal_vault_map_name; + struct coloured_feature { dungeon_feature_type feature; @@ -311,10 +317,37 @@ bool builder(int level_number, int level_type) if (dgn_Build_Method.size() > 0 && dgn_Build_Method[0] == ' ') dgn_Build_Method = dgn_Build_Method.substr(1); + // Save information in the level's properties hash table + // so we can inlcude it in crash reports. env.properties[BUILD_METHOD_KEY] = dgn_Build_Method; env.properties[LAYOUT_TYPE_KEY] = dgn_Layout_Type; env.properties[LEVEL_ID_KEY] = level_id::current().describe(); + // Save information in the player's properties has table so + // we can include it in the character dump. + if (!_you_vault_list.empty()) + { + const std::string lev = level_id::current().describe(); + CrawlHashTable &all_vaults = + you.props[YOU_DUNGEON_VAULTS_KEY].get_table(); + + CrawlHashTable &this_level = all_vaults[lev].get_table(); + this_level = _you_vault_list; + } + else if (!_portal_vault_map_name.empty()) + { + CrawlVector &vault_maps = + you.props[YOU_PORTAL_VAULT_MAPS_KEY].get_vector(); + vault_maps.push_back(_portal_vault_map_name); + } + + if (you.level_type == LEVEL_PORTAL_VAULT) + { + CrawlVector &vault_names = + you.props[YOU_PORTAL_VAULT_NAMES_KEY].get_vector(); + vault_names.push_back(you.level_type_name); + } + dgn_Layout_Type.clear(); Level_Unique_Maps.clear(); Level_Unique_Tags.clear(); @@ -900,6 +933,8 @@ void dgn_reset_level() Level_Unique_Maps.clear(); Level_Unique_Tags.clear(); + _portal_vault_map_name.clear(); + _you_vault_list.clear(); dgn_Build_Method.clear(); dgn_Layout_Type.clear(); level_clear_vault_memory(); @@ -4317,7 +4352,9 @@ static bool _build_vaults(int level_number, const map_def *vault, // Must do this only after target_connections is finalised, or the vault // exits will not be correctly set. Level_Vaults.push_back(place); - remember_vault_placement(LEVEL_VAULTS_KEY, place); + remember_vault_placement(vault->has_tag("extra") + ? LEVEL_EXTRAS_KEY: LEVEL_VAULTS_KEY, + place); #ifdef DEBUG_DIAGNOSTICS if (crawl_state.map_stat_gen) @@ -8343,6 +8380,9 @@ void vault_placement::draw_at(const coord_def &c) void remember_vault_placement(std::string key, vault_placement &place) { + // First we store some info on the vault into the level's properties + // hash table, so that if there's a crash the crash report can list + // them all. CrawlHashTable &table = env.properties[key].get_table(); std::string name = make_stringf("%s [%d]", place.map.name.c_str(), @@ -8356,4 +8396,88 @@ void remember_vault_placement(std::string key, vault_placement &place) place.num_runes, place.rune_subst); table[name] = place_str; + + // Second we setup some info to be saved in the player's properties + // hash table, so the information can be included in the character + // dump when the player dies/quits/wins. + if (you.level_type == LEVEL_DUNGEON + && !place.map.has_tag("layout") + && !place.map.has_tag_suffix("dummy") + && !place.map.has_tag("no_dump")) + { + const std::string type = place.map.has_tag("extra") + ? "extra" : "normal"; + + _you_vault_list[type].get_vector().push_back(place.map.name); + } + else if (you.level_type == LEVEL_PORTAL_VAULT + && place.map.orient == MAP_ENCOMPASS + && !place.map.has_tag("no_dump")) + { + _portal_vault_map_name = place.map.name; + } } + +std::string dump_vault_maps() +{ + std::string out = ""; + + std::vector<level_id> levels = all_dungeon_ids(); + + CrawlHashTable &vaults = you.props[YOU_DUNGEON_VAULTS_KEY].get_table(); + for (unsigned int i = 0; i < levels.size(); i++) + { + level_id &lid = levels[i]; + std::string lev = lid.describe(); + + if (!vaults.exists(lev)) + continue; + + out += lid.describe() + ":\n"; + + CrawlHashTable &lists = vaults[lev].get_table(); + + const char *types[] = {"normal", "extra"}; + for (int j = 0; j < 2; j++) + { + if (!lists.exists(types[j])) + continue; + + out += " "; + out += types[j]; + out += ": "; + + CrawlVector &vec = lists[types[j]].get_vector(); + + for (unsigned int k = 0, size = vec.size(); k < size; k++) + { + out += vec[k].get_string(); + if (k < (size - 1)) + out += ", "; + } + + out += "\n"; + } + out += "\n"; + } + CrawlVector &portals = you.props[YOU_PORTAL_VAULT_MAPS_KEY].get_vector(); + + if (!portals.empty()) + { + out += "\n"; + + out += "Portal vault maps: "; + + for (unsigned int i = 0, size = portals.size(); i < size; i++) + { + out += portals[i].get_string(); + + if (i < (size - 1)) + out += ", "; + } + + out += "\n\n"; + } + return (out); +} + diff --git a/crawl-ref/source/dungeon.h b/crawl-ref/source/dungeon.h index 75f5d641c5..f6932d1cb6 100644 --- a/crawl-ref/source/dungeon.h +++ b/crawl-ref/source/dungeon.h @@ -27,6 +27,8 @@ #define LEVEL_EXTRAS_KEY "level_extras_key" #define LEVEL_ID_KEY "level_id_key" +#define YOU_PORTAL_VAULT_NAMES_KEY "you_portal_vault_names_key" + enum portal_type { PORTAL_NONE = 0, @@ -423,4 +425,6 @@ inline int count_neighbours(const coord_def& p, dungeon_feature_type feat) } void remember_vault_placement(std::string key, vault_placement &place); + +std::string dump_vault_maps(); #endif diff --git a/crawl-ref/source/place.cc b/crawl-ref/source/place.cc index 9322716835..2064fb0dfb 100644 --- a/crawl-ref/source/place.cc +++ b/crawl-ref/source/place.cc @@ -198,3 +198,16 @@ bool level_type_is_stash_trackable(level_area_type type) { return (type != LEVEL_ABYSS && type != LEVEL_LABYRINTH); } + +std::vector<level_id> all_dungeon_ids() +{ + std::vector<level_id> out; + for (int i = 0; i < NUM_BRANCHES; i++) + { + const Branch &branch = branches[i]; + + for (int depth = 1; depth <= branch.depth; depth++) + out.push_back(level_id(branch.id, depth)); + } + return (out); +} diff --git a/crawl-ref/source/place.h b/crawl-ref/source/place.h index 47dd89f3c4..092a737b6e 100644 --- a/crawl-ref/source/place.h +++ b/crawl-ref/source/place.h @@ -48,4 +48,6 @@ bool level_type_exits_down(level_area_type type); bool level_type_allows_followers(level_area_type type); bool level_type_is_stash_trackable(level_area_type type); +std::vector<level_id> all_dungeon_ids(); + #endif diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index e8250fc3ac..bd07a101c8 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -278,6 +278,8 @@ public: int escaped_death_cause; std::string escaped_death_aux; + CrawlHashTable props; + protected: FixedVector<PlaceInfo, NUM_BRANCHES> branch_info; FixedVector<PlaceInfo, NUM_LEVEL_AREA_TYPES - 1> non_branch_info; diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index 91fe0c0643..ab02149019 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -1020,6 +1020,8 @@ static void tag_construct_you(writer &th) std::string revision = "Git:"; revision += Version::Long(); marshallString(th, revision); + + you.props.write(th); } static void tag_construct_you_items(writer &th) @@ -1468,6 +1470,12 @@ static void tag_read_you(reader &th, char minorVersion) std::string rev_str = unmarshallString(th); UNUSED(rev_str); } + + if (minorVersion >= TAG_MINOR_YOU_PROP) + { + you.props.clear(); + you.props.read(th); + } } static void tag_read_you_items(reader &th, char minorVersion) diff --git a/crawl-ref/source/tags.h b/crawl-ref/source/tags.h index 4f0fcf4116..3bb38318fd 100644 --- a/crawl-ref/source/tags.h +++ b/crawl-ref/source/tags.h @@ -57,7 +57,8 @@ enum tag_minor_version TAG_MINOR_TRANS = 7, // Keep track of cancellable transformations. TAG_MINOR_GITREV = 8, // Removed SVN revision and added Git revision. TAG_MINOR_DSTRAITS = 9, // Pre-calculate demonspawn mutations - TAG_MINOR_VERSION = 9 // Current version. (Keep equal to max.) + TAG_MINOR_YOU_PROP = 10, // Player class has CrawlHashTable + TAG_MINOR_VERSION = 10 // Current version. (Keep equal to max.) }; |