From 6e80ccca546ba7bc6797683675715ffdb84720cc Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Wed, 1 Mar 2023 00:25:30 -0800 Subject: [PATCH] document deck restrictions in Ep3 quest format --- src/Episode3/DataIndex.cc | 44 +++++++++++++++++++++++++++++++++++++++ src/Episode3/DataIndex.hh | 35 ++++++++++++++++++++++++++++++- 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/src/Episode3/DataIndex.cc b/src/Episode3/DataIndex.cc index 257c8836..5a3ea6a9 100644 --- a/src/Episode3/DataIndex.cc +++ b/src/Episode3/DataIndex.cc @@ -1176,6 +1176,50 @@ string MapDefinition::str(const DataIndex* data_index) const { } lines.emplace_back(" a9=" + format_data_string(this->unknown_a9.data(), this->unknown_a9.bytes())); lines.emplace_back(" a11=" + format_data_string(this->unknown_a11.data(), this->unknown_a11.bytes())); + lines.emplace_back(" unavailable_sc_cards=" + format_data_string(this->unavailable_sc_cards.data(), this->unavailable_sc_cards.bytes())); + for (size_t z = 0; z < 4; z++) { + string player_type; + switch (this->entry_states[z].player_type) { + case 0x00: + player_type = "Player"; + break; + case 0x01: + player_type = "Player/COM"; + break; + case 0x02: + player_type = "COM"; + break; + case 0x03: + player_type = "FIXED_COM"; + break; + case 0x04: + player_type = "NONE"; + break; + case 0xFF: + player_type = "FREE"; + break; + default: + player_type = string_printf("(%02hhX)", this->entry_states[z].player_type); + break; + } + string deck_type; + switch (this->entry_states[z].deck_type) { + case 0x00: + deck_type = "HERO ONLY"; + break; + case 0x01: + deck_type = "DARK ONLY"; + break; + case 0xFF: + deck_type = "any deck allowed"; + break; + default: + deck_type = string_printf("(%02hhX)", this->entry_states[z].deck_type); + break; + } + lines.emplace_back(string_printf( + " entry_states[%zu] = %s / %s", z, player_type.c_str(), deck_type.c_str())); + } return join(lines, "\n"); } diff --git a/src/Episode3/DataIndex.hh b/src/Episode3/DataIndex.hh index 3590793b..2991cef0 100644 --- a/src/Episode3/DataIndex.hh +++ b/src/Episode3/DataIndex.hh @@ -847,7 +847,40 @@ struct MapDefinition { // .mnmd format; also the format of (decompressed) quests /* 59B0 */ parray reward_card_ids; /* 59D0 */ parray unknown_a9; /* 59DC */ uint8_t unknown_a10; - /* 59DD */ parray unknown_a11; + /* 59DD */ parray unknown_a11; + // This array specifies which SC characters can't participate in the quest + // (that is, the player is not allowed to choose decks with these SC cards). + // The values in this array don't match the SC card IDs, however: + // 0000 => Guykild (0005) 000C => Hyze (0117) + // 0001 => Kylria (0006) 000D => Rufina (0118) + // 0002 => Saligun (0110) 000E => Peko (0119) + // 0003 => Relmitos (0111) 000F => Creinu (011A) + // 0004 => Kranz (0002) 0010 => Reiz (011B) + // 0005 => Sil'fer (0004) 0011 => Lura (0007) + // 0006 => Ino'lis (0003) 0012 => Break (0008) + // 0007 => Viviana (0112) 0013 => Rio (011C) + // 0008 => Teifu (0113) 0014 => Endu (0116) + // 0009 => Orland (0001) 0015 => Memoru (011D) + // 000A => Stella (0114) 0016 => K.C. (011E) + // 000B => Glustar (0115) 0017 => Ohgun (011F) + // Unused entries in this array should be set to FFFF. + /* 59E0 */ parray unavailable_sc_cards; + struct EntryState { + // Values for player_type: + // 00 = Player (selectable by player, COM decks not allowed) + // 01 = Player/COM (selectable by player) + // 02 = COM (selectable by player, player decks not allowed) + // 03 = COM (not selectable by player; uses NPC deck) + // 04 = NONE (not selectable by player) + // FF = FREE (same as Player/COM, used in free battle mode) + uint8_t player_type; + // Values for deck_type: + // 00 = HERO ONLY + // 01 = DARK ONLY + // FF = any deck allowed + uint8_t deck_type; + } __attribute__((packed)); + /* 5A10 */ parray entry_states; /* 5A18 */ std::string str(const DataIndex* data_index = nullptr) const;