diff --git a/src/Episode3/DataIndexes.cc b/src/Episode3/DataIndexes.cc index f6525bcb..4bc550f2 100644 --- a/src/Episode3/DataIndexes.cc +++ b/src/Episode3/DataIndexes.cc @@ -1620,7 +1620,7 @@ JSON MapDefinition::CameraSpec::json() const { }); } -JSON MapDefinition::NPCDeck::json() const { +JSON MapDefinition::NPCDeck::json(uint8_t language) const { JSON card_ids_json = JSON::list(); for (size_t z = 0; z < this->card_ids.size(); z++) { if (this->card_ids[z] != 0xFFFF) { @@ -1628,27 +1628,27 @@ JSON MapDefinition::NPCDeck::json() const { } } return JSON::dict({ - {"Name", this->name.decode()}, + {"Name", this->deck_name.decode(language)}, {"CardIDs", std::move(card_ids_json)}, }); } -JSON MapDefinition::AIParams::json() const { +JSON MapDefinition::AIParams::json(uint8_t language) const { JSON params_json = JSON::list(); for (size_t z = 0; z < this->params.size(); z++) { params_json.emplace_back(this->params[z].load()); } return JSON::dict({ {"IsArkz", this->is_arkz ? true : false}, - {"Name", this->name.decode()}, + {"Name", this->ai_name.decode(language)}, {"CardIDs", std::move(params_json)}, }); } -JSON MapDefinition::DialogueSet::json() const { +JSON MapDefinition::DialogueSet::json(uint8_t language) const { JSON strings_json = JSON::list(); for (size_t z = 0; z < this->strings.size(); z++) { - strings_json.emplace_back(this->strings[z].decode()); + strings_json.emplace_back(this->strings[z].decode(language)); } return JSON::dict({ {"When", this->when.load()}, @@ -1779,7 +1779,7 @@ string MapDefinition::str(const CardIndex* card_index, uint8_t language) const { lines.emplace_back(string_printf(" map_xy: %hu %hu", this->map_x.load(), this->map_y.load())); for (size_t z = 0; z < 3; z++) { lines.emplace_back(string_printf(" npc_chars[%zu]:", z)); - lines.emplace_back(" name: " + this->npc_ai_params[z].name.decode(language)); + lines.emplace_back(" name: " + this->npc_ai_params[z].ai_name.decode(language)); lines.emplace_back(string_printf( " ai_params: (a1: %04hX %04hX, is_arkz: %02hhX, a2: %02hX %02hX %02hX)", this->npc_ai_params[z].unknown_a1[0].load(), this->npc_ai_params[z].unknown_a1[1].load(), @@ -1800,7 +1800,7 @@ string MapDefinition::str(const CardIndex* card_index, uint8_t language) const { this->npc_ai_params[z].params[0x7A].load(), this->npc_ai_params[z].params[0x7B].load(), this->npc_ai_params[z].params[0x7C].load(), this->npc_ai_params[z].params[0x7D].load())); lines.emplace_back(string_printf(" npc_decks[%zu]:", z)); - lines.emplace_back(" name: " + this->npc_decks[z].name.decode(language)); + lines.emplace_back(" name: " + this->npc_decks[z].deck_name.decode(language)); for (size_t w = 0; w < 0x20; w++) { uint16_t card_id = this->npc_decks[z].card_ids[w]; shared_ptr entry; @@ -2062,7 +2062,7 @@ MapDefinitionTrial::operator MapDefinition() const { // guess and fill in the field appropriately here. size_t num_npc_decks = 0; for (size_t z = 0; z < ret.npc_decks.size(); z++) { - if (!ret.npc_decks[z].name.empty()) { + if (!ret.npc_decks[z].deck_name.empty()) { num_npc_decks++; } } diff --git a/src/Episode3/DataIndexes.hh b/src/Episode3/DataIndexes.hh index 1645b1f8..44d59528 100644 --- a/src/Episode3/DataIndexes.hh +++ b/src/Episode3/DataIndexes.hh @@ -756,9 +756,9 @@ struct CardDefinition { // enormous comment? That's what this array stores. /* 009C */ parray drop_rates; - /* 00A0 */ pstring en_name; + /* 00A0 */ pstring en_name; /* 00B4 */ pstring jp_short_name; - /* 00BF */ pstring en_short_name; + /* 00BF */ pstring en_short_name; // These effects modify the card's behavior in various situations. Only // effects for which effect_num is not zero are used. /* 00C7 */ parray effects; @@ -793,7 +793,7 @@ struct CardDefinitionsFooter { } __attribute__((packed)); struct DeckDefinition { - /* 00 */ pstring name; + /* 00 */ pstring name; /* 10 */ be_uint32_t client_id; // 0-3 // List of card IDs. The card count is the number of nonzero entries here // before a zero entry (or 50 if no entries are nonzero). The first card ID is @@ -816,7 +816,7 @@ struct PlayerConfig { // The game splits this internally into two structures. The first column of // offsets is relative to the start of the first structure; the second column // is relative to the start of the second structure. - /* 0000:---- */ pstring rank_text; // From B7 command + /* 0000:---- */ pstring rank_text; // From B7 command /* 000C:---- */ parray unknown_a1; /* 0028:---- */ parray tech_menu_shortcut_entries; /* 0050:---- */ parray choice_search_config; @@ -878,7 +878,7 @@ struct PlayerConfig { /* 2124:1FD0 */ be_uint32_t online_clv_exp; // CLvOn = this / 100 struct PlayerReference { /* 00 */ be_uint32_t guild_card_number; - /* 04 */ pstring player_name; + /* 04 */ pstring name; } __attribute__((packed)); // This array is updated when a battle is started (via a 6xB4x05 command). The // client adds the opposing players' info to ths first two entries here if the @@ -1198,10 +1198,10 @@ struct MapDefinition { // .mnmd format; also the format of (decompressed) quests /* 1D68 */ parray unknown_a5; /* 1DDC */ Rules default_rules; - /* 1DF0 */ pstring name; - /* 1E04 */ pstring location_name; - /* 1E18 */ pstring quest_name; // == location_name if not a quest - /* 1E54 */ pstring description; + /* 1DF0 */ pstring name; + /* 1E04 */ pstring location_name; + /* 1E18 */ pstring quest_name; // == location_name if not a quest + /* 1E54 */ pstring description; // These fields describe where the map cursor on the preview screen should // scroll to @@ -1209,10 +1209,10 @@ struct MapDefinition { // .mnmd format; also the format of (decompressed) quests /* 1FE6 */ be_uint16_t map_y; struct NPCDeck { - /* 00 */ pstring name; + /* 00 */ pstring deck_name; /* 18 */ parray card_ids; // Last one appears to always be FFFF /* 58 */ - JSON json() const; + JSON json(uint8_t language) const; } __attribute__((packed)); /* 1FE8 */ parray npc_decks; // Unused if name[0] == 0 @@ -1224,11 +1224,11 @@ struct MapDefinition { // .mnmd format; also the format of (decompressed) quests /* 0000 */ parray unknown_a1; /* 0004 */ uint8_t is_arkz; /* 0005 */ parray unknown_a2; - /* 0008 */ pstring name; + /* 0008 */ pstring ai_name; // TODO: Figure out exactly how these are used and document here. /* 0018 */ parray params; /* 0114 */ - JSON json() const; + JSON json(uint8_t language) const; } __attribute__((packed)); /* 20F0 */ parray npc_ai_params; // Unused if name[0] == 0 @@ -1259,9 +1259,9 @@ struct MapDefinition { // .mnmd format; also the format of (decompressed) quests // appears after the battle if it's not blank. dispatch_message appears right // before the player chooses a deck if it's not blank; usually it says // something like "You can only dispatch ". - /* 2440 */ pstring before_message; - /* 25D0 */ pstring after_message; - /* 2760 */ pstring dispatch_message; + /* 2440 */ pstring before_message; + /* 25D0 */ pstring after_message; + /* 2760 */ pstring dispatch_message; struct DialogueSet { // Dialogue sets specify lines that COMs can say at certain points during @@ -1279,9 +1279,9 @@ struct MapDefinition { // .mnmd format; also the format of (decompressed) quests /* 0002 */ be_uint16_t percent_chance; // 0-100, or FFFF if unused // If the dialogue set activates, the game randomly chooses one of these // strings, excluding any that are empty or begin with the character '^'. - /* 0004 */ parray, 4> strings; + /* 0004 */ parray, 4> strings; /* 0104 */ - JSON json() const; + JSON json(uint8_t language) const; } __attribute__((packed)); // There are up to 0x10 of these per valid NPC, but only the first 13 of them @@ -1380,7 +1380,7 @@ struct MapDefinition { // .mnmd format; also the format of (decompressed) quests void assert_semantically_equivalent(const MapDefinition& other) const; std::string str(const CardIndex* card_index, uint8_t language) const; - JSON json() const; + JSON json(uint8_t language) const; } __attribute__((packed)); struct MapDefinitionTrial { @@ -1401,19 +1401,19 @@ struct MapDefinitionTrial { /* 1C68 */ parray, 0x10> modification_tiles; /* 1D68 */ parray unknown_a5; /* 1DD4 */ RulesTrial default_rules; - /* 1DE8 */ pstring name; - /* 1DFC */ pstring location_name; - /* 1E10 */ pstring quest_name; - /* 1E4C */ pstring description; + /* 1DE8 */ pstring name; + /* 1DFC */ pstring location_name; + /* 1E10 */ pstring quest_name; + /* 1E4C */ pstring description; /* 1FDC */ be_uint16_t map_x; /* 1FDE */ be_uint16_t map_y; /* 1FE0 */ parray npc_decks; /* 20E8 */ parray npc_ai_params; /* 2424 */ parray unknown_a7; /* 242C */ parray npc_ai_params_entry_index; - /* 2438 */ pstring before_message; - /* 25C8 */ pstring after_message; - /* 2758 */ pstring dispatch_message; + /* 2438 */ pstring before_message; + /* 25C8 */ pstring after_message; + /* 2758 */ pstring dispatch_message; /* 28E8 */ parray, 3> dialogue_sets; /* 4148 */ parray reward_card_ids; /* 4168 */ be_int32_t win_level_override;