2017-09-25 00:09:13 +02:00
|
|
|
#ifndef GUARD_RECORDED_BATTLE_H
|
|
|
|
#define GUARD_RECORDED_BATTLE_H
|
|
|
|
|
2022-12-24 06:13:42 +01:00
|
|
|
#include "constants/battle.h"
|
|
|
|
|
|
|
|
#define BATTLER_RECORD_SIZE 664
|
|
|
|
|
|
|
|
struct RecordedBattleSave
|
|
|
|
{
|
|
|
|
struct Pokemon playerParty[PARTY_SIZE];
|
|
|
|
struct Pokemon opponentParty[PARTY_SIZE];
|
|
|
|
u8 playersName[MAX_BATTLERS_COUNT][PLAYER_NAME_LENGTH + 1];
|
|
|
|
u8 playersGender[MAX_BATTLERS_COUNT];
|
|
|
|
u32 playersTrainerId[MAX_BATTLERS_COUNT];
|
|
|
|
u8 playersLanguage[MAX_BATTLERS_COUNT];
|
|
|
|
u32 rngSeed;
|
|
|
|
u32 battleFlags;
|
|
|
|
u8 playersBattlers[MAX_BATTLERS_COUNT];
|
|
|
|
u16 opponentA;
|
|
|
|
u16 opponentB;
|
|
|
|
u16 partnerId;
|
|
|
|
u16 multiplayerId;
|
|
|
|
u8 lvlMode;
|
|
|
|
u8 frontierFacility;
|
|
|
|
u8 frontierBrainSymbol;
|
|
|
|
u8 battleScene:1;
|
|
|
|
u8 textSpeed:3;
|
|
|
|
u32 AI_scripts;
|
|
|
|
u8 recordMixFriendName[PLAYER_NAME_LENGTH + 1];
|
|
|
|
u8 recordMixFriendClass;
|
|
|
|
u8 apprenticeId;
|
|
|
|
u16 easyChatSpeech[EASY_CHAT_BATTLE_WORDS_COUNT];
|
|
|
|
u8 recordMixFriendLanguage;
|
|
|
|
u8 apprenticeLanguage;
|
|
|
|
u8 battleRecord[MAX_BATTLERS_COUNT][BATTLER_RECORD_SIZE];
|
|
|
|
u32 checksum;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
RECORDED_BYTE, // Generic.
|
|
|
|
RECORDED_ACTION_TYPE,
|
|
|
|
RECORDED_MOVE_SLOT,
|
|
|
|
RECORDED_MOVE_TARGET,
|
|
|
|
RECORDED_PARTY_INDEX,
|
|
|
|
RECORDED_BATTLE_PALACE_ACTION,
|
2023-04-14 20:25:50 +02:00
|
|
|
RECORDED_ITEM_ID,
|
2023-04-20 22:45:16 +02:00
|
|
|
RECORDED_ITEM_TARGET,
|
2023-04-26 01:02:47 +02:00
|
|
|
RECORDED_ITEM_MOVE,
|
2022-12-24 06:13:42 +01:00
|
|
|
};
|
|
|
|
|
2017-10-01 01:12:42 +02:00
|
|
|
extern u32 gRecordedBattleRngSeed;
|
2017-11-13 19:01:23 +01:00
|
|
|
extern u32 gBattlePalaceMoveSelectionRngValue;
|
2021-01-13 21:17:32 +01:00
|
|
|
extern u8 gRecordedBattleMultiplayerId;
|
2017-10-01 01:12:42 +02:00
|
|
|
|
2021-01-22 08:48:22 +01:00
|
|
|
#define B_RECORD_MODE_RECORDING 1
|
|
|
|
#define B_RECORD_MODE_PLAYBACK 2
|
|
|
|
|
2021-10-12 02:49:56 +02:00
|
|
|
void RecordedBattle_Init(u8 mode);
|
2021-10-04 16:21:03 +02:00
|
|
|
void RecordedBattle_SetTrainerInfo(void);
|
2018-02-08 11:17:41 +01:00
|
|
|
void RecordedBattle_SetBattlerAction(u8 battlerId, u8 action);
|
|
|
|
void RecordedBattle_ClearBattlerAction(u8 battlerId, u8 bytesToClear);
|
2022-12-24 06:13:42 +01:00
|
|
|
u8 RecordedBattle_GetBattlerAction(u32 actionType, u8 battlerId);
|
2021-01-23 02:03:21 +01:00
|
|
|
u8 RecordedBattle_BufferNewBattlerData(u8 *dst);
|
|
|
|
void RecordedBattle_RecordAllBattlerData(u8 *data);
|
2017-11-13 19:01:23 +01:00
|
|
|
bool32 CanCopyRecordedBattleSaveData(void);
|
2018-11-01 15:06:50 +01:00
|
|
|
bool32 MoveRecordedBattleToSaveData(void);
|
2022-12-24 06:13:42 +01:00
|
|
|
void SetVariablesForRecordedBattle(struct RecordedBattleSave *);
|
2017-11-13 19:01:23 +01:00
|
|
|
void PlayRecordedBattle(void (*CB2_After)(void));
|
2018-07-01 11:15:42 +02:00
|
|
|
u8 GetRecordedBattleFrontierFacility(void);
|
2018-11-01 15:06:50 +01:00
|
|
|
u8 GetRecordedBattleFronterBrainSymbol(void);
|
2017-11-13 19:01:23 +01:00
|
|
|
void RecordedBattle_SaveParties(void);
|
2018-02-08 11:17:41 +01:00
|
|
|
u8 GetActiveBattlerLinkPlayerGender(void);
|
2021-03-12 22:55:58 +01:00
|
|
|
void RecordedBattle_ClearFrontierPassFlag(void);
|
2021-10-12 02:49:56 +02:00
|
|
|
void RecordedBattle_SetFrontierPassFlagFromHword(u16 flags);
|
2021-03-12 22:55:58 +01:00
|
|
|
u8 RecordedBattle_GetFrontierPassFlag(void);
|
2018-11-01 15:06:50 +01:00
|
|
|
u8 GetBattleSceneInRecordedBattle(void);
|
2017-11-13 19:01:23 +01:00
|
|
|
u8 GetTextSpeedInRecordedBattle(void);
|
2018-02-08 11:17:41 +01:00
|
|
|
void RecordedBattle_CopyBattlerMoves(void);
|
2021-10-12 02:49:56 +02:00
|
|
|
void RecordedBattle_CheckMovesetChanges(u8 mode);
|
2017-11-13 19:01:23 +01:00
|
|
|
u32 GetAiScriptsInRecordedBattle(void);
|
2021-10-04 16:21:03 +02:00
|
|
|
void RecordedBattle_SetPlaybackFinished(void);
|
|
|
|
bool8 RecordedBattle_CanStopPlayback(void);
|
2020-12-24 22:18:47 +01:00
|
|
|
void GetRecordedBattleRecordMixFriendName(u8 *dst);
|
2018-11-01 15:06:50 +01:00
|
|
|
u8 GetRecordedBattleRecordMixFriendClass(void);
|
|
|
|
u8 GetRecordedBattleApprenticeId(void);
|
|
|
|
u8 GetRecordedBattleRecordMixFriendLanguage(void);
|
|
|
|
u8 GetRecordedBattleApprenticeLanguage(void);
|
|
|
|
void RecordedBattle_SaveBattleOutcome(void);
|
|
|
|
u16 *GetRecordedBattleEasyChatSpeech(void);
|
2017-09-25 00:09:13 +02:00
|
|
|
|
|
|
|
#endif // GUARD_RECORDED_BATTLE_H
|