document more Ep3 NTE differences

This commit is contained in:
Martin Michelsen
2024-01-16 22:27:36 -08:00
parent 408bc1befc
commit c5e8d2c77c
4 changed files with 238 additions and 196 deletions
+83 -54
View File
@@ -6055,79 +6055,89 @@ struct G_SetMesetaSlotPrizeResult_BB_6xE3 {
// 6xB4x02: Update hand and equips // 6xB4x02: Update hand and equips
struct G_UpdateHand_GC_Ep3_6xB4x02 { struct G_UpdateHand_GC_Ep3_6xB4x02 {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateHand_GC_Ep3_6xB4x02) / 4, 0, 0x02, 0, 0, 0}; /* 00 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateHand_GC_Ep3_6xB4x02) / 4, 0, 0x02, 0, 0, 0};
le_uint16_t client_id = 0; /* 08 */ le_uint16_t client_id = 0;
le_uint16_t unused = 0; /* 0A */ le_uint16_t unused = 0;
Episode3::HandAndEquipState state; /* 0C */ Episode3::HandAndEquipState state;
/* 60 */
} __packed__; } __packed__;
// 6xB4x03: Set state flags // 6xB4x03: Set state flags
struct G_SetStateFlags_GC_Ep3_6xB4x03 { struct G_SetStateFlags_GC_Ep3_6xB4x03 {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_SetStateFlags_GC_Ep3_6xB4x03) / 4, 0, 0x03, 0, 0, 0}; /* 00 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_SetStateFlags_GC_Ep3_6xB4x03) / 4, 0, 0x03, 0, 0, 0};
Episode3::StateFlags state; /* 08 */ Episode3::StateFlags state;
/* 20 */
} __packed__; } __packed__;
// 6xB4x04: Update SC/FC short statuses // 6xB4x04: Update SC/FC short statuses
struct G_UpdateShortStatuses_GC_Ep3_6xB4x04 { struct G_UpdateShortStatuses_GC_Ep3_6xB4x04 {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateShortStatuses_GC_Ep3_6xB4x04) / 4, 0, 0x04, 0, 0, 0}; /* 0000 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateShortStatuses_GC_Ep3_6xB4x04) / 4, 0, 0x04, 0, 0, 0};
le_uint16_t client_id = 0; /* 0008 */ le_uint16_t client_id = 0;
le_uint16_t unused = 0; /* 000A */ le_uint16_t unused = 0;
// The slots in this array have heterogeneous meanings. Specifically: // The slots in this array have heterogeneous meanings. Specifically:
// [0] is the SC card status // [0] is the SC card status
// [1] through [6] are hand cards // [1] through [6] are hand cards
// [7] through [14] are set FC cards (items/creatures) // [7] through [14] are set FC cards (items/creatures)
// [15] is the set assist card // [15] is the set assist card
parray<Episode3::CardShortStatus, 0x10> card_statuses; /* 000C */ parray<Episode3::CardShortStatus, 0x10> card_statuses;
/* 010C */
} __packed__; } __packed__;
// 6xB4x05: Update map state // 6xB4x05: Update map state
// TODO: This structure is different on Ep3 NTE because the Rules structure is
// shorter. Define an appropriate structure for this.
struct G_UpdateMap_GC_Ep3_6xB4x05 { struct G_UpdateMap_GC_Ep3_6xB4x05 {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateMap_GC_Ep3_6xB4x05) / 4, 0, 0x05, 0, 0, 0}; /* 0000 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateMap_GC_Ep3_6xB4x05) / 4, 0, 0x05, 0, 0, 0};
Episode3::MapAndRulesState state; /* 0008 */ Episode3::MapAndRulesState state;
uint8_t start_battle = 0; /* 0140 */ uint8_t start_battle = 0;
parray<uint8_t, 3> unused; /* 0141 */ parray<uint8_t, 3> unused;
/* 0144 */
} __packed__; } __packed__;
// 6xB4x06: Apply condition effect // 6xB4x06: Apply condition effect
struct G_ApplyConditionEffect_GC_Ep3_6xB4x06 { struct G_ApplyConditionEffect_GC_Ep3_6xB4x06 {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_ApplyConditionEffect_GC_Ep3_6xB4x06) / 4, 0, 0x06, 0, 0, 0}; /* 00 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_ApplyConditionEffect_GC_Ep3_6xB4x06) / 4, 0, 0x06, 0, 0, 0};
Episode3::EffectResult effect; /* 08 */ Episode3::EffectResult effect;
/* 14 */
} __packed__; } __packed__;
// 6xB4x07: Set battle decks // 6xB4x07: Set battle decks
struct G_UpdateDecks_GC_Ep3_6xB4x07 { struct G_UpdateDecks_GC_Ep3_6xB4x07 {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateDecks_GC_Ep3_6xB4x07) / 4, 0, 0x07, 0, 0, 0}; /* 0000 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateDecks_GC_Ep3_6xB4x07) / 4, 0, 0x07, 0, 0, 0};
parray<uint8_t, 4> entries_present; /* 0008 */ parray<uint8_t, 4> entries_present;
parray<Episode3::DeckEntry, 4> entries; /* 000C */ parray<Episode3::DeckEntry, 4> entries;
/* 016C */
} __packed__; } __packed__;
// 6xB4x09: Set action state // 6xB4x09: Set action state
struct G_SetActionState_GC_Ep3_6xB4x09 { struct G_SetActionState_GC_Ep3_6xB4x09 {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_SetActionState_GC_Ep3_6xB4x09) / 4, 0, 0x09, 0, 0, 0}; /* 00 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_SetActionState_GC_Ep3_6xB4x09) / 4, 0, 0x09, 0, 0, 0};
le_uint16_t client_id = 0; /* 08 */ le_uint16_t client_id = 0;
parray<uint8_t, 2> unknown_a1; /* 0A */ parray<uint8_t, 2> unknown_a1;
Episode3::ActionState state; /* 0C */ Episode3::ActionState state;
/* 70 */
} __packed__; } __packed__;
// 6xB4x0A: Update action chain and metadata // 6xB4x0A: Update action chain and metadata
// This command seems to be unused; Sega's server implementation never sends it. // This command seems to be unused; Sega's server implementation never sends it.
struct G_UpdateActionChainAndMetadata_GC_Ep3_6xB4x0A { struct G_UpdateActionChainAndMetadata_GC_Ep3_6xB4x0A {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateActionChainAndMetadata_GC_Ep3_6xB4x0A) / 4, 0, 0x0A, 0, 0, 0}; /* 0000 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateActionChainAndMetadata_GC_Ep3_6xB4x0A) / 4, 0, 0x0A, 0, 0, 0};
le_uint16_t client_id = 0; /* 0008 */ le_uint16_t client_id = 0;
// set_index must be 0xFF, or be in the range [0, 9]. If it's 0xFF, all nine // set_index must be 0xFF, or be in the range [0, 9]. If it's 0xFF, all nine
// chains and metadatas are cleared for the client; otherwise, the provided // chains and metadatas are cleared for the client; otherwise, the provided
// chain and metadata are copied into the slot specified by set_index. // chain and metadata are copied into the slot specified by set_index.
int8_t set_index = 0; /* 000A */ int8_t set_index = 0;
uint8_t unused = 0; /* 000B */ uint8_t unused = 0;
Episode3::ActionChainWithConds chain; /* 000C */ Episode3::ActionChainWithConds chain;
Episode3::ActionMetadata metadata; /* 010C */ Episode3::ActionMetadata metadata;
/* 0180 */
} __packed__; } __packed__;
// 6xB3x0B / CAx0B: Redraw initial hand (immediately before battle) // 6xB3x0B / CAx0B: Redraw initial hand (immediately before battle)
@@ -6282,11 +6292,12 @@ struct G_StartBattle_GC_Ep3_6xB3x1D_CAx1D {
// 6xB4x1E: Action result // 6xB4x1E: Action result
struct G_ActionResult_GC_Ep3_6xB4x1E { struct G_ActionResult_GC_Ep3_6xB4x1E {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_ActionResult_GC_Ep3_6xB4x1E) / 4, 0, 0x1E, 0, 0, 0}; /* 00 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_ActionResult_GC_Ep3_6xB4x1E) / 4, 0, 0x1E, 0, 0, 0};
be_uint32_t sequence_num = 0; /* 08 */ be_uint32_t sequence_num = 0;
uint8_t error_code = 0; /* 0C */ uint8_t error_code = 0;
uint8_t response_phase = 0; /* 0D */ uint8_t response_phase = 0;
parray<uint8_t, 2> unused; /* 0E */ parray<uint8_t, 2> unused;
/* 10 */
} __packed__; } __packed__;
// 6xB4x1F: Set context token // 6xB4x1F: Set context token
@@ -6368,10 +6379,11 @@ struct G_EndDefenseList_GC_Ep3_6xB3x28_CAx28 {
// sends this. // sends this.
struct G_SetActionState_GC_Ep3_6xB4x29 { struct G_SetActionState_GC_Ep3_6xB4x29 {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_SetActionState_GC_Ep3_6xB4x29) / 4, 0, 0x29, 0, 0, 0}; /* 00 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_SetActionState_GC_Ep3_6xB4x29) / 4, 0, 0x29, 0, 0, 0};
uint8_t unknown_a1 = 0; /* 08 */ uint8_t unknown_a1 = 0;
parray<uint8_t, 3> unknown_a2; /* 09 */ parray<uint8_t, 3> unknown_a2;
Episode3::ActionState state; /* 0C */ Episode3::ActionState state;
/* 70 */
} __packed__; } __packed__;
// 6xB4x2A: Unknown // 6xB4x2A: Unknown
@@ -6397,12 +6409,13 @@ struct G_ExecLegacyCard_GC_Ep3_6xB3x2B_CAx2B {
// 6xB4x2C: Unknown // 6xB4x2C: Unknown
struct G_Unknown_GC_Ep3_6xB4x2C { struct G_Unknown_GC_Ep3_6xB4x2C {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_Unknown_GC_Ep3_6xB4x2C) / 4, 0, 0x2C, 0, 0, 0}; /* 00 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_Unknown_GC_Ep3_6xB4x2C) / 4, 0, 0x2C, 0, 0, 0};
uint8_t change_type = 0; /* 08 */ uint8_t change_type = 0;
uint8_t client_id = 0; /* 09 */ uint8_t client_id = 0;
parray<le_uint16_t, 3> card_refs; /* 0A */ parray<le_uint16_t, 3> card_refs;
Episode3::Location loc; /* 10 */ Episode3::Location loc;
parray<le_uint32_t, 2> unknown_a2; /* 14 */ parray<le_uint32_t, 2> unknown_a2;
/* 1C */
} __packed__; } __packed__;
// 6xB5x2D: Unknown // 6xB5x2D: Unknown
@@ -6482,10 +6495,11 @@ struct G_MoveSharedMenuCursor_GC_Ep3_6xB5x32 {
// 6xB4x33: Subtract ally ATK points (e.g. for photon blast) // 6xB4x33: Subtract ally ATK points (e.g. for photon blast)
struct G_SubtractAllyATKPoints_GC_Ep3_6xB4x33 { struct G_SubtractAllyATKPoints_GC_Ep3_6xB4x33 {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_SubtractAllyATKPoints_GC_Ep3_6xB4x33) / 4, 0, 0x33, 0, 0, 0}; /* 00 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_SubtractAllyATKPoints_GC_Ep3_6xB4x33) / 4, 0, 0x33, 0, 0, 0};
uint8_t client_id = 0; /* 08 */ uint8_t client_id = 0;
uint8_t ally_cost = 0; /* 09 */ uint8_t ally_cost = 0;
le_uint16_t card_ref = 0xFFFF; /* 0A */ le_uint16_t card_ref = 0xFFFF;
/* 0C */
} __packed__; } __packed__;
// 6xB3x34 / CAx34: Photon blast request // 6xB3x34 / CAx34: Photon blast request
@@ -6500,10 +6514,11 @@ struct G_PhotonBlastRequest_GC_Ep3_6xB3x34_CAx34 {
// 6xB4x35: Update photon blast status // 6xB4x35: Update photon blast status
struct G_PhotonBlastStatus_GC_Ep3_6xB4x35 { struct G_PhotonBlastStatus_GC_Ep3_6xB4x35 {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_PhotonBlastStatus_GC_Ep3_6xB4x35) / 4, 0, 0x35, 0, 0, 0}; /* 00 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_PhotonBlastStatus_GC_Ep3_6xB4x35) / 4, 0, 0x35, 0, 0, 0};
uint8_t client_id = 0; /* 08 */ uint8_t client_id = 0;
uint8_t accepted = 0; /* 09 */ uint8_t accepted = 0;
le_uint16_t card_ref = 0xFFFF; /* 0A */ le_uint16_t card_ref = 0xFFFF;
/* 0C */
} __packed__; } __packed__;
// 6xB5x36: Recreate player // 6xB5x36: Recreate player
@@ -6541,10 +6556,13 @@ struct G_CardCountsRequest_GC_Ep3_6xB5x38 {
} __packed__; } __packed__;
// 6xB4x39: Update all player statistics // 6xB4x39: Update all player statistics
// TODO: This command is different on Ep3 NTE because the PlayerBattleStats
// structure is different. Document the format here.
struct G_UpdateAllPlayerStatistics_GC_Ep3_6xB4x39 { struct G_UpdateAllPlayerStatistics_GC_Ep3_6xB4x39 {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateAllPlayerStatistics_GC_Ep3_6xB4x39) / 4, 0, 0x39, 0, 0, 0}; /* 00 */ G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateAllPlayerStatistics_GC_Ep3_6xB4x39) / 4, 0, 0x39, 0, 0, 0};
parray<Episode3::PlayerBattleStats, 4> stats; /* 08 */ parray<Episode3::PlayerBattleStats, 4> stats;
/* A8 */
} __packed__; } __packed__;
// 6xB3x3A / CAx3A: Overall time limit expired // 6xB3x3A / CAx3A: Overall time limit expired
@@ -6771,6 +6789,7 @@ struct G_EndTurn_GC_Ep3_6xB3x48_CAx48 {
// pointer to the card counts array, but Sega's implementation always passes // pointer to the card counts array, but Sega's implementation always passes
// null there, which skips the owned card count check. newserv uses this data at // null there, which skips the owned card count check. newserv uses this data at
// that callsite to implement one of the deck validity checks. // that callsite to implement one of the deck validity checks.
// Episode 3 Trial Edition does not send this command.
struct G_CardCounts_GC_Ep3_6xB3x49_CAx49 { struct G_CardCounts_GC_Ep3_6xB3x49_CAx49 {
G_CardServerDataCommandHeader header = {0xB3, sizeof(G_CardCounts_GC_Ep3_6xB3x49_CAx49) / 4, 0, 0x49, 0, 0, 0, 0, 0}; G_CardServerDataCommandHeader header = {0xB3, sizeof(G_CardCounts_GC_Ep3_6xB3x49_CAx49) / 4, 0, 0x49, 0, 0, 0, 0, 0};
@@ -6782,6 +6801,7 @@ struct G_CardCounts_GC_Ep3_6xB3x49_CAx49 {
} __packed__; } __packed__;
// 6xB4x4A: Unknown // 6xB4x4A: Unknown
// This command is not valid on Episode 3 Trial Edition.
// TODO: Document this from Episode 3 client/server disassembly // TODO: Document this from Episode 3 client/server disassembly
struct G_Unknown_GC_Ep3_6xB4x4A { struct G_Unknown_GC_Ep3_6xB4x4A {
@@ -6796,6 +6816,7 @@ struct G_Unknown_GC_Ep3_6xB4x4A {
} __packed__; } __packed__;
// 6xB4x4B: Set EX result values // 6xB4x4B: Set EX result values
// This command is not valid on Episode 3 Trial Edition.
// This command specifies how much EX the player should get based on the // This command specifies how much EX the player should get based on the
// difference between their level and the levels of the players they defeated or // difference between their level and the levels of the players they defeated or
// were defeated by. (For multi-player opponent teams, the average of the // were defeated by. (For multi-player opponent teams, the average of the
@@ -6828,6 +6849,7 @@ struct G_SetEXResultValues_GC_Ep3_6xB4x4B {
} __packed__; } __packed__;
// 6xB4x4C: Update action chain // 6xB4x4C: Update action chain
// This command is not valid on Episode 3 Trial Edition.
struct G_UpdateActionChain_GC_Ep3_6xB4x4C { struct G_UpdateActionChain_GC_Ep3_6xB4x4C {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateActionChain_GC_Ep3_6xB4x4C) / 4, 0, 0x4C, 0, 0, 0}; G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateActionChain_GC_Ep3_6xB4x4C) / 4, 0, 0x4C, 0, 0, 0};
@@ -6838,6 +6860,7 @@ struct G_UpdateActionChain_GC_Ep3_6xB4x4C {
} __packed__; } __packed__;
// 6xB4x4D: Update action metadata // 6xB4x4D: Update action metadata
// This command is not valid on Episode 3 Trial Edition.
struct G_UpdateActionMetadata_GC_Ep3_6xB4x4D { struct G_UpdateActionMetadata_GC_Ep3_6xB4x4D {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateActionMetadata_GC_Ep3_6xB4x4D) / 4, 0, 0x4D, 0, 0, 0}; G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateActionMetadata_GC_Ep3_6xB4x4D) / 4, 0, 0x4D, 0, 0, 0};
@@ -6848,6 +6871,7 @@ struct G_UpdateActionMetadata_GC_Ep3_6xB4x4D {
} __packed__; } __packed__;
// 6xB4x4E: Update card conditions // 6xB4x4E: Update card conditions
// This command is not valid on Episode 3 Trial Edition.
struct G_UpdateCardConditions_GC_Ep3_6xB4x4E { struct G_UpdateCardConditions_GC_Ep3_6xB4x4E {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateCardConditions_GC_Ep3_6xB4x4E) / 4, 0, 0x4E, 0, 0, 0}; G_CardBattleCommandHeader header = {0xB4, sizeof(G_UpdateCardConditions_GC_Ep3_6xB4x4E) / 4, 0, 0x4E, 0, 0, 0};
@@ -6858,6 +6882,7 @@ struct G_UpdateCardConditions_GC_Ep3_6xB4x4E {
} __packed__; } __packed__;
// 6xB4x4F: Clear set card conditions // 6xB4x4F: Clear set card conditions
// This command is not valid on Episode 3 Trial Edition.
struct G_ClearSetCardConditions_GC_Ep3_6xB4x4F { struct G_ClearSetCardConditions_GC_Ep3_6xB4x4F {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_ClearSetCardConditions_GC_Ep3_6xB4x4F) / 4, 0, 0x4F, 0, 0, 0}; G_CardBattleCommandHeader header = {0xB4, sizeof(G_ClearSetCardConditions_GC_Ep3_6xB4x4F) / 4, 0, 0x4F, 0, 0, 0};
@@ -6871,6 +6896,7 @@ struct G_ClearSetCardConditions_GC_Ep3_6xB4x4F {
} __packed__; } __packed__;
// 6xB4x50: Set trap tile locations // 6xB4x50: Set trap tile locations
// This command is not valid on Episode 3 Trial Edition.
struct G_SetTrapTileLocations_GC_Ep3_6xB4x50 { struct G_SetTrapTileLocations_GC_Ep3_6xB4x50 {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_SetTrapTileLocations_GC_Ep3_6xB4x50) / 4, 0, 0x50, 0, 0, 0}; G_CardBattleCommandHeader header = {0xB4, sizeof(G_SetTrapTileLocations_GC_Ep3_6xB4x50) / 4, 0, 0x50, 0, 0, 0};
@@ -6882,6 +6908,7 @@ struct G_SetTrapTileLocations_GC_Ep3_6xB4x50 {
} __packed__; } __packed__;
// 6xB4x51: Tournament match result // 6xB4x51: Tournament match result
// This command is not valid on Episode 3 Trial Edition.
// This is sent as soon as the battle result is determined (before the battle // This is sent as soon as the battle result is determined (before the battle
// results screen). If the client is in tournament mode (tournament_flag is 1 in // results screen). If the client is in tournament mode (tournament_flag is 1 in
// the StateFlags struct), then it will use this information to show the // the StateFlags struct), then it will use this information to show the
@@ -6910,6 +6937,7 @@ struct G_TournamentMatchResult_GC_Ep3_6xB4x51 {
} __packed__; } __packed__;
// 6xB4x52: Set game metadata // 6xB4x52: Set game metadata
// This command is not valid on Episode 3 Trial Edition.
// This is sent to all players in a game and all attached spectator teams when // This is sent to all players in a game and all attached spectator teams when
// any player joins or leaves any spectator team watching the same game. // any player joins or leaves any spectator team watching the same game.
@@ -6941,6 +6969,7 @@ struct G_SetGameMetadata_GC_Ep3_6xB4x52 {
} __packed__; } __packed__;
// 6xB4x53: Reject battle start request // 6xB4x53: Reject battle start request
// This command is not valid on Episode 3 Trial Edition.
// This is sent in response to a CAx1D command if setup isn't complete (e.g. if // This is sent in response to a CAx1D command if setup isn't complete (e.g. if
// some names/decks are missing or invalid). Under normal operation, this should // some names/decks are missing or invalid). Under normal operation, this should
// never happen. // never happen.
+14 -12
View File
@@ -11,27 +11,29 @@
namespace Episode3 { namespace Episode3 {
struct NameEntry { struct NameEntry {
parray<char, 0x10> name; /* 00 */ parray<char, 0x10> name;
uint8_t client_id; /* 10 */ uint8_t client_id;
uint8_t present; /* 11 */ uint8_t present;
uint8_t is_cpu_player; /* 12 */ uint8_t is_cpu_player;
uint8_t unused; /* 13 */ uint8_t unused;
/* 14 */
NameEntry(); NameEntry();
void clear(); void clear();
} __attribute__((packed)); } __attribute__((packed));
struct DeckEntry { struct DeckEntry {
pstring<TextEncoding::SJIS, 0x10> name; /* 00 */ pstring<TextEncoding::SJIS, 0x10> name;
le_uint32_t team_id; /* 10 */ le_uint32_t team_id;
parray<le_uint16_t, 31> card_ids; /* 14 */ parray<le_uint16_t, 31> card_ids;
// If the following flag is not set to 3, then the God Whim assist effect can // If the following flag is not set to 3, then the God Whim assist effect can
// use cards that are hidden from the player during deck building. The client // use cards that are hidden from the player during deck building. The client
// always sets this to 3, and it's not clear why this even exists. // always sets this to 3, and it's not clear why this even exists.
uint8_t god_whim_flag; /* 52 */ uint8_t god_whim_flag;
uint8_t unused1; /* 53 */ uint8_t unused1;
le_uint16_t player_level; /* 54 */ le_uint16_t player_level;
parray<uint8_t, 2> unused2; /* 56 */ parray<uint8_t, 2> unused2;
/* 58 */
DeckEntry(); DeckEntry();
void clear(); void clear();
+18 -16
View File
@@ -10,10 +10,11 @@
namespace Episode3 { namespace Episode3 {
struct MapState { struct MapState {
le_uint16_t width; /* 0000 */ le_uint16_t width;
le_uint16_t height; /* 0002 */ le_uint16_t height;
parray<parray<uint8_t, 0x10>, 0x10> tiles; /* 0004 */ parray<parray<uint8_t, 0x10>, 0x10> tiles;
parray<parray<uint8_t, 6>, 2> start_tile_definitions; /* 0104 */ parray<parray<uint8_t, 6>, 2> start_tile_definitions;
/* 0110 */
MapState(); MapState();
void clear(); void clear();
@@ -22,18 +23,19 @@ struct MapState {
} __attribute__((packed)); } __attribute__((packed));
struct MapAndRulesState { struct MapAndRulesState {
MapState map; /* 0000 */ MapState map;
uint8_t num_players; /* 0110 */ uint8_t num_players;
uint8_t unused1; /* 0111 */ uint8_t unused1;
uint8_t environment_number; /* 0112 */ uint8_t environment_number;
uint8_t num_players_per_team; /* 0113 */ uint8_t num_players_per_team;
uint8_t num_team0_players; /* 0114 */ uint8_t num_team0_players;
uint8_t unused2; /* 0115 */ uint8_t unused2;
le_uint16_t start_facing_directions; /* 0116 */ le_uint16_t start_facing_directions;
uint32_t unused3; /* 0118 */ uint32_t unused3;
le_uint32_t map_number; /* 011C */ le_uint32_t map_number;
uint32_t unused4; /* 0120 */ uint32_t unused4;
Rules rules; /* 0124 */ Rules rules;
/* 0138 */
MapAndRulesState(); MapAndRulesState();
void clear(); void clear();
+123 -114
View File
@@ -13,19 +13,20 @@ class Server;
class Card; class Card;
struct Condition { struct Condition {
ConditionType type; /* 00 */ ConditionType type;
uint8_t remaining_turns; /* 01 */ uint8_t remaining_turns;
int8_t a_arg_value; /* 02 */ int8_t a_arg_value;
uint8_t dice_roll_value; /* 03 */ uint8_t dice_roll_value;
uint8_t flags; /* 04 */ uint8_t flags;
uint8_t card_definition_effect_index; /* 05 */ uint8_t card_definition_effect_index;
le_uint16_t card_ref; /* 06 */ le_uint16_t card_ref;
le_int16_t value; /* 08 */ le_int16_t value;
le_uint16_t condition_giver_card_ref; /* 0A */ le_uint16_t condition_giver_card_ref;
uint8_t random_percent; /* 0C */ uint8_t random_percent;
int8_t value8; /* 0D */ int8_t value8;
uint8_t order; /* 0E */ uint8_t order;
uint8_t unknown_a8; /* 0F */ uint8_t unknown_a8;
/* 10 */
Condition(); Condition();
bool operator==(const Condition& other) const; bool operator==(const Condition& other) const;
@@ -38,16 +39,17 @@ struct Condition {
} __attribute__((packed)); } __attribute__((packed));
struct EffectResult { struct EffectResult {
le_uint16_t attacker_card_ref; /* 00 */ le_uint16_t attacker_card_ref;
le_uint16_t target_card_ref; /* 02 */ le_uint16_t target_card_ref;
int8_t value; /* 04 */ int8_t value;
int8_t current_hp; /* 05 */ int8_t current_hp;
int8_t ap; /* 06 */ int8_t ap;
int8_t tp; /* 07 */ int8_t tp;
uint8_t flags; /* 08 */ uint8_t flags;
int8_t operation; // May be a negative condition number /* 09 */ int8_t operation; // May be a negative condition number
uint8_t condition_index; /* 0A */ uint8_t condition_index;
uint8_t dice_roll_value; /* 0B */ uint8_t dice_roll_value;
/* 0C */
EffectResult(); EffectResult();
bool operator==(const EffectResult& other) const; bool operator==(const EffectResult& other) const;
@@ -59,13 +61,14 @@ struct EffectResult {
} __attribute__((packed)); } __attribute__((packed));
struct CardShortStatus { struct CardShortStatus {
le_uint16_t card_ref; /* 00 */ le_uint16_t card_ref;
le_uint16_t current_hp; /* 02 */ le_uint16_t current_hp;
le_uint32_t card_flags; /* 04 */ le_uint32_t card_flags;
Location loc; /* 08 */ Location loc;
le_uint16_t unused1; /* 0C */ le_uint16_t unused1;
int8_t max_hp; /* 0E */ int8_t max_hp;
uint8_t unused2; /* 0F */ uint8_t unused2;
/* 10 */
CardShortStatus(); CardShortStatus();
bool operator==(const CardShortStatus& other) const; bool operator==(const CardShortStatus& other) const;
@@ -78,14 +81,15 @@ struct CardShortStatus {
} __attribute__((packed)); } __attribute__((packed));
struct ActionState { struct ActionState {
le_uint16_t client_id; /* 00 */ le_uint16_t client_id;
uint8_t unused; /* 02 */ uint8_t unused;
Direction facing_direction; /* 03 */ Direction facing_direction;
le_uint16_t attacker_card_ref; /* 04 */ le_uint16_t attacker_card_ref;
le_uint16_t defense_card_ref; /* 06 */ le_uint16_t defense_card_ref;
parray<le_uint16_t, 4 * 9> target_card_refs; /* 08 */ parray<le_uint16_t, 4 * 9> target_card_refs;
parray<le_uint16_t, 9> action_card_refs; /* 50 */ parray<le_uint16_t, 9> action_card_refs;
le_uint16_t original_attacker_card_ref; /* 62 */ le_uint16_t original_attacker_card_ref;
/* 64 */
ActionState(); ActionState();
bool operator==(const ActionState& other) const; bool operator==(const ActionState& other) const;
@@ -97,27 +101,28 @@ struct ActionState {
} __attribute__((packed)); } __attribute__((packed));
struct ActionChain { struct ActionChain {
int8_t effective_ap; /* 00 */ int8_t effective_ap;
int8_t effective_tp; /* 01 */ int8_t effective_tp;
int8_t ap_effect_bonus; /* 02 */ int8_t ap_effect_bonus;
int8_t damage; /* 03 */ int8_t damage;
le_uint16_t acting_card_ref; /* 04 */ le_uint16_t acting_card_ref;
le_uint16_t unknown_card_ref_a3; /* 06 */ le_uint16_t unknown_card_ref_a3;
parray<le_uint16_t, 8> attack_action_card_refs; /* 08 */ parray<le_uint16_t, 8> attack_action_card_refs;
uint8_t attack_action_card_ref_count; /* 18 */ uint8_t attack_action_card_ref_count;
AttackMedium attack_medium; /* 19 */ AttackMedium attack_medium;
uint8_t target_card_ref_count; /* 1A */ uint8_t target_card_ref_count;
ActionSubphase action_subphase; /* 1B */ ActionSubphase action_subphase;
uint8_t strike_count; /* 1C */ uint8_t strike_count;
int8_t damage_multiplier; /* 1D */ int8_t damage_multiplier;
uint8_t attack_number; /* 1E */ uint8_t attack_number;
int8_t tp_effect_bonus; /* 1F */ int8_t tp_effect_bonus;
uint8_t unused1; /* 20 */ uint8_t unused1;
uint8_t unused2; /* 21 */ uint8_t unused2;
int8_t card_ap; /* 22 */ int8_t card_ap;
int8_t card_tp; /* 23 */ int8_t card_tp;
le_uint32_t flags; /* 24 */ le_uint32_t flags;
parray<le_uint16_t, 4 * 9> target_card_refs; /* 28 */ parray<le_uint16_t, 4 * 9> target_card_refs;
/* 70 */
ActionChain(); ActionChain();
bool operator==(const ActionChain& other) const; bool operator==(const ActionChain& other) const;
@@ -130,8 +135,9 @@ struct ActionChain {
} __attribute__((packed)); } __attribute__((packed));
struct ActionChainWithConds { struct ActionChainWithConds {
ActionChain chain; /* 0000 */ ActionChain chain;
parray<Condition, 9> conditions; /* 0070 */ parray<Condition, 9> conditions;
/* 0100 */
ActionChainWithConds(); ActionChainWithConds();
bool operator==(const ActionChainWithConds& other) const; bool operator==(const ActionChainWithConds& other) const;
@@ -165,17 +171,18 @@ struct ActionChainWithConds {
} __attribute__((packed)); } __attribute__((packed));
struct ActionMetadata { struct ActionMetadata {
le_uint16_t card_ref; /* 00 */ le_uint16_t card_ref;
uint8_t target_card_ref_count; /* 02 */ uint8_t target_card_ref_count;
uint8_t defense_card_ref_count; /* 03 */ uint8_t defense_card_ref_count;
ActionSubphase action_subphase; /* 04 */ ActionSubphase action_subphase;
int8_t defense_power; /* 05 */ int8_t defense_power;
int8_t defense_bonus; /* 06 */ int8_t defense_bonus;
int8_t attack_bonus; /* 07 */ int8_t attack_bonus;
le_uint32_t flags; /* 08 */ le_uint32_t flags;
parray<le_uint16_t, 4 * 9> target_card_refs; /* 0C */ parray<le_uint16_t, 4 * 9> target_card_refs;
parray<le_uint16_t, 8> defense_card_refs; /* 54 */ parray<le_uint16_t, 8> defense_card_refs;
parray<le_uint16_t, 8> original_attacker_card_refs; /* 64 */ parray<le_uint16_t, 8> original_attacker_card_refs;
/* 74 */
ActionMetadata(); ActionMetadata();
bool operator==(const ActionMetadata& other) const; bool operator==(const ActionMetadata& other) const;
@@ -200,28 +207,29 @@ struct ActionMetadata {
} __attribute__((packed)); } __attribute__((packed));
struct HandAndEquipState { struct HandAndEquipState {
parray<uint8_t, 2> dice_results; /* 00 */ parray<uint8_t, 2> dice_results;
uint8_t atk_points; /* 02 */ uint8_t atk_points;
uint8_t def_points; /* 03 */ uint8_t def_points;
uint8_t atk_points2; // TODO: rename this to something more appropriate /* 04 */ uint8_t atk_points2; // TODO: rename this to something more appropriate
uint8_t unknown_a1; /* 05 */ uint8_t unknown_a1;
uint8_t total_set_cards_cost; /* 06 */ uint8_t total_set_cards_cost;
uint8_t is_cpu_player; /* 07 */ uint8_t is_cpu_player;
le_uint32_t assist_flags; /* 08 */ le_uint32_t assist_flags;
parray<le_uint16_t, 6> hand_card_refs; /* 0C */ parray<le_uint16_t, 6> hand_card_refs;
le_uint16_t assist_card_ref; /* 18 */ le_uint16_t assist_card_ref;
parray<le_uint16_t, 8> set_card_refs; /* 1A */ parray<le_uint16_t, 8> set_card_refs;
le_uint16_t sc_card_ref; /* 2A */ le_uint16_t sc_card_ref;
parray<le_uint16_t, 6> hand_card_refs2; /* 2C */ parray<le_uint16_t, 6> hand_card_refs2;
parray<le_uint16_t, 8> set_card_refs2; /* 38 */ parray<le_uint16_t, 8> set_card_refs2;
le_uint16_t assist_card_ref2; /* 48 */ le_uint16_t assist_card_ref2;
le_uint16_t assist_card_set_number; /* 4A */ le_uint16_t assist_card_set_number;
le_uint16_t assist_card_id; /* 4C */ le_uint16_t assist_card_id;
uint8_t assist_remaining_turns; /* 4E */ uint8_t assist_remaining_turns;
uint8_t assist_delay_turns; /* 4F */ uint8_t assist_delay_turns;
uint8_t atk_bonuses; /* 50 */ uint8_t atk_bonuses;
uint8_t def_bonuses; /* 51 */ uint8_t def_bonuses;
parray<uint8_t, 2> unused2; /* 52 */ parray<uint8_t, 2> unused2;
/* 54 */
HandAndEquipState(); HandAndEquipState();
bool operator==(const HandAndEquipState& other) const; bool operator==(const HandAndEquipState& other) const;
@@ -234,26 +242,27 @@ struct HandAndEquipState {
} __attribute__((packed)); } __attribute__((packed));
struct PlayerBattleStats { struct PlayerBattleStats {
le_uint16_t damage_given; /* 00 */ le_uint16_t damage_given;
le_uint16_t damage_taken; /* 02 */ le_uint16_t damage_taken;
le_uint16_t num_opponent_cards_destroyed; /* 04 */ le_uint16_t num_opponent_cards_destroyed;
le_uint16_t num_owned_cards_destroyed; /* 06 */ le_uint16_t num_owned_cards_destroyed;
le_uint16_t total_move_distance; /* 08 */ le_uint16_t total_move_distance;
le_uint16_t num_cards_set; /* 0A */ le_uint16_t num_cards_set;
le_uint16_t num_item_or_creature_cards_set; /* 0C */ le_uint16_t num_item_or_creature_cards_set;
le_uint16_t num_attack_actions_set; /* 0E */ le_uint16_t num_attack_actions_set;
le_uint16_t num_tech_cards_set; /* 10 */ le_uint16_t num_tech_cards_set;
le_uint16_t num_assist_cards_set; /* 12 */ le_uint16_t num_assist_cards_set;
le_uint16_t defense_actions_set_on_self; /* 14 */ le_uint16_t defense_actions_set_on_self;
le_uint16_t defense_actions_set_on_ally; /* 16 */ le_uint16_t defense_actions_set_on_ally;
le_uint16_t num_cards_drawn; /* 18 */ le_uint16_t num_cards_drawn;
le_uint16_t max_attack_damage; /* 1A */ le_uint16_t max_attack_damage;
le_uint16_t max_attack_combo_size; /* 1C */ le_uint16_t max_attack_combo_size;
le_uint16_t num_attacks_given; /* 1E */ le_uint16_t num_attacks_given;
le_uint16_t num_attacks_taken; /* 20 */ le_uint16_t num_attacks_taken;
le_uint16_t sc_damage_taken; /* 22 */ le_uint16_t sc_damage_taken;
le_uint16_t action_card_negated_damage; /* 24 */ le_uint16_t action_card_negated_damage;
le_uint16_t unused; /* 26 */ le_uint16_t unused;
/* 28 */
PlayerBattleStats(); PlayerBattleStats();
void clear(); void clear();