Sync Ruby/Sapphire Battle Tower structs

This commit is contained in:
PikalaxALT
2019-11-08 16:55:44 -05:00
parent b3caa183bf
commit d25196154f
12 changed files with 80 additions and 37 deletions
+6
View File
@@ -246,4 +246,10 @@ extern const u8 gText_Ice[];
extern const u8 gText_Confusion[];
extern const u8 gText_Love[];
extern const u8 gUnknown_83FE859[];
extern const u8 gUnknown_83FE85E[];
extern const u8 gUnknown_83FE85C[];
extern const u8 gUnknown_83FE860[];
extern const u8 gUnknown_83FE864[];
#endif // GUARD_BATTLE_MESSAGE_H
+1 -1
View File
@@ -13,7 +13,7 @@ void Special_StartLegendaryBattle(void);
void Special_StartGroudonKyogreBattle(void);
void Special_StartRegiBattle(void);
u8 BattleSetup_GetTerrainId(void);
u8 sub_8080060(void);
u8 BattleSetup_GetBattleTowerBattleTransition(void);
const u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data);
void ConfigureAndSetUpOneTrainerBattle(u8 trainerEventObjId, const u8 *trainerScript);
bool32 GetTrainerFlagFromScriptPointer(const u8 *data);
+21
View File
@@ -4,6 +4,27 @@
#include "global.h"
#include "constants/battle_tower.h"
#define BATTLE_TOWER_EREADER_TRAINER_ID 200
#define BATTLE_TOWER_RECORD_MIXING_TRAINER_BASE_ID 100
struct BattleTowerTrainer
{
u8 trainerClass;
u8 name[3];
u8 teamFlags;
u16 speech[6];
};
struct BattleTowerPokemonTemplate
{
u16 species;
u8 heldItem;
u8 teamFlags;
u16 moves[4];
u8 evSpread;
u8 nature;
};
u16 sub_8164FCC(u8, u8);
void sub_80E7524(struct BattleTowerEReaderTrainer *);
void ValidateEReaderTrainer(void);
+39 -23
View File
@@ -226,10 +226,22 @@ struct UnknownSaveBlock2Struct
u8 field_EB;
}; // sizeof = 0xEC
struct BattleTowerRecord // record mixing
{
/*0x00*/ u8 battleTowerLevelType; // 0 = level 50, 1 = level 100
/*0x01*/ u8 trainerClass;
/*0x02*/ u16 winStreak;
/*0x04*/ u8 name[8];
/*0x0C*/ u8 trainerId[4];
/*0x10*/ u16 greeting[6];
/*0x1C*/ struct BattleTowerPokemon party[3];
/*0xA0*/ u32 checksum;
};
struct BattleTowerEReaderTrainer
{
/*0x4A0 0x3F0 0x00*/ u8 unk0;
/*0x4A1 0x3F1 0x01*/ u8 facilityClass;
/*0x4A1 0x3F1 0x01*/ u8 trainerClass;
/*0x4A2 0x3F2 0x02*/ u16 winStreak;
/*0x4A4 0x3F4 0x04*/ u8 name[8];
/*0x4AC 0x3FC 0x0C*/ u8 trainerId[4];
@@ -240,28 +252,32 @@ struct BattleTowerEReaderTrainer
/*0x558 0x4A8 0xB8*/ u32 checksum;
};
struct UnkSaveBlock2Substruct_55C
struct BattleTowerData // Leftover from R/S
{
/* 0x000:0x55C */ u8 unk_00_0:1;
u8 unk_00_1:1;
/* 0x001:0x55D */ u8 unk_01;
/* 0x002:0x55E */ u8 unk_02[2];
/* 0x004:0x560 */ u16 unk_04[2];
/* 0x008:0x564 */ u16 unk_08[2];
/* 0x00C:0x568 */ u16 unk_0C[2];
/* 0x010:0x56C */ u8 unk_10;
/* 0x011:0x56D */ u8 unk_11[3];
/* 0x014:0x570 */ u16 unk_14;
/* 0x016:0x572 */ u8 unk_16;
}; // size: 0x018
struct UnkSaveBlock2Substruct_B0
{
/* 0x000:0x0B0 */ u8 field_0[0x3F0];
/* 0x3F0:0x4A0 */ struct BattleTowerEReaderTrainer field_3F0;
/* 0x4AC:0x55C */ struct UnkSaveBlock2Substruct_55C field_4AC;
/* 0x4C4:0x574 */ u8 field_4C4[0x324];
}; // size: 0x7E8
/*0x0000, 0x00B0*/ struct BattleTowerRecord playerRecord;
/*0x00A4, 0x0154*/ struct BattleTowerRecord records[5]; // from record mixing
/*0x03D8, 0x0488*/ u16 firstMonSpecies; // species of the first pokemon in the player's battle tower party
/*0x03DA, 0x048A*/ u16 defeatedBySpecies; // species of the pokemon that defated the player
/*0x03DC, 0x048C*/ u8 defeatedByTrainerName[8];
/*0x03E4, 0x0494*/ u8 firstMonNickname[POKEMON_NAME_LENGTH]; // nickname of the first pokemon in the player's battle tower party
/*0x03F0, 0x04A0*/ struct BattleTowerEReaderTrainer ereaderTrainer;
/*0x04AC, 0x055C*/ u8 battleTowerLevelType:1; // 0 = level 50; 1 = level 100
/*0x04AC, 0x055C*/ u8 unk_554:1;
/*0x04AD, 0x055D*/ u8 battleOutcome;
/*0x04AE, 0x055E*/ u8 var_4AE[2];
/*0x04B0, 0x0560*/ u16 curChallengeBattleNum[2]; // 1-based index of battle in the current challenge. (challenges consist of 7 battles)
/*0x04B4, 0x0564*/ u16 curStreakChallengesNum[2]; // 1-based index of the current challenge in the current streak.
/*0x04B8, 0x0568*/ u16 recordWinStreaks[2];
/*0x04BC, 0x056C*/ u8 battleTowerTrainerId; // index for gBattleTowerTrainers table
/*0x04BD, 0x056D*/ u8 selectedPartyMons[0x3]; // indices of the 3 selected player party mons.
/*0x04C0, 0x0570*/ u16 prizeItem;
/*0x04C2, 0x0572*/ u8 battledTrainerIds[6];
/*0x04C8, 0x0578*/ u16 totalBattleTowerWins;
/*0x04CA, 0x057A*/ u16 bestBattleTowerWinStreak;
/*0x04CC, 0x057C*/ u16 currentWinStreaks[2];
/*0x04D0, 0x0580*/ u8 lastStreakLevelType; // 0 = level 50, 1 = level 100. level type of the last streak. Used by tv to report the level mode.
/*0x04D1, 0x0581*/ u8 filler_4D1[0x317];
};
struct SaveBlock2
{
@@ -287,7 +303,7 @@ struct SaveBlock2
/*0x0A8*/ u32 field_A8;
/*0x0AC*/ u8 field_AC;
/*0x0AD*/ u8 field_AD;
/*0x0B0*/ struct UnkSaveBlock2Substruct_B0 unk_B0;
/*0x0B0*/ struct BattleTowerData battleTower;
/*0x898*/ u16 mapView[0x100];
/*0xA98*/ struct LinkBattleRecords linkBattleRecords;
/*0xAF0*/ struct BerryCrush berryCrush;