mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-08-22 09:26:14 -05:00
Merge pull request #304 from lhearachel/encounter
Some checks failed
build / build (push) Has been cancelled
Some checks failed
build / build (push) Has been cancelled
Document encounter.c
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
.include "consts/poketch.inc"
|
||||
.include "consts/scrcmd.inc"
|
||||
.include "consts/sdat.inc"
|
||||
.include "consts/species.inc"
|
||||
|
||||
.macro Noop
|
||||
.short 0
|
||||
@@ -1262,10 +1263,10 @@
|
||||
.short \arg0
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_0E5 arg0, arg1
|
||||
.macro StartTrainerBattle enemyTrainer1, enemyTrainer2
|
||||
.short 229
|
||||
.short \arg0
|
||||
.short \arg1
|
||||
.short \enemyTrainer1
|
||||
.short \enemyTrainer2
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_0E6 arg0, arg1
|
||||
@@ -1317,7 +1318,7 @@
|
||||
.short \arg0
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_0EF
|
||||
.macro StartDummyTrainerBattle
|
||||
.short 239
|
||||
.endm
|
||||
|
||||
@@ -1356,7 +1357,7 @@
|
||||
.short \arg0
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_0F6
|
||||
.macro StartLinkBattle
|
||||
.short 246
|
||||
.endm
|
||||
|
||||
@@ -1596,18 +1597,18 @@
|
||||
.short \arg1
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_124 arg0, arg1
|
||||
.macro StartWildBattle species, level
|
||||
.short 292
|
||||
.short \arg0
|
||||
.short \arg1
|
||||
.short \species
|
||||
.short \level
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_125 arg0
|
||||
.macro StartFirstBattle trainerID
|
||||
.short 293
|
||||
.short \arg0
|
||||
.short \trainerID
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_126
|
||||
.macro StartCatchingTutorial
|
||||
.short 294
|
||||
.endm
|
||||
|
||||
@@ -1620,7 +1621,7 @@
|
||||
.short \arg0
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_129
|
||||
.macro StartHoneyTreeBattle
|
||||
.short 297
|
||||
.endm
|
||||
|
||||
@@ -3642,11 +3643,11 @@
|
||||
.short \arg0
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_2A0 arg0, arg1, arg2
|
||||
.macro StartTagBattle partnerTrainer, enemyTrainer1, enemyTrainer2
|
||||
.short 672
|
||||
.short \arg0
|
||||
.short \arg1
|
||||
.short \arg2
|
||||
.short \partnerTrainer
|
||||
.short \enemyTrainer1
|
||||
.short \enemyTrainer2
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_2A1 arg0, arg1, arg2
|
||||
@@ -3798,10 +3799,10 @@
|
||||
.short \destVarID
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_2BD arg0, arg1
|
||||
.macro StartLegendaryBattle species, level
|
||||
.short 701
|
||||
.short \arg0
|
||||
.short \arg1
|
||||
.short \species
|
||||
.short \level
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_2BE arg0
|
||||
@@ -4305,16 +4306,16 @@
|
||||
.short \destVarIDZ
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_318 arg0, arg1
|
||||
.macro StartFatefulEncounter species, level
|
||||
.short 792
|
||||
.short \arg0
|
||||
.short \arg1
|
||||
.short \species
|
||||
.short \level
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_319 arg0, arg1
|
||||
.macro StartGiratinaOriginBattle species, level
|
||||
.short 793
|
||||
.short \arg0
|
||||
.short \arg1
|
||||
.short \species
|
||||
.short \level
|
||||
.endm
|
||||
|
||||
.macro ScrCmd_31A arg0
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
"RECORD_UNK_004",
|
||||
"RECORD_UNK_005",
|
||||
"RECORD_UNK_006",
|
||||
"RECORD_UNK_007",
|
||||
"RECORD_UNK_008",
|
||||
"RECORD_WILD_BATTLES_FOUGHT",
|
||||
"RECORD_TRAINER_BATTLES_FOUGHT",
|
||||
"RECORD_UNK_009",
|
||||
"RECORD_UNK_010",
|
||||
"RECORD_UNK_011",
|
||||
@@ -165,10 +165,10 @@
|
||||
"TRAINER_SCORE_EVENT_UNK_05",
|
||||
"TRAINER_SCORE_EVENT_UNK_06",
|
||||
"TRAINER_SCORE_EVENT_UNK_07",
|
||||
"TRAINER_SCORE_EVENT_UNK_08",
|
||||
"TRAINER_SCORE_EVENT_UNK_09",
|
||||
"TRAINER_SCORE_EVENT_UNK_10",
|
||||
"TRAINER_SCORE_EVENT_UNK_11",
|
||||
"TRAINER_SCORE_EVENT_WON_WILD_BATTLE",
|
||||
"TRAINER_SCORE_EVENT_CAPTURED_REGIONAL_MON",
|
||||
"TRAINER_SCORE_EVENT_CAPTURED_NATIONAL_MON",
|
||||
"TRAINER_SCORE_EVENT_WON_TRAINER_BATTLE",
|
||||
"TRAINER_SCORE_EVENT_UNK_12",
|
||||
"TRAINER_SCORE_EVENT_UNK_13",
|
||||
"TRAINER_SCORE_EVENT_UNK_14",
|
||||
@@ -178,7 +178,7 @@
|
||||
"TRAINER_SCORE_EVENT_UNK_18",
|
||||
"TRAINER_SCORE_EVENT_UNK_19",
|
||||
"TRAINER_SCORE_EVENT_UNK_20",
|
||||
"TRAINER_SCORE_EVENT_UNK_21",
|
||||
"TRAINER_SCORE_EVENT_FOUGHT_LINK_BATTLE",
|
||||
"TRAINER_SCORE_EVENT_CAUGHT_SPECIES",
|
||||
"TRAINER_SCORE_EVENT_UNK_23",
|
||||
"TRAINER_SCORE_EVENT_UNK_24",
|
||||
|
||||
@@ -49,17 +49,17 @@ enum EncEffectCutIn {
|
||||
* Get the cut-in effect ID applied as a transition from the overworld
|
||||
* to the battle UI.
|
||||
*
|
||||
* @param battleParams
|
||||
* @param dto
|
||||
* @return Cut-in effect ID
|
||||
*/
|
||||
u32 EncEffects_CutInEffect(const FieldBattleDTO *battleParams);
|
||||
u32 EncEffects_CutInEffect(const FieldBattleDTO *dto);
|
||||
|
||||
/**
|
||||
* Get the SEQ ID pointing to this encounter's background music.
|
||||
*
|
||||
* @param battleParams
|
||||
* @param dto
|
||||
* @return SEQ ID
|
||||
*/
|
||||
u32 EncEffects_BGM(const FieldBattleDTO *battleParams);
|
||||
u32 EncEffects_BGM(const FieldBattleDTO *dto);
|
||||
|
||||
#endif // POKEPLATINUM_ENC_EFFECTS_H
|
||||
|
||||
@@ -8,20 +8,19 @@
|
||||
#include "field_battle_data_transfer.h"
|
||||
#include "field_task.h"
|
||||
|
||||
void sub_02050ABC(FieldTask *param0, FieldBattleDTO *param1);
|
||||
void sub_02050E10(FieldSystem *fieldSystem, FieldBattleDTO *param1);
|
||||
void sub_02050E78(FieldSystem *fieldSystem, FieldTask *param1, FieldBattleDTO *param2);
|
||||
void sub_0205120C(FieldTask *param0, int *param1);
|
||||
void sub_02051270(FieldTask *param0, u16 param1, u8 param2, int *param3, BOOL param4);
|
||||
void sub_020512E4(FieldTask *param0, u16 param1, u8 param2, int *param3, BOOL param4);
|
||||
void sub_02051450(FieldSystem *fieldSystem, FieldBattleDTO *param1);
|
||||
void sub_02051480(FieldTask *param0, int param1, int param2, int *param3);
|
||||
void sub_02051590(FieldTask *param0);
|
||||
void sub_020515CC(FieldTask *param0, int param1, int param2, int param3, int param4, int *param5);
|
||||
void sub_0205167C(FieldTask *param0, const u8 *param1, int param2);
|
||||
void sub_020516F4(FieldTask *param0, int param1, int param2, int param3);
|
||||
void sub_020517E8(FieldSystem *fieldSystem, const u8 *param1, int param2);
|
||||
void sub_0205184C(FieldSystem *fieldSystem, const Party *param1, int param2);
|
||||
void sub_02051ABC(FieldTask *param0, u16 param1, u8 param2, int *param3, BOOL param4);
|
||||
void Encounter_NewVsWild(FieldSystem *fieldSystem, FieldBattleDTO *dto);
|
||||
void Encounter_StartVsWild(FieldSystem *fieldSystem, FieldTask *task, FieldBattleDTO *dto);
|
||||
void Encounter_NewVsHoneyTree(FieldTask *task, int *resultMaskPtr);
|
||||
void Encounter_NewVsSpeciesAtLevel(FieldTask *task, u16 species, u8 level, int *resultMaskPtr, BOOL isLegendary);
|
||||
void Encounter_NewFatefulVsSpeciesAtLevel(FieldTask *taskMan, u16 species, u8 level, int *resultMaskPtr, BOOL isLegendary);
|
||||
void Encounter_NewVsPalParkTransfer(FieldSystem *fieldSystem, FieldBattleDTO *dto);
|
||||
void Encounter_NewVsFirstBattle(FieldTask *task, int trainerID, int heapID, int *resultMaskPtr);
|
||||
void Encounter_NewCatchingTutorial(FieldTask *task);
|
||||
void Encounter_NewVsTrainer(FieldTask *taskMan, int enemyTrainer1ID, int enemyTrainer2ID, int partnerTrainerID, int heapID, int *resultMaskPtr);
|
||||
void Encounter_NewVsLink(FieldTask *task, const u8 *partyOrder, int battleType);
|
||||
void Encounter_NewVsWiFi(FieldTask *task, int param1, int normalizedLevel, int wifiBattleType);
|
||||
void Encounter_NewVsLinkWithRecording(FieldSystem *fieldSystem, const u8 *partyOrder, int battleType);
|
||||
void Encounter_NewVsLinkWithRecordingAndParty(FieldSystem *fieldSystem, const Party *party, int battleType);
|
||||
void Encounter_NewVsGiratinaOrigin(FieldTask *task, u16 species, u8 level, int *resultMaskPtr, BOOL isLegendary);
|
||||
|
||||
#endif // POKEPLATINUM_ENCOUNTER_H
|
||||
|
||||
14
include/field_transition.h
Normal file
14
include/field_transition.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef POKEPLATINUM_FIELD_TRANSITION_H
|
||||
#define POKEPLATINUM_FIELD_TRANSITION_H
|
||||
|
||||
#include "field_task.h"
|
||||
|
||||
void FieldTransition_StartEncounterEffect(FieldTask *task, int encEffectID, int battleBGM);
|
||||
void FieldTransition_FinishMap(FieldTask *task);
|
||||
void FieldTransition_StartMap(FieldTask *task);
|
||||
void FieldTransition_FadeOut(FieldTask *task);
|
||||
void FieldTransition_FadeIn(FieldTask *task);
|
||||
void FieldTransition_FadeOutAndFinishMap(FieldTask *task);
|
||||
void FieldTransition_StartMapAndFadeIn(FieldTask *task);
|
||||
|
||||
#endif // POKEPLATINUM_FIELD_TRANSITION_H
|
||||
@@ -35,8 +35,8 @@ enum ScriptManagerMember {
|
||||
SCRIPT_MANAGER_MESSAGE_BUF,
|
||||
SCRIPT_MANAGER_TEMPORARY_BUF,
|
||||
SCRIPT_MANAGER_SAVING_ICON,
|
||||
|
||||
SCRIPT_MANAGER_DATA_PTR = 20,
|
||||
SCRIPT_MANAGER_PARTY_MANAGEMENT_DATA,
|
||||
SCRIPT_MANAGER_DATA_PTR,
|
||||
|
||||
SCRIPT_MANAGER_PLAYER_TASK = 22,
|
||||
SCRIPT_MANAGER_BATTLE_RESULT,
|
||||
@@ -130,7 +130,7 @@ typedef struct ScriptManager {
|
||||
ApproachingTrainer trainers[2];
|
||||
u16 data[SCRIPT_DATA_MAX - SCRIPT_DATA_START];
|
||||
FieldSysFunc function;
|
||||
void *unk_A8;
|
||||
void *partyManagementDataPtr;
|
||||
void *dataPtr; // used as a generic pointer to data in many different script commands
|
||||
UnkStruct_ov101_021D5D90 *unk_B0;
|
||||
SysTask *playerTask; // used to set player sprite animations while saving
|
||||
|
||||
@@ -28,11 +28,11 @@ enum TrainerDataParam {
|
||||
* This routine is responsible for loading the name of a trainer and building
|
||||
* their party from the data archives.
|
||||
*
|
||||
* @param battleParams The parent FieldBattleDTO struct for the encounter.
|
||||
* @param dto The parent FieldBattleDTO struct for the encounter.
|
||||
* @param save Save data; used to pull out the rival's name, if needed.
|
||||
* @param heapID Heap on which to allocate message bank access.
|
||||
*/
|
||||
void TrainerData_Encounter(FieldBattleDTO *battleParams, const SaveData *save, int heapID);
|
||||
void TrainerData_Encounter(FieldBattleDTO *dto, const SaveData *save, int heapID);
|
||||
|
||||
/**
|
||||
* @brief Get a parameter for the given trainer ID from the data archive.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "pokemon.h"
|
||||
#include "savedata.h"
|
||||
|
||||
void sub_0203D1D4(FieldSystem *fieldSystem, FieldBattleDTO *param1);
|
||||
void FieldSystem_StartBattleProcess(FieldSystem *fieldSystem, FieldBattleDTO *dto);
|
||||
void sub_0203D1E4(FieldSystem *fieldSystem, void *param1);
|
||||
void *sub_0203D20C(FieldSystem *fieldSystem, UnkStruct_020684D0 *param1);
|
||||
void *sub_0203D264(FieldSystem *fieldSystem, int param1);
|
||||
|
||||
@@ -8,8 +8,8 @@ BOOL ScrCmd_0B7(ScriptContext *param0);
|
||||
BOOL ScrCmd_0B8(ScriptContext *param0);
|
||||
BOOL ScrCmd_0B9(ScriptContext *param0);
|
||||
BOOL ScrCmd_0E4(ScriptContext *param0);
|
||||
BOOL ScrCmd_0E5(ScriptContext *param0);
|
||||
BOOL ScrCmd_2A0(ScriptContext *param0);
|
||||
BOOL ScrCmd_StartTrainerBattle(ScriptContext *ctx);
|
||||
BOOL ScrCmd_StartTagBattle(ScriptContext *ctx);
|
||||
BOOL ScrCmd_0E7(ScriptContext *param0);
|
||||
BOOL ScrCmd_0E8(ScriptContext *param0);
|
||||
BOOL ScrCmd_0E9(ScriptContext *param0);
|
||||
@@ -19,7 +19,7 @@ BOOL ScrCmd_CheckWonBattle(ScriptContext *ctx);
|
||||
BOOL ScrCmd_CheckLostBattle(ScriptContext *ctx);
|
||||
BOOL ScrCmd_CheckDidNotCapture(ScriptContext *ctx);
|
||||
BOOL ScrCmd_0EE(ScriptContext *param0);
|
||||
BOOL ScrCmd_0EF(ScriptContext *param0);
|
||||
BOOL ScrCmd_StartDummyTrainerBattle(ScriptContext *ctx);
|
||||
BOOL ScrCmd_0F0(ScriptContext *param0);
|
||||
BOOL ScrCmd_0F1(ScriptContext *param0);
|
||||
BOOL ScrCmd_314(ScriptContext *param0);
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#ifndef POKEPLATINUM_UNK_0205578C_H
|
||||
#define POKEPLATINUM_UNK_0205578C_H
|
||||
|
||||
#include "field_task.h"
|
||||
|
||||
void sub_020557DC(FieldTask *param0, int param1, int param2);
|
||||
|
||||
#endif // POKEPLATINUM_UNK_0205578C_H
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef POKEPLATINUM_UNK_02055808_H
|
||||
#define POKEPLATINUM_UNK_02055808_H
|
||||
|
||||
#include "field_task.h"
|
||||
|
||||
void FieldTask_FinishFieldMap(FieldTask *param0);
|
||||
void FieldTask_StartFieldMap(FieldTask *param0);
|
||||
void sub_020558AC(FieldTask *param0);
|
||||
void sub_020558F0(FieldTask *param0);
|
||||
void FieldTask_FinishFadeOut(FieldTask *param0);
|
||||
void FieldTask_StartFadeIn(FieldTask *param0);
|
||||
|
||||
#endif // POKEPLATINUM_UNK_02055808_H
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "pokemon.h"
|
||||
#include "strbuf.h"
|
||||
|
||||
#define MAX_PC_BOXES 18
|
||||
|
||||
void PCBoxes_Init(PCBoxes *param0);
|
||||
u32 PCBoxes_SaveSize(void);
|
||||
BOOL sub_02079868(PCBoxes *param0, BoxPokemon *param1);
|
||||
|
||||
@@ -229,8 +229,7 @@ Static main
|
||||
Object main.nef.p/src_unk_02054D00.c.o
|
||||
Object main.nef.p/src_unk_020553DC.c.o
|
||||
Object main.nef.p/src_unk_020556C4.c.o
|
||||
Object main.nef.p/src_unk_0205578C.c.o
|
||||
Object main.nef.p/src_unk_02055808.c.o
|
||||
Object main.nef.p/src_field_transition.c.o
|
||||
Object main.nef.p/src_unk_020559DC.c.o
|
||||
Object main.nef.p/src_unk_02055C50.c.o
|
||||
Object main.nef.p/src_unk_020562F8.c.o
|
||||
|
||||
@@ -29,7 +29,7 @@ _002F:
|
||||
Message 0
|
||||
CloseMessage
|
||||
SetFlag 142
|
||||
ScrCmd_2BD 0x1E0, 50
|
||||
StartLegendaryBattle SPECIES_UXIE, 50
|
||||
ClearFlag 142
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0085
|
||||
|
||||
@@ -230,7 +230,7 @@ _032F:
|
||||
CloseMessage
|
||||
IncrementGameRecord RECORD_UNK_057
|
||||
Call _0605
|
||||
ScrCmd_0E5 0x4005, 0
|
||||
StartTrainerBattle 0x4005, 0
|
||||
CheckWonBattle 0x8000
|
||||
Return
|
||||
|
||||
|
||||
@@ -161,15 +161,15 @@ _028A:
|
||||
GoTo _02DF
|
||||
|
||||
_02DF:
|
||||
ScrCmd_0E5 0x1DC, 0
|
||||
StartTrainerBattle 0x1DC, 0
|
||||
GoTo _0303
|
||||
|
||||
_02EB:
|
||||
ScrCmd_0E5 0x1DD, 0
|
||||
StartTrainerBattle 0x1DD, 0
|
||||
GoTo _0303
|
||||
|
||||
_02F7:
|
||||
ScrCmd_0E5 0x1DE, 0
|
||||
StartTrainerBattle 0x1DE, 0
|
||||
GoTo _0303
|
||||
|
||||
_0303:
|
||||
|
||||
@@ -21,7 +21,7 @@ _0016:
|
||||
ScrCmd_1CD 9, 35, 0, 0, 0
|
||||
Message 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 250, 0
|
||||
StartTrainerBattle 250, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0120
|
||||
Message 1
|
||||
|
||||
@@ -40,7 +40,7 @@ _0063:
|
||||
_006E:
|
||||
Message 2
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x1A0, 0
|
||||
StartTrainerBattle 0x1A0, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0191
|
||||
Message 4
|
||||
|
||||
@@ -101,7 +101,7 @@ _0181:
|
||||
_019D:
|
||||
Message 8
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x391, 0
|
||||
StartTrainerBattle 0x391, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0393
|
||||
Call _01C3
|
||||
@@ -466,7 +466,7 @@ _0538:
|
||||
GoToIfEq 0x800C, 1, _057A
|
||||
Message 8
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x391, 0
|
||||
StartTrainerBattle 0x391, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0393
|
||||
Call _01C3
|
||||
|
||||
@@ -54,7 +54,7 @@ _0096:
|
||||
FacePlayer
|
||||
Message 5
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x194, 0
|
||||
StartTrainerBattle 0x194, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _01CE
|
||||
SetVar 0x4055, 10
|
||||
|
||||
@@ -66,7 +66,7 @@ _00C4:
|
||||
ScrCmd_04D
|
||||
CloseMessage
|
||||
SetFlag 142
|
||||
ScrCmd_319 0x1E7, 47
|
||||
StartGiratinaOriginBattle SPECIES_GIRATINA, 47
|
||||
ClearFlag 142
|
||||
CheckWonBattle 0x800C
|
||||
ScrCmd_314 0x800C
|
||||
|
||||
@@ -67,7 +67,7 @@ _0094:
|
||||
ScrCmd_1CD 9, 67, 0, 0, 0
|
||||
Message 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x13B, 0
|
||||
StartTrainerBattle 0x13B, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _01C3
|
||||
Message 1
|
||||
@@ -152,7 +152,7 @@ _01C9:
|
||||
ScrCmd_0EA 0x144
|
||||
Message 6
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x144, 0
|
||||
StartTrainerBattle 0x144, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _01C3
|
||||
Message 7
|
||||
@@ -180,7 +180,7 @@ _021C:
|
||||
Call _02DA
|
||||
Message 8
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x103, 0
|
||||
StartTrainerBattle 0x103, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _01C3
|
||||
Message 9
|
||||
@@ -208,7 +208,7 @@ _027B:
|
||||
Call _02DA
|
||||
Message 10
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x104, 0
|
||||
StartTrainerBattle 0x104, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _01C3
|
||||
Message 11
|
||||
|
||||
@@ -145,7 +145,7 @@ _014E:
|
||||
Message 8
|
||||
CloseMessage
|
||||
Call _030C
|
||||
ScrCmd_2A0 0x8004, 0x399, 0x39A
|
||||
StartTagBattle 0x8004, 0x399, 0x39A
|
||||
CheckWonBattle 0x800C
|
||||
Return
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@ _001E:
|
||||
_0024:
|
||||
LockAll
|
||||
Call _00CC
|
||||
ScrCmd_0E5 0x128, 0
|
||||
StartTrainerBattle 0x128, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _006E
|
||||
Call _00EE
|
||||
ScrCmd_0E5 0x129, 0
|
||||
StartTrainerBattle 0x129, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _006E
|
||||
Call _010E
|
||||
|
||||
@@ -41,7 +41,7 @@ _007D:
|
||||
Message 0
|
||||
CloseMessage
|
||||
SetFlag 142
|
||||
ScrCmd_318 0x1EC, 30
|
||||
StartFatefulEncounter SPECIES_SHAYMIN, 30
|
||||
ClearFlag 142
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _00D7
|
||||
|
||||
@@ -34,7 +34,7 @@ _0064:
|
||||
GoTo _0074
|
||||
|
||||
_0074:
|
||||
ScrCmd_0E5 0x193, 0
|
||||
StartTrainerBattle 0x193, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _00E1
|
||||
Message 2
|
||||
|
||||
@@ -39,7 +39,7 @@ _0059:
|
||||
GoToIfSet 173, _0114
|
||||
Message 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x199, 0
|
||||
StartTrainerBattle 0x199, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _011F
|
||||
SetFlag 173
|
||||
|
||||
@@ -41,7 +41,7 @@ _0056:
|
||||
Message 0
|
||||
CloseMessage
|
||||
SetFlag 142
|
||||
ScrCmd_2BD 0x1ED, 80
|
||||
StartLegendaryBattle SPECIES_ARCEUS, 80
|
||||
ClearFlag 142
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _00DF
|
||||
|
||||
@@ -45,7 +45,7 @@ _0096:
|
||||
ScrCmd_1CD 9, 100, 0, 0, 0
|
||||
Message 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x13E, 0
|
||||
StartTrainerBattle 0x13E, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _01DC
|
||||
Message 1
|
||||
|
||||
@@ -59,7 +59,7 @@ _00BB:
|
||||
Message 0
|
||||
CloseMessage
|
||||
SetFlag 142
|
||||
ScrCmd_0E5 0x13E, 0
|
||||
StartTrainerBattle 0x13E, 0
|
||||
ClearFlag 142
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0248
|
||||
|
||||
@@ -44,7 +44,7 @@ _00AE:
|
||||
Message 2
|
||||
ScrCmd_04D
|
||||
CloseMessage
|
||||
ScrCmd_2BD 0x17A, 30
|
||||
StartLegendaryBattle SPECIES_REGICE, 30
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0109
|
||||
CheckDidNotCapture 0x800C
|
||||
|
||||
@@ -172,7 +172,7 @@ _01AA:
|
||||
Message 8
|
||||
CloseMessage
|
||||
SetHasPartner
|
||||
ScrCmd_0E5 0x343, 0x344
|
||||
StartTrainerBattle 0x343, 0x344
|
||||
ClearHasPartner
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _037D
|
||||
|
||||
@@ -44,7 +44,7 @@ _00AE:
|
||||
Message 2
|
||||
ScrCmd_04D
|
||||
CloseMessage
|
||||
ScrCmd_2BD 0x17B, 30
|
||||
StartLegendaryBattle SPECIES_REGISTEEL, 30
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0109
|
||||
CheckDidNotCapture 0x800C
|
||||
|
||||
@@ -878,7 +878,7 @@ _0AFE:
|
||||
ApplyMovement 0xFF, _0F30
|
||||
WaitMovement
|
||||
Call _0BAA
|
||||
ScrCmd_2A0 0x8004, 0x19E, 0x19F
|
||||
StartTagBattle 0x8004, 0x19E, 0x19F
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0DB7
|
||||
ApplyMovement 18, _0EB4
|
||||
|
||||
@@ -194,7 +194,7 @@ _0230:
|
||||
WaitMovement
|
||||
Message 9
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x195, 0
|
||||
StartTrainerBattle 0x195, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _02DB
|
||||
Message 10
|
||||
|
||||
@@ -39,7 +39,7 @@ _0079:
|
||||
Message 0
|
||||
CloseMessage
|
||||
SetFlag 142
|
||||
ScrCmd_2BD 0x1EB, 50
|
||||
StartLegendaryBattle SPECIES_DARKRAI, 50
|
||||
ClearFlag 142
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _014C
|
||||
|
||||
@@ -21,7 +21,7 @@ _0006:
|
||||
ScrCmd_04C 0x1DF, 0
|
||||
ScrCmd_04D
|
||||
SetFlag 0xAB0
|
||||
ScrCmd_124 0x1DF, 20
|
||||
StartWildBattle SPECIES_ROTOM, 20
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _00A7
|
||||
CheckDidNotCapture 0x800C
|
||||
|
||||
@@ -16,7 +16,7 @@ _000E:
|
||||
ScrCmd_1CD 9, 47, 0, 0, 0
|
||||
Message 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 246, 0
|
||||
StartTrainerBattle 246, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0119
|
||||
Message 1
|
||||
|
||||
@@ -581,15 +581,15 @@ _04C8:
|
||||
GoTo _053F
|
||||
|
||||
_053F:
|
||||
ScrCmd_0E5 0x1D9, 0
|
||||
StartTrainerBattle 0x1D9, 0
|
||||
GoTo _0563
|
||||
|
||||
_054B:
|
||||
ScrCmd_0E5 0x1DA, 0
|
||||
StartTrainerBattle 0x1DA, 0
|
||||
GoTo _0563
|
||||
|
||||
_0557:
|
||||
ScrCmd_0E5 0x1DB, 0
|
||||
StartTrainerBattle 0x1DB, 0
|
||||
GoTo _0563
|
||||
|
||||
_0563:
|
||||
|
||||
@@ -48,7 +48,7 @@ _0076:
|
||||
ScrCmd_1CD 9, 122, 0, 0, 0
|
||||
Message 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x13C, 0
|
||||
StartTrainerBattle 0x13C, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _016B
|
||||
Message 1
|
||||
|
||||
@@ -30,11 +30,11 @@ _000A:
|
||||
End
|
||||
|
||||
_007A:
|
||||
ScrCmd_0E5 0x105, 0
|
||||
StartTrainerBattle 0x105, 0
|
||||
Return
|
||||
|
||||
_0082:
|
||||
ScrCmd_0E5 0x362, 0
|
||||
StartTrainerBattle 0x362, 0
|
||||
Return
|
||||
|
||||
_008A:
|
||||
|
||||
@@ -30,11 +30,11 @@ _000A:
|
||||
End
|
||||
|
||||
_007A:
|
||||
ScrCmd_0E5 0x106, 0
|
||||
StartTrainerBattle 0x106, 0
|
||||
Return
|
||||
|
||||
_0082:
|
||||
ScrCmd_0E5 0x363, 0
|
||||
StartTrainerBattle 0x363, 0
|
||||
Return
|
||||
|
||||
_008A:
|
||||
|
||||
@@ -59,11 +59,11 @@ _00F0:
|
||||
Return
|
||||
|
||||
_00F5:
|
||||
ScrCmd_0E5 0x10B, 0
|
||||
StartTrainerBattle 0x10B, 0
|
||||
Return
|
||||
|
||||
_00FD:
|
||||
ScrCmd_0E5 0x366, 0
|
||||
StartTrainerBattle 0x366, 0
|
||||
Return
|
||||
|
||||
_0105:
|
||||
|
||||
@@ -32,11 +32,11 @@ _000A:
|
||||
End
|
||||
|
||||
_00A0:
|
||||
ScrCmd_0E5 0x107, 0
|
||||
StartTrainerBattle 0x107, 0
|
||||
Return
|
||||
|
||||
_00A8:
|
||||
ScrCmd_0E5 0x364, 0
|
||||
StartTrainerBattle 0x364, 0
|
||||
Return
|
||||
|
||||
_00B0:
|
||||
|
||||
@@ -30,11 +30,11 @@ _000A:
|
||||
End
|
||||
|
||||
_007A:
|
||||
ScrCmd_0E5 0x108, 0
|
||||
StartTrainerBattle 0x108, 0
|
||||
Return
|
||||
|
||||
_0082:
|
||||
ScrCmd_0E5 0x365, 0
|
||||
StartTrainerBattle 0x365, 0
|
||||
Return
|
||||
|
||||
_008A:
|
||||
|
||||
@@ -154,15 +154,15 @@ _01C1:
|
||||
GoTo _01F7
|
||||
|
||||
_01F7:
|
||||
ScrCmd_0E5 0x1DF, 0
|
||||
StartTrainerBattle 0x1DF, 0
|
||||
GoTo _021B
|
||||
|
||||
_0203:
|
||||
ScrCmd_0E5 0x1E0, 0
|
||||
StartTrainerBattle 0x1E0, 0
|
||||
GoTo _021B
|
||||
|
||||
_020F:
|
||||
ScrCmd_0E5 0x1E1, 0
|
||||
StartTrainerBattle 0x1E1, 0
|
||||
GoTo _021B
|
||||
|
||||
_021B:
|
||||
|
||||
@@ -95,7 +95,7 @@ _00FF:
|
||||
WaitMovement
|
||||
Message 15
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x381, 0
|
||||
StartTrainerBattle 0x381, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0484
|
||||
AddVar 0x8005, 0x404D
|
||||
@@ -107,7 +107,7 @@ _00FF:
|
||||
WaitMovement
|
||||
Message 17
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x382, 0
|
||||
StartTrainerBattle 0x382, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0484
|
||||
AddVar 0x8005, 0x404D
|
||||
@@ -119,7 +119,7 @@ _00FF:
|
||||
WaitMovement
|
||||
Message 19
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x383, 0
|
||||
StartTrainerBattle 0x383, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0484
|
||||
AddVar 0x8005, 0x404D
|
||||
@@ -131,7 +131,7 @@ _00FF:
|
||||
WaitMovement
|
||||
Message 21
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x384, 0
|
||||
StartTrainerBattle 0x384, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0484
|
||||
AddVar 0x8005, 0x404D
|
||||
@@ -151,7 +151,7 @@ _00FF:
|
||||
WaitMovement
|
||||
Message 23
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x385, 0
|
||||
StartTrainerBattle 0x385, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0484
|
||||
AddVar 0x8005, 0x404D
|
||||
@@ -179,7 +179,7 @@ _00FF:
|
||||
CallIfEq 0x8006, 0, _03CD
|
||||
CallIfEq 0x8006, 1, _03D2
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x8007, 0
|
||||
StartTrainerBattle 0x8007, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0484
|
||||
SetTrainerFlag 0x37C
|
||||
|
||||
@@ -228,7 +228,7 @@ _03C8:
|
||||
|
||||
_03E7:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x218, 0x227
|
||||
StartTrainerBattle 0x218, 0x227
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x218
|
||||
@@ -350,7 +350,7 @@ _0572:
|
||||
|
||||
_0591:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x218, 0x227
|
||||
StartTrainerBattle 0x218, 0x227
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x218
|
||||
@@ -472,7 +472,7 @@ _071C:
|
||||
|
||||
_073B:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x221, 0x222
|
||||
StartTrainerBattle 0x221, 0x222
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x221
|
||||
@@ -594,7 +594,7 @@ _08C6:
|
||||
|
||||
_08E5:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x221, 0x222
|
||||
StartTrainerBattle 0x221, 0x222
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x221
|
||||
@@ -716,7 +716,7 @@ _0A70:
|
||||
|
||||
_0A8F:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x21E, 0x21F
|
||||
StartTrainerBattle 0x21E, 0x21F
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x21E
|
||||
@@ -838,7 +838,7 @@ _0C1A:
|
||||
|
||||
_0C39:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x21E, 0x21F
|
||||
StartTrainerBattle 0x21E, 0x21F
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x21E
|
||||
@@ -960,7 +960,7 @@ _0DC4:
|
||||
|
||||
_0DE3:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x21B, 0x217
|
||||
StartTrainerBattle 0x21B, 0x217
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x21B
|
||||
@@ -1082,7 +1082,7 @@ _0F6E:
|
||||
|
||||
_0F8D:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x21B, 0x217
|
||||
StartTrainerBattle 0x21B, 0x217
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x21B
|
||||
@@ -1204,7 +1204,7 @@ _1118:
|
||||
|
||||
_1137:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x224, 0x21C
|
||||
StartTrainerBattle 0x224, 0x21C
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x224
|
||||
@@ -1326,7 +1326,7 @@ _12C2:
|
||||
|
||||
_12E1:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x224, 0x21C
|
||||
StartTrainerBattle 0x224, 0x21C
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x224
|
||||
@@ -1448,7 +1448,7 @@ _146C:
|
||||
|
||||
_148B:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x228, 0x220
|
||||
StartTrainerBattle 0x228, 0x220
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x228
|
||||
@@ -1570,7 +1570,7 @@ _1616:
|
||||
|
||||
_1635:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x228, 0x220
|
||||
StartTrainerBattle 0x228, 0x220
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x228
|
||||
@@ -1692,7 +1692,7 @@ _17C0:
|
||||
|
||||
_17DF:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x21A, 0x223
|
||||
StartTrainerBattle 0x21A, 0x223
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x21A
|
||||
@@ -1814,7 +1814,7 @@ _196A:
|
||||
|
||||
_1989:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x21A, 0x223
|
||||
StartTrainerBattle 0x21A, 0x223
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x21A
|
||||
@@ -1936,7 +1936,7 @@ _1B14:
|
||||
|
||||
_1B33:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x21D, 0x226
|
||||
StartTrainerBattle 0x21D, 0x226
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x21D
|
||||
@@ -2058,7 +2058,7 @@ _1CBE:
|
||||
|
||||
_1CDD:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x21D, 0x226
|
||||
StartTrainerBattle 0x21D, 0x226
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x21D
|
||||
@@ -2180,7 +2180,7 @@ _1E68:
|
||||
|
||||
_1E87:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x225, 0x219
|
||||
StartTrainerBattle 0x225, 0x219
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x225
|
||||
@@ -2302,7 +2302,7 @@ _2012:
|
||||
|
||||
_2031:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x225, 0x219
|
||||
StartTrainerBattle 0x225, 0x219
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _2125
|
||||
SetTrainerFlag 0x225
|
||||
|
||||
@@ -44,7 +44,7 @@ _00AE:
|
||||
Message 2
|
||||
ScrCmd_04D
|
||||
CloseMessage
|
||||
ScrCmd_2BD 0x179, 30
|
||||
StartLegendaryBattle SPECIES_REGIROCK, 30
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0109
|
||||
CheckDidNotCapture 0x800C
|
||||
|
||||
@@ -364,15 +364,15 @@ _057A:
|
||||
End
|
||||
|
||||
_05B1:
|
||||
ScrCmd_125 0x352
|
||||
StartFirstBattle 0x352
|
||||
GoTo _05CF
|
||||
|
||||
_05BB:
|
||||
ScrCmd_125 0x353
|
||||
StartFirstBattle 0x353
|
||||
GoTo _05CF
|
||||
|
||||
_05C5:
|
||||
ScrCmd_125 0x354
|
||||
StartFirstBattle 0x354
|
||||
GoTo _05CF
|
||||
|
||||
_05CF:
|
||||
|
||||
@@ -130,7 +130,7 @@ _01C5:
|
||||
ApplyMovement 3, _0488
|
||||
ApplyMovement 0xFF, _04BC
|
||||
WaitMovement
|
||||
ScrCmd_126
|
||||
StartCatchingTutorial
|
||||
ApplyMovement 3, _0490
|
||||
WaitMovement
|
||||
GetPlayerGender 0x800C
|
||||
|
||||
@@ -95,15 +95,15 @@ _0111:
|
||||
GoTo _0140
|
||||
|
||||
_0140:
|
||||
ScrCmd_0E5 247, 0
|
||||
StartTrainerBattle 247, 0
|
||||
GoTo _0164
|
||||
|
||||
_014C:
|
||||
ScrCmd_0E5 248, 0
|
||||
StartTrainerBattle 248, 0
|
||||
GoTo _0164
|
||||
|
||||
_0158:
|
||||
ScrCmd_0E5 249, 0
|
||||
StartTrainerBattle 249, 0
|
||||
GoTo _0164
|
||||
|
||||
_0164:
|
||||
|
||||
@@ -84,7 +84,7 @@ _014D:
|
||||
Message 9
|
||||
ScrCmd_04D
|
||||
CloseMessage
|
||||
ScrCmd_124 0x1BA, 25
|
||||
StartWildBattle SPECIES_SPIRITOMB, 25
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _017F
|
||||
SetVar 0x408A, 0
|
||||
|
||||
@@ -38,17 +38,17 @@ _001D:
|
||||
End
|
||||
|
||||
_00A5:
|
||||
ScrCmd_0E5 0x1D6, 0
|
||||
StartTrainerBattle 0x1D6, 0
|
||||
GoTo _00CF
|
||||
End
|
||||
|
||||
_00B3:
|
||||
ScrCmd_0E5 0x1D7, 0
|
||||
StartTrainerBattle 0x1D7, 0
|
||||
GoTo _00CF
|
||||
End
|
||||
|
||||
_00C1:
|
||||
ScrCmd_0E5 0x1D8, 0
|
||||
StartTrainerBattle 0x1D8, 0
|
||||
GoTo _00CF
|
||||
End
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ _0025:
|
||||
ScrCmd_1CD 9, 167, 0, 0, 0
|
||||
Message 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x13F, 0
|
||||
StartTrainerBattle 0x13F, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _010E
|
||||
Message 1
|
||||
|
||||
@@ -47,7 +47,7 @@ _0081:
|
||||
ScrCmd_04C 0x1E6, 0
|
||||
ScrCmd_04D
|
||||
SetFlag 142
|
||||
ScrCmd_2BD 0x1E6, 1
|
||||
StartLegendaryBattle SPECIES_REGIGIGAS, 1
|
||||
ClearFlag 142
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _00D1
|
||||
|
||||
@@ -136,7 +136,7 @@ _01A6:
|
||||
_01CA:
|
||||
Message 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x209, 0x20F
|
||||
StartTrainerBattle 0x209, 0x20F
|
||||
CheckWonBattle 0x800C
|
||||
Return
|
||||
|
||||
@@ -215,7 +215,7 @@ _0249:
|
||||
Message 9
|
||||
CloseMessage
|
||||
Call _0424
|
||||
ScrCmd_2A0 0x8004, 0x210, 0x197
|
||||
StartTagBattle 0x8004, 0x210, 0x197
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _02D0
|
||||
Call _0456
|
||||
|
||||
@@ -39,7 +39,7 @@ _0077:
|
||||
Message 1
|
||||
ScrCmd_04D
|
||||
CloseMessage
|
||||
ScrCmd_2BD 0x1E3, 70
|
||||
StartLegendaryBattle SPECIES_DIALGA, 70
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _00E8
|
||||
SetVar 0x40C4, 1
|
||||
|
||||
@@ -39,7 +39,7 @@ _0077:
|
||||
Message 1
|
||||
ScrCmd_04D
|
||||
CloseMessage
|
||||
ScrCmd_2BD 0x1E4, 70
|
||||
StartLegendaryBattle SPECIES_PALKIA, 70
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _00E8
|
||||
SetVar 0x40C5, 1
|
||||
|
||||
@@ -19,7 +19,7 @@ _0014:
|
||||
CloseMessage
|
||||
ApplyMovement 0, _0160
|
||||
WaitMovement
|
||||
ScrCmd_0E5 0x39E, 0
|
||||
StartTrainerBattle 0x39E, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0150
|
||||
Message 1
|
||||
@@ -32,7 +32,7 @@ _0014:
|
||||
CloseMessage
|
||||
ApplyMovement 4, _01CC
|
||||
WaitMovement
|
||||
ScrCmd_0E5 0x39F, 0
|
||||
StartTrainerBattle 0x39F, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0150
|
||||
Message 3
|
||||
|
||||
@@ -108,7 +108,7 @@ _00E6:
|
||||
Message 15
|
||||
CloseMessage
|
||||
SetFlag 142
|
||||
ScrCmd_2BD 0x1E5, 50
|
||||
StartLegendaryBattle SPECIES_HEATRAN, 50
|
||||
ClearFlag 142
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0168
|
||||
|
||||
@@ -30,7 +30,7 @@ _0027:
|
||||
ScrCmd_1CD 9, 156, 0, 0, 0
|
||||
Message 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x140, 0
|
||||
StartTrainerBattle 0x140, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _011A
|
||||
Message 1
|
||||
|
||||
@@ -183,12 +183,12 @@ _01FA:
|
||||
End
|
||||
|
||||
_021A:
|
||||
ScrCmd_0E5 0x345, 0
|
||||
StartTrainerBattle 0x345, 0
|
||||
GoTo _02AE
|
||||
End
|
||||
|
||||
_0228:
|
||||
ScrCmd_0E5 0x367, 0
|
||||
StartTrainerBattle 0x367, 0
|
||||
GoTo _02AE
|
||||
End
|
||||
|
||||
@@ -199,12 +199,12 @@ _0236:
|
||||
End
|
||||
|
||||
_0256:
|
||||
ScrCmd_0E5 0x346, 0
|
||||
StartTrainerBattle 0x346, 0
|
||||
GoTo _02AE
|
||||
End
|
||||
|
||||
_0264:
|
||||
ScrCmd_0E5 0x368, 0
|
||||
StartTrainerBattle 0x368, 0
|
||||
GoTo _02AE
|
||||
End
|
||||
|
||||
@@ -215,12 +215,12 @@ _0272:
|
||||
End
|
||||
|
||||
_0292:
|
||||
ScrCmd_0E5 0x347, 0
|
||||
StartTrainerBattle 0x347, 0
|
||||
GoTo _02AE
|
||||
End
|
||||
|
||||
_02A0:
|
||||
ScrCmd_0E5 0x369, 0
|
||||
StartTrainerBattle 0x369, 0
|
||||
GoTo _02AE
|
||||
End
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ _0022:
|
||||
WaitMovement
|
||||
Message 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x196, 0
|
||||
StartTrainerBattle 0x196, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0135
|
||||
Message 1
|
||||
|
||||
@@ -175,17 +175,17 @@ _01E7:
|
||||
End
|
||||
|
||||
_0212:
|
||||
ScrCmd_0E5 0x156, 0
|
||||
StartTrainerBattle 0x156, 0
|
||||
GoTo _023C
|
||||
End
|
||||
|
||||
_0220:
|
||||
ScrCmd_0E5 0x156, 0
|
||||
StartTrainerBattle 0x156, 0
|
||||
GoTo _023C
|
||||
End
|
||||
|
||||
_022E:
|
||||
ScrCmd_0E5 0x156, 0
|
||||
StartTrainerBattle 0x156, 0
|
||||
GoTo _023C
|
||||
End
|
||||
|
||||
@@ -269,17 +269,17 @@ _031A:
|
||||
End
|
||||
|
||||
_0345:
|
||||
ScrCmd_0E5 0x159, 0
|
||||
StartTrainerBattle 0x159, 0
|
||||
GoTo _036F
|
||||
End
|
||||
|
||||
_0353:
|
||||
ScrCmd_0E5 0x159, 0
|
||||
StartTrainerBattle 0x159, 0
|
||||
GoTo _036F
|
||||
End
|
||||
|
||||
_0361:
|
||||
ScrCmd_0E5 0x159, 0
|
||||
StartTrainerBattle 0x159, 0
|
||||
GoTo _036F
|
||||
End
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ _0037:
|
||||
Message 0
|
||||
CloseMessage
|
||||
SetFlag 142
|
||||
ScrCmd_2BD 0x1E7, 47
|
||||
StartLegendaryBattle SPECIES_GIRATINA, 47
|
||||
ClearFlag 142
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _009B
|
||||
|
||||
@@ -163,7 +163,7 @@ _02A4:
|
||||
ScrCmd_2BA 0x800C
|
||||
GoToIfEq 0x800C, 1, _0B63
|
||||
GoToIfEq 0x800C, 2, _0B63
|
||||
ScrCmd_0F6
|
||||
StartLinkBattle
|
||||
Call _0BB2
|
||||
GoTo _00D0
|
||||
End
|
||||
@@ -616,7 +616,7 @@ _095C:
|
||||
ScrCmd_2BA 0x800C
|
||||
GoToIfEq 0x800C, 1, _0B63
|
||||
GoToIfEq 0x800C, 2, _0B63
|
||||
ScrCmd_0F6
|
||||
StartLinkBattle
|
||||
ScrCmd_139 11
|
||||
Call _0BB2
|
||||
GoTo _07D4
|
||||
|
||||
@@ -529,7 +529,7 @@ _06D5:
|
||||
|
||||
_06F4:
|
||||
IncrementGameRecord RECORD_UNK_117
|
||||
ScrCmd_129
|
||||
StartHoneyTreeBattle
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0713
|
||||
ScrCmd_12A
|
||||
|
||||
@@ -399,7 +399,7 @@ _0513:
|
||||
Return
|
||||
|
||||
_051E:
|
||||
ScrCmd_0F6
|
||||
StartLinkBattle
|
||||
ScrCmd_151
|
||||
End
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ _0631:
|
||||
|
||||
_0687:
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x8005, 0
|
||||
StartTrainerBattle 0x8005, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0822
|
||||
GoTo _06A8
|
||||
|
||||
@@ -962,7 +962,7 @@ _0F01:
|
||||
_0F1D:
|
||||
CloseMessage
|
||||
ScrCmd_20B
|
||||
ScrCmd_0E5 0x8004, 0
|
||||
StartTrainerBattle 0x8004, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0FC5
|
||||
SetTrainerFlag 0x8004
|
||||
@@ -1067,7 +1067,7 @@ _1083:
|
||||
OpenMessage
|
||||
ScrCmd_0E6 0x8004, 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x8004, 0
|
||||
StartTrainerBattle 0x8004, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0FC5
|
||||
ScrCmd_0B9 0, 0x800C
|
||||
@@ -1098,7 +1098,7 @@ _10F3:
|
||||
OpenMessage
|
||||
ScrCmd_0E6 0x8005, 7
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x8004, 0x8005
|
||||
StartTrainerBattle 0x8004, 0x8005
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0FC5
|
||||
ScrCmd_0B9 0, 0x800C
|
||||
@@ -1138,7 +1138,7 @@ _11A0:
|
||||
OpenMessage
|
||||
ScrCmd_0E6 0x8005, 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x8004, 0x8005
|
||||
StartTrainerBattle 0x8004, 0x8005
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0FC5
|
||||
ScrCmd_0B9 0, 0x800C
|
||||
|
||||
@@ -88,7 +88,7 @@ _00F5:
|
||||
_0107:
|
||||
Message 2
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x127, 0
|
||||
StartTrainerBattle 0x127, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _02B9
|
||||
Message 3
|
||||
|
||||
@@ -63,7 +63,7 @@ _00CF:
|
||||
FacePlayer
|
||||
Message 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x34B, 0
|
||||
StartTrainerBattle 0x34B, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0133
|
||||
Message 1
|
||||
@@ -146,7 +146,7 @@ _01BF:
|
||||
CloseMessage
|
||||
ScrCmd_04D
|
||||
SetFlag 142
|
||||
ScrCmd_2BD 0x1A9, 15
|
||||
StartLegendaryBattle SPECIES_DRIFLOON, 15
|
||||
ClearFlag 142
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _01FB
|
||||
|
||||
@@ -43,7 +43,7 @@ _0077:
|
||||
Message 3
|
||||
CloseMessage
|
||||
SetFlag 142
|
||||
ScrCmd_2BD 0x1E2, 50
|
||||
StartLegendaryBattle SPECIES_AZELF, 50
|
||||
ClearFlag 142
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _00CD
|
||||
@@ -76,7 +76,7 @@ _00D3:
|
||||
WaitTime 30, 0x800C
|
||||
Message 1
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x198, 0
|
||||
StartTrainerBattle 0x198, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0144
|
||||
Message 2
|
||||
|
||||
@@ -84,7 +84,7 @@ _013A:
|
||||
FacePlayer
|
||||
Message 2
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x34F, 0
|
||||
StartTrainerBattle 0x34F, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _01D9
|
||||
Message 3
|
||||
|
||||
@@ -507,7 +507,7 @@ _0656:
|
||||
CallIfEq 0x800C, 1, _09B3
|
||||
CallIfEq 0x800C, 0, _09C7
|
||||
Call _0919
|
||||
ScrCmd_2A0 0x8004, 0x350, 0x351
|
||||
StartTagBattle 0x8004, 0x350, 0x351
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0A73
|
||||
Message 16
|
||||
|
||||
@@ -24,7 +24,7 @@ _0022:
|
||||
ScrCmd_1CD 9, 133, 0, 0, 0
|
||||
Message 0
|
||||
CloseMessage
|
||||
ScrCmd_0E5 0x13D, 0
|
||||
StartTrainerBattle 0x13D, 0
|
||||
CheckWonBattle 0x800C
|
||||
GoToIfEq 0x800C, 0, _0118
|
||||
Message 1
|
||||
|
||||
@@ -109,9 +109,9 @@ static const EncEffectsPair sEncEffectsTable[35] = {
|
||||
[ENCEFF_NORMAL_WILD] = { ENCEFF_CUTIN_USE_LOCAL, SEQ_BATTLE_WILD_POKEMON }
|
||||
};
|
||||
|
||||
static u32 EncEffects_GetEffectPair(const FieldBattleDTO *battleParams);
|
||||
static u32 EncEffects_CutInEffectForPair(u32 effectPairID, const FieldBattleDTO *battleParams);
|
||||
static u32 EncEffects_BGMForPair(u32 effectPairID, const FieldBattleDTO *battleParams);
|
||||
static u32 EncEffects_GetEffectPair(const FieldBattleDTO *dto);
|
||||
static u32 EncEffects_CutInEffectForPair(u32 effectPairID, const FieldBattleDTO *dto);
|
||||
static u32 EncEffects_BGMForPair(u32 effectPairID, const FieldBattleDTO *dto);
|
||||
static u32 EncEffects_TrainerClassEffect(u32 trainerClass);
|
||||
static u32 EncEffects_WildPokemonEffect(Party *wildParty, int mapHeaderID);
|
||||
|
||||
@@ -122,12 +122,12 @@ inline BOOL EncEffects_Galactic(u32 effect)
|
||||
|| (effect == ENCEFF_GALACTIC_CYRUS);
|
||||
}
|
||||
|
||||
static u32 EncEffects_GetEffectPair(const FieldBattleDTO *battleParams)
|
||||
static u32 EncEffects_GetEffectPair(const FieldBattleDTO *dto)
|
||||
{
|
||||
u32 battleType = battleParams->battleType;
|
||||
u32 battleType = dto->battleType;
|
||||
|
||||
if (battleType & BATTLE_TYPE_TRAINER) {
|
||||
u32 trainerEffect = EncEffects_TrainerClassEffect(battleParams->trainerData[1].class);
|
||||
u32 trainerEffect = EncEffects_TrainerClassEffect(dto->trainerData[1].class);
|
||||
|
||||
if (battleType & BATTLE_TYPE_FRONTIER) {
|
||||
if (trainerEffect == ENCEFF_FRONTIER_BRAIN) {
|
||||
@@ -164,7 +164,7 @@ static u32 EncEffects_GetEffectPair(const FieldBattleDTO *battleParams)
|
||||
return trainerEffect;
|
||||
}
|
||||
|
||||
u32 pokemonEffect = EncEffects_WildPokemonEffect(battleParams->parties[1], battleParams->mapHeaderID);
|
||||
u32 pokemonEffect = EncEffects_WildPokemonEffect(dto->parties[1], dto->mapHeaderID);
|
||||
|
||||
if (pokemonEffect < ENCEFF_NORMAL_WILD) {
|
||||
return pokemonEffect;
|
||||
@@ -177,34 +177,34 @@ static u32 EncEffects_GetEffectPair(const FieldBattleDTO *battleParams)
|
||||
return pokemonEffect;
|
||||
}
|
||||
|
||||
static u32 EncEffects_CutInEffectForPair(u32 effectPairID, const FieldBattleDTO *battleParams)
|
||||
static u32 EncEffects_CutInEffectForPair(u32 effectPairID, const FieldBattleDTO *dto)
|
||||
{
|
||||
GF_ASSERT(effectPairID < ENCEFF_MAX);
|
||||
|
||||
// If the cut-in effect specifies, determine what effect to use
|
||||
// based on the encounter locale.
|
||||
if (sEncEffectsTable[effectPairID].cutInEffect == ENCEFF_CUTIN_USE_LOCAL) {
|
||||
return CutInEffects_ForBattle(battleParams);
|
||||
return CutInEffects_ForBattle(dto);
|
||||
}
|
||||
|
||||
return sEncEffectsTable[effectPairID].cutInEffect;
|
||||
}
|
||||
|
||||
static u32 EncEffects_BGMForPair(u32 effectPairID, const FieldBattleDTO *battleParams)
|
||||
static u32 EncEffects_BGMForPair(u32 effectPairID, const FieldBattleDTO *dto)
|
||||
{
|
||||
GF_ASSERT(effectPairID < ENCEFF_MAX);
|
||||
|
||||
return sEncEffectsTable[effectPairID].sdatBGMusic;
|
||||
}
|
||||
|
||||
u32 EncEffects_CutInEffect(const FieldBattleDTO *battleParams)
|
||||
u32 EncEffects_CutInEffect(const FieldBattleDTO *dto)
|
||||
{
|
||||
return EncEffects_CutInEffectForPair(EncEffects_GetEffectPair(battleParams), battleParams);
|
||||
return EncEffects_CutInEffectForPair(EncEffects_GetEffectPair(dto), dto);
|
||||
}
|
||||
|
||||
u32 EncEffects_BGM(const FieldBattleDTO *battleParams)
|
||||
u32 EncEffects_BGM(const FieldBattleDTO *dto)
|
||||
{
|
||||
return EncEffects_BGMForPair(EncEffects_GetEffectPair(battleParams), battleParams);
|
||||
return EncEffects_BGMForPair(EncEffects_GetEffectPair(dto), dto);
|
||||
}
|
||||
|
||||
static u32 EncEffects_TrainerClassEffect(u32 trainerClass)
|
||||
|
||||
1109
src/encounter.c
1109
src/encounter.c
File diff suppressed because it is too large
Load Diff
@@ -536,9 +536,9 @@ static void sub_02059D58(void)
|
||||
sub_020389A0(v2);
|
||||
|
||||
if (sFieldCommMan->party == NULL) {
|
||||
sub_020517E8(sFieldCommMan->fieldSystem, v2, v1);
|
||||
Encounter_NewVsLinkWithRecording(sFieldCommMan->fieldSystem, v2, v1);
|
||||
} else {
|
||||
sub_0205184C(sFieldCommMan->fieldSystem, sFieldCommMan->party, v1);
|
||||
Encounter_NewVsLinkWithRecordingAndParty(sFieldCommMan->fieldSystem, sFieldCommMan->party, v1);
|
||||
Heap_FreeToHeap(sFieldCommMan->party);
|
||||
sFieldCommMan->party = NULL;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "field_overworld_state.h"
|
||||
#include "field_system.h"
|
||||
#include "field_task.h"
|
||||
#include "field_transition.h"
|
||||
#include "game_overlay.h"
|
||||
#include "heap.h"
|
||||
#include "inlines.h"
|
||||
@@ -62,7 +63,6 @@
|
||||
#include "unk_02054BD0.h"
|
||||
#include "unk_02054D00.h"
|
||||
#include "unk_020553DC.h"
|
||||
#include "unk_02055808.h"
|
||||
#include "unk_020559DC.h"
|
||||
#include "unk_0205B33C.h"
|
||||
#include "unk_0205C22C.h"
|
||||
@@ -142,15 +142,15 @@ static void sub_02053374(FieldSystem *fieldSystem);
|
||||
static void sub_020534BC(FieldSystem *fieldSystem);
|
||||
static BOOL FieldTask_MapChangeFly(FieldTask *taskMan);
|
||||
static void FieldTask_FinishFly(FieldTask *taskMan);
|
||||
static BOOL FieldTask_FinishFieldMapFly(FieldTask *taskMan);
|
||||
static void FieldTask_StartFadeInFly(FieldTask *taskMan);
|
||||
static BOOL FieldTask_StartFadeInFlySub(FieldTask *taskMan);
|
||||
static BOOL FieldTransition_FinishMapFly(FieldTask *taskMan);
|
||||
static void FieldTransition_StartMapAndFadeInFly(FieldTask *taskMan);
|
||||
static BOOL FieldTransition_StartMapAndFadeInFlySub(FieldTask *taskMan);
|
||||
static void FieldTask_FadeInFly(FieldTask *taskMan);
|
||||
static BOOL FieldTask_WaitFadeInFly(FieldTask *taskMan);
|
||||
static BOOL FieldTask_MapChangeByDig(FieldTask *taskMan);
|
||||
static void FieldTask_StartFinishFieldMapDig(FieldTask *taskMan);
|
||||
static BOOL FieldTask_FinishFieldMapDig(FieldTask *taskMan);
|
||||
static void FieldTask_StartFadeInDig(FieldTask *taskMan);
|
||||
static BOOL FieldTransition_FinishMapDig(FieldTask *taskMan);
|
||||
static void FieldTransition_StartMapAndFadeInDig(FieldTask *taskMan);
|
||||
static BOOL FieldTask_FadeInDig(FieldTask *taskMan);
|
||||
static void sub_02053E5C(FieldTask *taskMan);
|
||||
static BOOL sub_0205444C(FieldTask *taskMan, int param1);
|
||||
@@ -459,7 +459,7 @@ static BOOL FieldTask_LoadNewGameSpawn(FieldTask *taskMan)
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
FieldTask_StartFadeIn(taskMan);
|
||||
FieldTransition_StartMapAndFadeIn(taskMan);
|
||||
(*state)++;
|
||||
break;
|
||||
case 2:
|
||||
@@ -523,7 +523,7 @@ static BOOL FieldTask_LoadSavedGameMap(FieldTask *taskMan)
|
||||
(*state) = 2;
|
||||
break;
|
||||
case 2:
|
||||
FieldTask_StartFadeIn(taskMan);
|
||||
FieldTransition_StartMapAndFadeIn(taskMan);
|
||||
(*state) = 3;
|
||||
break;
|
||||
case 3:
|
||||
@@ -570,7 +570,7 @@ static BOOL FieldTask_LoadMapFromError(FieldTask *taskMan)
|
||||
case 2:
|
||||
fieldSystem->unk_7C = FieldSystem_InitCommUnionRoom(fieldSystem);
|
||||
fieldSystem->unk_80 = sub_0205C22C(fieldSystem->unk_7C);
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
(*state)++;
|
||||
break;
|
||||
case 3:
|
||||
@@ -625,7 +625,7 @@ static BOOL FieldTask_ChangeMap(FieldTask *taskMan)
|
||||
case 0:
|
||||
Sound_PlayEffect(1539);
|
||||
Sound_TryFadeInBGM(fieldSystem, location->mapId);
|
||||
FieldTask_FinishFadeOut(taskMan);
|
||||
FieldTransition_FadeOutAndFinishMap(taskMan);
|
||||
mapChangeData->state++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -638,7 +638,7 @@ static BOOL FieldTask_ChangeMap(FieldTask *taskMan)
|
||||
}
|
||||
|
||||
Sound_PlayMapBGM(fieldSystem, location->mapId);
|
||||
FieldTask_StartFadeIn(taskMan);
|
||||
FieldTransition_StartMapAndFadeIn(taskMan);
|
||||
mapChangeData->state++;
|
||||
break;
|
||||
case 3:
|
||||
@@ -719,7 +719,7 @@ static BOOL FieldTask_ChangeMapFull(FieldTask *taskMan)
|
||||
switch (mapChangeSub->state) {
|
||||
case 0:
|
||||
Sound_TryFadeInBGM(fieldSystem, nextLocation->mapId);
|
||||
FieldTask_FinishFieldMap(taskMan);
|
||||
FieldTransition_FinishMap(taskMan);
|
||||
mapChangeSub->state++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -732,7 +732,7 @@ static BOOL FieldTask_ChangeMapFull(FieldTask *taskMan)
|
||||
}
|
||||
|
||||
Sound_PlayMapBGM(fieldSystem, nextLocation->mapId);
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
mapChangeSub->state++;
|
||||
break;
|
||||
case 3:
|
||||
@@ -807,7 +807,7 @@ static BOOL FieldTask_MapChangeFly(FieldTask *taskMan)
|
||||
|
||||
Sound_PlayMapBGM(fieldSystem, location->mapId);
|
||||
sub_0207056C(fieldSystem);
|
||||
FieldTask_StartFadeInFly(taskMan);
|
||||
FieldTransition_StartMapAndFadeInFly(taskMan);
|
||||
mapChangeData->state++;
|
||||
break;
|
||||
case 3:
|
||||
@@ -820,16 +820,16 @@ static BOOL FieldTask_MapChangeFly(FieldTask *taskMan)
|
||||
|
||||
static void FieldTask_FinishFly(FieldTask *taskMan)
|
||||
{
|
||||
FieldTask_InitCall(taskMan, FieldTask_FinishFieldMapFly, NULL);
|
||||
FieldTask_InitCall(taskMan, FieldTransition_FinishMapFly, NULL);
|
||||
}
|
||||
|
||||
static BOOL FieldTask_FinishFieldMapFly(FieldTask *taskMan)
|
||||
static BOOL FieldTransition_FinishMapFly(FieldTask *taskMan)
|
||||
{
|
||||
int *state = FieldTask_GetState(taskMan);
|
||||
|
||||
switch (*state) {
|
||||
case 0:
|
||||
FieldTask_FinishFieldMap(taskMan);
|
||||
FieldTransition_FinishMap(taskMan);
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -839,20 +839,20 @@ static BOOL FieldTask_FinishFieldMapFly(FieldTask *taskMan)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void FieldTask_StartFadeInFly(FieldTask *taskMan)
|
||||
static void FieldTransition_StartMapAndFadeInFly(FieldTask *taskMan)
|
||||
{
|
||||
MapChangeFlyData *mapChangeData = FieldTask_GetEnv(taskMan);
|
||||
FieldTask_InitCall(taskMan, FieldTask_StartFadeInFlySub, mapChangeData);
|
||||
FieldTask_InitCall(taskMan, FieldTransition_StartMapAndFadeInFlySub, mapChangeData);
|
||||
}
|
||||
|
||||
static BOOL FieldTask_StartFadeInFlySub(FieldTask *taskMan)
|
||||
static BOOL FieldTransition_StartMapAndFadeInFlySub(FieldTask *taskMan)
|
||||
{
|
||||
int *state = FieldTask_GetState(taskMan);
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan);
|
||||
|
||||
switch (*state) {
|
||||
case 0:
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -937,7 +937,7 @@ static BOOL FieldTask_MapChangeByDig(FieldTask *taskMan)
|
||||
GF_ASSERT(FALSE);
|
||||
}
|
||||
|
||||
FieldTask_StartFadeInDig(taskMan);
|
||||
FieldTransition_StartMapAndFadeInDig(taskMan);
|
||||
mapChangeData->state++;
|
||||
break;
|
||||
case 3:
|
||||
@@ -950,16 +950,16 @@ static BOOL FieldTask_MapChangeByDig(FieldTask *taskMan)
|
||||
|
||||
static void FieldTask_StartFinishFieldMapDig(FieldTask *taskMan)
|
||||
{
|
||||
FieldTask_InitCall(taskMan, FieldTask_FinishFieldMapDig, NULL);
|
||||
FieldTask_InitCall(taskMan, FieldTransition_FinishMapDig, NULL);
|
||||
}
|
||||
|
||||
static BOOL FieldTask_FinishFieldMapDig(FieldTask *taskMan)
|
||||
static BOOL FieldTransition_FinishMapDig(FieldTask *taskMan)
|
||||
{
|
||||
int *state = FieldTask_GetState(taskMan);
|
||||
|
||||
switch (*state) {
|
||||
case 0:
|
||||
FieldTask_FinishFieldMap(taskMan);
|
||||
FieldTransition_FinishMap(taskMan);
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -969,7 +969,7 @@ static BOOL FieldTask_FinishFieldMapDig(FieldTask *taskMan)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void FieldTask_StartFadeInDig(FieldTask *taskMan)
|
||||
static void FieldTransition_StartMapAndFadeInDig(FieldTask *taskMan)
|
||||
{
|
||||
MapChangeDigData *mapChangeData = FieldTask_GetEnv(taskMan);
|
||||
FieldTask_InitCall(taskMan, FieldTask_FadeInDig, mapChangeData);
|
||||
@@ -983,7 +983,7 @@ static BOOL FieldTask_FadeInDig(FieldTask *taskMan)
|
||||
|
||||
switch (*state) {
|
||||
case 0:
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -1026,7 +1026,7 @@ static BOOL FieldTask_MapChangeWarp(FieldTask *taskMan)
|
||||
case 1:
|
||||
if (mapChangeWarpData->warpFinished) {
|
||||
Sound_TryFadeInBGM(fieldSystem, nextLocation->mapId);
|
||||
FieldTask_FinishFieldMap(taskMan);
|
||||
FieldTransition_FinishMap(taskMan);
|
||||
mapChangeWarpData->state++;
|
||||
}
|
||||
break;
|
||||
@@ -1040,7 +1040,7 @@ static BOOL FieldTask_MapChangeWarp(FieldTask *taskMan)
|
||||
}
|
||||
|
||||
Sound_PlayMapBGM(fieldSystem, nextLocation->mapId);
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
mapChangeWarpData->state++;
|
||||
break;
|
||||
case 4:
|
||||
@@ -1214,7 +1214,7 @@ BOOL FieldTask_MapChangeToUnderground(FieldTask *taskMan)
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
FieldTask_FinishFieldMap(taskMan);
|
||||
FieldTransition_FinishMap(taskMan);
|
||||
mapChangeUndergroundData->state++;
|
||||
break;
|
||||
case 9:
|
||||
@@ -1231,7 +1231,7 @@ BOOL FieldTask_MapChangeToUnderground(FieldTask *taskMan)
|
||||
|
||||
sub_02004234(0);
|
||||
Sound_ClearSpecialBGM(fieldSystem);
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
mapChangeUndergroundData->state++;
|
||||
break;
|
||||
case 11:
|
||||
@@ -1282,7 +1282,7 @@ BOOL FieldTask_MapChangeFromUnderground(FieldTask *taskMan)
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
FieldTask_FinishFieldMap(taskMan);
|
||||
FieldTransition_FinishMap(taskMan);
|
||||
mapChangeUndergroundData->state++;
|
||||
break;
|
||||
case 4:
|
||||
@@ -1298,7 +1298,7 @@ BOOL FieldTask_MapChangeFromUnderground(FieldTask *taskMan)
|
||||
|
||||
sub_02004234(0);
|
||||
Sound_ClearSpecialBGM(fieldSystem);
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
mapChangeUndergroundData->state++;
|
||||
break;
|
||||
case 6:
|
||||
@@ -1405,7 +1405,7 @@ static BOOL sub_02054538(FieldTask *taskMan)
|
||||
break;
|
||||
case 1:
|
||||
if (mapChangeData->unk_04) {
|
||||
FieldTask_FinishFieldMap(taskMan);
|
||||
FieldTransition_FinishMap(taskMan);
|
||||
(*state)++;
|
||||
}
|
||||
break;
|
||||
@@ -1419,11 +1419,11 @@ static BOOL sub_02054538(FieldTask *taskMan)
|
||||
}
|
||||
|
||||
Sound_PlayMapBGM(fieldSystem, v3->mapId);
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
(*state)++;
|
||||
break;
|
||||
case 4:
|
||||
sub_020558F0(taskMan);
|
||||
FieldTransition_FadeIn(taskMan);
|
||||
(*state)++;
|
||||
break;
|
||||
case 5:
|
||||
@@ -1460,11 +1460,11 @@ static BOOL sub_02054648(FieldTask *taskMan)
|
||||
switch (*state) {
|
||||
case 0:
|
||||
Sound_TryFadeInBGM(fieldSystem, v3->mapId);
|
||||
sub_020558AC(taskMan);
|
||||
FieldTransition_FadeOut(taskMan);
|
||||
(*state)++;
|
||||
break;
|
||||
case 1:
|
||||
FieldTask_FinishFieldMap(taskMan);
|
||||
FieldTransition_FinishMap(taskMan);
|
||||
(*state)++;
|
||||
break;
|
||||
case 2:
|
||||
@@ -1477,7 +1477,7 @@ static BOOL sub_02054648(FieldTask *taskMan)
|
||||
}
|
||||
|
||||
Sound_PlayMapBGM(fieldSystem, v3->mapId);
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
(*state)++;
|
||||
break;
|
||||
case 4:
|
||||
@@ -1526,7 +1526,7 @@ static BOOL FieldTask_ChangeMapColosseum(FieldTask *taskMan)
|
||||
case 0:
|
||||
Sound_PlayEffect(1539);
|
||||
Sound_TryFadeInBGM(fieldSystem, location->mapId);
|
||||
FieldTask_FinishFadeOut(taskMan);
|
||||
FieldTransition_FadeOutAndFinishMap(taskMan);
|
||||
mapChangeData->state++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -1539,7 +1539,7 @@ static BOOL FieldTask_ChangeMapColosseum(FieldTask *taskMan)
|
||||
}
|
||||
|
||||
Sound_PlayMapBGM(fieldSystem, location->mapId);
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
mapChangeData->state++;
|
||||
break;
|
||||
case 3:
|
||||
|
||||
191
src/field_transition.c
Normal file
191
src/field_transition.c
Normal file
@@ -0,0 +1,191 @@
|
||||
#include "field_transition.h"
|
||||
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "constants/heap.h"
|
||||
|
||||
#include "field/field_system.h"
|
||||
#include "overlay005/encounter_effect.h"
|
||||
#include "overlay005/ov5_021DD6FC.h"
|
||||
|
||||
#include "field_system.h"
|
||||
#include "field_task.h"
|
||||
#include "heap.h"
|
||||
#include "unk_020041CC.h"
|
||||
#include "unk_0200F174.h"
|
||||
|
||||
typedef struct EncounterEffectTaskData {
|
||||
int taskState;
|
||||
BOOL done;
|
||||
int encEffectID;
|
||||
int battleBGM;
|
||||
} EncounterEffectTaskData;
|
||||
|
||||
static BOOL FieldTask_RunEncounterEffect(FieldTask *task)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task);
|
||||
EncounterEffectTaskData *data = FieldTask_GetEnv(task);
|
||||
|
||||
switch (data->taskState) {
|
||||
case 0:
|
||||
EncounterEffect_Start(data->encEffectID, fieldSystem, &data->done);
|
||||
sub_02004550(5, data->battleBGM, 1);
|
||||
data->taskState++;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (data->done == TRUE) {
|
||||
Heap_FreeToHeap(data);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void FieldTransition_StartEncounterEffect(FieldTask *task, int encEffectID, int battleBGM)
|
||||
{
|
||||
EncounterEffectTaskData *data = Heap_AllocFromHeapAtEnd(HEAP_ID_FIELDMAP, sizeof(EncounterEffectTaskData));
|
||||
|
||||
data->taskState = 0;
|
||||
data->done = FALSE;
|
||||
data->encEffectID = encEffectID;
|
||||
data->battleBGM = battleBGM;
|
||||
|
||||
FieldTask_InitCall(task, FieldTask_RunEncounterEffect, data);
|
||||
}
|
||||
|
||||
static BOOL FieldTask_WaitUntilMapFinished(FieldTask *task)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task);
|
||||
if (!FieldSystem_HasParentProcess(fieldSystem)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void FieldTransition_FinishMap(FieldTask *task)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task);
|
||||
if (!FieldSystem_HasParentProcess(fieldSystem)) {
|
||||
GF_ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
FieldSystem_FlagNotRunningFieldMap(fieldSystem);
|
||||
FieldTask_InitCall(task, FieldTask_WaitUntilMapFinished, NULL);
|
||||
}
|
||||
|
||||
static BOOL FieldTask_WaitUntilMapStarted(FieldTask *task)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task);
|
||||
if (FieldSystem_IsRunningFieldMap(fieldSystem)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void FieldTransition_StartMap(FieldTask *task)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task);
|
||||
if (FieldSystem_HasParentProcess(fieldSystem)) {
|
||||
GF_ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
FieldSystem_StartFieldMap(fieldSystem);
|
||||
FieldTask_InitCall(task, FieldTask_WaitUntilMapStarted, NULL);
|
||||
}
|
||||
|
||||
static BOOL FieldTask_WaitUntilScreenTransitionDone(FieldTask *task)
|
||||
{
|
||||
if (IsScreenTransitionDone()) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void FieldTransition_FadeOut(FieldTask *task)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task);
|
||||
if (!FieldSystem_HasParentProcess(fieldSystem)) {
|
||||
GF_ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
StartScreenTransition(0, 0, 0, 0x0, 6, 1, 4);
|
||||
FieldTask_InitCall(task, FieldTask_WaitUntilScreenTransitionDone, NULL);
|
||||
}
|
||||
|
||||
void FieldTransition_FadeIn(FieldTask *task)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task);
|
||||
if (!FieldSystem_HasParentProcess(fieldSystem)) {
|
||||
GF_ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
StartScreenTransition(0, 1, 1, 0x0, 6, 1, 4);
|
||||
FieldTask_InitCall(task, FieldTask_WaitUntilScreenTransitionDone, NULL);
|
||||
}
|
||||
|
||||
static BOOL FieldTask_FadeOutAndFinishMap(FieldTask *task)
|
||||
{
|
||||
int *state = FieldTask_GetState(task);
|
||||
|
||||
switch (*state) {
|
||||
case 0:
|
||||
FieldTransition_FadeOut(task);
|
||||
(*state)++;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
FieldTransition_FinishMap(task);
|
||||
(*state)++;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void FieldTransition_FadeOutAndFinishMap(FieldTask *task)
|
||||
{
|
||||
FieldTask_InitCall(task, FieldTask_FadeOutAndFinishMap, NULL);
|
||||
}
|
||||
|
||||
static BOOL FieldTask_StartMapAndFadeIn(FieldTask *task)
|
||||
{
|
||||
int *state = FieldTask_GetState(task);
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task);
|
||||
|
||||
switch (*state) {
|
||||
case 0:
|
||||
FieldTransition_StartMap(task);
|
||||
(*state)++;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
FieldSystem_RequestLocationName(fieldSystem);
|
||||
FieldTransition_FadeIn(task);
|
||||
(*state)++;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void FieldTransition_StartMapAndFadeIn(FieldTask *task)
|
||||
{
|
||||
FieldTask_InitCall(task, FieldTask_StartMapAndFadeIn, NULL);
|
||||
}
|
||||
@@ -92,8 +92,8 @@ static u8 sUsesHighLimit[MAX_RECORDS] = {
|
||||
[RECORD_UNK_004] = TRUE,
|
||||
[RECORD_UNK_005] = TRUE,
|
||||
[RECORD_UNK_006] = TRUE,
|
||||
[RECORD_UNK_007] = TRUE,
|
||||
[RECORD_UNK_008] = TRUE,
|
||||
[RECORD_WILD_BATTLES_FOUGHT] = TRUE,
|
||||
[RECORD_TRAINER_BATTLES_FOUGHT] = TRUE,
|
||||
[RECORD_UNK_009] = FALSE,
|
||||
[RECORD_UNK_010] = FALSE,
|
||||
[RECORD_UNK_011] = FALSE,
|
||||
@@ -264,10 +264,10 @@ static const u16 sTrainerScoreIncrements[MAX_TRAINER_SCORE_EVENTS] = {
|
||||
[TRAINER_SCORE_EVENT_UNK_05] = 1,
|
||||
[TRAINER_SCORE_EVENT_UNK_06] = 2,
|
||||
[TRAINER_SCORE_EVENT_UNK_07] = 2,
|
||||
[TRAINER_SCORE_EVENT_UNK_08] = 2,
|
||||
[TRAINER_SCORE_EVENT_UNK_09] = 2,
|
||||
[TRAINER_SCORE_EVENT_UNK_10] = 3,
|
||||
[TRAINER_SCORE_EVENT_UNK_11] = 3,
|
||||
[TRAINER_SCORE_EVENT_WON_WILD_BATTLE] = 2,
|
||||
[TRAINER_SCORE_EVENT_CAPTURED_REGIONAL_MON] = 2,
|
||||
[TRAINER_SCORE_EVENT_CAPTURED_NATIONAL_MON] = 3,
|
||||
[TRAINER_SCORE_EVENT_WON_TRAINER_BATTLE] = 3,
|
||||
[TRAINER_SCORE_EVENT_UNK_12] = 3,
|
||||
[TRAINER_SCORE_EVENT_UNK_13] = 7,
|
||||
[TRAINER_SCORE_EVENT_UNK_14] = 7,
|
||||
@@ -277,7 +277,7 @@ static const u16 sTrainerScoreIncrements[MAX_TRAINER_SCORE_EVENTS] = {
|
||||
[TRAINER_SCORE_EVENT_UNK_18] = 11,
|
||||
[TRAINER_SCORE_EVENT_UNK_19] = 11,
|
||||
[TRAINER_SCORE_EVENT_UNK_20] = 11,
|
||||
[TRAINER_SCORE_EVENT_UNK_21] = 11,
|
||||
[TRAINER_SCORE_EVENT_FOUGHT_LINK_BATTLE] = 11,
|
||||
[TRAINER_SCORE_EVENT_CAUGHT_SPECIES] = 20,
|
||||
[TRAINER_SCORE_EVENT_UNK_23] = 30,
|
||||
[TRAINER_SCORE_EVENT_UNK_24] = 35,
|
||||
|
||||
@@ -217,8 +217,7 @@ pokeplatinum_c = files(
|
||||
'unk_02054D00.c',
|
||||
'unk_020553DC.c',
|
||||
'unk_020556C4.c',
|
||||
'unk_0205578C.c',
|
||||
'unk_02055808.c',
|
||||
'field_transition.c',
|
||||
'unk_020559DC.c',
|
||||
'unk_02055C50.c',
|
||||
'unk_020562F8.c',
|
||||
|
||||
@@ -548,7 +548,7 @@ static BOOL Field_CheckWildEncounter(FieldSystem *fieldSystem)
|
||||
|
||||
if (SystemFlag_CheckInPalPark(SaveData_GetVarsFlags(fieldSystem->saveData)) == TRUE) {
|
||||
if (sub_02056374(fieldSystem, playerX, playerZ) == TRUE) {
|
||||
sub_02051450(fieldSystem, sub_0205639C(fieldSystem));
|
||||
Encounter_NewVsPalParkTransfer(fieldSystem, sub_0205639C(fieldSystem));
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
|
||||
@@ -892,7 +892,7 @@ static BOOL ov5_021E0560(FieldTask *param0)
|
||||
if (ov6_022413E4(fieldSystem, &v9) == 1) {
|
||||
PlayerAvatar_SetInDeepSwamp(v0->playerAvatar, 1);
|
||||
ov5_021E1134(v0);
|
||||
sub_02050E78(fieldSystem, param0, v9);
|
||||
Encounter_StartVsWild(fieldSystem, param0, v9);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ BOOL ov5_021F08F8(FieldTask *taskMan)
|
||||
GameRecords_IncrementRecordValue(v4, RECORD_UNK_010);
|
||||
}
|
||||
|
||||
sub_02050E78(fieldSystem, taskMan, v1->unk_10);
|
||||
Encounter_StartVsWild(fieldSystem, taskMan, v1->unk_10);
|
||||
Heap_FreeToHeap(v1);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -301,7 +301,7 @@ BOOL ov6_02240D5C(FieldSystem *fieldSystem)
|
||||
FieldBattleDTO_Init(battleParams, fieldSystem);
|
||||
ov6_0224239C(encounterFieldParams.trainerID, v17, battleParams);
|
||||
RadarChain_Clear(fieldSystem->chain);
|
||||
sub_02050E10(fieldSystem, battleParams);
|
||||
Encounter_NewVsWild(fieldSystem, battleParams);
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
@@ -358,7 +358,7 @@ BOOL ov6_02240D5C(FieldSystem *fieldSystem)
|
||||
}
|
||||
|
||||
if (v7) {
|
||||
sub_02050E10(fieldSystem, battleParams);
|
||||
Encounter_NewVsWild(fieldSystem, battleParams);
|
||||
} else {
|
||||
v6 = FALSE;
|
||||
}
|
||||
@@ -492,7 +492,7 @@ BOOL ov6_022411C8(FieldSystem *fieldSystem, FieldTask *param1)
|
||||
FieldBattleDTO_Init(battleParams, fieldSystem);
|
||||
ov6_0224239C(encounterFieldParams.trainerID, v15, battleParams);
|
||||
RadarChain_Clear(fieldSystem->chain);
|
||||
sub_02050E78(fieldSystem, param1, battleParams);
|
||||
Encounter_StartVsWild(fieldSystem, param1, battleParams);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -543,7 +543,7 @@ BOOL ov6_022411C8(FieldSystem *fieldSystem, FieldTask *param1)
|
||||
}
|
||||
|
||||
if (v8) {
|
||||
sub_02050E78(fieldSystem, param1, battleParams);
|
||||
Encounter_StartVsWild(fieldSystem, param1, battleParams);
|
||||
} else {
|
||||
GF_ASSERT(FALSE);
|
||||
}
|
||||
|
||||
138
src/scrcmd.c
138
src/scrcmd.c
@@ -4,6 +4,8 @@
|
||||
#include <nitro/code16.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "constants/battle.h"
|
||||
#include "constants/heap.h"
|
||||
#include "constants/overworld_weather.h"
|
||||
#include "constants/species.h"
|
||||
#include "consts/scrcmd.h"
|
||||
@@ -102,6 +104,7 @@
|
||||
#include "field_script_context.h"
|
||||
#include "field_system.h"
|
||||
#include "field_task.h"
|
||||
#include "field_transition.h"
|
||||
#include "game_records.h"
|
||||
#include "heap.h"
|
||||
#include "inlines.h"
|
||||
@@ -186,7 +189,6 @@
|
||||
#include "unk_020528D0.h"
|
||||
#include "unk_02052C6C.h"
|
||||
#include "unk_020553DC.h"
|
||||
#include "unk_02055808.h"
|
||||
#include "unk_020559DC.h"
|
||||
#include "unk_0205749C.h"
|
||||
#include "unk_0205B33C.h"
|
||||
@@ -427,7 +429,7 @@ static BOOL ScrCmd_0F3(ScriptContext *ctx);
|
||||
static BOOL sub_0204300C(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_0F4(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_0F5(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_0F6(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_StartLinkBattle(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_0F7(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_11B(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_11C(ScriptContext *ctx);
|
||||
@@ -438,14 +440,14 @@ static BOOL ScrCmd_120(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_121(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_122(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_123(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_124(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_2BD(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_318(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_125(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_126(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_StartWildBattle(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_StartLegendaryBattle(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_StartFatefulEncounter(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_StartFirstBattle(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_StartCatchingTutorial(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_127(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_128(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_129(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_StartHoneyTreeBattle(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_12A(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_12B(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_CheckSaveType(ScriptContext *ctx);
|
||||
@@ -729,7 +731,7 @@ static BOOL ScrCmd_311(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_312(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_31F(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_313(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_319(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_StartGiratinaOriginBattle(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_31A(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_320(ScriptContext *ctx);
|
||||
static BOOL ScrCmd_321(ScriptContext *ctx);
|
||||
@@ -992,7 +994,7 @@ const ScrCmdFunc Unk_020EAC58[] = {
|
||||
ScrCmd_0E2,
|
||||
ScrCmd_0E3,
|
||||
ScrCmd_0E4,
|
||||
ScrCmd_0E5,
|
||||
ScrCmd_StartTrainerBattle,
|
||||
ScrCmd_0E6,
|
||||
ScrCmd_0E7,
|
||||
ScrCmd_0E8,
|
||||
@@ -1002,14 +1004,14 @@ const ScrCmdFunc Unk_020EAC58[] = {
|
||||
ScrCmd_CheckWonBattle,
|
||||
ScrCmd_CheckLostBattle,
|
||||
ScrCmd_0EE,
|
||||
ScrCmd_0EF,
|
||||
ScrCmd_StartDummyTrainerBattle,
|
||||
ScrCmd_0F0,
|
||||
ScrCmd_0F1,
|
||||
ScrCmd_0F2,
|
||||
ScrCmd_0F3,
|
||||
ScrCmd_0F4,
|
||||
ScrCmd_0F5,
|
||||
ScrCmd_0F6,
|
||||
ScrCmd_StartLinkBattle,
|
||||
ScrCmd_0F7,
|
||||
ScrCmd_0F8,
|
||||
ScrCmd_0F9,
|
||||
@@ -1055,12 +1057,12 @@ const ScrCmdFunc Unk_020EAC58[] = {
|
||||
ScrCmd_121,
|
||||
ScrCmd_122,
|
||||
ScrCmd_123,
|
||||
ScrCmd_124,
|
||||
ScrCmd_125,
|
||||
ScrCmd_126,
|
||||
ScrCmd_StartWildBattle,
|
||||
ScrCmd_StartFirstBattle,
|
||||
ScrCmd_StartCatchingTutorial,
|
||||
ScrCmd_127,
|
||||
ScrCmd_128,
|
||||
ScrCmd_129,
|
||||
ScrCmd_StartHoneyTreeBattle,
|
||||
ScrCmd_12A,
|
||||
ScrCmd_12B,
|
||||
ScrCmd_CheckSaveType,
|
||||
@@ -1435,7 +1437,7 @@ const ScrCmdFunc Unk_020EAC58[] = {
|
||||
ScrCmd_29D,
|
||||
ScrCmd_29E,
|
||||
ScrCmd_29F,
|
||||
ScrCmd_2A0,
|
||||
ScrCmd_StartTagBattle,
|
||||
ScrCmd_2A1,
|
||||
ScrCmd_2A2,
|
||||
ScrCmd_2A3,
|
||||
@@ -1464,7 +1466,7 @@ const ScrCmdFunc Unk_020EAC58[] = {
|
||||
ScrCmd_2BA,
|
||||
ScrCmd_2BB,
|
||||
ScrCmd_CheckDidNotCapture,
|
||||
ScrCmd_2BD,
|
||||
ScrCmd_StartLegendaryBattle,
|
||||
ScrCmd_2BE,
|
||||
ScrCmd_2BF,
|
||||
ScrCmd_2C0,
|
||||
@@ -1555,8 +1557,8 @@ const ScrCmdFunc Unk_020EAC58[] = {
|
||||
ScrCmd_315,
|
||||
ScrCmd_316,
|
||||
ScrCmd_GetPlayer3DPos,
|
||||
ScrCmd_318,
|
||||
ScrCmd_319,
|
||||
ScrCmd_StartFatefulEncounter,
|
||||
ScrCmd_StartGiratinaOriginBattle,
|
||||
ScrCmd_31A,
|
||||
ScrCmd_31B,
|
||||
ScrCmd_31C,
|
||||
@@ -3921,13 +3923,13 @@ BOOL sub_02041D60(ScriptContext *ctx)
|
||||
|
||||
static BOOL ScrCmd_0A1(ScriptContext *ctx)
|
||||
{
|
||||
FieldTask_StartFieldMap(ctx->fieldSystem->task);
|
||||
FieldTransition_StartMap(ctx->fieldSystem->task);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static BOOL ScrCmd_1F8(ScriptContext *ctx)
|
||||
{
|
||||
FieldTask_FinishFieldMap(ctx->fieldSystem->task);
|
||||
FieldTransition_FinishMap(ctx->fieldSystem->task);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -4914,20 +4916,17 @@ static BOOL ScrCmd_0F5(ScriptContext *ctx)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static BOOL ScrCmd_0F6(ScriptContext *ctx)
|
||||
static BOOL ScrCmd_StartLinkBattle(ScriptContext *ctx)
|
||||
{
|
||||
PartyManagementData *v0;
|
||||
void **v1;
|
||||
void **partyManagementDataPtr = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_PARTY_MANAGEMENT_DATA);
|
||||
PartyManagementData *partyManagementData = *partyManagementDataPtr;
|
||||
|
||||
v1 = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, 19);
|
||||
v0 = *v1;
|
||||
Encounter_NewVsLink(ctx->fieldSystem->task, partyManagementData->unk_2C, BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER);
|
||||
Heap_FreeToHeap(partyManagementData);
|
||||
|
||||
sub_0205167C(ctx->fieldSystem->task, v0->unk_2C, (0x4 | 0x1));
|
||||
Heap_FreeToHeap(v0);
|
||||
*partyManagementDataPtr = NULL;
|
||||
|
||||
*v1 = NULL;
|
||||
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL ScrCmd_0F7(ScriptContext *ctx)
|
||||
@@ -5035,62 +5034,60 @@ static BOOL ScrCmd_123(ScriptContext *ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static BOOL ScrCmd_124(ScriptContext *ctx)
|
||||
static BOOL ScrCmd_StartWildBattle(ScriptContext *ctx)
|
||||
{
|
||||
BOOL *v0 = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 v1 = ScriptContext_GetVar(ctx);
|
||||
u8 v2 = (u8)ScriptContext_GetVar(ctx);
|
||||
int *battleResultMaskPtr = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 species = ScriptContext_GetVar(ctx);
|
||||
u8 level = (u8)ScriptContext_GetVar(ctx);
|
||||
|
||||
sub_02051270(ctx->task, v1, v2, v0, 0);
|
||||
|
||||
return 1;
|
||||
Encounter_NewVsSpeciesAtLevel(ctx->task, species, level, battleResultMaskPtr, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL ScrCmd_2BD(ScriptContext *ctx)
|
||||
static BOOL ScrCmd_StartLegendaryBattle(ScriptContext *ctx)
|
||||
{
|
||||
BOOL *v0 = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 v1 = ScriptContext_GetVar(ctx);
|
||||
u8 v2 = (u8)ScriptContext_GetVar(ctx);
|
||||
int *battleResultMaskPtr = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 species = ScriptContext_GetVar(ctx);
|
||||
u8 level = (u8)ScriptContext_GetVar(ctx);
|
||||
|
||||
sub_02051270(ctx->task, v1, v2, v0, 1);
|
||||
|
||||
return 1;
|
||||
Encounter_NewVsSpeciesAtLevel(ctx->task, species, level, battleResultMaskPtr, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL ScrCmd_319(ScriptContext *ctx)
|
||||
static BOOL ScrCmd_StartGiratinaOriginBattle(ScriptContext *ctx)
|
||||
{
|
||||
BOOL *v0 = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 v1 = ScriptContext_GetVar(ctx);
|
||||
u8 v2 = (u8)ScriptContext_GetVar(ctx);
|
||||
int *battleResultMaskPtr = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 species = ScriptContext_GetVar(ctx);
|
||||
u8 level = (u8)ScriptContext_GetVar(ctx);
|
||||
|
||||
sub_02051ABC(ctx->task, v1, v2, v0, 1);
|
||||
return 1;
|
||||
Encounter_NewVsGiratinaOrigin(ctx->task, species, level, battleResultMaskPtr, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL ScrCmd_318(ScriptContext *ctx)
|
||||
static BOOL ScrCmd_StartFatefulEncounter(ScriptContext *ctx)
|
||||
{
|
||||
BOOL *v0 = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 v1 = ScriptContext_GetVar(ctx);
|
||||
u8 v2 = (u8)ScriptContext_GetVar(ctx);
|
||||
int *battleResultMaskPtr = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 species = ScriptContext_GetVar(ctx);
|
||||
u8 level = (u8)ScriptContext_GetVar(ctx);
|
||||
|
||||
sub_020512E4(ctx->task, v1, v2, v0, 1);
|
||||
return 1;
|
||||
Encounter_NewFatefulVsSpeciesAtLevel(ctx->task, species, level, battleResultMaskPtr, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL ScrCmd_125(ScriptContext *ctx)
|
||||
static BOOL ScrCmd_StartFirstBattle(ScriptContext *ctx)
|
||||
{
|
||||
FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
BOOL *v1 = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 v2 = ScriptContext_GetVar(ctx);
|
||||
int *battleResultMaskPtr = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 trainerID = ScriptContext_GetVar(ctx);
|
||||
|
||||
sub_02051480(ctx->task, v2, 11, v1);
|
||||
return 1;
|
||||
Encounter_NewVsFirstBattle(ctx->task, trainerID, HEAP_ID_FIELDMAP, battleResultMaskPtr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL ScrCmd_126(ScriptContext *ctx)
|
||||
static BOOL ScrCmd_StartCatchingTutorial(ScriptContext *ctx)
|
||||
{
|
||||
sub_02051590(ctx->task);
|
||||
return 1;
|
||||
Encounter_NewCatchingTutorial(ctx->task);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL ScrCmd_127(ScriptContext *ctx)
|
||||
@@ -5110,13 +5107,12 @@ static BOOL ScrCmd_128(ScriptContext *ctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static BOOL ScrCmd_129(ScriptContext *ctx)
|
||||
static BOOL ScrCmd_StartHoneyTreeBattle(ScriptContext *ctx)
|
||||
{
|
||||
FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
BOOL *v1 = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
|
||||
sub_0205120C(ctx->task, v1);
|
||||
return 1;
|
||||
int *battleResultMaskPtr = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
Encounter_NewVsHoneyTree(ctx->task, battleResultMaskPtr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL ScrCmd_12A(ScriptContext *ctx)
|
||||
|
||||
@@ -352,8 +352,8 @@ void *ScriptManager_GetMemberPtr(ScriptManager *scriptManager, u32 member)
|
||||
return &scriptManager->tmpBuf;
|
||||
case SCRIPT_MANAGER_SAVING_ICON:
|
||||
return &scriptManager->savingIcon;
|
||||
case 19:
|
||||
return &scriptManager->unk_A8;
|
||||
case SCRIPT_MANAGER_PARTY_MANAGEMENT_DATA:
|
||||
return &scriptManager->partyManagementDataPtr;
|
||||
case SCRIPT_MANAGER_DATA_PTR:
|
||||
return &scriptManager->dataPtr;
|
||||
case 21:
|
||||
|
||||
@@ -22,34 +22,34 @@
|
||||
#include "trainer_data.h"
|
||||
#include "unk_0201D15C.h"
|
||||
|
||||
static void TrainerData_BuildParty(FieldBattleDTO *battleParams, int battler, int heapID);
|
||||
static void TrainerData_BuildParty(FieldBattleDTO *dto, int battler, int heapID);
|
||||
|
||||
void TrainerData_Encounter(FieldBattleDTO *battleParams, const SaveData *save, int heapID)
|
||||
void TrainerData_Encounter(FieldBattleDTO *dto, const SaveData *save, int heapID)
|
||||
{
|
||||
TrainerData trdata;
|
||||
MessageLoader *msgLoader = MessageLoader_Init(MESSAGE_LOADER_NARC_HANDLE, NARC_INDEX_MSGDATA__PL_MSG, 618, heapID);
|
||||
const charcode_t *rivalName = MiscSaveBlock_RivalName(SaveData_MiscSaveBlockConst(save));
|
||||
|
||||
for (int i = 0; i < MAX_BATTLERS; i++) {
|
||||
if (!battleParams->trainerIDs[i]) {
|
||||
if (!dto->trainerIDs[i]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
TrainerData_Load(battleParams->trainerIDs[i], &trdata);
|
||||
battleParams->trainerData[i] = trdata;
|
||||
TrainerData_Load(dto->trainerIDs[i], &trdata);
|
||||
dto->trainerData[i] = trdata;
|
||||
|
||||
if (trdata.class == TRAINER_CLASS_RIVAL) {
|
||||
CharCode_Copy(battleParams->trainerData[i].name, rivalName);
|
||||
CharCode_Copy(dto->trainerData[i].name, rivalName);
|
||||
} else {
|
||||
Strbuf *trainerName = MessageLoader_GetNewStrbuf(msgLoader, battleParams->trainerIDs[i]);
|
||||
Strbuf_ToChars(trainerName, battleParams->trainerData[i].name, TRAINER_NAME_LEN + 1);
|
||||
Strbuf *trainerName = MessageLoader_GetNewStrbuf(msgLoader, dto->trainerIDs[i]);
|
||||
Strbuf_ToChars(trainerName, dto->trainerData[i].name, TRAINER_NAME_LEN + 1);
|
||||
Strbuf_Free(trainerName);
|
||||
}
|
||||
|
||||
TrainerData_BuildParty(battleParams, i, heapID);
|
||||
TrainerData_BuildParty(dto, i, heapID);
|
||||
}
|
||||
|
||||
battleParams->battleType |= trdata.battleType;
|
||||
dto->battleType |= trdata.battleType;
|
||||
MessageLoader_Free(msgLoader);
|
||||
}
|
||||
|
||||
@@ -170,11 +170,11 @@ u8 TrainerClass_Gender(int trclass)
|
||||
/**
|
||||
* @brief Build the party for a trainer as loaded in the FieldBattleDTO struct.
|
||||
*
|
||||
* @param battleParams The parent FieldBattleDTO struct containing trainer data.
|
||||
* @param dto The parent FieldBattleDTO struct containing trainer data.
|
||||
* @param battler Which battler's party is to be loaded.
|
||||
* @param heapID Heap on which to perform any allocations.
|
||||
*/
|
||||
static void TrainerData_BuildParty(FieldBattleDTO *battleParams, int battler, int heapID)
|
||||
static void TrainerData_BuildParty(FieldBattleDTO *dto, int battler, int heapID)
|
||||
{
|
||||
// must make declarations C89-style to match
|
||||
void *buf;
|
||||
@@ -186,28 +186,28 @@ static void TrainerData_BuildParty(FieldBattleDTO *battleParams, int battler, in
|
||||
oldSeed = LCRNG_GetSeed();
|
||||
|
||||
// alloc enough space to support the maximum possible data size
|
||||
Party_InitWithCapacity(battleParams->parties[battler], MAX_PARTY_SIZE);
|
||||
Party_InitWithCapacity(dto->parties[battler], MAX_PARTY_SIZE);
|
||||
buf = Heap_AllocFromHeap(heapID, sizeof(TrainerMonWithMovesAndItem) * MAX_PARTY_SIZE);
|
||||
mon = Pokemon_New(heapID);
|
||||
|
||||
TrainerData_LoadParty(battleParams->trainerIDs[battler], buf);
|
||||
TrainerData_LoadParty(dto->trainerIDs[battler], buf);
|
||||
|
||||
// determine which magic gender-specific modifier to use for the RNG function
|
||||
genderMod = TrainerClass_Gender(battleParams->trainerData[battler].class) == GENDER_FEMALE
|
||||
genderMod = TrainerClass_Gender(dto->trainerData[battler].class) == GENDER_FEMALE
|
||||
? 120
|
||||
: 136;
|
||||
|
||||
switch (battleParams->trainerData[battler].type) {
|
||||
switch (dto->trainerData[battler].type) {
|
||||
case TRDATATYPE_BASE: {
|
||||
TrainerMonBase *trmon = (TrainerMonBase *)buf;
|
||||
for (i = 0; i < battleParams->trainerData[battler].partySize; i++) {
|
||||
for (i = 0; i < dto->trainerData[battler].partySize; i++) {
|
||||
u16 species = trmon[i].species & 0x3FF;
|
||||
u8 form = (trmon[i].species & 0xFC00) >> 10;
|
||||
|
||||
rnd = trmon[i].dv + trmon[i].level + species + battleParams->trainerIDs[battler];
|
||||
rnd = trmon[i].dv + trmon[i].level + species + dto->trainerIDs[battler];
|
||||
LCRNG_SetSeed(rnd);
|
||||
|
||||
for (j = 0; j < battleParams->trainerData[battler].class; j++) {
|
||||
for (j = 0; j < dto->trainerData[battler].class; j++) {
|
||||
rnd = LCRNG_Next();
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ static void TrainerData_BuildParty(FieldBattleDTO *battleParams, int battler, in
|
||||
Pokemon_InitWith(mon, species, trmon[i].level, ivs, TRUE, rnd, OTID_NOT_SHINY, 0);
|
||||
Pokemon_SetBallSeal(trmon[i].cbSeal, mon, heapID);
|
||||
Pokemon_SetValue(mon, MON_DATA_FORM, &form);
|
||||
Party_AddPokemon(battleParams->parties[battler], mon);
|
||||
Party_AddPokemon(dto->parties[battler], mon);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -225,14 +225,14 @@ static void TrainerData_BuildParty(FieldBattleDTO *battleParams, int battler, in
|
||||
|
||||
case TRDATATYPE_WITH_MOVES: {
|
||||
TrainerMonWithMoves *trmon = (TrainerMonWithMoves *)buf;
|
||||
for (i = 0; i < battleParams->trainerData[battler].partySize; i++) {
|
||||
for (i = 0; i < dto->trainerData[battler].partySize; i++) {
|
||||
u16 species = trmon[i].species & 0x3FF;
|
||||
u8 form = (trmon[i].species & 0xFC00) >> 10;
|
||||
|
||||
rnd = trmon[i].dv + trmon[i].level + species + battleParams->trainerIDs[battler];
|
||||
rnd = trmon[i].dv + trmon[i].level + species + dto->trainerIDs[battler];
|
||||
LCRNG_SetSeed(rnd);
|
||||
|
||||
for (j = 0; j < battleParams->trainerData[battler].class; j++) {
|
||||
for (j = 0; j < dto->trainerData[battler].class; j++) {
|
||||
rnd = LCRNG_Next();
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ static void TrainerData_BuildParty(FieldBattleDTO *battleParams, int battler, in
|
||||
|
||||
Pokemon_SetBallSeal(trmon[i].cbSeal, mon, heapID);
|
||||
Pokemon_SetValue(mon, MON_DATA_FORM, &form);
|
||||
Party_AddPokemon(battleParams->parties[battler], mon);
|
||||
Party_AddPokemon(dto->parties[battler], mon);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -255,14 +255,14 @@ static void TrainerData_BuildParty(FieldBattleDTO *battleParams, int battler, in
|
||||
|
||||
case TRDATATYPE_WITH_ITEM: {
|
||||
TrainerMonWithItem *trmon = (TrainerMonWithItem *)buf;
|
||||
for (i = 0; i < battleParams->trainerData[battler].partySize; i++) {
|
||||
for (i = 0; i < dto->trainerData[battler].partySize; i++) {
|
||||
u16 species = trmon[i].species & 0x3FF;
|
||||
u8 form = (trmon[i].species & 0xFC00) >> 10;
|
||||
|
||||
rnd = trmon[i].dv + trmon[i].level + species + battleParams->trainerIDs[battler];
|
||||
rnd = trmon[i].dv + trmon[i].level + species + dto->trainerIDs[battler];
|
||||
LCRNG_SetSeed(rnd);
|
||||
|
||||
for (j = 0; j < battleParams->trainerData[battler].class; j++) {
|
||||
for (j = 0; j < dto->trainerData[battler].class; j++) {
|
||||
rnd = LCRNG_Next();
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ static void TrainerData_BuildParty(FieldBattleDTO *battleParams, int battler, in
|
||||
Pokemon_SetValue(mon, MON_DATA_HELD_ITEM, &trmon[i].item);
|
||||
Pokemon_SetBallSeal(trmon[i].cbSeal, mon, heapID);
|
||||
Pokemon_SetValue(mon, MON_DATA_FORM, &form);
|
||||
Party_AddPokemon(battleParams->parties[battler], mon);
|
||||
Party_AddPokemon(dto->parties[battler], mon);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -281,14 +281,14 @@ static void TrainerData_BuildParty(FieldBattleDTO *battleParams, int battler, in
|
||||
|
||||
case TRDATATYPE_WITH_MOVES_AND_ITEM: {
|
||||
TrainerMonWithMovesAndItem *trmon = (TrainerMonWithMovesAndItem *)buf;
|
||||
for (i = 0; i < battleParams->trainerData[battler].partySize; i++) {
|
||||
for (i = 0; i < dto->trainerData[battler].partySize; i++) {
|
||||
u16 species = trmon[i].species & 0x3FF;
|
||||
u8 form = (trmon[i].species & 0xFC00) >> 10;
|
||||
|
||||
rnd = trmon[i].dv + trmon[i].level + species + battleParams->trainerIDs[battler];
|
||||
rnd = trmon[i].dv + trmon[i].level + species + dto->trainerIDs[battler];
|
||||
LCRNG_SetSeed(rnd);
|
||||
|
||||
for (j = 0; j < battleParams->trainerData[battler].class; j++) {
|
||||
for (j = 0; j < dto->trainerData[battler].class; j++) {
|
||||
rnd = LCRNG_Next();
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ static void TrainerData_BuildParty(FieldBattleDTO *battleParams, int battler, in
|
||||
|
||||
Pokemon_SetBallSeal(trmon[i].cbSeal, mon, heapID);
|
||||
Pokemon_SetValue(mon, MON_DATA_FORM, &form);
|
||||
Party_AddPokemon(battleParams->parties[battler], mon);
|
||||
Party_AddPokemon(dto->parties[battler], mon);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
#include "field_overworld_state.h"
|
||||
#include "field_system.h"
|
||||
#include "field_task.h"
|
||||
#include "field_transition.h"
|
||||
#include "game_options.h"
|
||||
#include "game_records.h"
|
||||
#include "heap.h"
|
||||
@@ -122,7 +123,6 @@
|
||||
#include "unk_020366A0.h"
|
||||
#include "unk_02038FFC.h"
|
||||
#include "unk_020553DC.h"
|
||||
#include "unk_02055808.h"
|
||||
#include "unk_020559DC.h"
|
||||
#include "unk_0205B33C.h"
|
||||
#include "unk_0206AFE0.h"
|
||||
@@ -254,9 +254,9 @@ const OverlayManagerTemplate gBattleOverlayTemplate = {
|
||||
FS_OVERLAY_ID(battle)
|
||||
};
|
||||
|
||||
void sub_0203D1D4(FieldSystem *fieldSystem, FieldBattleDTO *param1)
|
||||
void FieldSystem_StartBattleProcess(FieldSystem *fieldSystem, FieldBattleDTO *dto)
|
||||
{
|
||||
FieldSystem_StartChildProcess(fieldSystem, &gBattleOverlayTemplate, param1);
|
||||
FieldSystem_StartChildProcess(fieldSystem, &gBattleOverlayTemplate, dto);
|
||||
}
|
||||
|
||||
static const u8 Unk_020EA164[] = {
|
||||
@@ -1018,7 +1018,7 @@ BOOL sub_0203DBF0(FieldTask *param0)
|
||||
switch (v2->unk_00) {
|
||||
case 0:
|
||||
if (!sub_020389B8()) {
|
||||
FieldTask_FinishFieldMap(param0);
|
||||
FieldTransition_FinishMap(param0);
|
||||
}
|
||||
|
||||
v2->unk_00++;
|
||||
@@ -1180,7 +1180,7 @@ static BOOL sub_0203DE98(FieldTask *param0)
|
||||
|
||||
switch (v2->unk_00) {
|
||||
case 0:
|
||||
FieldTask_FinishFieldMap(param0);
|
||||
FieldTransition_FinishMap(param0);
|
||||
v2->unk_00++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -1188,7 +1188,7 @@ static BOOL sub_0203DE98(FieldTask *param0)
|
||||
v2->unk_00++;
|
||||
break;
|
||||
case 2:
|
||||
FieldTask_StartFieldMap(param0);
|
||||
FieldTransition_StartMap(param0);
|
||||
v2->unk_00++;
|
||||
break;
|
||||
case 3:
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "constants/heap.h"
|
||||
|
||||
#include "struct_decls/struct_0205E884_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
@@ -28,15 +30,15 @@ BOOL ScrCmd_0B7(ScriptContext *param0);
|
||||
BOOL ScrCmd_0B8(ScriptContext *param0);
|
||||
BOOL ScrCmd_0B9(ScriptContext *param0);
|
||||
BOOL ScrCmd_0E4(ScriptContext *param0);
|
||||
BOOL ScrCmd_0E5(ScriptContext *param0);
|
||||
BOOL ScrCmd_2A0(ScriptContext *param0);
|
||||
BOOL ScrCmd_StartTrainerBattle(ScriptContext *ctx);
|
||||
BOOL ScrCmd_StartTagBattle(ScriptContext *ctx);
|
||||
BOOL ScrCmd_0E7(ScriptContext *param0);
|
||||
BOOL ScrCmd_0E8(ScriptContext *param0);
|
||||
BOOL ScrCmd_0E9(ScriptContext *param0);
|
||||
BOOL ScrCmd_0EA(ScriptContext *param0);
|
||||
BOOL ScrCmd_0EB(ScriptContext *param0);
|
||||
BOOL ScrCmd_0EE(ScriptContext *param0);
|
||||
BOOL ScrCmd_0EF(ScriptContext *param0);
|
||||
BOOL ScrCmd_StartDummyTrainerBattle(ScriptContext *ctx);
|
||||
BOOL ScrCmd_0F0(ScriptContext *param0);
|
||||
BOOL ScrCmd_0F1(ScriptContext *param0);
|
||||
BOOL ScrCmd_314(ScriptContext *param0);
|
||||
@@ -136,36 +138,43 @@ BOOL ScrCmd_0E4(ScriptContext *param0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL ScrCmd_0E5(ScriptContext *param0)
|
||||
BOOL ScrCmd_StartTrainerBattle(ScriptContext *ctx)
|
||||
{
|
||||
u32 v0;
|
||||
FieldSystem *fieldSystem = param0->fieldSystem;
|
||||
u16 *v2 = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_SCRIPT_ID);
|
||||
BOOL *v3 = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 v4 = ScriptContext_GetVar(param0);
|
||||
u16 v5 = ScriptContext_GetVar(param0);
|
||||
u16 v6;
|
||||
FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
u16 *scriptIDPtr = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_SCRIPT_ID);
|
||||
int *battleResultMaskPtr = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 enemyTrainer1 = ScriptContext_GetVar(ctx);
|
||||
u16 enemyTrainer2 = ScriptContext_GetVar(ctx);
|
||||
u16 partnerTrainer = 0;
|
||||
|
||||
v6 = 0;
|
||||
|
||||
if (SystemFlag_CheckHasPartner(SaveData_GetVarsFlags(param0->fieldSystem->saveData)) == 1) {
|
||||
v6 = sub_0206B034(SaveData_GetVarsFlags(fieldSystem->saveData));
|
||||
if (SystemFlag_CheckHasPartner(SaveData_GetVarsFlags(ctx->fieldSystem->saveData)) == TRUE) {
|
||||
partnerTrainer = sub_0206B034(SaveData_GetVarsFlags(fieldSystem->saveData));
|
||||
}
|
||||
|
||||
sub_020515CC(param0->task, v4, v5, v6, 11, v3);
|
||||
return 1;
|
||||
Encounter_NewVsTrainer(ctx->task,
|
||||
enemyTrainer1,
|
||||
enemyTrainer2,
|
||||
partnerTrainer,
|
||||
HEAP_ID_FIELDMAP,
|
||||
battleResultMaskPtr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL ScrCmd_2A0(ScriptContext *param0)
|
||||
BOOL ScrCmd_StartTagBattle(ScriptContext *ctx)
|
||||
{
|
||||
FieldSystem *fieldSystem = param0->fieldSystem;
|
||||
BOOL *v1 = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 v2 = ScriptContext_GetVar(param0);
|
||||
u16 v3 = ScriptContext_GetVar(param0);
|
||||
u16 v4 = ScriptContext_GetVar(param0);
|
||||
FieldSystem *fieldSystem = ctx->fieldSystem;
|
||||
int *battleResultMaskPtr = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
u16 partnerTrainer = ScriptContext_GetVar(ctx);
|
||||
u16 enemyTrainer1 = ScriptContext_GetVar(ctx);
|
||||
u16 enemyTrainer2 = ScriptContext_GetVar(ctx);
|
||||
|
||||
sub_020515CC(param0->task, v3, v4, v2, 11, v1);
|
||||
return 1;
|
||||
Encounter_NewVsTrainer(ctx->task,
|
||||
enemyTrainer1,
|
||||
enemyTrainer2,
|
||||
partnerTrainer,
|
||||
HEAP_ID_FIELDMAP,
|
||||
battleResultMaskPtr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL ScrCmd_0E7(ScriptContext *param0)
|
||||
@@ -296,14 +305,12 @@ BOOL ScrCmd_0EE(ScriptContext *param0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL ScrCmd_0EF(ScriptContext *param0)
|
||||
BOOL ScrCmd_StartDummyTrainerBattle(ScriptContext *param0)
|
||||
{
|
||||
FieldSystem *fieldSystem = param0->fieldSystem;
|
||||
BOOL *v1 = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
|
||||
sub_020515CC(param0->task, 1, 0, 0, 11, v1);
|
||||
|
||||
return 1;
|
||||
int *battleResultMaskPtr = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_BATTLE_RESULT);
|
||||
Encounter_NewVsTrainer(param0->task, 1, 0, 0, HEAP_ID_FIELDMAP, battleResultMaskPtr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL ScrCmd_0F0(ScriptContext *param0)
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "core_sys.h"
|
||||
#include "field_map_change.h"
|
||||
#include "field_task.h"
|
||||
#include "field_transition.h"
|
||||
#include "heap.h"
|
||||
#include "inlines.h"
|
||||
#include "location.h"
|
||||
@@ -22,7 +23,6 @@
|
||||
#include "player_avatar.h"
|
||||
#include "system_flags.h"
|
||||
#include "unk_02005474.h"
|
||||
#include "unk_02055808.h"
|
||||
#include "unk_02056B30.h"
|
||||
#include "unk_02070428.h"
|
||||
#include "vars_flags.h"
|
||||
@@ -58,11 +58,11 @@ static BOOL sub_020505A0(FieldTask *taskMan)
|
||||
v1->unk_04 = Player_GetXPos(fieldSystem->playerAvatar);
|
||||
v1->unk_06 = Player_GetZPos(fieldSystem->playerAvatar);
|
||||
sub_02070428(fieldSystem, 1);
|
||||
sub_020558AC(taskMan);
|
||||
FieldTransition_FadeOut(taskMan);
|
||||
v1->unk_08++;
|
||||
break;
|
||||
case 1:
|
||||
FieldTask_FinishFieldMap(taskMan);
|
||||
FieldTransition_FinishMap(taskMan);
|
||||
v1->unk_08++;
|
||||
break;
|
||||
case 2:
|
||||
@@ -77,7 +77,7 @@ static BOOL sub_020505A0(FieldTask *taskMan)
|
||||
v1->unk_08++;
|
||||
break;
|
||||
case 3:
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
v1->unk_08++;
|
||||
break;
|
||||
case 4:
|
||||
@@ -98,7 +98,7 @@ static BOOL sub_020505A0(FieldTask *taskMan)
|
||||
v1->unk_08++;
|
||||
break;
|
||||
case 7:
|
||||
FieldTask_FinishFieldMap(taskMan);
|
||||
FieldTransition_FinishMap(taskMan);
|
||||
v1->unk_08++;
|
||||
break;
|
||||
case 8:
|
||||
@@ -113,12 +113,12 @@ static BOOL sub_020505A0(FieldTask *taskMan)
|
||||
v1->unk_08++;
|
||||
break;
|
||||
case 9:
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
v1->unk_08++;
|
||||
break;
|
||||
case 10:
|
||||
sub_0205074C(fieldSystem->playerAvatar, 0);
|
||||
sub_020558F0(taskMan);
|
||||
FieldTransition_FadeIn(taskMan);
|
||||
v1->unk_08++;
|
||||
break;
|
||||
case 11:
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "field_overworld_state.h"
|
||||
#include "field_system.h"
|
||||
#include "field_task.h"
|
||||
#include "field_transition.h"
|
||||
#include "font.h"
|
||||
#include "graphics.h"
|
||||
#include "gx_layers.h"
|
||||
@@ -33,7 +34,6 @@
|
||||
#include "unk_0200F174.h"
|
||||
#include "unk_0203A7D8.h"
|
||||
#include "unk_020553DC.h"
|
||||
#include "unk_02055808.h"
|
||||
#include "unk_02070428.h"
|
||||
|
||||
typedef struct {
|
||||
@@ -243,7 +243,7 @@ BOOL sub_02052B2C(FieldTask *param0)
|
||||
(*v1)++;
|
||||
break;
|
||||
case 4:
|
||||
FieldTask_StartFieldMap(param0);
|
||||
FieldTransition_StartMap(param0);
|
||||
(*v1)++;
|
||||
break;
|
||||
case 5:
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "field/field_system_decl.h"
|
||||
#include "overlay005/encounter_effect.h"
|
||||
|
||||
#include "field_task.h"
|
||||
#include "heap.h"
|
||||
#include "unk_020041CC.h"
|
||||
|
||||
typedef struct {
|
||||
int unk_00;
|
||||
BOOL unk_04;
|
||||
int unk_08;
|
||||
int unk_0C;
|
||||
} UnkStruct_0205578C;
|
||||
|
||||
void sub_020557DC(FieldTask *param0, int param1, int param2);
|
||||
|
||||
static BOOL sub_0205578C(FieldTask *param0)
|
||||
{
|
||||
FieldSystem *fieldSystem;
|
||||
UnkStruct_0205578C *v1;
|
||||
|
||||
fieldSystem = FieldTask_GetFieldSystem(param0);
|
||||
v1 = FieldTask_GetEnv(param0);
|
||||
|
||||
switch (v1->unk_00) {
|
||||
case 0:
|
||||
EncounterEffect_Start(v1->unk_08, fieldSystem, &v1->unk_04);
|
||||
sub_02004550(5, v1->unk_0C, 1);
|
||||
v1->unk_00++;
|
||||
break;
|
||||
case 1:
|
||||
if (v1->unk_04 == 1) {
|
||||
Heap_FreeToHeap(v1);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_020557DC(FieldTask *param0, int param1, int param2)
|
||||
{
|
||||
UnkStruct_0205578C *v0 = Heap_AllocFromHeapAtEnd(11, sizeof(UnkStruct_0205578C));
|
||||
|
||||
v0->unk_00 = 0;
|
||||
v0->unk_04 = 0;
|
||||
v0->unk_08 = param1;
|
||||
v0->unk_0C = param2;
|
||||
|
||||
FieldTask_InitCall(param0, sub_0205578C, v0);
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
#include "unk_02055808.h"
|
||||
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "field/field_system.h"
|
||||
#include "overlay005/ov5_021DD6FC.h"
|
||||
|
||||
#include "field_system.h"
|
||||
#include "field_task.h"
|
||||
#include "unk_0200F174.h"
|
||||
|
||||
static BOOL sub_02055808(FieldTask *param0)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
|
||||
|
||||
if (!FieldSystem_HasParentProcess(fieldSystem)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FieldTask_FinishFieldMap(FieldTask *param0)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
|
||||
|
||||
if (!FieldSystem_HasParentProcess(fieldSystem)) {
|
||||
GF_ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
FieldSystem_FlagNotRunningFieldMap(fieldSystem);
|
||||
FieldTask_InitCall(param0, sub_02055808, NULL);
|
||||
}
|
||||
|
||||
static BOOL sub_02055850(FieldTask *param0)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
|
||||
|
||||
if (FieldSystem_IsRunningFieldMap(fieldSystem)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FieldTask_StartFieldMap(FieldTask *param0)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
|
||||
|
||||
if (FieldSystem_HasParentProcess(fieldSystem)) {
|
||||
GF_ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
FieldSystem_StartFieldMap(fieldSystem);
|
||||
FieldTask_InitCall(param0, sub_02055850, NULL);
|
||||
}
|
||||
|
||||
static BOOL sub_02055898(FieldTask *param0)
|
||||
{
|
||||
if (IsScreenTransitionDone()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_020558AC(FieldTask *param0)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
|
||||
|
||||
if (!FieldSystem_HasParentProcess(fieldSystem)) {
|
||||
GF_ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
StartScreenTransition(0, 0, 0, 0x0, 6, 1, 4);
|
||||
FieldTask_InitCall(param0, sub_02055898, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_020558F0(FieldTask *param0)
|
||||
{
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
|
||||
|
||||
if (!FieldSystem_HasParentProcess(fieldSystem)) {
|
||||
GF_ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
StartScreenTransition(0, 1, 1, 0x0, 6, 1, 4);
|
||||
FieldTask_InitCall(param0, sub_02055898, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL sub_02055934(FieldTask *param0)
|
||||
{
|
||||
int *v0 = FieldTask_GetState(param0);
|
||||
|
||||
switch (*v0) {
|
||||
case 0:
|
||||
sub_020558AC(param0);
|
||||
(*v0)++;
|
||||
break;
|
||||
case 1:
|
||||
FieldTask_FinishFieldMap(param0);
|
||||
(*v0)++;
|
||||
break;
|
||||
case 2:
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FieldTask_FinishFadeOut(FieldTask *param0)
|
||||
{
|
||||
FieldTask_InitCall(param0, sub_02055934, NULL);
|
||||
}
|
||||
|
||||
static BOOL sub_02055984(FieldTask *param0)
|
||||
{
|
||||
int *v0 = FieldTask_GetState(param0);
|
||||
FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0);
|
||||
|
||||
switch (*v0) {
|
||||
case 0:
|
||||
FieldTask_StartFieldMap(param0);
|
||||
(*v0)++;
|
||||
break;
|
||||
case 1:
|
||||
FieldSystem_RequestLocationName(fieldSystem);
|
||||
sub_020558F0(param0);
|
||||
(*v0)++;
|
||||
break;
|
||||
case 2:
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FieldTask_StartFadeIn(FieldTask *param0)
|
||||
{
|
||||
FieldTask_InitCall(param0, sub_02055984, NULL);
|
||||
}
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "camera.h"
|
||||
#include "field_map_change.h"
|
||||
#include "field_task.h"
|
||||
#include "field_transition.h"
|
||||
#include "heap.h"
|
||||
#include "inlines.h"
|
||||
#include "location.h"
|
||||
@@ -30,7 +31,6 @@
|
||||
#include "unk_0200F174.h"
|
||||
#include "unk_02054D00.h"
|
||||
#include "unk_020553DC.h"
|
||||
#include "unk_02055808.h"
|
||||
#include "unk_020655F4.h"
|
||||
|
||||
typedef struct {
|
||||
@@ -215,7 +215,7 @@ static BOOL sub_02056CFC(FieldTask *taskMan)
|
||||
(v1->unk_00)++;
|
||||
break;
|
||||
case 1:
|
||||
FieldTask_FinishFieldMap(taskMan);
|
||||
FieldTransition_FinishMap(taskMan);
|
||||
(v1->unk_00)++;
|
||||
break;
|
||||
case 2:
|
||||
@@ -223,7 +223,7 @@ static BOOL sub_02056CFC(FieldTask *taskMan)
|
||||
(v1->unk_00)++;
|
||||
break;
|
||||
case 3:
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
(v1->unk_00)++;
|
||||
break;
|
||||
case 4:
|
||||
@@ -262,7 +262,7 @@ static BOOL sub_02056DE4(FieldTask *taskMan)
|
||||
case 0:
|
||||
Sound_PlayEffect(1539);
|
||||
|
||||
sub_020558AC(taskMan);
|
||||
FieldTransition_FadeOut(taskMan);
|
||||
(v1->unk_04)++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -294,7 +294,7 @@ static BOOL sub_02056E20(FieldTask *taskMan)
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
sub_020558AC(taskMan);
|
||||
FieldTransition_FadeOut(taskMan);
|
||||
(v1->unk_04)++;
|
||||
break;
|
||||
case 3:
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
#include "core_sys.h"
|
||||
#include "field_map_change.h"
|
||||
#include "field_task.h"
|
||||
#include "field_transition.h"
|
||||
#include "heap.h"
|
||||
#include "location.h"
|
||||
#include "map_object.h"
|
||||
#include "player_avatar.h"
|
||||
#include "system_flags.h"
|
||||
#include "unk_02005474.h"
|
||||
#include "unk_02055808.h"
|
||||
#include "unk_02056B30.h"
|
||||
#include "unk_02070428.h"
|
||||
#include "vars_flags.h"
|
||||
@@ -59,11 +59,11 @@ static BOOL sub_0206C120(FieldTask *taskMan)
|
||||
sub_02070428(fieldSystem, 1);
|
||||
ov6_02242A94(v1->unk_0D, v1->unk_04);
|
||||
v1->unk_08 = ov6_02242AEC(v1->unk_04);
|
||||
sub_020558AC(taskMan);
|
||||
FieldTransition_FadeOut(taskMan);
|
||||
v1->unk_0C = 1;
|
||||
break;
|
||||
case 1:
|
||||
FieldTask_FinishFieldMap(taskMan);
|
||||
FieldTransition_FinishMap(taskMan);
|
||||
v1->unk_0C = 2;
|
||||
break;
|
||||
case 2: {
|
||||
@@ -80,7 +80,7 @@ static BOOL sub_0206C120(FieldTask *taskMan)
|
||||
v1->unk_0C = 3;
|
||||
break;
|
||||
case 3:
|
||||
FieldTask_StartFieldMap(taskMan);
|
||||
FieldTransition_StartMap(taskMan);
|
||||
v1->unk_0C = 4;
|
||||
break;
|
||||
case 4: {
|
||||
@@ -101,7 +101,7 @@ static BOOL sub_0206C120(FieldTask *taskMan)
|
||||
v1->unk_0C = 5;
|
||||
} else {
|
||||
MapObject_SetHidden(v3, 0);
|
||||
sub_020558F0(taskMan);
|
||||
FieldTransition_FadeIn(taskMan);
|
||||
v1->unk_0C = 8;
|
||||
}
|
||||
} break;
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
#include "overlay095/ov95_02246C20.h"
|
||||
|
||||
#include "field_task.h"
|
||||
#include "field_transition.h"
|
||||
#include "heap.h"
|
||||
#include "pokemon.h"
|
||||
#include "unk_02055808.h"
|
||||
|
||||
FS_EXTERN_OVERLAY(overlay95);
|
||||
|
||||
@@ -59,11 +59,11 @@ static BOOL sub_0206C680(FieldTask *param0)
|
||||
v1->unk_04++;
|
||||
break;
|
||||
case 1:
|
||||
sub_020558AC(param0);
|
||||
FieldTransition_FadeOut(param0);
|
||||
v1->unk_04++;
|
||||
break;
|
||||
case 2:
|
||||
FieldTask_FinishFieldMap(param0);
|
||||
FieldTransition_FinishMap(param0);
|
||||
v1->unk_04++;
|
||||
break;
|
||||
case 3:
|
||||
@@ -71,11 +71,11 @@ static BOOL sub_0206C680(FieldTask *param0)
|
||||
v1->unk_04++;
|
||||
break;
|
||||
case 4:
|
||||
FieldTask_StartFieldMap(param0);
|
||||
FieldTransition_StartMap(param0);
|
||||
v1->unk_04++;
|
||||
break;
|
||||
case 5:
|
||||
sub_020558F0(param0);
|
||||
FieldTransition_FadeIn(param0);
|
||||
v1->unk_04++;
|
||||
break;
|
||||
case 6:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user