diff options
Diffstat (limited to 'src')
74 files changed, 15979 insertions, 3245 deletions
diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 1eaa9da18..6148587f8 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1606,22 +1606,22 @@ static void OpponentHandleChoosePokemon(void) { s32 chosenMonId; - if (*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) == 6) + if (*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) == PARTY_SIZE) { chosenMonId = GetMostSuitableMonToSwitchInto(); - if (chosenMonId == 6) + if (chosenMonId == PARTY_SIZE) { - s32 bank1, bank2, firstId, lastId; + s32 battler1, battler2, firstId, lastId; if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { - bank2 = bank1 = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); + battler2 = battler1 = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); } else { - bank1 = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); - bank2 = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); + battler1 = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); + battler2 = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); } if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) @@ -1639,8 +1639,8 @@ static void OpponentHandleChoosePokemon(void) for (chosenMonId = firstId; chosenMonId < lastId; chosenMonId++) { if (GetMonData(&gEnemyParty[chosenMonId], MON_DATA_HP) != 0 - && chosenMonId != gBattlerPartyIndexes[bank1] - && chosenMonId != gBattlerPartyIndexes[bank2]) + && chosenMonId != gBattlerPartyIndexes[battler1] + && chosenMonId != gBattlerPartyIndexes[battler2]) { break; } @@ -1650,7 +1650,7 @@ static void OpponentHandleChoosePokemon(void) else { chosenMonId = *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler); - *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = 6; + *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; } diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 6ab19e368..7f038a0c3 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -28,19 +28,18 @@ #include "pokeball.h" #include "data2.h" #include "battle_setup.h" -#include "item_use.h" +#include "item_menu.h" #include "recorded_battle.h" #include "party_menu.h" +#include "battle_dome.h" extern u8 gUnknown_0203CEE8; extern u8 gUnknown_0203CEE9; extern u8 gUnknown_0203CF00[]; extern u16 gBattle_BG0_X; extern u16 gBattle_BG0_Y; -extern s32 gUnknown_0203CD70; extern struct UnusedControllerStruct gUnknown_02022D0C; extern struct MusicPlayerInfo gMPlayInfo_BGM; -extern struct SpriteTemplate gMultiuseSpriteTemplate; extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; @@ -52,7 +51,6 @@ extern void sub_81851A8(u8 *); // this file's functions static void PlayerHandleGetMonData(void); -void PlayerHandleGetRawMonData(void); static void PlayerHandleSetMonData(void); static void PlayerHandleSetRawMonData(void); static void PlayerHandleLoadMonSprite(void); diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index bc97c01f9..aab804b41 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -21,7 +21,7 @@ #include "pokeball.h" #include "data2.h" #include "pokeblock.h" -#include "item_use.h" +#include "item_menu.h" extern u16 gBattle_BG0_X; extern u16 gBattle_BG0_Y; diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index 960181fbc..4faf78681 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -29,7 +29,7 @@ #include "data2.h" #include "party_menu.h" #include "battle_setup.h" -#include "item_use.h" +#include "item_menu.h" extern u16 gBattle_BG0_X; extern u16 gBattle_BG0_Y; diff --git a/src/battle_data.c b/src/battle_data.c index f3719ac2d..7f86385aa 100644 --- a/src/battle_data.c +++ b/src/battle_data.c @@ -5,6 +5,7 @@ #include "constants/moves.h" #include "constants/species.h" #include "constants/trainers.h" +#include "constants/battle_ai.h" #include "data/trainer_parties.h" #include "data/text/trainer_class_names.h" diff --git a/src/battle_dome.c b/src/battle_dome.c new file mode 100644 index 000000000..ff284b564 --- /dev/null +++ b/src/battle_dome.c @@ -0,0 +1,6481 @@ +#include "global.h" +#include "battle_dome.h" +#include "battle.h" +#include "battle_setup.h" +#include "battle_tower.h" +#include "battle_message.h" +#include "event_data.h" +#include "overworld.h" +#include "util.h" +#include "malloc.h" +#include "string_util.h" +#include "random.h" +#include "task.h" +#include "main.h" +#include "gpu_regs.h" +#include "text.h" +#include "bg.h" +#include "window.h" +#include "palette.h" +#include "decompress.h" +#include "menu.h" +#include "sound.h" +#include "pokemon_icon.h" +#include "data2.h" +#include "international_string_util.h" +#include "trainer_pokemon_sprites.h" +#include "scanline_effect.h" +#include "constants/species.h" +#include "constants/moves.h" +#include "constants/trainers.h" +#include "constants/abilities.h" +#include "constants/songs.h" +#include "constants/battle_frontier.h" +#include "constants/rgb.h" + +#define DOME_ROUND1 0 +#define DOME_ROUND2 1 +#define DOME_QUARTERFINAL 1 // Different name for the same round. +#define DOME_SEMIFINAL 2 +#define DOME_FINAL 3 +#define DOME_ROUNDS_COUNT 4 + +struct BattleDomeStruct +{ + u8 arr[DOME_TOURNAMENT_TRAINERS_COUNT]; + u8 unk_10; + u8 unk_11[3]; +}; + +struct UnkStruct_860DD10 +{ + u8 x; + u8 y; + u16 src; +}; + +extern void sub_81B8558(void); +extern u32 sub_81A39C4(void); +extern u16 sub_8162548(u8, u8); +extern u16 RandomizeFacilityTrainerMonId(u16); +extern u8 GetFacilityEnemyMonLevel(void); +extern u16 sub_81A5060(u8 monId, u8 moveSlotId); +extern u8 sub_81A50F0(u8, u8); +extern u8 sub_81A50B0(u8); +extern void sub_8162614(u16, u8); +extern void sub_81A4C30(void); +extern bool8 sub_81A3610(void); +extern u16 sub_81A4FF0(u8); +extern u8 GetFrontierTrainerFrontSpriteId(u16); +extern u8 GetFrontierOpponentClass(u16); +extern void sub_80F94E8(void); + +extern u8 gUnknown_0203CEF8[]; +extern u16 gBattle_BG0_X; +extern u16 gBattle_BG0_Y; +extern u16 gBattle_BG1_X; +extern u16 gBattle_BG1_Y; +extern u16 gBattle_BG2_X; +extern u16 gBattle_BG2_Y; +extern u16 gBattle_BG3_X; +extern u16 gBattle_BG3_Y; + +extern const u16 gBattleFrontierHeldItems[]; +extern const struct FacilityMon gBattleFrontierMons[]; +extern const struct BattleFrontierTrainer gBattleFrontierTrainers[]; +extern const struct SpriteTemplate gUnknown_0860CFA8; + +// gfx +extern const u8 gUnknown_08D83D50[]; +extern const u8 gUnknown_08D84970[]; +extern const u8 gUnknown_08D84F00[]; +extern const u8 gUnknown_08D85444[]; +extern const u8 gUnknown_08D85358[]; +extern const u8 gUnknown_08D85600[]; +extern const u8 gUnknown_08D854C8[]; +extern const u8 gUnknown_08D82F10[]; +extern const u8 gUnknown_08D834FC[]; +extern const u8 gUnknown_08D83B2C[]; +extern const u8 gUnknown_08D83C3C[]; +extern const u8 gUnknown_08D83900[]; +extern const u8 gBattleFrontierGfx_DomeOptions[]; + +// text +extern const u8 gTrainerClassNames[][0xD]; + +extern const u8 gBattleDomeOpponentPotential1[]; +extern const u8 gBattleDomeOpponentPotential2[]; +extern const u8 gBattleDomeOpponentPotential3[]; +extern const u8 gBattleDomeOpponentPotential4[]; +extern const u8 gBattleDomeOpponentPotential5[]; +extern const u8 gBattleDomeOpponentPotential6[]; +extern const u8 gBattleDomeOpponentPotential7[]; +extern const u8 gBattleDomeOpponentPotential8[]; +extern const u8 gBattleDomeOpponentPotential9[]; +extern const u8 gBattleDomeOpponentPotential10[]; +extern const u8 gBattleDomeOpponentPotential11[]; +extern const u8 gBattleDomeOpponentPotential12[]; +extern const u8 gBattleDomeOpponentPotential13[]; +extern const u8 gBattleDomeOpponentPotential14[]; +extern const u8 gBattleDomeOpponentPotential15[]; +extern const u8 gBattleDomeOpponentPotential16[]; +extern const u8 gBattleDomeOpponentPotential17[]; +extern const u8 gBattleDomeOpponentStyle1[]; +extern const u8 gBattleDomeOpponentStyle2[]; +extern const u8 gBattleDomeOpponentStyle3[]; +extern const u8 gBattleDomeOpponentStyle4[]; +extern const u8 gBattleDomeOpponentStyle5[]; +extern const u8 gBattleDomeOpponentStyle6[]; +extern const u8 gBattleDomeOpponentStyle7[]; +extern const u8 gBattleDomeOpponentStyle8[]; +extern const u8 gBattleDomeOpponentStyle9[]; +extern const u8 gBattleDomeOpponentStyle10[]; +extern const u8 gBattleDomeOpponentStyle11[]; +extern const u8 gBattleDomeOpponentStyle12[]; +extern const u8 gBattleDomeOpponentStyle13[]; +extern const u8 gBattleDomeOpponentStyle14[]; +extern const u8 gBattleDomeOpponentStyle15[]; +extern const u8 gBattleDomeOpponentStyle16[]; +extern const u8 gBattleDomeOpponentStyle17[]; +extern const u8 gBattleDomeOpponentStyle18[]; +extern const u8 gBattleDomeOpponentStyle19[]; +extern const u8 gBattleDomeOpponentStyle20[]; +extern const u8 gBattleDomeOpponentStyle21[]; +extern const u8 gBattleDomeOpponentStyle22[]; +extern const u8 gBattleDomeOpponentStyle23[]; +extern const u8 gBattleDomeOpponentStyle24[]; +extern const u8 gBattleDomeOpponentStyle25[]; +extern const u8 gBattleDomeOpponentStyle26[]; +extern const u8 gBattleDomeOpponentStyle27[]; +extern const u8 gBattleDomeOpponentStyle28[]; +extern const u8 gBattleDomeOpponentStyleUnused1[]; +extern const u8 gBattleDomeOpponentStyleUnused2[]; +extern const u8 gBattleDomeOpponentStyleUnused3[]; +extern const u8 gBattleDomeOpponentStyleUnused4[]; +extern const u8 gBattleDomeOpponentStats1[]; +extern const u8 gBattleDomeOpponentStats2[]; +extern const u8 gBattleDomeOpponentStats3[]; +extern const u8 gBattleDomeOpponentStats4[]; +extern const u8 gBattleDomeOpponentStats5[]; +extern const u8 gBattleDomeOpponentStats6[]; +extern const u8 gBattleDomeOpponentStats7[]; +extern const u8 gBattleDomeOpponentStats8[]; +extern const u8 gBattleDomeOpponentStats9[]; +extern const u8 gBattleDomeOpponentStats10[]; +extern const u8 gBattleDomeOpponentStats11[]; +extern const u8 gBattleDomeOpponentStats12[]; +extern const u8 gBattleDomeOpponentStats13[]; +extern const u8 gBattleDomeOpponentStats14[]; +extern const u8 gBattleDomeOpponentStats15[]; +extern const u8 gBattleDomeOpponentStats16[]; +extern const u8 gBattleDomeOpponentStats17[]; +extern const u8 gBattleDomeOpponentStats18[]; +extern const u8 gBattleDomeOpponentStats19[]; +extern const u8 gBattleDomeOpponentStats20[]; +extern const u8 gBattleDomeOpponentStats21[]; +extern const u8 gBattleDomeOpponentStats22[]; +extern const u8 gBattleDomeOpponentStats23[]; +extern const u8 gBattleDomeOpponentStats24[]; +extern const u8 gBattleDomeOpponentStats25[]; +extern const u8 gBattleDomeOpponentStats26[]; +extern const u8 gBattleDomeOpponentStats27[]; +extern const u8 gBattleDomeOpponentStats28[]; +extern const u8 gBattleDomeOpponentStats29[]; +extern const u8 gBattleDomeOpponentStats30[]; +extern const u8 gBattleDomeOpponentStats31[]; +extern const u8 gBattleDomeOpponentStats32[]; +extern const u8 gBattleDomeOpponentStats33[]; +extern const u8 gBattleDomeOpponentStats34[]; +extern const u8 gBattleDomeOpponentStats35[]; +extern const u8 gBattleDomeOpponentStats36[]; +extern const u8 gBattleDomeOpponentStats37[]; +extern const u8 gBattleDomeOpponentStats38[]; +extern const u8 gBattleDomeOpponentStats39[]; +extern const u8 gBattleDomeOpponentStats40[]; +extern const u8 gBattleDomeOpponentStats41[]; +extern const u8 gBattleDomeOpponentStats42[]; +extern const u8 gBattleDomeOpponentStats43[]; +extern const u8 gBattleDomeMatchNumber1[]; +extern const u8 gBattleDomeMatchNumber2[]; +extern const u8 gBattleDomeMatchNumber3[]; +extern const u8 gBattleDomeMatchNumber4[]; +extern const u8 gBattleDomeMatchNumber5[]; +extern const u8 gBattleDomeMatchNumber6[]; +extern const u8 gBattleDomeMatchNumber7[]; +extern const u8 gBattleDomeMatchNumber8[]; +extern const u8 gBattleDomeMatchNumber9[]; +extern const u8 gBattleDomeMatchNumber10[]; +extern const u8 gBattleDomeMatchNumber11[]; +extern const u8 gBattleDomeMatchNumber12[]; +extern const u8 gBattleDomeMatchNumber13[]; +extern const u8 gBattleDomeMatchNumber14[]; +extern const u8 gBattleDomeMatchNumber15[]; +extern const u8 gBattleDomeWinStrings1[]; +extern const u8 gBattleDomeWinStrings2[]; +extern const u8 gBattleDomeWinStrings3[]; +extern const u8 gBattleDomeWinStrings4[]; +extern const u8 gBattleDomeWinStrings5[]; +extern const u8 gBattleDomeWinStrings6[]; +extern const u8 gBattleDomeWinStrings7[]; + +// This file's functions. +static u8 GetDomeTrainerMonIvs(u16 trainerId); +static void SwapDomeTrainers(s32 id1, s32 id2, u16 *statsArray); +static void CalcDomeMonStats(u16 species, s32 level, s32 ivs, u8 evBits, u8 nature, s32 *stats); +static void CreateDomeTrainerMons(u16 tournamentTrainerId); +static s32 sub_818FCBC(u16 tournamentTrainerId, bool8 arg1); +static s32 sub_818FDB8(u16 tournamentTrainerId, bool8 arg1); +static s32 GetTypeEffectivenessPoints(s32 move, s32 species, s32 arg2); +static s32 sub_818FEB4(s32 *arr, bool8 arg1); +static void sub_8190400(u8 taskId); +static void sub_8190CD4(u8 taskId); +static u8 sub_819221C(u8 taskId); +static void sub_8194D48(void); +static s32 TrainerIdToTournamentId(u16 trainerId); +static u16 TrainerIdOfPlayerOpponent(void); +static void sub_8194220(u8 taskId); +static void sub_8194950(u8 taskId); +static void CB2_BattleDome(void); +static void VblankCb0_BattleDome(void); +static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo); +static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTournamentId); +static s32 sub_8192F08(u8, u8*); +static u8 GetDomeBrainTrainerPicId(void); +static u8 GetDomeBrainTrainerClass(void); +static void CopyDomeBrainTrainerName(u8 *dst); +static void CopyDomeTrainerName(u8 *dst, u16 trainerId); +static void HblankCb_BattleDome(void); +static void VblankCb1_BattleDome(void); +static u8 sub_8193BDC(u8 taskId); +static void DecideRoundWinners(u8 roundId); +static u8 sub_81953E8(u8 tournamentId, u8); +static void sub_81948EC(u8, u8); +static void sub_8190B40(struct Sprite *sprite); +static void sub_8190C6C(struct Sprite *sprite); +static void sub_818E9CC(void); +static void sub_818EA84(void); +static void sub_818ED28(void); +static void sub_818F9B0(void); +static void sub_818F9E0(void); +static void sub_818FA20(void); +static void ShowDomeOpponentInfo(void); +static void sub_81938A4(void); +static void sub_81938E0(void); +static void sub_8190298(void); +static void sub_81902E4(void); +static void sub_8193D40(void); +static void sub_8193D7C(void); +static void sub_81902F8(void); +static void sub_819033C(void); +static void sub_8194D68(void); +static void sub_8194E44(void); +static void sub_8194EB4(void); +static void sub_8194EC0(void); +static void sub_8194EF8(void); +static void sub_8194F58(void); +static void InitDomeTrainers(void); + +// EWRAM variables. +EWRAM_DATA u32 gUnknown_0203CD70 = 0; +static EWRAM_DATA u32 gUnknown_0203CD74 = 0; +static EWRAM_DATA struct BattleDomeStruct *sBattleDomeStruct = {0}; +static EWRAM_DATA u8 *sTilemapBuffer = NULL; + +// Const rom data. +static const u8 sMovePointsForDomeTrainers[MOVES_COUNT][DOME_TOURNAMENT_TRAINERS_COUNT] = +{ + [MOVE_NONE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_POUND] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_KARATE_CHOP] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_DOUBLE_SLAP] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_COMET_PUNCH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_MEGA_PUNCH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_PAY_DAY] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_FIRE_PUNCH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_ICE_PUNCH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_THUNDER_PUNCH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_SCRATCH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_VICE_GRIP] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_GUILLOTINE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_RAZOR_WIND] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SWORDS_DANCE] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0}, + [MOVE_CUT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_GUST] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_WING_ATTACK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_WHIRLWIND] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_FLY] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_BIND] = {0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_SLAM] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_VINE_WHIP] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_STOMP] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_DOUBLE_KICK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_MEGA_KICK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_JUMP_KICK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_ROLLING_KICK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_SAND_ATTACK] = {0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_HEADBUTT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_HORN_ATTACK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_FURY_ATTACK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_HORN_DRILL] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_TACKLE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_BODY_SLAM] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_WRAP] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_TAKE_DOWN] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_THRASH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_DOUBLE_EDGE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_TAIL_WHIP] = {0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_POISON_STING] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_TWINEEDLE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_PIN_MISSILE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_LEER] = {0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_BITE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_GROWL] = {0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_ROAR] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SING] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SUPERSONIC] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SONIC_BOOM] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_DISABLE] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_ACID] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_EMBER] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_FLAMETHROWER] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1}, + [MOVE_MIST] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_WATER_GUN] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_HYDRO_PUMP] = {1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0}, + [MOVE_SURF] = {1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0}, + [MOVE_ICE_BEAM] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1}, + [MOVE_BLIZZARD] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1}, + [MOVE_PSYBEAM] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_BUBBLE_BEAM] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_AURORA_BEAM] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_HYPER_BEAM] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0}, + [MOVE_PECK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_DRILL_PECK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SUBMISSION] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_LOW_KICK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_COUNTER] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0}, + [MOVE_SEISMIC_TOSS] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_STRENGTH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_ABSORB] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_MEGA_DRAIN] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_LEECH_SEED] = {1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_GROWTH] = {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_RAZOR_LEAF] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SOLAR_BEAM] = {1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0}, + [MOVE_POISON_POWDER] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_STUN_SPORE] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SLEEP_POWDER] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_PETAL_DANCE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_STRING_SHOT] = {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_DRAGON_RAGE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_FIRE_SPIN] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_THUNDER_SHOCK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_THUNDERBOLT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1}, + [MOVE_THUNDER_WAVE] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_THUNDER] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1}, + [MOVE_ROCK_THROW] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_EARTHQUAKE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0}, + [MOVE_FISSURE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0}, + [MOVE_DIG] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_TOXIC] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_CONFUSION] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_PSYCHIC] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1}, + [MOVE_HYPNOSIS] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_MEDITATE] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_AGILITY] = {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_QUICK_ATTACK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_RAGE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_TELEPORT] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_NIGHT_SHADE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_MIMIC] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SCREECH] = {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_DOUBLE_TEAM] = {0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_RECOVER] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_HARDEN] = {0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_MINIMIZE] = {0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SMOKESCREEN] = {0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_CONFUSE_RAY] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_WITHDRAW] = {0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_DEFENSE_CURL] = {0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_BARRIER] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_LIGHT_SCREEN] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_HAZE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_REFLECT] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_FOCUS_ENERGY] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_BIDE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_METRONOME] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}, + [MOVE_MIRROR_MOVE] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}, + [MOVE_SELF_DESTRUCT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0}, + [MOVE_EGG_BOMB] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0}, + [MOVE_LICK] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_SMOG] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_SLUDGE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_BONE_CLUB] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_FIRE_BLAST] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1}, + [MOVE_WATERFALL] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_CLAMP] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_SWIFT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SKULL_BASH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0}, + [MOVE_SPIKE_CANNON] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_CONSTRICT] = {0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_AMNESIA] = {0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_KINESIS] = {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SOFT_BOILED] = {0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_HI_JUMP_KICK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_GLARE] = {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_DREAM_EATER] = {1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0}, + [MOVE_POISON_GAS] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_BARRAGE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_LEECH_LIFE] = {0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_LOVELY_KISS] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SKY_ATTACK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1}, + [MOVE_TRANSFORM] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_BUBBLE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_DIZZY_PUNCH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_SPORE] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_FLASH] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_PSYWAVE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SPLASH] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_ACID_ARMOR] = {0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_CRABHAMMER] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0}, + [MOVE_EXPLOSION] = {0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0}, + [MOVE_FURY_SWIPES] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_BONEMERANG] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_REST] = {1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_ROCK_SLIDE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_HYPER_FANG] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_SHARPEN] = {0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_CONVERSION] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_TRI_ATTACK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_SUPER_FANG] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SLASH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SUBSTITUTE] = {0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_STRUGGLE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0}, + [MOVE_SKETCH] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0}, + [MOVE_TRIPLE_KICK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_THIEF] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_SPIDER_WEB] = {0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_MIND_READER] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0}, + [MOVE_NIGHTMARE] = {1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_FLAME_WHEEL] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_SNORE] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_CURSE] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_FLAIL] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_CONVERSION_2] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_AEROBLAST] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0}, + [MOVE_COTTON_SPORE] = {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_REVERSAL] = {1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SPITE] = {0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_POWDER_SNOW] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_PROTECT] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0}, + [MOVE_MACH_PUNCH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SCARY_FACE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_FAINT_ATTACK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SWEET_KISS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_BELLY_DRUM] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SLUDGE_BOMB] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1}, + [MOVE_MUD_SLAP] = {0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_OCTAZOOKA] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_SPIKES] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_ZAP_CANNON] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1}, + [MOVE_FORESIGHT] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_DESTINY_BOND] = {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_PERISH_SONG] = {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_ICY_WIND] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_DETECT] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_BONE_RUSH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_LOCK_ON] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0}, + [MOVE_OUTRAGE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1}, + [MOVE_SANDSTORM] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_GIGA_DRAIN] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0}, + [MOVE_ENDURE] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_CHARM] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_ROLLOUT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_FALSE_SWIPE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SWAGGER] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_MILK_DRINK] = {0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SPARK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_FURY_CUTTER] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_STEEL_WING] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_MEAN_LOOK] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0}, + [MOVE_ATTRACT] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SLEEP_TALK] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}, + [MOVE_HEAL_BELL] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_RETURN] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_PRESENT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0}, + [MOVE_FRUSTRATION] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SAFEGUARD] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_PAIN_SPLIT] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SACRED_FIRE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1}, + [MOVE_MAGNITUDE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_DYNAMIC_PUNCH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1}, + [MOVE_MEGAHORN] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0}, + [MOVE_DRAGON_BREATH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_BATON_PASS] = {1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_ENCORE] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0}, + [MOVE_PURSUIT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_RAPID_SPIN] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SWEET_SCENT] = {0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_IRON_TAIL] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1}, + [MOVE_METAL_CLAW] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_VITAL_THROW] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_MORNING_SUN] = {1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_SYNTHESIS] = {1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_MOONLIGHT] = {1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_HIDDEN_POWER] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_CROSS_CHOP] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0}, + [MOVE_TWISTER] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_RAIN_DANCE] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_SUNNY_DAY] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_CRUNCH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_MIRROR_COAT] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_PSYCH_UP] = {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_EXTREME_SPEED] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0}, + [MOVE_ANCIENT_POWER] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1}, + [MOVE_SHADOW_BALL] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_FUTURE_SIGHT] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_ROCK_SMASH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_WHIRLPOOL] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_BEAT_UP] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_FAKE_OUT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_UPROAR] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_STOCKPILE] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SPIT_UP] = {1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0}, + [MOVE_SWALLOW] = {1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_HEAT_WAVE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1}, + [MOVE_HAIL] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_TORMENT] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_FLATTER] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_WILL_O_WISP] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_MEMENTO] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_FACADE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_FOCUS_PUNCH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0}, + [MOVE_SMELLING_SALT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_FOLLOW_ME] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_NATURE_POWER] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_CHARGE] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_TAUNT] = {0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_HELPING_HAND] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_TRICK] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_ROLE_PLAY] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_WISH] = {0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_ASSIST] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}, + [MOVE_INGRAIN] = {1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_SUPERPOWER] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0}, + [MOVE_MAGIC_COAT] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0}, + [MOVE_RECYCLE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_REVENGE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0}, + [MOVE_BRICK_BREAK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_YAWN] = {1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_KNOCK_OFF] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_ENDEAVOR] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0}, + [MOVE_ERUPTION] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0}, + [MOVE_SKILL_SWAP] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_IMPRISON] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}, + [MOVE_REFRESH] = {0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_GRUDGE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0}, + [MOVE_SNATCH] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0}, + [MOVE_SECRET_POWER] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_DIVE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_ARM_THRUST] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_CAMOUFLAGE] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_TAIL_GLOW] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_LUSTER_PURGE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1}, + [MOVE_MIST_BALL] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1}, + [MOVE_FEATHER_DANCE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_TEETER_DANCE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_BLAZE_KICK] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_MUD_SPORT] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_ICE_BALL] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_NEEDLE_ARM] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_SLACK_OFF] = {0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_HYPER_VOICE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0}, + [MOVE_POISON_FANG] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_CRUSH_CLAW] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_BLAST_BURN] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0}, + [MOVE_HYDRO_CANNON] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0}, + [MOVE_METEOR_MASH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1}, + [MOVE_ASTONISH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_WEATHER_BALL] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_AROMATHERAPY] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}, + [MOVE_FAKE_TEARS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_AIR_CUTTER] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_OVERHEAT] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1}, + [MOVE_ODOR_SLEUTH] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_ROCK_TOMB] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_SILVER_WIND] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1}, + [MOVE_METAL_SOUND] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_GRASS_WHISTLE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_TICKLE] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_COSMIC_POWER] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_WATER_SPOUT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0}, + [MOVE_SIGNAL_BEAM] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_SHADOW_PUNCH] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_EXTRASENSORY] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_SKY_UPPERCUT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SAND_TOMB] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_SHEER_COLD] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0}, + [MOVE_MUDDY_WATER] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1}, + [MOVE_BULLET_SEED] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_AERIAL_ACE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_ICICLE_SPEAR] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_IRON_DEFENSE] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_BLOCK] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0}, + [MOVE_HOWL] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_DRAGON_CLAW] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_FRENZY_PLANT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0}, + [MOVE_BULK_UP] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_BOUNCE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1}, + [MOVE_MUD_SHOT] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1}, + [MOVE_POISON_TAIL] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_COVET] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_VOLT_TACKLE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0}, + [MOVE_MAGICAL_LEAF] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_WATER_SPORT] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_CALM_MIND] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_LEAF_BLADE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0}, + [MOVE_DRAGON_DANCE] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_ROCK_BLAST] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_SHOCK_WAVE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + [MOVE_WATER_PULSE] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1}, + [MOVE_DOOM_DESIRE] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0}, + [MOVE_PSYCHO_BOOST] = {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1}, +}; + +static const u8 gUnknown_0860C988[][DOME_TOURNAMENT_TRAINERS_COUNT] = +{ + {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 2, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0}, + {1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + {3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0}, + {0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0}, + {0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0}, + {2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +}; +static const u8 sUnusedArray[] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 3, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 2, 253, 0, 0, 0, 0, 0, 253, 0, 0, 0, 0, 0, 253, 0, + 0, 0, 0, 0, 253, 0, 0, 0, 0, 0, 253, 254, 0, 0, 0, 0, + 0, 254, 0, 0, 0, 0, 0, 254, 0, 0, 0, 0, 0, 254, 0, 0, + 0, 0, 0, 254, 0, 0, 0, 0, 0, +}; + +static const u8 gUnknown_0860CBF1[][5][4]= +{ + {{0x07, 0x01, 0x08, 0x10}, {0x07, 0x01, 0x08, 0x10}, {0x07, 0x01, 0x08, 0x10}, {0x07, 0x01, 0x08, 0x10}, {0x07, 0x01, 0x08, 0x10}}, + {{0x00, 0x02, 0x09, 0x10}, {0x00, 0x02, 0x09, 0x10}, {0x00, 0x02, 0x09, 0x10}, {0x00, 0x02, 0x09, 0x10}, {0x00, 0x02, 0x09, 0x10}}, + {{0x01, 0x03, 0x0a, 0x11}, {0x01, 0x03, 0x0a, 0x11}, {0x01, 0x03, 0x0a, 0x11}, {0x01, 0x03, 0x0a, 0x11}, {0x01, 0x03, 0x0a, 0x11}}, + {{0x02, 0x04, 0x0b, 0x11}, {0x02, 0x04, 0x0b, 0x11}, {0x02, 0x04, 0x0b, 0x11}, {0x02, 0x04, 0x0b, 0x11}, {0x02, 0x04, 0x0b, 0x11}}, + {{0x03, 0x05, 0x0c, 0x12}, {0x03, 0x05, 0x0c, 0x12}, {0x03, 0x05, 0x0c, 0x12}, {0x03, 0x05, 0x0c, 0x12}, {0x03, 0x05, 0x0c, 0x12}}, + {{0x04, 0x06, 0x0d, 0x12}, {0x04, 0x06, 0x0d, 0x12}, {0x04, 0x06, 0x0d, 0x12}, {0x04, 0x06, 0x0d, 0x12}, {0x04, 0x06, 0x0d, 0x12}}, + {{0x05, 0x07, 0x0e, 0x13}, {0x05, 0x07, 0x0e, 0x13}, {0x05, 0x07, 0x0e, 0x13}, {0x05, 0x07, 0x0e, 0x13}, {0x05, 0x07, 0x0e, 0x13}}, + {{0x06, 0x00, 0x0f, 0x13}, {0x06, 0x00, 0x0f, 0x13}, {0x06, 0x00, 0x0f, 0x13}, {0x06, 0x00, 0x0f, 0x13}, {0x06, 0x00, 0x0f, 0x13}}, + {{0x1f, 0x09, 0x14, 0x1f}, {0x1f, 0x09, 0x14, 0x1f}, {0x1f, 0x09, 0x14, 0x1f}, {0x1f, 0x09, 0x14, 0x1f}, {0x1f, 0x09, 0x14, 0x1f}}, + {{0x08, 0x0a, 0x14, 0x01}, {0x08, 0x0a, 0x14, 0x01}, {0x08, 0x0a, 0x14, 0x01}, {0x08, 0x0a, 0x14, 0x01}, {0x08, 0x0a, 0x14, 0x01}}, + {{0x09, 0x0b, 0x15, 0x02}, {0x09, 0x0b, 0x15, 0x02}, {0x09, 0x0b, 0x15, 0x02}, {0x09, 0x0b, 0x15, 0x02}, {0x09, 0x0b, 0x15, 0x02}}, + {{0x0a, 0x0c, 0x15, 0x03}, {0x0a, 0x0c, 0x15, 0x03}, {0x0a, 0x0c, 0x15, 0x03}, {0x0a, 0x0c, 0x15, 0x03}, {0x0a, 0x0c, 0x15, 0x03}}, + {{0x0b, 0x0d, 0x16, 0x04}, {0x0b, 0x0d, 0x16, 0x04}, {0x0b, 0x0d, 0x16, 0x04}, {0x0b, 0x0d, 0x16, 0x04}, {0x0b, 0x0d, 0x16, 0x04}}, + {{0x0c, 0x0e, 0x16, 0x05}, {0x0c, 0x0e, 0x16, 0x05}, {0x0c, 0x0e, 0x16, 0x05}, {0x0c, 0x0e, 0x16, 0x05}, {0x0c, 0x0e, 0x16, 0x05}}, + {{0x0d, 0x0f, 0x17, 0x06}, {0x0d, 0x0f, 0x17, 0x06}, {0x0d, 0x0f, 0x17, 0x06}, {0x0d, 0x0f, 0x17, 0x06}, {0x0d, 0x0f, 0x17, 0x06}}, + {{0x0e, 0x1f, 0x17, 0x07}, {0x0e, 0x1f, 0x17, 0x07}, {0x0e, 0x1f, 0x17, 0x07}, {0x0e, 0x1f, 0x17, 0x07}, {0x0e, 0x1f, 0x17, 0x07}}, + {{0x13, 0x11, 0x00, 0x14}, {0x13, 0x11, 0x00, 0x18}, {0x13, 0x11, 0x00, 0x18}, {0x13, 0x11, 0x00, 0x18}, {0x13, 0x11, 0x00, 0x18}}, + {{0x10, 0x12, 0x02, 0x15}, {0x10, 0x12, 0x02, 0x18}, {0x10, 0x12, 0x02, 0x18}, {0x10, 0x12, 0x02, 0x18}, {0x10, 0x12, 0x02, 0x18}}, + {{0x11, 0x13, 0x04, 0x16}, {0x11, 0x13, 0x04, 0x19}, {0x11, 0x13, 0x04, 0x19}, {0x11, 0x13, 0x04, 0x19}, {0x11, 0x13, 0x04, 0x19}}, + {{0x12, 0x10, 0x06, 0x17}, {0x12, 0x10, 0x06, 0x19}, {0x12, 0x10, 0x06, 0x19}, {0x12, 0x10, 0x06, 0x19}, {0x12, 0x10, 0x06, 0x19}}, + {{0x17, 0x15, 0x10, 0x08}, {0x17, 0x15, 0x1a, 0x08}, {0x17, 0x15, 0x1a, 0x08}, {0x17, 0x15, 0x1a, 0x08}, {0x17, 0x15, 0x1a, 0x08}}, + {{0x14, 0x16, 0x11, 0x0a}, {0x14, 0x16, 0x1a, 0x0a}, {0x14, 0x16, 0x1a, 0x0a}, {0x14, 0x16, 0x1a, 0x0a}, {0x14, 0x16, 0x1a, 0x0a}}, + {{0x15, 0x17, 0x12, 0x0c}, {0x15, 0x17, 0x1b, 0x0c}, {0x15, 0x17, 0x1b, 0x0c}, {0x15, 0x17, 0x1b, 0x0c}, {0x15, 0x17, 0x1b, 0x0c}}, + {{0x16, 0x14, 0x13, 0x0e}, {0x16, 0x14, 0x1b, 0x0e}, {0x16, 0x14, 0x1b, 0x0e}, {0x16, 0x14, 0x1b, 0x0e}, {0x16, 0x14, 0x1b, 0x0e}}, + {{0xff, 0xff, 0xff, 0xff}, {0x19, 0x19, 0x10, 0x1a}, {0x19, 0x19, 0x10, 0x1c}, {0x19, 0x19, 0x10, 0x1c}, {0x19, 0x19, 0x10, 0x1c}}, + {{0xff, 0xff, 0xff, 0xff}, {0x18, 0x18, 0x12, 0x1b}, {0x18, 0x18, 0x12, 0x1c}, {0x18, 0x18, 0x12, 0x1c}, {0x18, 0x18, 0x12, 0x1c}}, + {{0xff, 0xff, 0xff, 0xff}, {0x1b, 0x1b, 0x18, 0x14}, {0x1b, 0x1b, 0x1d, 0x14}, {0x1b, 0x1b, 0x1d, 0x14}, {0x1b, 0x1b, 0x1d, 0x14}}, + {{0xff, 0xff, 0xff, 0xff}, {0x1a, 0x1a, 0x19, 0x16}, {0x1a, 0x1a, 0x1d, 0x16}, {0x1a, 0x1a, 0x1d, 0x16}, {0x1a, 0x1a, 0x1d, 0x16}}, + {{0xff, 0xff, 0xff, 0xff}, {0xff, 0xff, 0xff, 0xff}, {0xff, 0xff, 0x18, 0x1d}, {0xff, 0xff, 0x18, 0x1e}, {0xff, 0xff, 0x18, 0x1e}}, + {{0xff, 0xff, 0xff, 0xff}, {0xff, 0xff, 0xff, 0xff}, {0xff, 0xff, 0x1c, 0x1a}, {0xff, 0xff, 0x1e, 0x1a}, {0xff, 0xff, 0x1e, 0x1a}}, + {{0xff, 0xff, 0xff, 0xff}, {0xff, 0xff, 0xff, 0xff}, {0xff, 0xff, 0xff, 0xff}, {0xff, 0xff, 0x1c, 0x1d}, {0xff, 0xff, 0x1c, 0x1d}}, + {{0x0f, 0x08, 0x08, 0x00}, {0x0f, 0x08, 0x08, 0x00}, {0x0f, 0x08, 0x08, 0x00}, {0x0f, 0x08, 0x08, 0x00}, {0x0f, 0x08, 0x08, 0x00}}, +}; + +static const struct BgTemplate gUnknown_0860CE74[4] = +{ + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 28, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 1, + .mapBaseIndex = 29, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 2, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, +}; + +static const struct BgTemplate gUnknown_0860CE84[4] = +{ + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 20, + .screenSize = 3, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 1, + .mapBaseIndex = 24, + .screenSize = 3, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 28, + .screenSize = 3, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 2, + .mapBaseIndex = 7, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, +}; + +static const struct WindowTemplate gUnknown_0860CE94[] = +{ + { + .priority = 0, + .tilemapLeft = 0, + .tilemapTop = 3, + .width = 8, + .height = 16, + .paletteNum = 15, + .baseBlock = 16, + }, + { + .priority = 0, + .tilemapLeft = 22, + .tilemapTop = 3, + .width = 8, + .height = 16, + .paletteNum = 15, + .baseBlock = 144, + }, + { + .priority = 0, + .tilemapLeft = 8, + .tilemapTop = 1, + .width = 14, + .height = 2, + .paletteNum = 15, + .baseBlock = 272, + }, + DUMMY_WIN_TEMPLATE, +}; + +static const struct WindowTemplate gUnknown_0860CEB4[] = +{ + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 2, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 1, + }, + { + .priority = 0, + .tilemapLeft = 16, + .tilemapTop = 5, + .width = 8, + .height = 2, + .paletteNum = 15, + .baseBlock = 53, + }, + { + .priority = 0, + .tilemapLeft = 19, + .tilemapTop = 7, + .width = 9, + .height = 3, + .paletteNum = 15, + .baseBlock = 69, + }, + { + .priority = 0, + .tilemapLeft = 16, + .tilemapTop = 10, + .width = 8, + .height = 2, + .paletteNum = 15, + .baseBlock = 96, + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 12, + .width = 26, + .height = 7, + .paletteNum = 15, + .baseBlock = 112, + }, + { + .priority = 0, + .tilemapLeft = 5, + .tilemapTop = 2, + .width = 23, + .height = 2, + .paletteNum = 15, + .baseBlock = 294, + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 5, + .width = 8, + .height = 2, + .paletteNum = 15, + .baseBlock = 340, + }, + { + .priority = 0, + .tilemapLeft = 20, + .tilemapTop = 5, + .width = 8, + .height = 2, + .paletteNum = 15, + .baseBlock = 356, + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 16, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 372, + }, + { + .priority = 1, + .tilemapLeft = 2, + .tilemapTop = 2, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 1, + }, + { + .priority = 1, + .tilemapLeft = 16, + .tilemapTop = 5, + .width = 8, + .height = 2, + .paletteNum = 15, + .baseBlock = 53, + }, + { + .priority = 1, + .tilemapLeft = 19, + .tilemapTop = 7, + .width = 9, + .height = 3, + .paletteNum = 15, + .baseBlock = 69, + }, + { + .priority = 1, + .tilemapLeft = 16, + .tilemapTop = 10, + .width = 8, + .height = 2, + .paletteNum = 15, + .baseBlock = 96, + }, + { + .priority = 1, + .tilemapLeft = 2, + .tilemapTop = 12, + .width = 26, + .height = 7, + .paletteNum = 15, + .baseBlock = 112, + }, + { + .priority = 1, + .tilemapLeft = 5, + .tilemapTop = 2, + .width = 23, + .height = 2, + .paletteNum = 15, + .baseBlock = 294, + }, + { + .priority = 1, + .tilemapLeft = 2, + .tilemapTop = 5, + .width = 8, + .height = 2, + .paletteNum = 15, + .baseBlock = 340, + }, + { + .priority = 1, + .tilemapLeft = 20, + .tilemapTop = 5, + .width = 8, + .height = 2, + .paletteNum = 15, + .baseBlock = 356, + }, + { + .priority = 1, + .tilemapLeft = 2, + .tilemapTop = 16, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 372, + }, + // UB: No DUMMY_WIN_TEMPLATE at the array's end. +}; + +static const struct ScanlineEffectParams gUnknown_0860CF44 = +{ + .dmaDest = (void *)REG_ADDR_BG3CNT, + .dmaControl = 0xa2600001, + .initState = 1, +}; + +static const struct CompressedSpriteSheet gUnknown_0860CF50[] = +{ + {gBattleFrontierGfx_DomeOptions, 0x0600, 0x0000}, + {}, +}; + +static const struct CompressedSpritePalette gUnknown_0860CF60[] = +{ + {gUnknown_08D85444, 0x0000}, + {}, +}; + +static const struct OamData gUnknown_0860CF70 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; + +static const struct OamData gUnknown_0860CF78 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 0, + .paletteNum = 1, + .affineParam = 0, +}; + +static const struct OamData gUnknown_0860CF80 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 0, + .tileNum = 0, + .priority = 0, + .paletteNum = 2, + .affineParam = 0, +}; + +static const struct OamData gUnknown_0860CF88 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 2, + .x = 0, + .matrixNum = 0, + .size = 0, + .tileNum = 0, + .priority = 0, + .paletteNum = 2, + .affineParam = 0, +}; + +static const union AnimCmd gUnknown_0860CF90[] = +{ + ANIMCMD_FRAME(20, 1), + ANIMCMD_END, +}; +static const union AnimCmd gUnknown_0860CF98[] = +{ + ANIMCMD_FRAME(24, 1), + ANIMCMD_END, +}; + +static const union AnimCmd * const gUnknown_0860CFA0[] = +{ + gUnknown_0860CF90, + gUnknown_0860CF98, +}; + +static const struct SpriteTemplate gUnknown_0860CFA8 = +{ + .tileTag = 0x0000, + .paletteTag = 0xffff, + .oam = &gUnknown_0860CF70, + .anims = gUnknown_0860CFA0, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +static const union AnimCmd gUnknown_0860CFC0[] = +{ + ANIMCMD_FRAME(8, 1), + ANIMCMD_END, +}; + +static const union AnimCmd gUnknown_0860CFC8[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +static const union AnimCmd * const gUnknown_0860CFD0[] = +{ + gUnknown_0860CFC0, + gUnknown_0860CFC8, +}; + +static const struct SpriteTemplate gUnknown_0860CFD8 = +{ + .tileTag = 0x0000, + .paletteTag = 0xffff, + .oam = &gUnknown_0860CF78, + .anims = gUnknown_0860CFD0, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +static const union AnimCmd gUnknown_0860CFF0[] = +{ + ANIMCMD_FRAME(40, 1), + ANIMCMD_END, +}; + +static const union AnimCmd gUnknown_0860CFF8[] = +{ + ANIMCMD_FRAME(32, 1), + ANIMCMD_END, + }; + +static const union AnimCmd * const gUnknown_0860D000[] = +{ + gUnknown_0860CFF0, + gUnknown_0860CFF8, +}; + +static const struct SpriteTemplate gUnknown_0860D008 = +{ + .tileTag = 0x0000, + .paletteTag = 0xffff, + .oam = &gUnknown_0860CF78, + .anims = gUnknown_0860D000, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +static const union AnimCmd gUnknown_0860D020[] = +{ + ANIMCMD_FRAME(18, 1), + ANIMCMD_END, +}; + +static const union AnimCmd gUnknown_0860D028[] = +{ + ANIMCMD_FRAME(18, 129, .vFlip = TRUE), + ANIMCMD_END, + }; + +static const union AnimCmd gUnknown_0860D030[] = +{ + ANIMCMD_FRAME(16, 65, .hFlip = TRUE), + ANIMCMD_END, +}; + +static const union AnimCmd gUnknown_0860D038[] = +{ + ANIMCMD_FRAME(16, 1), + ANIMCMD_END, +}; + +static const union AnimCmd * const gUnknown_0860D040[] = +{ + gUnknown_0860D020, + gUnknown_0860D028, +}; + +static const union AnimCmd * const gUnknown_0860D048[] = +{ + gUnknown_0860D030, + gUnknown_0860D038, +}; + +static const struct SpriteTemplate gUnknown_0860D050 = +{ + .tileTag = 0x0000, + .paletteTag = 0xffff, + .oam = &gUnknown_0860CF88, + .anims = gUnknown_0860D048, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8190B40 +}; + +static const struct SpriteTemplate gUnknown_0860D068 = +{ + .tileTag = 0x0000, + .paletteTag = 0xffff, + .oam = &gUnknown_0860CF80, + .anims = gUnknown_0860D040, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8190C6C +}; + +static const u8 gUnknown_0860D080[DOME_TOURNAMENT_TRAINERS_COUNT] = +{ + 0x00, 0x08, 0x0c, 0x04, 0x07, 0x0f, 0x0b, 0x03, 0x02, 0x0a, 0x0e, 0x06, 0x05, 0x0d, 0x09, 0x01 +}; + +static void (* const gUnknown_0860D090[])(void) = +{ + sub_818E9CC, + sub_818EA84, + sub_818ED28, + sub_818F9B0, + sub_818F9E0, + sub_818FA20, + ShowDomeOpponentInfo, + sub_81938A4, + sub_81938E0, + sub_8190298, + sub_81902E4, + sub_8193D40, + sub_8193D7C, + sub_81902F8, + sub_819033C, + sub_8194D48, + sub_8194D68, + sub_8194E44, + sub_8194EB4, + sub_8194EC0, + sub_8194EF8, + sub_8194F58, + InitDomeTrainers, +}; + +static const u32 gUnknown_0860D0EC[][2] = +{ + {0x00000004, 0x00000008}, + {0x00100000, 0x00200000}, +}; + +static const u32 gUnknown_0860D0FC[][2] = +{ + {0xfffffffb, 0xfffffff7}, + {0xffefffff, 0xffdfffff}, +}; + +static const u8 sIdToOpponentId[DOME_TOURNAMENT_TRAINERS_COUNT][DOME_ROUNDS_COUNT] = +{ + [0] = {8, 0, 4, 8}, + [1] = {9, 12, 8, 0}, + [2] = {10, 8, 12, 0}, + [3] = {11, 4, 0, 8}, + [4] = {12, 0, 4, 8}, + [5] = {13, 12, 8, 0}, + [6] = {14, 8, 12, 0}, + [7] = {15, 4, 0, 8}, + [8] = {0, 0, 4, 8}, + [9] = {1, 12, 8, 0}, + [10] = {2, 8, 12, 0}, + [11] = {3, 4, 0, 8}, + [12] = {4, 0, 4, 8}, + [13] = {5, 12, 8, 0}, + [14] = {6, 8, 12, 0}, + [15] = {7, 4, 0, 8}, +}; + +static const u8 gUnknown_0860D14C[] = {0x00, 0x08, 0x04, 0x0c, 0x07, 0x0f, 0x03, 0x0b, 0x02, 0x0a, 0x06, 0x0e, 0x05, 0x0d, 0x01, 0x09}; + +static const u8 gUnknown_0860D15C[][4] = +{ + {0x00, 0x08, 0x0c, 0x0e}, + {0x00, 0x08, 0x0c, 0x0e}, + {0x01, 0x08, 0x0c, 0x0e}, + {0x01, 0x08, 0x0c, 0x0e}, + {0x02, 0x09, 0x0c, 0x0e}, + {0x02, 0x09, 0x0c, 0x0e}, + {0x03, 0x09, 0x0c, 0x0e}, + {0x03, 0x09, 0x0c, 0x0e}, + {0x04, 0x0a, 0x0d, 0x0e}, + {0x04, 0x0a, 0x0d, 0x0e}, + {0x05, 0x0a, 0x0d, 0x0e}, + {0x05, 0x0a, 0x0d, 0x0e}, + {0x06, 0x0b, 0x0d, 0x0e}, + {0x06, 0x0b, 0x0d, 0x0e}, + {0x07, 0x0b, 0x0d, 0x0e}, + {0x07, 0x0b, 0x0d, 0x0e}, +}; + +static const u8 gUnknown_0860D19C[] = {0x17, 0x1b, 0x1d, 0x1e}; + +static const u8 gUnknown_0860D1A0[][4] = +{ + {0x10, 0x18, 0x1c, 0x1e}, + {0x11, 0x18, 0x1c, 0x1e}, + {0x12, 0x19, 0x1c, 0x1e}, + {0x13, 0x19, 0x1c, 0x1e}, + {0x14, 0x1a, 0x1d, 0x1e}, + {0x15, 0x1a, 0x1d, 0x1e}, + {0x16, 0x1b, 0x1d, 0x1e}, + {0x17, 0x1b, 0x1d, 0x1e}, +}; + +static const u8 gUnknown_0860D1C0[] = {0x00, 0x0f, 0x08, 0x07, 0x03, 0x0c, 0x0b, 0x04, 0x01, 0x0e, 0x09, 0x06, 0x02, 0x0d, 0x0a, 0x05}; + +static const u8 *const gBattleDomePotentialPointers[] = +{ + gBattleDomeOpponentPotential1, + gBattleDomeOpponentPotential2, + gBattleDomeOpponentPotential3, + gBattleDomeOpponentPotential4, + gBattleDomeOpponentPotential5, + gBattleDomeOpponentPotential6, + gBattleDomeOpponentPotential7, + gBattleDomeOpponentPotential8, + gBattleDomeOpponentPotential9, + gBattleDomeOpponentPotential10, + gBattleDomeOpponentPotential11, + gBattleDomeOpponentPotential12, + gBattleDomeOpponentPotential13, + gBattleDomeOpponentPotential14, + gBattleDomeOpponentPotential15, + gBattleDomeOpponentPotential16, + gBattleDomeOpponentPotential17, +}; + +static const u8 *const gBattleDomeOpponentStylePointers[] = +{ + gBattleDomeOpponentStyle1, + gBattleDomeOpponentStyle2, + gBattleDomeOpponentStyle3, + gBattleDomeOpponentStyle4, + gBattleDomeOpponentStyle5, + gBattleDomeOpponentStyle6, + gBattleDomeOpponentStyle7, + gBattleDomeOpponentStyle8, + gBattleDomeOpponentStyle9, + gBattleDomeOpponentStyle10, + gBattleDomeOpponentStyle11, + gBattleDomeOpponentStyle12, + gBattleDomeOpponentStyle13, + gBattleDomeOpponentStyle14, + gBattleDomeOpponentStyle15, + gBattleDomeOpponentStyle16, + gBattleDomeOpponentStyle17, + gBattleDomeOpponentStyle18, + gBattleDomeOpponentStyle19, + gBattleDomeOpponentStyle20, + gBattleDomeOpponentStyle21, + gBattleDomeOpponentStyle22, + gBattleDomeOpponentStyle23, + gBattleDomeOpponentStyle24, + gBattleDomeOpponentStyle25, + gBattleDomeOpponentStyle26, + gBattleDomeOpponentStyle27, + gBattleDomeOpponentStyle28, + gBattleDomeOpponentStyleUnused1, + gBattleDomeOpponentStyleUnused2, + gBattleDomeOpponentStyleUnused3, + gBattleDomeOpponentStyleUnused4, +}; + +static const u8 *const gBattleDomeOpponentStatsPointers[] = +{ + gBattleDomeOpponentStats1, + gBattleDomeOpponentStats2, + gBattleDomeOpponentStats3, + gBattleDomeOpponentStats4, + gBattleDomeOpponentStats5, + gBattleDomeOpponentStats6, + gBattleDomeOpponentStats7, + gBattleDomeOpponentStats8, + gBattleDomeOpponentStats9, + gBattleDomeOpponentStats10, + gBattleDomeOpponentStats11, + gBattleDomeOpponentStats12, + gBattleDomeOpponentStats13, + gBattleDomeOpponentStats14, + gBattleDomeOpponentStats15, + gBattleDomeOpponentStats16, + gBattleDomeOpponentStats17, + gBattleDomeOpponentStats18, + gBattleDomeOpponentStats19, + gBattleDomeOpponentStats20, + gBattleDomeOpponentStats21, + gBattleDomeOpponentStats22, + gBattleDomeOpponentStats23, + gBattleDomeOpponentStats24, + gBattleDomeOpponentStats25, + gBattleDomeOpponentStats26, + gBattleDomeOpponentStats27, + gBattleDomeOpponentStats28, + gBattleDomeOpponentStats29, + gBattleDomeOpponentStats30, + gBattleDomeOpponentStats31, + gBattleDomeOpponentStats32, + gBattleDomeOpponentStats33, + gBattleDomeOpponentStats34, + gBattleDomeOpponentStats35, + gBattleDomeOpponentStats36, + gBattleDomeOpponentStats37, + gBattleDomeOpponentStats38, + gBattleDomeOpponentStats39, + gBattleDomeOpponentStats40, + gBattleDomeOpponentStats41, + gBattleDomeOpponentStats42, + gBattleDomeOpponentStats43, +}; + +static const u8 sInfoTrainerMonX[] = {0x68, 0x88, 0x68}; +static const u8 sInfoTrainerMonY[] = {0x26, 0x3e, 0x4e}; +static const u8 gUnknown_0860D346[] = {0x00, 0x04, 0x00}; + +static const u8 gUnknown_0860D349[] = {0x00, 0x05, 0x09, 0x0c, 0x0e, 0x00, 0x00}; + +static const u8 *const gBattleDomeMatchNumberPointers[] = +{ + gBattleDomeMatchNumber1, + gBattleDomeMatchNumber2, + gBattleDomeMatchNumber3, + gBattleDomeMatchNumber4, + gBattleDomeMatchNumber5, + gBattleDomeMatchNumber6, + gBattleDomeMatchNumber7, + gBattleDomeMatchNumber8, + gBattleDomeMatchNumber9, + gBattleDomeMatchNumber10, + gBattleDomeMatchNumber11, + gBattleDomeMatchNumber12, + gBattleDomeMatchNumber13, + gBattleDomeMatchNumber14, + gBattleDomeMatchNumber15, +}; + +static const u8 *const gBattleDomeWinStringsPointers[] = +{ + gBattleDomeWinStrings1, + gBattleDomeWinStrings2, + gBattleDomeWinStrings3, + gBattleDomeWinStrings4, + gBattleDomeWinStrings5, + gBattleDomeWinStrings6, + gBattleDomeWinStrings7, +}; + +static const u8 sFirstTrainerMonX[] = {0x60, 0x60, 0x60}; +static const u8 sFirstTrainerMonY[] = {0x38, 0x50, 0x68}; +static const u8 sSecondTrainerMonX[] = {0x90, 0x90, 0x90}; +static const u8 sSecondTrainerMonY[] = {0x38, 0x50, 0x68}; + +static const u8 gUnknown_0860D3B4[] = {0x00, 0x08, 0x0c, 0x04, 0x07, 0x0f, 0x0b, 0x03, 0x02, 0x0a, 0x0e, 0x06, 0x05, 0x0d, 0x09, 0x01}; + +static const u8 gUnknown_0860D3C4[][3] = +{ + {0x00, 0x02, 0x00}, + {0x02, 0x02, 0x00}, + {0x04, 0x02, 0x00}, + {0x06, 0x02, 0x00}, + {0x08, 0x02, 0x00}, + {0x0a, 0x02, 0x00}, + {0x0c, 0x02, 0x00}, + {0x0e, 0x02, 0x00}, + {0x00, 0x04, 0x01}, + {0x04, 0x04, 0x01}, + {0x08, 0x04, 0x01}, + {0x0c, 0x04, 0x01}, + {0x00, 0x08, 0x02}, + {0x08, 0x08, 0x02}, + {0x00, 0x10, 0x03}, +}; + +static const u8 gUnknown_0860D3F1[][2] = +{ + {0x00, 0x00}, + {0x01, 0x70}, + {0x01, 0x00}, + {0x00, 0x70}, + {0x00, 0x30}, + {0x01, 0x40}, + {0x01, 0x30}, + {0x00, 0x40}, + {0x00, 0x10}, + {0x01, 0x60}, + {0x01, 0x10}, + {0x00, 0x60}, + {0x00, 0x20}, + {0x01, 0x50}, + {0x01, 0x20}, + {0x00, 0x50}, +}; + +static const u8 gUnknown_0860D411[][2] = +{ + {0x44, 0x21}, + {0x44, 0x31}, + {0x44, 0x41}, + {0x44, 0x51}, + {0x44, 0x61}, + {0x44, 0x71}, + {0x44, 0x81}, + {0x44, 0x91}, + {0xac, 0x21}, + {0xac, 0x31}, + {0xac, 0x41}, + {0xac, 0x51}, + {0xac, 0x61}, + {0xac, 0x71}, + {0xac, 0x81}, + {0xac, 0x91}, + {0x57, 0x29}, + {0x57, 0x49}, + {0x57, 0x69}, + {0x57, 0x89}, + {0x99, 0x29}, + {0x99, 0x49}, + {0x99, 0x69}, + {0x99, 0x89}, + {0x5f, 0x39}, + {0x5f, 0x79}, + {0x91, 0x39}, + {0x91, 0x79}, + {0x67, 0x59}, + {0x89, 0x59}, + {0x78, 0x59}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d450[] = +{ + {.src = 0x6021, .y = 0x04, .x = 0x09}, + {.src = 0x6023, .y = 0x04, .x = 0x0a}, + {.src = 0x6047, .y = 0x05, .x = 0x0a}, + {.src = 0x6043, .y = 0x05, .x = 0x0b}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d460[] = +{ + {.src = 0x6021, .y = 0x04, .x = 0x09}, + {.src = 0x6023, .y = 0x04, .x = 0x0a}, + {.src = 0x6047, .y = 0x05, .x = 0x0a}, + {.src = 0x6023, .y = 0x05, .x = 0x0b}, + {.src = 0x6027, .y = 0x06, .x = 0x0b}, + {.src = 0x6047, .y = 0x07, .x = 0x0b}, + {.src = 0x6043, .y = 0x07, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d47c[] = +{ + {.src = 0x6021, .y = 0x04, .x = 0x09}, + {.src = 0x6023, .y = 0x04, .x = 0x0a}, + {.src = 0x6047, .y = 0x05, .x = 0x0a}, + {.src = 0x6023, .y = 0x05, .x = 0x0b}, + {.src = 0x6027, .y = 0x06, .x = 0x0b}, + {.src = 0x6047, .y = 0x07, .x = 0x0b}, + {.src = 0x6023, .y = 0x07, .x = 0x0c}, + {.src = 0x6027, .y = 0x08, .x = 0x0c}, + {.src = 0x6027, .y = 0x09, .x = 0x0c}, + {.src = 0x6027, .y = 0x0a, .x = 0x0c}, + {.src = 0x603b, .y = 0x0b, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d4a8[] = +{ + {.src = 0x6021, .y = 0x04, .x = 0x09}, + {.src = 0x6023, .y = 0x04, .x = 0x0a}, + {.src = 0x6047, .y = 0x05, .x = 0x0a}, + {.src = 0x6023, .y = 0x05, .x = 0x0b}, + {.src = 0x6027, .y = 0x06, .x = 0x0b}, + {.src = 0x6047, .y = 0x07, .x = 0x0b}, + {.src = 0x6023, .y = 0x07, .x = 0x0c}, + {.src = 0x6027, .y = 0x08, .x = 0x0c}, + {.src = 0x6027, .y = 0x09, .x = 0x0c}, + {.src = 0x6027, .y = 0x0a, .x = 0x0c}, + {.src = 0x603b, .y = 0x0b, .x = 0x0c}, + {.src = 0x602c, .y = 0x0b, .x = 0x0d}, + {.src = 0x602d, .y = 0x0b, .x = 0x0e}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d4dc[] = +{ + {.src = 0x6021, .y = 0x06, .x = 0x09}, + {.src = 0x6021, .y = 0x06, .x = 0x0a}, + {.src = 0x6027, .y = 0x05, .x = 0x0a}, + {.src = 0x6043, .y = 0x05, .x = 0x0b}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d4ec[] = +{ + {.src = 0x6021, .y = 0x06, .x = 0x09}, + {.src = 0x6021, .y = 0x06, .x = 0x0a}, + {.src = 0x6027, .y = 0x05, .x = 0x0a}, + {.src = 0x6023, .y = 0x05, .x = 0x0b}, + {.src = 0x6027, .y = 0x06, .x = 0x0b}, + {.src = 0x6047, .y = 0x07, .x = 0x0b}, + {.src = 0x6043, .y = 0x07, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d508[] = +{ + {.src = 0x6021, .y = 0x06, .x = 0x09}, + {.src = 0x6021, .y = 0x06, .x = 0x0a}, + {.src = 0x6027, .y = 0x05, .x = 0x0a}, + {.src = 0x6023, .y = 0x05, .x = 0x0b}, + {.src = 0x6027, .y = 0x06, .x = 0x0b}, + {.src = 0x6047, .y = 0x07, .x = 0x0b}, + {.src = 0x6023, .y = 0x07, .x = 0x0c}, + {.src = 0x6027, .y = 0x08, .x = 0x0c}, + {.src = 0x6027, .y = 0x09, .x = 0x0c}, + {.src = 0x6027, .y = 0x0a, .x = 0x0c}, + {.src = 0x603b, .y = 0x0b, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d534[] = +{ + {.src = 0x6021, .y = 0x06, .x = 0x09}, + {.src = 0x6021, .y = 0x06, .x = 0x0a}, + {.src = 0x6027, .y = 0x05, .x = 0x0a}, + {.src = 0x6023, .y = 0x05, .x = 0x0b}, + {.src = 0x6027, .y = 0x06, .x = 0x0b}, + {.src = 0x6047, .y = 0x07, .x = 0x0b}, + {.src = 0x6023, .y = 0x07, .x = 0x0c}, + {.src = 0x6027, .y = 0x08, .x = 0x0c}, + {.src = 0x6027, .y = 0x09, .x = 0x0c}, + {.src = 0x6027, .y = 0x0a, .x = 0x0c}, + {.src = 0x603b, .y = 0x0b, .x = 0x0c}, + {.src = 0x602c, .y = 0x0b, .x = 0x0d}, + {.src = 0x602d, .y = 0x0b, .x = 0x0e}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d568[] = +{ + {.src = 0x6021, .y = 0x08, .x = 0x09}, + {.src = 0x6023, .y = 0x08, .x = 0x0a}, + {.src = 0x6047, .y = 0x09, .x = 0x0a}, + {.src = 0x6021, .y = 0x09, .x = 0x0b}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d578[] = +{ + {.src = 0x6021, .y = 0x08, .x = 0x09}, + {.src = 0x6023, .y = 0x08, .x = 0x0a}, + {.src = 0x6047, .y = 0x09, .x = 0x0a}, + {.src = 0x6021, .y = 0x09, .x = 0x0b}, + {.src = 0x6027, .y = 0x08, .x = 0x0b}, + {.src = 0x6027, .y = 0x07, .x = 0x0b}, + {.src = 0x6043, .y = 0x07, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d594[] = +{ + {.src = 0x6021, .y = 0x08, .x = 0x09}, + {.src = 0x6023, .y = 0x08, .x = 0x0a}, + {.src = 0x6047, .y = 0x09, .x = 0x0a}, + {.src = 0x6021, .y = 0x09, .x = 0x0b}, + {.src = 0x6027, .y = 0x08, .x = 0x0b}, + {.src = 0x6027, .y = 0x07, .x = 0x0b}, + {.src = 0x6023, .y = 0x07, .x = 0x0c}, + {.src = 0x6027, .y = 0x08, .x = 0x0c}, + {.src = 0x6027, .y = 0x09, .x = 0x0c}, + {.src = 0x6027, .y = 0x0a, .x = 0x0c}, + {.src = 0x603b, .y = 0x0b, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d5c0[] = +{ + {.src = 0x6021, .y = 0x08, .x = 0x09}, + {.src = 0x6023, .y = 0x08, .x = 0x0a}, + {.src = 0x6047, .y = 0x09, .x = 0x0a}, + {.src = 0x6021, .y = 0x09, .x = 0x0b}, + {.src = 0x6027, .y = 0x08, .x = 0x0b}, + {.src = 0x6027, .y = 0x07, .x = 0x0b}, + {.src = 0x6023, .y = 0x07, .x = 0x0c}, + {.src = 0x6027, .y = 0x08, .x = 0x0c}, + {.src = 0x6027, .y = 0x09, .x = 0x0c}, + {.src = 0x6027, .y = 0x0a, .x = 0x0c}, + {.src = 0x603b, .y = 0x0b, .x = 0x0c}, + {.src = 0x602c, .y = 0x0b, .x = 0x0d}, + {.src = 0x602d, .y = 0x0b, .x = 0x0e}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d5f4[] = +{ + {.src = 0x6021, .y = 0x0a, .x = 0x09}, + {.src = 0x6021, .y = 0x0a, .x = 0x0a}, + {.src = 0x6027, .y = 0x09, .x = 0x0a}, + {.src = 0x6021, .y = 0x09, .x = 0x0b}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d604[] = +{ + {.src = 0x6021, .y = 0x0a, .x = 0x09}, + {.src = 0x6021, .y = 0x0a, .x = 0x0a}, + {.src = 0x6027, .y = 0x09, .x = 0x0a}, + {.src = 0x6021, .y = 0x09, .x = 0x0b}, + {.src = 0x6027, .y = 0x08, .x = 0x0b}, + {.src = 0x6027, .y = 0x07, .x = 0x0b}, + {.src = 0x6043, .y = 0x07, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d620[] = +{ + {.src = 0x6021, .y = 0x0a, .x = 0x09}, + {.src = 0x6021, .y = 0x0a, .x = 0x0a}, + {.src = 0x6027, .y = 0x09, .x = 0x0a}, + {.src = 0x6021, .y = 0x09, .x = 0x0b}, + {.src = 0x6027, .y = 0x08, .x = 0x0b}, + {.src = 0x6027, .y = 0x07, .x = 0x0b}, + {.src = 0x6023, .y = 0x07, .x = 0x0c}, + {.src = 0x6027, .y = 0x08, .x = 0x0c}, + {.src = 0x6027, .y = 0x09, .x = 0x0c}, + {.src = 0x6027, .y = 0x0a, .x = 0x0c}, + {.src = 0x603b, .y = 0x0b, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d64c[] = +{ + {.src = 0x6021, .y = 0x0a, .x = 0x09}, + {.src = 0x6021, .y = 0x0a, .x = 0x0a}, + {.src = 0x6027, .y = 0x09, .x = 0x0a}, + {.src = 0x6021, .y = 0x09, .x = 0x0b}, + {.src = 0x6027, .y = 0x08, .x = 0x0b}, + {.src = 0x6027, .y = 0x07, .x = 0x0b}, + {.src = 0x6023, .y = 0x07, .x = 0x0c}, + {.src = 0x6027, .y = 0x08, .x = 0x0c}, + {.src = 0x6027, .y = 0x09, .x = 0x0c}, + {.src = 0x6027, .y = 0x0a, .x = 0x0c}, + {.src = 0x603b, .y = 0x0b, .x = 0x0c}, + {.src = 0x602c, .y = 0x0b, .x = 0x0d}, + {.src = 0x602d, .y = 0x0b, .x = 0x0e}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d680[] = +{ + {.src = 0x6021, .y = 0x0c, .x = 0x09}, + {.src = 0x6023, .y = 0x0c, .x = 0x0a}, + {.src = 0x6047, .y = 0x0d, .x = 0x0a}, + {.src = 0x6043, .y = 0x0d, .x = 0x0b}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d690[] = +{ + {.src = 0x6021, .y = 0x0c, .x = 0x09}, + {.src = 0x6023, .y = 0x0c, .x = 0x0a}, + {.src = 0x6047, .y = 0x0d, .x = 0x0a}, + {.src = 0x6023, .y = 0x0d, .x = 0x0b}, + {.src = 0x6027, .y = 0x0e, .x = 0x0b}, + {.src = 0x6047, .y = 0x0f, .x = 0x0b}, + {.src = 0x6021, .y = 0x0f, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d6ac[] = +{ + {.src = 0x6021, .y = 0x0c, .x = 0x09}, + {.src = 0x6023, .y = 0x0c, .x = 0x0a}, + {.src = 0x6047, .y = 0x0d, .x = 0x0a}, + {.src = 0x6023, .y = 0x0d, .x = 0x0b}, + {.src = 0x6027, .y = 0x0e, .x = 0x0b}, + {.src = 0x6047, .y = 0x0f, .x = 0x0b}, + {.src = 0x6021, .y = 0x0f, .x = 0x0c}, + {.src = 0x6033, .y = 0x0e, .x = 0x0c}, + {.src = 0x6032, .y = 0x0d, .x = 0x0c}, + {.src = 0x6031, .y = 0x0c, .x = 0x0c}, + {.src = 0x6030, .y = 0x0b, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d6d8[] = +{ + {.src = 0x6021, .y = 0x0c, .x = 0x09}, + {.src = 0x6023, .y = 0x0c, .x = 0x0a}, + {.src = 0x6047, .y = 0x0d, .x = 0x0a}, + {.src = 0x6023, .y = 0x0d, .x = 0x0b}, + {.src = 0x6027, .y = 0x0e, .x = 0x0b}, + {.src = 0x6047, .y = 0x0f, .x = 0x0b}, + {.src = 0x6021, .y = 0x0f, .x = 0x0c}, + {.src = 0x6033, .y = 0x0e, .x = 0x0c}, + {.src = 0x6032, .y = 0x0d, .x = 0x0c}, + {.src = 0x6031, .y = 0x0c, .x = 0x0c}, + {.src = 0x6030, .y = 0x0b, .x = 0x0c}, + {.src = 0x602c, .y = 0x0b, .x = 0x0d}, + {.src = 0x602d, .y = 0x0b, .x = 0x0e}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d70c[] = +{ + {.src = 0x6021, .y = 0x0e, .x = 0x09}, + {.src = 0x6021, .y = 0x0e, .x = 0x0a}, + {.src = 0x6027, .y = 0x0d, .x = 0x0a}, + {.src = 0x6043, .y = 0x0d, .x = 0x0b}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d71c[] = +{ + {.src = 0x6021, .y = 0x0e, .x = 0x09}, + {.src = 0x6021, .y = 0x0e, .x = 0x0a}, + {.src = 0x6027, .y = 0x0d, .x = 0x0a}, + {.src = 0x6023, .y = 0x0d, .x = 0x0b}, + {.src = 0x6027, .y = 0x0e, .x = 0x0b}, + {.src = 0x6047, .y = 0x0f, .x = 0x0b}, + {.src = 0x6021, .y = 0x0f, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d738[] = +{ + {.src = 0x6021, .y = 0x0e, .x = 0x09}, + {.src = 0x6021, .y = 0x0e, .x = 0x0a}, + {.src = 0x6027, .y = 0x0d, .x = 0x0a}, + {.src = 0x6023, .y = 0x0d, .x = 0x0b}, + {.src = 0x6027, .y = 0x0e, .x = 0x0b}, + {.src = 0x6047, .y = 0x0f, .x = 0x0b}, + {.src = 0x6021, .y = 0x0f, .x = 0x0c}, + {.src = 0x6033, .y = 0x0e, .x = 0x0c}, + {.src = 0x6032, .y = 0x0d, .x = 0x0c}, + {.src = 0x6031, .y = 0x0c, .x = 0x0c}, + {.src = 0x6030, .y = 0x0b, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d764[] = +{ + {.src = 0x6021, .y = 0x0e, .x = 0x09}, + {.src = 0x6021, .y = 0x0e, .x = 0x0a}, + {.src = 0x6027, .y = 0x0d, .x = 0x0a}, + {.src = 0x6023, .y = 0x0d, .x = 0x0b}, + {.src = 0x6027, .y = 0x0e, .x = 0x0b}, + {.src = 0x6047, .y = 0x0f, .x = 0x0b}, + {.src = 0x6021, .y = 0x0f, .x = 0x0c}, + {.src = 0x6033, .y = 0x0e, .x = 0x0c}, + {.src = 0x6032, .y = 0x0d, .x = 0x0c}, + {.src = 0x6031, .y = 0x0c, .x = 0x0c}, + {.src = 0x6030, .y = 0x0b, .x = 0x0c}, + {.src = 0x602c, .y = 0x0b, .x = 0x0d}, + {.src = 0x602d, .y = 0x0b, .x = 0x0e}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d798[] = +{ + {.src = 0x6021, .y = 0x10, .x = 0x09}, + {.src = 0x6023, .y = 0x10, .x = 0x0a}, + {.src = 0x6047, .y = 0x11, .x = 0x0a}, + {.src = 0x6021, .y = 0x11, .x = 0x0b}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d7a8[] = +{ + {.src = 0x6021, .y = 0x10, .x = 0x09}, + {.src = 0x6023, .y = 0x10, .x = 0x0a}, + {.src = 0x6047, .y = 0x11, .x = 0x0a}, + {.src = 0x6021, .y = 0x11, .x = 0x0b}, + {.src = 0x6027, .y = 0x10, .x = 0x0b}, + {.src = 0x6027, .y = 0x0f, .x = 0x0b}, + {.src = 0x6021, .y = 0x0f, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d7c4[] = +{ + {.src = 0x6021, .y = 0x10, .x = 0x09}, + {.src = 0x6023, .y = 0x10, .x = 0x0a}, + {.src = 0x6047, .y = 0x11, .x = 0x0a}, + {.src = 0x6021, .y = 0x11, .x = 0x0b}, + {.src = 0x6027, .y = 0x10, .x = 0x0b}, + {.src = 0x6027, .y = 0x0f, .x = 0x0b}, + {.src = 0x6021, .y = 0x0f, .x = 0x0c}, + {.src = 0x6033, .y = 0x0e, .x = 0x0c}, + {.src = 0x6032, .y = 0x0d, .x = 0x0c}, + {.src = 0x6031, .y = 0x0c, .x = 0x0c}, + {.src = 0x6030, .y = 0x0b, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d7f0[] = +{ + {.src = 0x6021, .y = 0x10, .x = 0x09}, + {.src = 0x6023, .y = 0x10, .x = 0x0a}, + {.src = 0x6047, .y = 0x11, .x = 0x0a}, + {.src = 0x6021, .y = 0x11, .x = 0x0b}, + {.src = 0x6027, .y = 0x10, .x = 0x0b}, + {.src = 0x6027, .y = 0x0f, .x = 0x0b}, + {.src = 0x6021, .y = 0x0f, .x = 0x0c}, + {.src = 0x6033, .y = 0x0e, .x = 0x0c}, + {.src = 0x6032, .y = 0x0d, .x = 0x0c}, + {.src = 0x6031, .y = 0x0c, .x = 0x0c}, + {.src = 0x6030, .y = 0x0b, .x = 0x0c}, + {.src = 0x602c, .y = 0x0b, .x = 0x0d}, + {.src = 0x602d, .y = 0x0b, .x = 0x0e}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d824[] = +{ + {.src = 0x602b, .y = 0x12, .x = 0x09}, + {.src = 0x602b, .y = 0x12, .x = 0x0a}, + {.src = 0x6027, .y = 0x11, .x = 0x0a}, + {.src = 0x6021, .y = 0x11, .x = 0x0b}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d834[] = +{ + {.src = 0x602b, .y = 0x12, .x = 0x09}, + {.src = 0x602b, .y = 0x12, .x = 0x0a}, + {.src = 0x6027, .y = 0x11, .x = 0x0a}, + {.src = 0x6021, .y = 0x11, .x = 0x0b}, + {.src = 0x6027, .y = 0x10, .x = 0x0b}, + {.src = 0x6027, .y = 0x0f, .x = 0x0b}, + {.src = 0x6021, .y = 0x0f, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d850[] = +{ + {.src = 0x602b, .y = 0x12, .x = 0x09}, + {.src = 0x602b, .y = 0x12, .x = 0x0a}, + {.src = 0x6027, .y = 0x11, .x = 0x0a}, + {.src = 0x6021, .y = 0x11, .x = 0x0b}, + {.src = 0x6027, .y = 0x10, .x = 0x0b}, + {.src = 0x6027, .y = 0x0f, .x = 0x0b}, + {.src = 0x6021, .y = 0x0f, .x = 0x0c}, + {.src = 0x6033, .y = 0x0e, .x = 0x0c}, + {.src = 0x6032, .y = 0x0d, .x = 0x0c}, + {.src = 0x6031, .y = 0x0c, .x = 0x0c}, + {.src = 0x6030, .y = 0x0b, .x = 0x0c}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d87c[] = +{ + {.src = 0x602b, .y = 0x12, .x = 0x09}, + {.src = 0x602b, .y = 0x12, .x = 0x0a}, + {.src = 0x6027, .y = 0x11, .x = 0x0a}, + {.src = 0x6021, .y = 0x11, .x = 0x0b}, + {.src = 0x6027, .y = 0x10, .x = 0x0b}, + {.src = 0x6027, .y = 0x0f, .x = 0x0b}, + {.src = 0x6021, .y = 0x0f, .x = 0x0c}, + {.src = 0x6033, .y = 0x0e, .x = 0x0c}, + {.src = 0x6032, .y = 0x0d, .x = 0x0c}, + {.src = 0x6031, .y = 0x0c, .x = 0x0c}, + {.src = 0x6030, .y = 0x0b, .x = 0x0c}, + {.src = 0x602c, .y = 0x0b, .x = 0x0d}, + {.src = 0x602d, .y = 0x0b, .x = 0x0e}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d8b0[] = +{ + {.src = 0x6021, .y = 0x04, .x = 0x14}, + {.src = 0x6025, .y = 0x04, .x = 0x13}, + {.src = 0x6049, .y = 0x05, .x = 0x13}, + {.src = 0x6045, .y = 0x05, .x = 0x12}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d8c0[] = +{ + {.src = 0x6021, .y = 0x04, .x = 0x14}, + {.src = 0x6025, .y = 0x04, .x = 0x13}, + {.src = 0x6049, .y = 0x05, .x = 0x13}, + {.src = 0x6025, .y = 0x05, .x = 0x12}, + {.src = 0x6029, .y = 0x06, .x = 0x12}, + {.src = 0x6049, .y = 0x07, .x = 0x12}, + {.src = 0x6045, .y = 0x07, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d8dc[] = +{ + {.src = 0x6021, .y = 0x04, .x = 0x14}, + {.src = 0x6025, .y = 0x04, .x = 0x13}, + {.src = 0x6049, .y = 0x05, .x = 0x13}, + {.src = 0x6025, .y = 0x05, .x = 0x12}, + {.src = 0x6029, .y = 0x06, .x = 0x12}, + {.src = 0x6049, .y = 0x07, .x = 0x12}, + {.src = 0x6025, .y = 0x07, .x = 0x11}, + {.src = 0x6029, .y = 0x08, .x = 0x11}, + {.src = 0x6029, .y = 0x09, .x = 0x11}, + {.src = 0x6029, .y = 0x0a, .x = 0x11}, + {.src = 0x603c, .y = 0x0b, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d908[] = +{ + {.src = 0x6021, .y = 0x04, .x = 0x14}, + {.src = 0x6025, .y = 0x04, .x = 0x13}, + {.src = 0x6049, .y = 0x05, .x = 0x13}, + {.src = 0x6025, .y = 0x05, .x = 0x12}, + {.src = 0x6029, .y = 0x06, .x = 0x12}, + {.src = 0x6049, .y = 0x07, .x = 0x12}, + {.src = 0x6025, .y = 0x07, .x = 0x11}, + {.src = 0x6029, .y = 0x08, .x = 0x11}, + {.src = 0x6029, .y = 0x09, .x = 0x11}, + {.src = 0x6029, .y = 0x0a, .x = 0x11}, + {.src = 0x603c, .y = 0x0b, .x = 0x11}, + {.src = 0x602f, .y = 0x0b, .x = 0x10}, + {.src = 0x602e, .y = 0x0b, .x = 0x0f}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d93c[] = +{ + {.src = 0x6021, .y = 0x06, .x = 0x14}, + {.src = 0x6021, .y = 0x06, .x = 0x13}, + {.src = 0x6029, .y = 0x05, .x = 0x13}, + {.src = 0x6045, .y = 0x05, .x = 0x12}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d94c[] = +{ + {.src = 0x6021, .y = 0x06, .x = 0x14}, + {.src = 0x6021, .y = 0x06, .x = 0x13}, + {.src = 0x6029, .y = 0x05, .x = 0x13}, + {.src = 0x6025, .y = 0x05, .x = 0x12}, + {.src = 0x6029, .y = 0x06, .x = 0x12}, + {.src = 0x6049, .y = 0x07, .x = 0x12}, + {.src = 0x6045, .y = 0x07, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d968[] = +{ + {.src = 0x6021, .y = 0x06, .x = 0x14}, + {.src = 0x6021, .y = 0x06, .x = 0x13}, + {.src = 0x6029, .y = 0x05, .x = 0x13}, + {.src = 0x6025, .y = 0x05, .x = 0x12}, + {.src = 0x6029, .y = 0x06, .x = 0x12}, + {.src = 0x6049, .y = 0x07, .x = 0x12}, + {.src = 0x6025, .y = 0x07, .x = 0x11}, + {.src = 0x6029, .y = 0x08, .x = 0x11}, + {.src = 0x6029, .y = 0x09, .x = 0x11}, + {.src = 0x6029, .y = 0x0a, .x = 0x11}, + {.src = 0x603c, .y = 0x0b, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d994[] = +{ + {.src = 0x6021, .y = 0x06, .x = 0x14}, + {.src = 0x6021, .y = 0x06, .x = 0x13}, + {.src = 0x6029, .y = 0x05, .x = 0x13}, + {.src = 0x6025, .y = 0x05, .x = 0x12}, + {.src = 0x6029, .y = 0x06, .x = 0x12}, + {.src = 0x6049, .y = 0x07, .x = 0x12}, + {.src = 0x6025, .y = 0x07, .x = 0x11}, + {.src = 0x6029, .y = 0x08, .x = 0x11}, + {.src = 0x6029, .y = 0x09, .x = 0x11}, + {.src = 0x6029, .y = 0x0a, .x = 0x11}, + {.src = 0x603c, .y = 0x0b, .x = 0x11}, + {.src = 0x602f, .y = 0x0b, .x = 0x10}, + {.src = 0x602e, .y = 0x0b, .x = 0x0f}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d9c8[] = +{ + {.src = 0x6021, .y = 0x08, .x = 0x14}, + {.src = 0x6025, .y = 0x08, .x = 0x13}, + {.src = 0x6049, .y = 0x09, .x = 0x13}, + {.src = 0x6021, .y = 0x09, .x = 0x12}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d9d8[] = +{ + {.src = 0x6021, .y = 0x08, .x = 0x14}, + {.src = 0x6025, .y = 0x08, .x = 0x13}, + {.src = 0x6049, .y = 0x09, .x = 0x13}, + {.src = 0x6021, .y = 0x09, .x = 0x12}, + {.src = 0x6029, .y = 0x08, .x = 0x12}, + {.src = 0x6029, .y = 0x07, .x = 0x12}, + {.src = 0x6045, .y = 0x07, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860d9f4[] = +{ + {.src = 0x6021, .y = 0x08, .x = 0x14}, + {.src = 0x6025, .y = 0x08, .x = 0x13}, + {.src = 0x6049, .y = 0x09, .x = 0x13}, + {.src = 0x6021, .y = 0x09, .x = 0x12}, + {.src = 0x6029, .y = 0x08, .x = 0x12}, + {.src = 0x6029, .y = 0x07, .x = 0x12}, + {.src = 0x6025, .y = 0x07, .x = 0x11}, + {.src = 0x6029, .y = 0x08, .x = 0x11}, + {.src = 0x6029, .y = 0x09, .x = 0x11}, + {.src = 0x6029, .y = 0x0a, .x = 0x11}, + {.src = 0x603c, .y = 0x0b, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860da20[] = +{ + {.src = 0x6021, .y = 0x08, .x = 0x14}, + {.src = 0x6025, .y = 0x08, .x = 0x13}, + {.src = 0x6049, .y = 0x09, .x = 0x13}, + {.src = 0x6021, .y = 0x09, .x = 0x12}, + {.src = 0x6029, .y = 0x08, .x = 0x12}, + {.src = 0x6029, .y = 0x07, .x = 0x12}, + {.src = 0x6025, .y = 0x07, .x = 0x11}, + {.src = 0x6029, .y = 0x08, .x = 0x11}, + {.src = 0x6029, .y = 0x09, .x = 0x11}, + {.src = 0x6029, .y = 0x0a, .x = 0x11}, + {.src = 0x603c, .y = 0x0b, .x = 0x11}, + {.src = 0x602f, .y = 0x0b, .x = 0x10}, + {.src = 0x602e, .y = 0x0b, .x = 0x0f}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860da54[] = +{ + {.src = 0x6021, .y = 0x0a, .x = 0x14}, + {.src = 0x6021, .y = 0x0a, .x = 0x13}, + {.src = 0x6029, .y = 0x09, .x = 0x13}, + {.src = 0x6021, .y = 0x09, .x = 0x12}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860da64[] = +{ + {.src = 0x6021, .y = 0x0a, .x = 0x14}, + {.src = 0x6021, .y = 0x0a, .x = 0x13}, + {.src = 0x6029, .y = 0x09, .x = 0x13}, + {.src = 0x6021, .y = 0x09, .x = 0x12}, + {.src = 0x6029, .y = 0x08, .x = 0x12}, + {.src = 0x6029, .y = 0x07, .x = 0x12}, + {.src = 0x6045, .y = 0x07, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860da80[] = +{ + {.src = 0x6021, .y = 0x0a, .x = 0x14}, + {.src = 0x6021, .y = 0x0a, .x = 0x13}, + {.src = 0x6029, .y = 0x09, .x = 0x13}, + {.src = 0x6021, .y = 0x09, .x = 0x12}, + {.src = 0x6029, .y = 0x08, .x = 0x12}, + {.src = 0x6029, .y = 0x07, .x = 0x12}, + {.src = 0x6025, .y = 0x07, .x = 0x11}, + {.src = 0x6029, .y = 0x08, .x = 0x11}, + {.src = 0x6029, .y = 0x09, .x = 0x11}, + {.src = 0x6029, .y = 0x0a, .x = 0x11}, + {.src = 0x603c, .y = 0x0b, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860daac[] = +{ + {.src = 0x6021, .y = 0x0a, .x = 0x14}, + {.src = 0x6021, .y = 0x0a, .x = 0x13}, + {.src = 0x6029, .y = 0x09, .x = 0x13}, + {.src = 0x6021, .y = 0x09, .x = 0x12}, + {.src = 0x6029, .y = 0x08, .x = 0x12}, + {.src = 0x6029, .y = 0x07, .x = 0x12}, + {.src = 0x6025, .y = 0x07, .x = 0x11}, + {.src = 0x6029, .y = 0x08, .x = 0x11}, + {.src = 0x6029, .y = 0x09, .x = 0x11}, + {.src = 0x6029, .y = 0x0a, .x = 0x11}, + {.src = 0x603c, .y = 0x0b, .x = 0x11}, + {.src = 0x602f, .y = 0x0b, .x = 0x10}, + {.src = 0x602e, .y = 0x0b, .x = 0x0f}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860dae0[] = +{ + {.src = 0x6021, .y = 0x0c, .x = 0x14}, + {.src = 0x6025, .y = 0x0c, .x = 0x13}, + {.src = 0x6049, .y = 0x0d, .x = 0x13}, + {.src = 0x6045, .y = 0x0d, .x = 0x12}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860daf0[] = +{ + {.src = 0x6021, .y = 0x0c, .x = 0x14}, + {.src = 0x6025, .y = 0x0c, .x = 0x13}, + {.src = 0x6049, .y = 0x0d, .x = 0x13}, + {.src = 0x6025, .y = 0x0d, .x = 0x12}, + {.src = 0x6029, .y = 0x0e, .x = 0x12}, + {.src = 0x6049, .y = 0x0f, .x = 0x12}, + {.src = 0x6021, .y = 0x0f, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860db0c[] = +{ + {.src = 0x6021, .y = 0x0c, .x = 0x14}, + {.src = 0x6025, .y = 0x0c, .x = 0x13}, + {.src = 0x6049, .y = 0x0d, .x = 0x13}, + {.src = 0x6025, .y = 0x0d, .x = 0x12}, + {.src = 0x6029, .y = 0x0e, .x = 0x12}, + {.src = 0x6049, .y = 0x0f, .x = 0x12}, + {.src = 0x6021, .y = 0x0f, .x = 0x11}, + {.src = 0x6038, .y = 0x0e, .x = 0x11}, + {.src = 0x6037, .y = 0x0d, .x = 0x11}, + {.src = 0x6036, .y = 0x0c, .x = 0x11}, + {.src = 0x6035, .y = 0x0b, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860db38[] = +{ + {.src = 0x6021, .y = 0x0c, .x = 0x14}, + {.src = 0x6025, .y = 0x0c, .x = 0x13}, + {.src = 0x6049, .y = 0x0d, .x = 0x13}, + {.src = 0x6025, .y = 0x0d, .x = 0x12}, + {.src = 0x6029, .y = 0x0e, .x = 0x12}, + {.src = 0x6049, .y = 0x0f, .x = 0x12}, + {.src = 0x6021, .y = 0x0f, .x = 0x11}, + {.src = 0x6038, .y = 0x0e, .x = 0x11}, + {.src = 0x6037, .y = 0x0d, .x = 0x11}, + {.src = 0x6036, .y = 0x0c, .x = 0x11}, + {.src = 0x6035, .y = 0x0b, .x = 0x11}, + {.src = 0x602f, .y = 0x0b, .x = 0x10}, + {.src = 0x602e, .y = 0x0b, .x = 0x0f}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860db6c[] = +{ + {.src = 0x6021, .y = 0x0e, .x = 0x14}, + {.src = 0x6021, .y = 0x0e, .x = 0x13}, + {.src = 0x6029, .y = 0x0d, .x = 0x13}, + {.src = 0x6045, .y = 0x0d, .x = 0x12}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860db7c[] = +{ + {.src = 0x6021, .y = 0x0e, .x = 0x14}, + {.src = 0x6021, .y = 0x0e, .x = 0x13}, + {.src = 0x6029, .y = 0x0d, .x = 0x13}, + {.src = 0x6025, .y = 0x0d, .x = 0x12}, + {.src = 0x6029, .y = 0x0e, .x = 0x12}, + {.src = 0x6049, .y = 0x0f, .x = 0x12}, + {.src = 0x6021, .y = 0x0f, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860db98[] = +{ + {.src = 0x6021, .y = 0x0e, .x = 0x14}, + {.src = 0x6021, .y = 0x0e, .x = 0x13}, + {.src = 0x6029, .y = 0x0d, .x = 0x13}, + {.src = 0x6025, .y = 0x0d, .x = 0x12}, + {.src = 0x6029, .y = 0x0e, .x = 0x12}, + {.src = 0x6049, .y = 0x0f, .x = 0x12}, + {.src = 0x6021, .y = 0x0f, .x = 0x11}, + {.src = 0x6038, .y = 0x0e, .x = 0x11}, + {.src = 0x6037, .y = 0x0d, .x = 0x11}, + {.src = 0x6036, .y = 0x0c, .x = 0x11}, + {.src = 0x6035, .y = 0x0b, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860dbc4[] = +{ + {.src = 0x6021, .y = 0x0e, .x = 0x14}, + {.src = 0x6021, .y = 0x0e, .x = 0x13}, + {.src = 0x6029, .y = 0x0d, .x = 0x13}, + {.src = 0x6025, .y = 0x0d, .x = 0x12}, + {.src = 0x6029, .y = 0x0e, .x = 0x12}, + {.src = 0x6049, .y = 0x0f, .x = 0x12}, + {.src = 0x6021, .y = 0x0f, .x = 0x11}, + {.src = 0x6038, .y = 0x0e, .x = 0x11}, + {.src = 0x6037, .y = 0x0d, .x = 0x11}, + {.src = 0x6036, .y = 0x0c, .x = 0x11}, + {.src = 0x6035, .y = 0x0b, .x = 0x11}, + {.src = 0x602f, .y = 0x0b, .x = 0x10}, + {.src = 0x602e, .y = 0x0b, .x = 0x0f}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860dbf8[] = +{ + {.src = 0x6021, .y = 0x10, .x = 0x14}, + {.src = 0x6025, .y = 0x10, .x = 0x13}, + {.src = 0x6049, .y = 0x11, .x = 0x13}, + {.src = 0x6021, .y = 0x11, .x = 0x12}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860dc08[] = +{ + {.src = 0x6021, .y = 0x10, .x = 0x14}, + {.src = 0x6025, .y = 0x10, .x = 0x13}, + {.src = 0x6049, .y = 0x11, .x = 0x13}, + {.src = 0x6021, .y = 0x11, .x = 0x12}, + {.src = 0x6029, .y = 0x10, .x = 0x12}, + {.src = 0x6029, .y = 0x0f, .x = 0x12}, + {.src = 0x6021, .y = 0x0f, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860dc24[] = +{ + {.src = 0x6021, .y = 0x10, .x = 0x14}, + {.src = 0x6025, .y = 0x10, .x = 0x13}, + {.src = 0x6049, .y = 0x11, .x = 0x13}, + {.src = 0x6021, .y = 0x11, .x = 0x12}, + {.src = 0x6029, .y = 0x10, .x = 0x12}, + {.src = 0x6029, .y = 0x0f, .x = 0x12}, + {.src = 0x6021, .y = 0x0f, .x = 0x11}, + {.src = 0x6038, .y = 0x0e, .x = 0x11}, + {.src = 0x6037, .y = 0x0d, .x = 0x11}, + {.src = 0x6036, .y = 0x0c, .x = 0x11}, + {.src = 0x6035, .y = 0x0b, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860dc50[] = +{ + {.src = 0x6021, .y = 0x10, .x = 0x14}, + {.src = 0x6025, .y = 0x10, .x = 0x13}, + {.src = 0x6049, .y = 0x11, .x = 0x13}, + {.src = 0x6021, .y = 0x11, .x = 0x12}, + {.src = 0x6029, .y = 0x10, .x = 0x12}, + {.src = 0x6029, .y = 0x0f, .x = 0x12}, + {.src = 0x6021, .y = 0x0f, .x = 0x11}, + {.src = 0x6038, .y = 0x0e, .x = 0x11}, + {.src = 0x6037, .y = 0x0d, .x = 0x11}, + {.src = 0x6036, .y = 0x0c, .x = 0x11}, + {.src = 0x6035, .y = 0x0b, .x = 0x11}, + {.src = 0x602f, .y = 0x0b, .x = 0x10}, + {.src = 0x602e, .y = 0x0b, .x = 0x0f}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860dc84[] = +{ + {.src = 0x602b, .y = 0x12, .x = 0x14}, + {.src = 0x602b, .y = 0x12, .x = 0x13}, + {.src = 0x6029, .y = 0x11, .x = 0x13}, + {.src = 0x6021, .y = 0x11, .x = 0x12}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860dc94[] = +{ + {.src = 0x602b, .y = 0x12, .x = 0x14}, + {.src = 0x602b, .y = 0x12, .x = 0x13}, + {.src = 0x6029, .y = 0x11, .x = 0x13}, + {.src = 0x6021, .y = 0x11, .x = 0x12}, + {.src = 0x6029, .y = 0x10, .x = 0x12}, + {.src = 0x6029, .y = 0x0f, .x = 0x12}, + {.src = 0x6021, .y = 0x0f, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860dcb0[] = +{ + {.src = 0x602b, .y = 0x12, .x = 0x14}, + {.src = 0x602b, .y = 0x12, .x = 0x13}, + {.src = 0x6029, .y = 0x11, .x = 0x13}, + {.src = 0x6021, .y = 0x11, .x = 0x12}, + {.src = 0x6029, .y = 0x10, .x = 0x12}, + {.src = 0x6029, .y = 0x0f, .x = 0x12}, + {.src = 0x6021, .y = 0x0f, .x = 0x11}, + {.src = 0x6038, .y = 0x0e, .x = 0x11}, + {.src = 0x6037, .y = 0x0d, .x = 0x11}, + {.src = 0x6036, .y = 0x0c, .x = 0x11}, + {.src = 0x6035, .y = 0x0b, .x = 0x11}, +}; + +static const struct UnkStruct_860DD10 gUnknown_0860dcdc[] = +{ + {.src = 0x602b, .y = 0x12, .x = 0x14}, + {.src = 0x602b, .y = 0x12, .x = 0x13}, + {.src = 0x6029, .y = 0x11, .x = 0x13}, + {.src = 0x6021, .y = 0x11, .x = 0x12}, + {.src = 0x6029, .y = 0x10, .x = 0x12}, + {.src = 0x6029, .y = 0x0f, .x = 0x12}, + {.src = 0x6021, .y = 0x0f, .x = 0x11}, + {.src = 0x6038, .y = 0x0e, .x = 0x11}, + {.src = 0x6037, .y = 0x0d, .x = 0x11}, + {.src = 0x6036, .y = 0x0c, .x = 0x11}, + {.src = 0x6035, .y = 0x0b, .x = 0x11}, + {.src = 0x602f, .y = 0x0b, .x = 0x10}, + {.src = 0x602e, .y = 0x0b, .x = 0x0f}, +}; + +static const struct UnkStruct_860DD10 * const gUnknown_0860DD10[DOME_TOURNAMENT_TRAINERS_COUNT][4] = +{ + {gUnknown_0860d450, gUnknown_0860d460, gUnknown_0860d47c, gUnknown_0860d4a8}, + {gUnknown_0860dc84, gUnknown_0860dc94, gUnknown_0860dcb0, gUnknown_0860dcdc}, + {gUnknown_0860d8b0, gUnknown_0860d8c0, gUnknown_0860d8dc, gUnknown_0860d908}, + {gUnknown_0860d824, gUnknown_0860d834, gUnknown_0860d850, gUnknown_0860d87c}, + {gUnknown_0860d5f4, gUnknown_0860d604, gUnknown_0860d620, gUnknown_0860d64c}, + {gUnknown_0860dae0, gUnknown_0860daf0, gUnknown_0860db0c, gUnknown_0860db38}, + {gUnknown_0860da54, gUnknown_0860da64, gUnknown_0860da80, gUnknown_0860daac}, + {gUnknown_0860d680, gUnknown_0860d690, gUnknown_0860d6ac, gUnknown_0860d6d8}, + {gUnknown_0860d4dc, gUnknown_0860d4ec, gUnknown_0860d508, gUnknown_0860d534}, + {gUnknown_0860dbf8, gUnknown_0860dc08, gUnknown_0860dc24, gUnknown_0860dc50}, + {gUnknown_0860d93c, gUnknown_0860d94c, gUnknown_0860d968, gUnknown_0860d994}, + {gUnknown_0860d798, gUnknown_0860d7a8, gUnknown_0860d7c4, gUnknown_0860d7f0}, + {gUnknown_0860d568, gUnknown_0860d578, gUnknown_0860d594, gUnknown_0860d5c0}, + {gUnknown_0860db6c, gUnknown_0860db7c, gUnknown_0860db98, gUnknown_0860dbc4}, + {gUnknown_0860d9c8, gUnknown_0860d9d8, gUnknown_0860d9f4, gUnknown_0860da20}, + {gUnknown_0860d70c, gUnknown_0860d71c, gUnknown_0860d738, gUnknown_0860d764}, +}; + +static const u8 gUnknown_0860DE10[DOME_TOURNAMENT_TRAINERS_COUNT][4] = +{ + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, + {0x04, 0x07, 0x0b, 0x0d}, +}; + +// code +void CallBattleDomeFunction(void) +{ + gUnknown_0860D090[gSpecialVar_0x8004](); +} + +static void sub_818E9CC(void) +{ + u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + + gSaveBlock2Ptr->frontier.field_CA8 = 0; + gSaveBlock2Ptr->frontier.field_CB2 = 0; + gSaveBlock2Ptr->frontier.field_CA9_a = 0; + gSaveBlock2Ptr->frontier.field_CA9_b = 0; + if (!(gSaveBlock2Ptr->frontier.field_CDC & gUnknown_0860D0EC[battleMode][lvlMode])) + gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode] = 0; + + saved_warp2_set(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + gTrainerBattleOpponent_A = 0; +} + +static void sub_818EA84(void) +{ + u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + + switch (gSpecialVar_0x8005) + { + case 0: + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode]; + break; + case 1: + gSpecialVar_Result = ((gSaveBlock2Ptr->frontier.field_CDC & gUnknown_0860D0EC[battleMode][lvlMode]) != 0); + break; + case 2: + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D08_0; + break; + case 3: + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D08_1; + break; + case 4: + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D08_2; + break; + case 5: + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D08_3; + break; + case 6: + if (VarGet(VAR_FRONTIER_BATTLE_MODE) == FRONTIER_MODE_DOUBLES) + { + if (lvlMode) + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D08_5; + else + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D08_4; + } + else + { + if (lvlMode) + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D08_1; + else + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D08_0; + } + break; + case 7: + if (VarGet(VAR_FRONTIER_BATTLE_MODE) == FRONTIER_MODE_DOUBLES) + { + if (lvlMode) + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D08_7; + else + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D08_6; + } + else + { + if (lvlMode) + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D08_3; + else + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D08_2; + } + break; + case 8: + sub_81B8558(); + gUnknown_0203CEF8[0] = gSaveBlock2Ptr->frontier.field_CB0; + gUnknown_0203CEF8[1] = gSaveBlock2Ptr->frontier.field_CB0 >> 8; + break; + case 9: + gSpecialVar_Result = (gSaveBlock2Ptr->frontier.field_D0A * 2) - 3 + gSaveBlock2Ptr->frontier.field_D0B; + break; + } +} + +static void sub_818ED28(void) +{ + u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + + switch (gSpecialVar_0x8005) + { + case 0: + gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode] = gSpecialVar_0x8006; + break; + case 1: + if (gSpecialVar_0x8006) + gSaveBlock2Ptr->frontier.field_CDC |= gUnknown_0860D0EC[battleMode][lvlMode]; + else + gSaveBlock2Ptr->frontier.field_CDC &= gUnknown_0860D0FC[battleMode][lvlMode]; + break; + case 2: + gSaveBlock2Ptr->frontier.field_D08_0 = gSpecialVar_0x8006; + break; + case 3: + gSaveBlock2Ptr->frontier.field_D08_1 = gSpecialVar_0x8006; + break; + case 4: + gSaveBlock2Ptr->frontier.field_D08_2 = gSpecialVar_0x8006; + break; + case 5: + gSaveBlock2Ptr->frontier.field_D08_3 = gSpecialVar_0x8006; + break; + case 6: + if (VarGet(VAR_FRONTIER_BATTLE_MODE) == FRONTIER_MODE_DOUBLES) + { + if (lvlMode) + gSaveBlock2Ptr->frontier.field_D08_5 = gSpecialVar_0x8006; + else + gSaveBlock2Ptr->frontier.field_D08_4 = gSpecialVar_0x8006; + } + else + { + if (lvlMode) + gSaveBlock2Ptr->frontier.field_D08_1 = gSpecialVar_0x8006; + else + gSaveBlock2Ptr->frontier.field_D08_0 = gSpecialVar_0x8006; + } + break; + case 7: + if (VarGet(VAR_FRONTIER_BATTLE_MODE) == FRONTIER_MODE_DOUBLES) + { + if (lvlMode) + gSaveBlock2Ptr->frontier.field_D08_7 = gSpecialVar_0x8006; + else + gSaveBlock2Ptr->frontier.field_D08_6 = gSpecialVar_0x8006; + } + else + { + if (lvlMode) + gSaveBlock2Ptr->frontier.field_D08_3 = gSpecialVar_0x8006; + else + gSaveBlock2Ptr->frontier.field_D08_2 = gSpecialVar_0x8006; + } + break; + case 8: + gSaveBlock2Ptr->frontier.field_CB0 = T1_READ_16(gUnknown_0203CEF8); + break; + } +} + +static void InitDomeTrainers(void) +{ + s32 i, j, k; + s32 monLevel; + s32 species[3]; + s32 monTypesBits, monTypesCount; + s32 trainerId; + s32 monTournamentId; + u16 *statSums; + s32 *statValues; + u8 ivs = 0; + + species[0] = 0; + species[1] = 0; + species[2] = 0; + statSums = AllocZeroed(sizeof(u16) * DOME_TOURNAMENT_TRAINERS_COUNT); + statValues = AllocZeroed(sizeof(s32) * 6); + + gSaveBlock2Ptr->frontier.field_D0A = gSaveBlock2Ptr->frontier.lvlMode + 1; + gSaveBlock2Ptr->frontier.field_D0B = VarGet(VAR_FRONTIER_BATTLE_MODE) + 1; + gSaveBlock2Ptr->frontier.domeTrainers[0].trainerId = TRAINER_PLAYER; + gSaveBlock2Ptr->frontier.domeTrainers[0].isEliminated = 0; + gSaveBlock2Ptr->frontier.domeTrainers[0].eliminatedAt = 0; + gSaveBlock2Ptr->frontier.domeTrainers[0].unk3 = 0; + + for (i = 0; i < 3; i++) + { + gSaveBlock2Ptr->frontier.domeMonId[0][i] = GetMonData(&gPlayerParty[gSaveBlock2Ptr->frontier.field_CAA[i] - 1], MON_DATA_SPECIES, NULL); + for (j = 0; j < 4; j++) + gSaveBlock2Ptr->frontier.field_EFC[i].moves[j] = GetMonData(&gPlayerParty[gSaveBlock2Ptr->frontier.field_CAA[i] - 1], MON_DATA_MOVE1 + j, NULL); + for (j = 0; j < 6; j++) + gSaveBlock2Ptr->frontier.field_EFC[i].evs[j] = GetMonData(&gPlayerParty[gSaveBlock2Ptr->frontier.field_CAA[i] - 1], MON_DATA_HP_EV + j, NULL); + + gSaveBlock2Ptr->frontier.field_EFC[i].nature = GetNature(&gPlayerParty[gSaveBlock2Ptr->frontier.field_CAA[i] - 1]); + } + + for (i = 1; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (i > 5) + { + do + { + trainerId = sub_8162548(sub_81A39C4(), 0); + for (j = 1; j < i; j++) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[j].trainerId == trainerId) + break; + } + } while (j != i); + gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId = trainerId; + } + else + { + do + { + trainerId = sub_8162548(sub_81A39C4() + 1, 0); + for (j = 1; j < i; j++) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[j].trainerId == trainerId) + break; + } + } while (j != i); + gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId = trainerId; + } + + for (j = 0; j < 3; j++) + { + // Make sure the mon is valid. + do + { + monTournamentId = RandomizeFacilityTrainerMonId(trainerId); + for (k = 0; k < j; k++) + { + s32 checkingMonId = gSaveBlock2Ptr->frontier.domeMonId[i][k]; + if (checkingMonId == monTournamentId + || species[0] == gFacilityTrainerMons[monTournamentId].species + || species[1] == gFacilityTrainerMons[monTournamentId].species + || gFacilityTrainerMons[checkingMonId].itemTableId == gFacilityTrainerMons[monTournamentId].itemTableId) + break; + } + } while (k != j); + + gSaveBlock2Ptr->frontier.domeMonId[i][j] = monTournamentId; + species[j] = gFacilityTrainerMons[monTournamentId].species; + } + + gSaveBlock2Ptr->frontier.domeTrainers[i].isEliminated = 0; + gSaveBlock2Ptr->frontier.domeTrainers[i].eliminatedAt = 0; + gSaveBlock2Ptr->frontier.domeTrainers[i].unk3 = 0; + } + + monTypesBits = 0; + statSums[0] = 0; + for (i = 0; i < 3; i++) + { + trainerId = gSaveBlock2Ptr->frontier.field_CAA[i] - 1; // Great variable choice, gamefreak. + statSums[0] += GetMonData(&gPlayerParty[trainerId], MON_DATA_ATK, NULL); + statSums[0] += GetMonData(&gPlayerParty[trainerId], MON_DATA_DEF, NULL); + statSums[0] += GetMonData(&gPlayerParty[trainerId], MON_DATA_SPATK, NULL); + statSums[0] += GetMonData(&gPlayerParty[trainerId], MON_DATA_SPDEF, NULL); + statSums[0] += GetMonData(&gPlayerParty[trainerId], MON_DATA_SPEED, NULL); + statSums[0] += GetMonData(&gPlayerParty[trainerId], MON_DATA_MAX_HP, NULL); + monTypesBits |= gBitTable[gBaseStats[GetMonData(&gPlayerParty[trainerId], MON_DATA_SPECIES, NULL)].type1]; + monTypesBits |= gBitTable[gBaseStats[GetMonData(&gPlayerParty[trainerId], MON_DATA_SPECIES, NULL)].type2]; + } + + for (monTypesCount = 0, j = 0; j < 32; j++) + { + if (monTypesBits & 1) + monTypesCount++; + monTypesBits >>= 1; + } + + monLevel = GetFacilityEnemyMonLevel(); + statSums[0] += (monTypesCount * monLevel) / 20; + + for (i = 1; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + monTypesBits = 0; + statSums[i] = 0; + ivs = GetDomeTrainerMonIvs(gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId); + for (j = 0; j < 3; j++) + { + CalcDomeMonStats(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].species, + monLevel, ivs, + gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].evSpread, + gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].nature, + statValues); + + statSums[i] += statValues[STAT_ATK]; + statSums[i] += statValues[STAT_DEF]; + statSums[i] += statValues[STAT_SPATK]; + statSums[i] += statValues[STAT_SPDEF]; + statSums[i] += statValues[STAT_SPEED]; + statSums[i] += statValues[STAT_HP]; + monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].species].type1]; + monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].species].type2]; + } + + for (monTypesCount = 0, j = 0; j < 32; j++) + { + if (monTypesBits & 1) + monTypesCount++; + monTypesBits >>= 1; + } + statSums[i] += (monTypesCount * monLevel) / 20; + } + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT - 1; i++) + { + for (j = i + 1; j < DOME_TOURNAMENT_TRAINERS_COUNT; j++) + { + if (statSums[i] < statSums[j]) + { + SwapDomeTrainers(i, j, statSums); + } + else + { + if (statSums[i] == statSums[j]) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[j].trainerId == TRAINER_PLAYER) + SwapDomeTrainers(i, j, statSums); + else if (gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId > gSaveBlock2Ptr->frontier.domeTrainers[j].trainerId) + SwapDomeTrainers(i, j, statSums); + } + } + } + } + + if (sub_81A3610()) + { + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId == TRAINER_PLAYER) + break; + } + + if (gUnknown_0860D3F1[i][0] != 0) + { + j = 0; + gSaveBlock2Ptr->frontier.domeTrainers[j].trainerId = TRAINER_FRONTIER_BRAIN; + } + else + { + j = 1; + gSaveBlock2Ptr->frontier.domeTrainers[j].trainerId = TRAINER_FRONTIER_BRAIN; + } + + for (i = 0; i < 3; i++) + gSaveBlock2Ptr->frontier.domeMonId[j][i] = sub_81A4FF0(i); + } + + Free(statSums); + Free(statValues); +} + +#define CALC_STAT(base, statIndex) \ +{ \ + u8 baseStat = gBaseStats[species].base; \ + stats[statIndex] = (((2 * baseStat + ivs + evs[statIndex] / 4) * level) / 100) + 5; \ + stats[statIndex] = (u8) ModifyStatByNature(nature, stats[statIndex], statIndex); \ +} + +static void CalcDomeMonStats(u16 species, s32 level, s32 ivs, u8 evBits, u8 nature, s32 *stats) +{ + s32 i, count; + u8 bits; + u16 resultingEvs; + s32 evs[6]; + + count = 0, bits = evBits; + for (i = 0; i < 6; bits >>= 1, i++) + { + if (bits & 1) + count++; + } + + resultingEvs = MAX_TOTAL_EVS / count; + for (i = 0; i < 6; bits <<= 1, i++) + { + evs[i] = 0; + if (evBits & bits) + evs[i] = resultingEvs; + } + + if (species == SPECIES_SHEDINJA) + { + stats[STAT_HP] = 1; + } + else + { + s32 n = 2 * gBaseStats[species].baseHP; + stats[STAT_HP] = (((n + ivs + evs[STAT_HP] / 4) * level) / 100) + level + 10; + } + + CALC_STAT(baseAttack, STAT_ATK); + CALC_STAT(baseDefense, STAT_DEF); + CALC_STAT(baseSpeed, STAT_SPEED); + CALC_STAT(baseSpAttack, STAT_SPATK); + CALC_STAT(baseSpDefense, STAT_SPDEF); +} + +static void SwapDomeTrainers(s32 id1, s32 id2, u16 *statsArray) +{ + s32 i; + u16 temp; + + SWAP(statsArray[id1], statsArray[id2], temp); + SWAP(gSaveBlock2Ptr->frontier.domeTrainers[id1].trainerId, gSaveBlock2Ptr->frontier.domeTrainers[id2].trainerId, temp); + + for (i = 0; i < 3; i++) + SWAP(gSaveBlock2Ptr->frontier.domeMonId[id1][i], gSaveBlock2Ptr->frontier.domeMonId[id2][i], temp); +} + +static void sub_818F9B0(void) +{ + StringCopy(gStringVar1, gRoundsStringTable[gSaveBlock2Ptr->frontier.field_CB2]); +} + +static void sub_818F9E0(void) +{ + StringCopy(gStringVar1, gRoundsStringTable[gSaveBlock2Ptr->frontier.field_CB2]); + CopyDomeTrainerName(gStringVar2, gTrainerBattleOpponent_A); +} + +static void sub_818FA20(void) +{ + gUnknown_0203CD70 = 0; + gUnknown_0203CD74 = GetMonData(&gPlayerParty[0], MON_DATA_MAX_HP, NULL); + gUnknown_0203CD74 += GetMonData(&gPlayerParty[1], MON_DATA_MAX_HP, NULL); + CalculatePlayerPartyCount(); + CreateDomeTrainerMons(TrainerIdToTournamentId(gTrainerBattleOpponent_A)); +} + +static void CreateDomeMon(u8 monPartyId, u16 tournamentTrainerId, u8 tournamentMonId, u32 otId) +{ + s32 i; + u8 happiness = 0xFF; + u8 fixedIv = GetDomeTrainerMonIvs(tournamentTrainerId); // BUG: Should be using trainerId instead of tournamentTrainerId. As a result, all Pokemon have ivs of 3. + u8 level = GetFacilityEnemyMonLevel(); + CreateMonWithEVSpreadPersonalityOTID(&gEnemyParty[monPartyId], + gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].species, + level, + gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].nature, + fixedIv, + gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].evSpread, otId); + + happiness = 0xFF; + for (i = 0; i < 4; i++) + { + SetMonMoveSlot(&gEnemyParty[monPartyId], + gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].moves[i], i); + if (gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].moves[i] == MOVE_FRUSTRATION) + happiness = 0; + } + + SetMonData(&gEnemyParty[monPartyId], MON_DATA_FRIENDSHIP, &happiness); + SetMonData(&gEnemyParty[monPartyId], MON_DATA_HELD_ITEM, + &gBattleFrontierHeldItems[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].itemTableId]); +} + +static void CreateDomeTrainerMons(u16 tournamentTrainerId) +{ + u8 monsCount = 0; + u32 otId = 0; + s32 i, bits; + + ZeroEnemyPartyMons(); + bits = GetTrainerMonCountInBits(tournamentTrainerId); + otId = Random32(); + if (Random() % 10 > 5) + { + for (i = 0; i < 3; i++) + { + if (bits & 1) + { + CreateDomeMon(monsCount, tournamentTrainerId, i, otId); + monsCount++; + } + bits >>= 1; + } + } + else + { + for (i = 2; i >= 0; i--) + { + if (bits & 4) + { + CreateDomeMon(monsCount, tournamentTrainerId, i, otId); + monsCount++; + } + bits <<= 1; + } + } +} + +s32 GetTrainerMonCountInBits(u16 tournamentTrainerId) +{ + s32 bits; + if (Random() & 1) + { + bits = sub_818FCBC(tournamentTrainerId, FALSE); + if (bits == 0) + bits = sub_818FDB8(tournamentTrainerId, TRUE); + } + else + { + bits = sub_818FDB8(tournamentTrainerId, FALSE); + if (bits == 0) + bits = sub_818FCBC(tournamentTrainerId, TRUE); + } + + return bits; +} + +static s32 sub_818FCBC(u16 tournamentTrainerId, bool8 arg1) +{ + s32 i, moveId, playerMonId; + s32 array[3]; + + for (i = 0; i < 3; i++) + { + array[i] = 0; + for (moveId = 0; moveId < 4; moveId++) + { + for (playerMonId = 0; playerMonId < 3; playerMonId++) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN) + { + array[i] += GetTypeEffectivenessPoints(sub_81A5060(i, moveId), + GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), 0); + } + else + { + array[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][i]].moves[moveId], + GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), 0); + } + } + } + } + return sub_818FEB4(array, arg1); +} + +static s32 sub_818FDB8(u16 tournamentTrainerId, bool8 arg1) +{ + s32 i, moveId, playerMonId; + s32 array[3]; + + for (i = 0; i < 3; i++) + { + array[i] = 0; + for (moveId = 0; moveId < 4; moveId++) + { + for (playerMonId = 0; playerMonId < 3; playerMonId++) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN) + { + array[i] += GetTypeEffectivenessPoints(sub_81A5060(i, moveId), + GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), 1); + } + else + { + array[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][i]].moves[moveId], + GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), 1); + } + } + } + } + return sub_818FEB4(array, arg1); +} + +static s32 sub_818FEB4(s32 *arr, bool8 arg1) +{ + s32 i, j; + s32 bits = 0; + s32 array[3]; + + for (i = 0; i < 3; i++) + array[i] = i; + + if (arr[0] == arr[1] && arr[0] == arr[2]) + { + if (arg1) + { + i = 0; + while (i != 2) + { + u32 rand = Random() & 3; + if (rand != 3 && !(bits & gBitTable[rand])) + { + bits |= gBitTable[rand]; + i++; + } + } + } + } + else + { + for (i = 0; i < 2; i++) + { + for (j = i + 1; j < 3; j++) + { + s32 temp; + + if (arr[i] < arr[j]) + { + temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; + + temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } + + if (arr[i] == arr[j] && (Random() & 1)) + { + temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; + + temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } + } + } + + for (i = 0; i < 2; i++) + { + bits |= gBitTable[array[i]]; + } + } + + return bits; +} + +#define TYPE_x0 0 +#define TYPE_x0_25 5 +#define TYPE_x0_50 10 +#define TYPE_x1 20 +#define TYPE_x2 40 +#define TYPE_x4 80 + +// Functionally equivalent, while loop is impossible to match. +#ifdef NONMATCHING +static s32 GetTypeEffectivenessPoints(s32 move, s32 targetSpecies, s32 arg2) +{ + s32 defType1, defType2, defAbility, moveType; + s32 i = 0; + s32 typePower = TYPE_x1; + + if (move == MOVE_NONE || move == 0xFFFF || gBattleMoves[move].power == 0) + return 0; + + defType1 = gBaseStats[targetSpecies].type1; + defType2 = gBaseStats[targetSpecies].type2; + defAbility = gBaseStats[targetSpecies].ability1; + moveType = gBattleMoves[move].type; + + if (defAbility == ABILITY_LEVITATE && moveType == TYPE_GROUND) + { + if (arg2 == 1) + typePower = 8; + } + else + { + while (gTypeEffectiveness[i + 0] != TYPE_ENDTABLE) + { + if (gTypeEffectiveness[i + 0] == TYPE_FORESIGHT) + { + i += 3; + } + else + { + u8 val = gTypeEffectiveness[i + 0]; + if (val == moveType) + { + // BUG: * 2 is not necessary and makes the condition always false if the ability is wonder guard. + if (gTypeEffectiveness[i + 1] == defType1 && (defAbility != ABILITY_WONDER_GUARD || gTypeEffectiveness[i + 2] == TYPE_MUL_SUPER_EFFECTIVE * 2)) + typePower = (gTypeEffectiveness[i + 2] * typePower) / 10; + if (gTypeEffectiveness[i + 1] == defType2 && defType1 != defType2 && (defAbility != ABILITY_WONDER_GUARD || gTypeEffectiveness[i + 2] == TYPE_MUL_SUPER_EFFECTIVE * 2)) + typePower = (gTypeEffectiveness[i + 2] * typePower) / 10; + } + i += 3; + } + } + } + + switch (arg2) + { + case 0: + switch (typePower) + { + case 10: + case 5: + case 0: + default: + typePower = 0; + break; + case 20: + typePower = 2; + break; + case 40: + typePower = 4; + break; + case 80: + typePower = 8; + break; + } + break; + case 1: + switch (typePower) + { + default: + case 20: + typePower = 0; + break; + case 5: + typePower = 4; + break; + case 0: + typePower = 8; + break; + case 10: + typePower = 2; + break; + case 40: + typePower = -2; + break; + case 80: + typePower = -4; + break; + } + break; + case 2: + switch (typePower) + { + case TYPE_x0: + typePower = -16; + break; + case TYPE_x0_25: + typePower = -8; + break; + case TYPE_x0_50: + default: + typePower = 0; + break; + case TYPE_x1: + typePower = 4; + break; + case TYPE_x2: + typePower = 12; + break; + case TYPE_x4: + typePower = 20; + break; + } + break; + } + + return typePower; +} +#else +NAKED +static s32 GetTypeEffectivenessPoints(s32 move, s32 species, s32 arg2) +{ + asm_unified("\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x8\n\ + adds r3, r0, 0\n\ + adds r4, r1, 0\n\ + str r2, [sp]\n\ + movs r6, 0\n\ + movs r2, 0x14\n\ + cmp r3, 0\n\ + beq _0818FFF0\n\ + ldr r0, =0x0000ffff\n\ + cmp r3, r0\n\ + beq _0818FFF0\n\ + ldr r0, =gBattleMoves\n\ + lsls r1, r3, 1\n\ + adds r1, r3\n\ + lsls r1, 2\n\ + adds r3, r1, r0\n\ + ldrb r0, [r3, 0x1]\n\ + cmp r0, 0\n\ + bne _0818FFFC\n\ +_0818FFF0:\n\ + movs r0, 0\n\ + b _08190156\n\ + .pool\n\ +_0818FFFC:\n\ + ldr r1, =gBaseStats\n\ + lsls r0, r4, 3\n\ + subs r0, r4\n\ + lsls r0, 2\n\ + adds r0, r1\n\ + ldrb r1, [r0, 0x6]\n\ + mov r10, r1\n\ + ldrb r1, [r0, 0x7]\n\ + mov r9, r1\n\ + ldrb r0, [r0, 0x16]\n\ + mov r8, r0\n\ + ldrb r3, [r3, 0x2]\n\ + str r3, [sp, 0x4]\n\ + cmp r0, 0x1A\n\ + bne _0819002C\n\ + cmp r3, 0x4\n\ + bne _0819002C\n\ + ldr r0, [sp]\n\ + cmp r0, 0x1\n\ + bne _081900AA\n\ + movs r2, 0x8\n\ + b _081900A4\n\ + .pool\n\ +_0819002C:\n\ + ldr r0, =gTypeEffectiveness\n\ + adds r1, r6, r0\n\ + ldrb r0, [r1]\n\ + ldr r7, =gTypeEffectiveness\n\ + cmp r0, 0xFF\n\ + beq _081900A4\n\ + adds r4, r1, 0\n\ +_0819003A:\n\ + ldrb r0, [r4]\n\ + cmp r0, 0xFE\n\ + beq _08190096\n\ + ldrb r0, [r4]\n\ + ldr r1, [sp, 0x4]\n\ + cmp r0, r1\n\ + bne _08190096\n\ + ldrb r0, [r4, 0x1]\n\ + adds r5, r6, 0x1\n\ + cmp r0, r10\n\ + bne _0819006C\n\ + adds r1, r6, 0x2\n\ + mov r0, r8\n\ + cmp r0, 0x19\n\ + bne _0819005E\n\ + ldrb r0, [r4, 0x2]\n\ + cmp r0, 0x28\n\ + bne _0819006C\n\ +_0819005E:\n\ + adds r0, r1, r7\n\ + ldrb r0, [r0]\n\ + muls r0, r2\n\ + movs r1, 0xA\n\ + bl __divsi3\n\ + adds r2, r0, 0\n\ +_0819006C:\n\ + adds r0, r5, r7\n\ + ldrb r0, [r0]\n\ + cmp r0, r9\n\ + bne _08190096\n\ + cmp r10, r9\n\ + beq _08190096\n\ + adds r1, r6, 0x2\n\ + mov r0, r8\n\ + cmp r0, 0x19\n\ + bne _08190088\n\ + adds r0, r1, r7\n\ + ldrb r0, [r0]\n\ + cmp r0, 0x28\n\ + bne _08190096\n\ +_08190088:\n\ + adds r0, r1, r7\n\ + ldrb r0, [r0]\n\ + muls r0, r2\n\ + movs r1, 0xA\n\ + bl __divsi3\n\ + adds r2, r0, 0\n\ +_08190096:\n\ + adds r4, 0x3\n\ + adds r6, 0x3\n\ + ldr r1, =gTypeEffectiveness\n\ + adds r0, r6, r1\n\ + ldrb r0, [r0]\n\ + cmp r0, 0xFF\n\ + bne _0819003A\n\ +_081900A4:\n\ + ldr r0, [sp]\n\ + cmp r0, 0x1\n\ + beq _081900E0\n\ +_081900AA:\n\ + ldr r1, [sp]\n\ + cmp r1, 0x1\n\ + bgt _081900BC\n\ + cmp r1, 0\n\ + beq _081900C4\n\ + b _08190154\n\ + .pool\n\ +_081900BC:\n\ + ldr r0, [sp]\n\ + cmp r0, 0x2\n\ + beq _08190114\n\ + b _08190154\n\ +_081900C4:\n\ + cmp r2, 0xA\n\ + beq _08190146\n\ + cmp r2, 0xA\n\ + ble _08190146\n\ + cmp r2, 0x28\n\ + beq _0819014A\n\ + cmp r2, 0x28\n\ + bgt _081900DA\n\ + cmp r2, 0x14\n\ + beq _08190104\n\ + b _08190146\n\ +_081900DA:\n\ + cmp r2, 0x50\n\ + bne _08190146\n\ + b _08190100\n\ +_081900E0:\n\ + cmp r2, 0xA\n\ + beq _08190104\n\ + cmp r2, 0xA\n\ + bgt _081900F2\n\ + cmp r2, 0\n\ + beq _08190100\n\ + cmp r2, 0x5\n\ + beq _0819014A\n\ + b _08190146\n\ +_081900F2:\n\ + cmp r2, 0x28\n\ + beq _08190108\n\ + cmp r2, 0x28\n\ + ble _08190146\n\ + cmp r2, 0x50\n\ + beq _0819010E\n\ + b _08190146\n\ +_08190100:\n\ + movs r2, 0x8\n\ + b _08190154\n\ +_08190104:\n\ + movs r2, 0x2\n\ + b _08190154\n\ +_08190108:\n\ + movs r2, 0x2\n\ + negs r2, r2\n\ + b _08190154\n\ +_0819010E:\n\ + movs r2, 0x4\n\ + negs r2, r2\n\ + b _08190154\n\ +_08190114:\n\ + cmp r2, 0xA\n\ + beq _08190146\n\ + cmp r2, 0xA\n\ + bgt _08190126\n\ + cmp r2, 0\n\ + beq _0819013A\n\ + cmp r2, 0x5\n\ + beq _08190140\n\ + b _08190146\n\ +_08190126:\n\ + cmp r2, 0x28\n\ + beq _0819014E\n\ + cmp r2, 0x28\n\ + bgt _08190134\n\ + cmp r2, 0x14\n\ + beq _0819014A\n\ + b _08190146\n\ +_08190134:\n\ + cmp r2, 0x50\n\ + beq _08190152\n\ + b _08190146\n\ +_0819013A:\n\ + movs r2, 0x10\n\ + negs r2, r2\n\ + b _08190154\n\ +_08190140:\n\ + movs r2, 0x8\n\ + negs r2, r2\n\ + b _08190154\n\ +_08190146:\n\ + movs r2, 0\n\ + b _08190154\n\ +_0819014A:\n\ + movs r2, 0x4\n\ + b _08190154\n\ +_0819014E:\n\ + movs r2, 0xC\n\ + b _08190154\n\ +_08190152:\n\ + movs r2, 0x14\n\ +_08190154:\n\ + adds r0, r2, 0\n\ +_08190156:\n\ + add sp, 0x8\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1\n\ + "); +} +#endif // NONMATCHING + +static u8 GetDomeTrainerMonIvs(u16 trainerId) +{ + u8 fixedIv; + if (trainerId <= 99) + fixedIv = 3; + else if (trainerId <= 119) + fixedIv = 6; + else if (trainerId <= 139) + fixedIv = 9; + else if (trainerId <= 159) + fixedIv = 12; + else if (trainerId <= 179) + fixedIv = 15; + else if (trainerId <= 199) + fixedIv = 18; + else if (trainerId <= 219) + fixedIv = 21; + else + fixedIv = 31; + + return fixedIv; +} + +static s32 TournamentIdOfOpponent(s32 roundId, s32 trainerId) +{ + s32 i, j, val; + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId == trainerId) + break; + } + + if (roundId != DOME_ROUND1) + { + if (roundId == DOME_FINAL) + val = sIdToOpponentId[i][roundId] + 8; + else + val = sIdToOpponentId[i][roundId] + 4; + + for (j = sIdToOpponentId[i][roundId]; j < val; j++) + { + if (gUnknown_0860D14C[j] != i && !gSaveBlock2Ptr->frontier.domeTrainers[gUnknown_0860D14C[j]].isEliminated) + break; + } + + if (j != val) + return gUnknown_0860D14C[j]; + else + return 0xFF; + } + else + { + if (!gSaveBlock2Ptr->frontier.domeTrainers[sIdToOpponentId[i][roundId]].isEliminated) + return sIdToOpponentId[i][roundId]; + else + return 0xFF; + } +} + +static void sub_8190298(void) +{ + gTrainerBattleOpponent_A = TrainerIdOfPlayerOpponent(); +} + +static u16 TrainerIdOfPlayerOpponent(void) +{ + return gSaveBlock2Ptr->frontier.domeTrainers[TournamentIdOfOpponent(gSaveBlock2Ptr->frontier.field_CB2, TRAINER_PLAYER)].trainerId; +} + +static void sub_81902E4(void) +{ + sub_8162614(gTrainerBattleOpponent_A, 0); +} + +static void sub_81902F8(void) +{ + gSaveBlock2Ptr->frontier.field_CA8 = gSpecialVar_0x8005; + VarSet(VAR_TEMP_0, 0); + gSaveBlock2Ptr->frontier.field_CA9_a = 1; + sub_81A4C30(); +} + +static void sub_819033C(void) +{ + u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + + if (gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode] < 999) + gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode]++; + if (gSaveBlock2Ptr->frontier.field_D1C[battleMode][lvlMode] < 999) + gSaveBlock2Ptr->frontier.field_D1C[battleMode][lvlMode]++; + + if (gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode] > gSaveBlock2Ptr->frontier.field_D14[battleMode][lvlMode]) + gSaveBlock2Ptr->frontier.field_D14[battleMode][lvlMode] = gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode]; +} + +static void ShowDomeOpponentInfo(void) +{ + u8 taskId = CreateTask(sub_8190400, 0); + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = TrainerIdToTournamentId(TrainerIdOfPlayerOpponent()); + gTasks[taskId].data[2] = 0; + gTasks[taskId].data[3] = 0; + + SetMainCallback2(CB2_BattleDome); +} + +static void sub_8190400(u8 taskId) +{ + s32 i; + s32 r5 = gTasks[taskId].data[1]; + s32 r9 = gTasks[taskId].data[2]; + s32 r7 = gTasks[taskId].data[3]; + + switch (gTasks[taskId].data[0]) + { + case 0: + SetHBlankCallback(NULL); + SetVBlankCallback(NULL); + EnableInterrupts(INTR_FLAG_VBLANK); + CpuFill32(0, (void *)VRAM, VRAM_SIZE); + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, gUnknown_0860CE84, ARRAY_COUNT(gUnknown_0860CE84)); + InitWindows(gUnknown_0860CEB4); + DeactivateAllTextPrinters(); + gBattle_BG0_X = 0; + gBattle_BG0_Y = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + gBattle_BG3_X = 0; + gBattle_BG3_Y = 0; + if (r9 == 2) + gBattle_BG2_X = 0, gBattle_BG2_Y = 0; + else + gBattle_BG2_X = 0, gBattle_BG2_Y = 160; + + gTasks[taskId].data[0]++; + break; + case 1: + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); + SetGpuReg(REG_OFFSET_MOSAIC, 0); + SetGpuReg(REG_OFFSET_WIN0H, 0); + SetGpuReg(REG_OFFSET_WIN0V, 0); + SetGpuReg(REG_OFFSET_WIN1H, 0); + SetGpuReg(REG_OFFSET_WIN1V, 0); + SetGpuReg(REG_OFFSET_WININ, 0); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); + ResetPaletteFade(); + ResetSpriteData(); + FreeAllSpritePalettes(); + gReservedSpritePaletteCount = 4; + gTasks[taskId].data[0]++; + break; + case 2: + DecompressAndLoadBgGfxUsingHeap(2, gUnknown_08D83D50, 0x2000, 0, 0); + DecompressAndLoadBgGfxUsingHeap(2, gUnknown_08D84970, 0x2000, 0, 1); + DecompressAndLoadBgGfxUsingHeap(3, gUnknown_08D84F00, 0x800, 0, 1); + LoadCompressedObjectPic(gUnknown_0860CF50); + LoadCompressedPalette(gUnknown_08D85358, 0, 0x200); + LoadCompressedPalette(gUnknown_08D85444, 0x100, 0x200); + LoadCompressedPalette(gUnknown_08D85600, 0xF0, 0x20); + if (r9 == 2) + LoadCompressedPalette(gUnknown_08D854C8, 0x50, 0x20); + CpuFill32(0, gPlttBufferFaded, 0x400); + ShowBg(0); + ShowBg(1); + ShowBg(2); + ShowBg(3); + gTasks[taskId].data[0]++; + break; + case 3: + SetVBlankCallback(VblankCb0_BattleDome); + sBattleDomeStruct = AllocZeroed(sizeof(*sBattleDomeStruct)); + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + sBattleDomeStruct->arr[i] |= 0xFF; + LoadMonIconPalettes(); + i = CreateTask(sub_8190CD4, 0); + gTasks[i].data[0] = 0; + gTasks[i].data[2] = 0; + gTasks[i].data[3] = r9; + gTasks[i].data[4] = r7; + if (r9 == 2) + { + DisplayMatchInfoOnCard(0, r5); + sBattleDomeStruct->unk_10 = 1; + } + else + { + DisplayTrainerInfoOnCard(0, r5); + } + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_1D_MAP); + if (r9 != 0) + { + r7 = CreateSprite(&gUnknown_0860D068, 120, 4, 0); + StartSpriteAnim(&gSprites[r7], 0); + gSprites[r7].data[0] = i; + + r7 = CreateSprite(&gUnknown_0860D068, 120, 156, 0); + StartSpriteAnim(&gSprites[r7], 1); + gSprites[r7].data[0] = i; + + r7 = CreateSprite(&gUnknown_0860D050, 6, 80, 0); + StartSpriteAnim(&gSprites[r7], 0); + gSprites[r7].data[0] = i; + gSprites[r7].data[1] = 0; + if (r9 == 1) + gSprites[r7].invisible = 1; + + r7 = CreateSprite(&gUnknown_0860D050, 234, 80, 0); + StartSpriteAnim(&gSprites[r7], 1); + gSprites[r7].data[0] = i; + gSprites[r7].data[1] = 1; + } + DestroyTask(taskId); + break; + } +} + +// Note: Card scrolling up means the current card goes down and another one appears from top. +// The same is true for scrolling left. +// That means that the sprite needs to move with the moving card in the opposite scrolling direction. + +static void SpriteCb_TrainerIconCardScrollUp(struct Sprite *sprite) +{ + sprite->pos1.y += 4; + if (sprite->data[0] != 0) + { + if (sprite->pos1.y >= -32) + sprite->invisible = 0; + if (++sprite->data[1] == 40) + sprite->callback = SpriteCallbackDummy; + } + else + { + if (sprite->pos1.y >= 192) + { + sBattleDomeStruct->arr[sprite->data[2]] = 0xFF; + FreeAndDestroyTrainerPicSprite(sprite->data[3]); + } + } +} + +static void SpriteCb_TrainerIconCardScrollDown(struct Sprite *sprite) +{ + sprite->pos1.y -= 4; + if (sprite->data[0] != 0) + { + if (sprite->pos1.y <= 192) + sprite->invisible = 0; + if (++sprite->data[1] == 40) + sprite->callback = SpriteCallbackDummy; + } + else + { + if (sprite->pos1.y <= -32) + { + sBattleDomeStruct->arr[sprite->data[2]] = 0xFF; + FreeAndDestroyTrainerPicSprite(sprite->data[3]); + } + } +} + +static void SpriteCb_TrainerIconCardScrollLeft(struct Sprite *sprite) +{ + sprite->pos1.x += 4; + if (sprite->data[0] != 0) + { + if (sprite->pos1.x >= -32) + sprite->invisible = 0; + if (++sprite->data[1] == 64) + sprite->callback = SpriteCallbackDummy; + } + else + { + if (sprite->pos1.x >= 272) + { + sBattleDomeStruct->arr[sprite->data[2]] = 0xFF; + FreeAndDestroyTrainerPicSprite(sprite->data[3]); + } + } +} + +static void SpriteCb_TrainerIconCardScrollRight(struct Sprite *sprite) +{ + sprite->pos1.x -= 4; + if (sprite->data[0] != 0) + { + if (sprite->pos1.x <= 272) + sprite->invisible = 0; + if (++sprite->data[1] == 64) + sprite->callback = SpriteCallbackDummy; + } + else + { + if (sprite->pos1.x <= -32) + { + sBattleDomeStruct->arr[sprite->data[2]] = 0xFF; + FreeAndDestroyTrainerPicSprite(sprite->data[3]); + } + } +} + +#define sMonIconStill data[3] + +static void SpriteCb_MonIcon(struct Sprite *sprite) +{ + if (!sprite->sMonIconStill) + UpdateMonIconFrame(sprite); +} + +static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite) +{ + if (!sprite->sMonIconStill) + UpdateMonIconFrame(sprite); + sprite->pos1.y += 4; + if (sprite->data[0] != 0) + { + if (sprite->pos1.y >= -16) + sprite->invisible = 0; + if (++sprite->data[1] == 40) + sprite->callback = SpriteCb_MonIcon; + } + else + { + if (sprite->pos1.y >= 176) + { + sBattleDomeStruct->arr[sprite->data[2]] = 0xFF; + sub_80D2EF8(sprite); + } + } +} + +static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite) +{ + if (!sprite->sMonIconStill) + UpdateMonIconFrame(sprite); + sprite->pos1.y -= 4; + if (sprite->data[0] != 0) + { + if (sprite->pos1.y <= 176) + sprite->invisible = 0; + if (++sprite->data[1] == 40) + sprite->callback = SpriteCb_MonIcon; + } + else + { + if (sprite->pos1.y <= -16) + { + sBattleDomeStruct->arr[sprite->data[2]] = 0xFF; + sub_80D2EF8(sprite); + } + } +} + +static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite) +{ + if (!sprite->sMonIconStill) + UpdateMonIconFrame(sprite); + sprite->pos1.x += 4; + if (sprite->data[0] != 0) + { + if (sprite->pos1.x >= -16) + sprite->invisible = 0; + if (++sprite->data[1] == 64) + sprite->callback = SpriteCb_MonIcon; + } + else + { + if (sprite->pos1.x >= 256) + { + sBattleDomeStruct->arr[sprite->data[2]] = 0xFF; + sub_80D2EF8(sprite); + } + } +} + +static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite) +{ + if (!sprite->sMonIconStill) + UpdateMonIconFrame(sprite); + sprite->pos1.x -= 4; + if (sprite->data[0] != 0) + { + if (sprite->pos1.x <= 256) + sprite->invisible = 0; + if (++sprite->data[1] == 64) + sprite->callback = SpriteCb_MonIcon; + } + else + { + if (sprite->pos1.x <= -16) + { + sBattleDomeStruct->arr[sprite->data[2]] = 0xFF; + sub_80D2EF8(sprite); + } + } +} + +static void sub_8190B40(struct Sprite *sprite) +{ + s32 taskId1 = sprite->data[0]; + s32 arrId = gTasks[gTasks[taskId1].data[4]].data[1]; + s32 tournmanetTrainerId = gUnknown_0860D080[arrId]; + s32 r12 = gSaveBlock2Ptr->frontier.field_CB2; + + if (gTasks[taskId1].data[3] == 1) + { + if (sprite->data[1]) + { + if ((gSaveBlock2Ptr->frontier.domeTrainers[tournmanetTrainerId].isEliminated + && sBattleDomeStruct->unk_10 - 1 < gSaveBlock2Ptr->frontier.domeTrainers[tournmanetTrainerId].eliminatedAt)) + { + sprite->invisible = 0; + } + else if (!gSaveBlock2Ptr->frontier.domeTrainers[tournmanetTrainerId].isEliminated + && sBattleDomeStruct->unk_10 - 1 < r12) + { + sprite->invisible = 0; + } + else + { + if (gTasks[taskId1].data[0] == 2) + sprite->invisible = 1; + } + } + else + { + if (sBattleDomeStruct->unk_10 != 0) + { + sprite->invisible = 0; + } + else + { + if (gTasks[taskId1].data[0] == 2) + sprite->invisible = 1; + } + } + } + else + { + if (sprite->data[1]) + { + if (sBattleDomeStruct->unk_10 > 1) + { + if (gTasks[taskId1].data[0] == 2) + sprite->invisible = 1; + } + else + { + sprite->invisible = 0; + } + } + else + { + if (sBattleDomeStruct->unk_10 != 0) + { + sprite->invisible = 0; + } + else + { + if (gTasks[taskId1].data[0] == 2) + sprite->invisible = 1; + } + } + } +} + +static void sub_8190C6C(struct Sprite *sprite) +{ + s32 taskId1 = sprite->data[0]; + + if (gTasks[taskId1].data[3] == 1) + { + if (sBattleDomeStruct->unk_10 != 0) + { + if (gTasks[taskId1].data[0] == 2) + sprite->invisible = 1; + } + else + { + sprite->invisible = 0; + } + } + else + { + if (sBattleDomeStruct->unk_10 != 1) + { + if (gTasks[taskId1].data[0] == 2) + sprite->invisible = 1; + } + else + { + sprite->invisible = 0; + } + } +} + +static void sub_8190CD4(u8 taskId) +{ + s32 i; + s32 windowId = 0; + s32 r9 = gTasks[taskId].data[3]; + s32 taskId2 = gTasks[taskId].data[4]; + s32 trainerTournamentId = 0; + s32 matchNo = 0; + + switch (gTasks[taskId].data[0]) + { + case 0: + if (!gPaletteFade.active) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + gTasks[taskId].data[0] = 1; + } + break; + case 1: + if (!gPaletteFade.active) + gTasks[taskId].data[0] = 2; + break; + case 2: + i = sub_819221C(taskId); + switch (i) + { + case 9: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + gTasks[taskId].data[0] = 8; + break; + case 1 ... 8: + gTasks[taskId].data[5] = i; + if (gTasks[taskId].data[2] != 0) + windowId = 9; + else + windowId = 0; + + for (i = windowId; i < windowId + 9; i++) + { + CopyWindowToVram(i, 2); + FillWindowPixelBuffer(i, 0); + } + gTasks[taskId].data[0] = 3; + break; + case 0: + break; + } + break; + case 3: + i = gTasks[taskId].data[5]; + switch (i) + { + case 1: + case 5: + if (gTasks[taskId].data[2]) + { + gBattle_BG0_X = 0; + gBattle_BG0_Y = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 160; + } + else + { + gBattle_BG0_X = 0; + gBattle_BG0_Y = 160; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + } + + if (i == 1) + { + if (sBattleDomeStruct->unk_10 == 0) + { + gBattle_BG2_X = 0; + gBattle_BG2_Y = 320; + trainerTournamentId = gUnknown_0860D080[gTasks[taskId2].data[1]]; + DisplayTrainerInfoOnCard(gTasks[taskId].data[2] | 0x10, trainerTournamentId); + } + else + { + gBattle_BG2_X = 256; + gBattle_BG2_Y = 0; + trainerTournamentId = gUnknown_0860D080[gTasks[taskId2].data[1]]; + DisplayTrainerInfoOnCard(gTasks[taskId].data[2] | 0x10, trainerTournamentId); + sBattleDomeStruct->unk_10 = 0; + } + } + else + { + if (sBattleDomeStruct->unk_10 == 0) + { + matchNo = gTasks[taskId2].data[1] - 16; + sub_8192F08(matchNo, sBattleDomeStruct->unk_11); + gBattle_BG2_X = 0; + gBattle_BG2_Y = 320; + trainerTournamentId = sBattleDomeStruct->unk_11[0]; + DisplayTrainerInfoOnCard(gTasks[taskId].data[2] | 0x10, trainerTournamentId); + } + else if (sBattleDomeStruct->unk_10 == 2) + { + matchNo = gTasks[taskId2].data[1] - 16; + sub_8192F08(matchNo, sBattleDomeStruct->unk_11); + gBattle_BG2_X = 0; + gBattle_BG2_Y = 320; + trainerTournamentId = sBattleDomeStruct->unk_11[1]; + DisplayTrainerInfoOnCard(gTasks[taskId].data[2] | 0x10, trainerTournamentId); + } + else + { + gBattle_BG2_X = 256; + gBattle_BG2_Y = 160; + matchNo = gTasks[taskId2].data[1] - 16; + DisplayMatchInfoOnCard(gTasks[taskId].data[2] | 0x10, matchNo); + } + } + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT / 2; i++) + { + if (i < 2) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_TrainerIconCardScrollUp; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2] ^ 1; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + gSprites[sBattleDomeStruct->arr[i]].data[3] = sBattleDomeStruct->arr[i]; + } + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_MonIconCardScrollUp; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2] ^ 1; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + } + } + } + for (i = DOME_TOURNAMENT_TRAINERS_COUNT / 2; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (i < 10) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_TrainerIconCardScrollUp; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2]; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + gSprites[sBattleDomeStruct->arr[i]].data[3] = sBattleDomeStruct->arr[i]; + } + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_MonIconCardScrollUp; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2]; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + } + } + } + + gTasks[taskId].data[0] = 4; + gTasks[taskId].data[5] = 0; + break; + case 2: + case 6: + if (gTasks[taskId].data[2]) + { + gBattle_BG0_X = 0; + gBattle_BG0_Y = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = -160; + } + else + { + gBattle_BG0_X = 0; + gBattle_BG0_Y = -160; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + } + + if (i == 2) + { + if (sBattleDomeStruct->unk_10 == 0) + { + gBattle_BG2_X = 0; + gBattle_BG2_Y = 160; + trainerTournamentId = gUnknown_0860D080[gTasks[taskId2].data[1]]; + DisplayTrainerInfoOnCard(gTasks[taskId].data[2] | 4, trainerTournamentId); + } + else + { + gBattle_BG2_X = 0; + gBattle_BG2_Y = 0; + trainerTournamentId = gUnknown_0860D080[gTasks[taskId2].data[1]]; + DisplayTrainerInfoOnCard(gTasks[taskId].data[2] | 4, trainerTournamentId); + sBattleDomeStruct->unk_10 = 0; + } + } + else + { + if (sBattleDomeStruct->unk_10 == 0) + { + matchNo = gTasks[taskId2].data[1] - 16; + sub_8192F08(matchNo, sBattleDomeStruct->unk_11); + gBattle_BG2_X = 0; + gBattle_BG2_Y = 160; + trainerTournamentId = sBattleDomeStruct->unk_11[0]; + DisplayTrainerInfoOnCard(gTasks[taskId].data[2] | 4, trainerTournamentId); + } + else if (sBattleDomeStruct->unk_10 == 2) + { + matchNo = gTasks[taskId2].data[1] - 16; + sub_8192F08(matchNo, sBattleDomeStruct->unk_11); + gBattle_BG2_X = 0; + gBattle_BG2_Y = 160; + trainerTournamentId = sBattleDomeStruct->unk_11[1]; + DisplayTrainerInfoOnCard(gTasks[taskId].data[2] | 4, trainerTournamentId); + } + else + { + gBattle_BG2_X = 256; + gBattle_BG2_Y = 0; + matchNo = gTasks[taskId2].data[1] - 16; + DisplayMatchInfoOnCard(gTasks[taskId].data[2] | 4, matchNo); + } + } + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT / 2; i++) + { + if (i < 2) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_TrainerIconCardScrollDown; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2] ^ 1; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + gSprites[sBattleDomeStruct->arr[i]].data[3] = sBattleDomeStruct->arr[i]; + } + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_MonIconCardScrollDown; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2] ^ 1; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + } + } + } + for (i = DOME_TOURNAMENT_TRAINERS_COUNT / 2; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (i < 10) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_TrainerIconCardScrollDown; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2]; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + gSprites[sBattleDomeStruct->arr[i]].data[3] = sBattleDomeStruct->arr[i]; + } + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_MonIconCardScrollDown; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2]; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + } + } + } + + gTasks[taskId].data[0] = 5; + gTasks[taskId].data[5] = 0; + break; + case 3: + if (gTasks[taskId].data[2]) + { + gBattle_BG0_X = 0; + gBattle_BG0_Y = 0; + gBattle_BG1_X = 256; + gBattle_BG1_Y = 0; + } + else + { + gBattle_BG0_X = 256; + gBattle_BG0_Y = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + } + + if (sBattleDomeStruct->unk_10 == 0) + { + gBattle_BG2_X = 256; + gBattle_BG2_Y = 160; + trainerTournamentId = gUnknown_0860D080[gTasks[taskId2].data[1]]; + DisplayTrainerInfoOnCard(gTasks[taskId].data[2] | 8, trainerTournamentId); + } + else + { + gBattle_BG2_X = 256; + gBattle_BG2_Y = 0; + matchNo = gUnknown_0860D15C[gTasks[taskId2].data[1]][sBattleDomeStruct->unk_10 - 1]; + DisplayMatchInfoOnCard(gTasks[taskId].data[2] | 8, matchNo); + } + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT / 2; i++) + { + if (i < 2) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_TrainerIconCardScrollLeft; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2] ^ 1; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + gSprites[sBattleDomeStruct->arr[i]].data[3] = sBattleDomeStruct->arr[i]; + } + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_MonIconCardScrollLeft; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2] ^ 1; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + } + } + } + for (i = DOME_TOURNAMENT_TRAINERS_COUNT / 2; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (i < 10) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_TrainerIconCardScrollLeft; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2]; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + gSprites[sBattleDomeStruct->arr[i]].data[3] = sBattleDomeStruct->arr[i]; + } + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_MonIconCardScrollLeft; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2]; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + } + } + } + + gTasks[taskId].data[0] = 6; + gTasks[taskId].data[5] = 0; + break; + case 7: + if (gTasks[taskId].data[2]) + { + gBattle_BG0_X = 0; + gBattle_BG0_Y = 0; + gBattle_BG1_X = 256; + gBattle_BG1_Y = 0; + } + else + { + gBattle_BG0_X = 256; + gBattle_BG0_Y = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + } + + if (sBattleDomeStruct->unk_10 == 0) + { + gBattle_BG2_X = 256; + gBattle_BG2_Y = 160; + trainerTournamentId = sBattleDomeStruct->unk_11[0]; + DisplayTrainerInfoOnCard(gTasks[taskId].data[2] | 8, trainerTournamentId); + } + else + { + gBattle_BG2_X = 0; + gBattle_BG2_Y = 160; + matchNo = gTasks[taskId2].data[1] - 16; + DisplayMatchInfoOnCard(gTasks[taskId].data[2] | 8, matchNo); + } + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT / 2; i++) + { + if (i < 2) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_TrainerIconCardScrollLeft; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2] ^ 1; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + gSprites[sBattleDomeStruct->arr[i]].data[3] = sBattleDomeStruct->arr[i]; + } + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_MonIconCardScrollLeft; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2] ^ 1; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + } + } + } + for (i = DOME_TOURNAMENT_TRAINERS_COUNT / 2; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (i < 10) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_TrainerIconCardScrollLeft; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2]; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + gSprites[sBattleDomeStruct->arr[i]].data[3] = sBattleDomeStruct->arr[i]; + } + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_MonIconCardScrollLeft; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2]; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + } + } + } + + gTasks[taskId].data[0] = 6; + gTasks[taskId].data[5] = 0; + break; + case 4: + if (gTasks[taskId].data[2]) + { + gBattle_BG0_X = 0; + gBattle_BG0_Y = 0; + gBattle_BG1_X = -256; + gBattle_BG1_Y = 0; + } + else + { + gBattle_BG0_X = -256; + gBattle_BG0_Y = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + } + + if (sBattleDomeStruct->unk_10 == 1) + { + gBattle_BG2_X = 0; + gBattle_BG2_Y = 160; + } + else + { + gBattle_BG2_X = 0; + gBattle_BG2_Y = 0; + } + matchNo = gUnknown_0860D15C[gTasks[taskId2].data[1]][sBattleDomeStruct->unk_10 - 1]; + DisplayMatchInfoOnCard(gTasks[taskId].data[2] | 2, matchNo); + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT / 2; i++) + { + if (i < 2) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_TrainerIconCardScrollRight; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2] ^ 1; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + gSprites[sBattleDomeStruct->arr[i]].data[3] = sBattleDomeStruct->arr[i]; + } + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_MonIconCardScrollRight; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2] ^ 1; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + } + } + } + for (i = DOME_TOURNAMENT_TRAINERS_COUNT / 2; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (i < 10) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_TrainerIconCardScrollRight; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2]; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + gSprites[sBattleDomeStruct->arr[i]].data[3] = sBattleDomeStruct->arr[i]; + } + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_MonIconCardScrollRight; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2]; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + } + } + } + + gTasks[taskId].data[0] = 7; + gTasks[taskId].data[5] = 0; + break; + case 8: + if (gTasks[taskId].data[2]) + { + gBattle_BG0_X = 0; + gBattle_BG0_Y = 0; + gBattle_BG1_X = -256; + gBattle_BG1_Y = 0; + } + else + { + gBattle_BG0_X = -256; + gBattle_BG0_Y = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + } + + if (sBattleDomeStruct->unk_10 == 2) + { + gBattle_BG2_X = 256; + gBattle_BG2_Y = 160; + trainerTournamentId = sBattleDomeStruct->unk_11[1]; + DisplayTrainerInfoOnCard(gTasks[taskId].data[2] | 2, trainerTournamentId); + } + else + { + gBattle_BG2_X = 0; + gBattle_BG2_Y = 160; + matchNo = gTasks[taskId2].data[1] - 16; + DisplayMatchInfoOnCard(gTasks[taskId].data[2] | 2, matchNo); + } + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT / 2; i++) + { + if (i < 2) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_TrainerIconCardScrollRight; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2] ^ 1; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + gSprites[sBattleDomeStruct->arr[i]].data[3] = sBattleDomeStruct->arr[i]; + } + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_MonIconCardScrollRight; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2] ^ 1; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + } + } + } + for (i = DOME_TOURNAMENT_TRAINERS_COUNT / 2; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (i < 10) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_TrainerIconCardScrollRight; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2]; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + gSprites[sBattleDomeStruct->arr[i]].data[3] = sBattleDomeStruct->arr[i]; + } + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + { + gSprites[sBattleDomeStruct->arr[i]].callback = SpriteCb_MonIconCardScrollRight; + gSprites[sBattleDomeStruct->arr[i]].data[0] = gTasks[taskId].data[2]; + gSprites[sBattleDomeStruct->arr[i]].data[1] = 0; + gSprites[sBattleDomeStruct->arr[i]].data[2] = i; + } + } + } + + gTasks[taskId].data[0] = 7; + gTasks[taskId].data[5] = 0; + break; + } + break; + case 4: + if (++gTasks[taskId].data[5] != 41) + { + gBattle_BG0_Y -= 4; + gBattle_BG1_Y -= 4; + gBattle_BG2_Y -= 4; + } + else + { + gTasks[taskId].data[0] = 2; + } + break; + case 5: + if (++gTasks[taskId].data[5] != 41) + { + gBattle_BG0_Y += 4; + gBattle_BG1_Y += 4; + gBattle_BG2_Y += 4; + } + else + { + gTasks[taskId].data[0] = 2; + } + break; + case 6: + if (++gTasks[taskId].data[5] != 65) + { + gBattle_BG0_X -= 4; + gBattle_BG1_X -= 4; + gBattle_BG2_X -= 4; + } + else + { + gTasks[taskId].data[0] = 2; + } + break; + case 7: + if (++gTasks[taskId].data[5] != 65) + { + gBattle_BG0_X += 4; + gBattle_BG1_X += 4; + gBattle_BG2_X += 4; + } + else + { + gTasks[taskId].data[0] = 2; + } + break; + case 8: + if (!gPaletteFade.active) + { + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT / 2; i++) + { + if (i < 2) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + FreeAndDestroyTrainerPicSprite(sBattleDomeStruct->arr[i]); + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + sub_80D2EF8(&gSprites[sBattleDomeStruct->arr[i]]); + } + } + for (i = DOME_TOURNAMENT_TRAINERS_COUNT / 2; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (i < 10) + { + if (sBattleDomeStruct->arr[i] != 0xFF) + FreeAndDestroyTrainerPicSprite(sBattleDomeStruct->arr[i]); + } + else + { + if (sBattleDomeStruct->arr[i] != 0xFF) + sub_80D2EF8(&gSprites[sBattleDomeStruct->arr[i]]); + } + } + + FreeMonIconPalettes(); + FREE_AND_SET_NULL(sBattleDomeStruct); + FreeAllWindowBuffers(); + if (r9 == 0) + { + SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic); + } + else + { + i = CreateTask(sub_8194220, 0); + gTasks[i].data[0] = 0; + gTasks[i].data[1] = 0; + gTasks[i].data[2] = 3; + gTasks[i].data[3] = gTasks[taskId].data[4]; + gTasks[i].data[4] = gTasks[taskId2].data[6]; + } + DestroyTask(taskId); + } + break; + } +} + +static u8 sub_819221C(u8 taskId) +{ + u8 retVal = 0; + s32 taskId2 = gTasks[taskId].data[4]; + s32 r5 = gTasks[taskId2].data[1]; + u8 r10 = gUnknown_0860D080[r5]; + u16 roundId = gSaveBlock2Ptr->frontier.field_CB2; + + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + retVal = 9; + + if (gTasks[taskId].data[3] == 0) + return retVal; + + if (gTasks[taskId].data[3] == 1) + { + if (gMain.newKeys & DPAD_UP && sBattleDomeStruct->unk_10 == 0) + { + if (r5 == 0) + r5 = 15; + else + r5--; + retVal = 1; + } + else if (gMain.newKeys & DPAD_DOWN && sBattleDomeStruct->unk_10 == 0) + { + if (r5 == 15) + r5 = 0; + else + r5++; + retVal = 2; + } + else if (gMain.newKeys & DPAD_LEFT && sBattleDomeStruct->unk_10 != 0) + { + sBattleDomeStruct->unk_10--; + retVal = 3; + } + else if (gMain.newKeys & DPAD_RIGHT) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[r10].isEliminated && sBattleDomeStruct->unk_10 - 1 < gSaveBlock2Ptr->frontier.domeTrainers[r10].eliminatedAt) + { + sBattleDomeStruct->unk_10++; + retVal = 4; + } + if (!gSaveBlock2Ptr->frontier.domeTrainers[r10].isEliminated && sBattleDomeStruct->unk_10 - 1 < roundId) + { + sBattleDomeStruct->unk_10++; + retVal = 4; + } + } + + if (retVal == 9) + { + if (sBattleDomeStruct->unk_10 != 0) + gTasks[taskId2].data[1] = gUnknown_0860D1A0[r5 / 2][sBattleDomeStruct->unk_10 - 1]; + else + gTasks[taskId2].data[1] = r5; + } + } + else + { + if (gMain.newKeys & DPAD_UP && sBattleDomeStruct->unk_10 == 1) + { + if (r5 == 16) + r5 = gUnknown_0860D19C[roundId]; + else + r5--; + retVal = 5; + } + else if (gMain.newKeys & DPAD_DOWN && sBattleDomeStruct->unk_10 == 1) + { + if (r5 == gUnknown_0860D19C[roundId]) + r5 = 16; + else + r5++; + retVal = 6; + } + else if (gMain.newKeys & DPAD_LEFT && sBattleDomeStruct->unk_10 != 0) + { + retVal = 7; + sBattleDomeStruct->unk_10--; + } + else if (gMain.newKeys & DPAD_RIGHT && (sBattleDomeStruct->unk_10 == 0 || sBattleDomeStruct->unk_10 == 1)) + { + retVal = 8; + sBattleDomeStruct->unk_10++; + } + + if (retVal == 9) + { + if (sBattleDomeStruct->unk_10 == 0) + gTasks[taskId2].data[1] = gUnknown_0860D1C0[sBattleDomeStruct->unk_11[0]]; + else if (sBattleDomeStruct->unk_10 == 2) + gTasks[taskId2].data[1] = gUnknown_0860D1C0[sBattleDomeStruct->unk_11[1]]; + else + gTasks[taskId2].data[1] = r5; + } + } + + if (retVal != 0 && retVal != 9) + { + PlaySE(SE_SELECT); + gTasks[taskId2].data[1] = r5; + gTasks[taskId].data[2] ^= 1; + } + + return retVal; +} + +static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTournamentId) +{ + struct TextSubPrinter textPrinter; + s32 i, j, k; + s32 trainerId = 0; + u8 nature = 0; + s32 arrId = 0; + s32 windowId = 0; + s32 x = 0, y = 0; + u8 palSlot = 0; + s16 *allocatedArray = AllocZeroed(sizeof(s16) * 18); + trainerId = gSaveBlock2Ptr->frontier.domeTrainers[trainerTournamentId].trainerId; + + if (flags & 1) + arrId = 8, windowId = 9, palSlot = 2; + if (flags & 2) + x = 256; + if (flags & 4) + y = 160; + if (flags & 8) + x = -256; + if (flags & 0x10) + y = -160; + + if (trainerId == TRAINER_PLAYER) + sBattleDomeStruct->arr[arrId] = CreateTrainerPicSprite(PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender), TRUE, x + 48, y + 64, palSlot + 12, 0xFFFF); + else if (trainerId == TRAINER_FRONTIER_BRAIN) + sBattleDomeStruct->arr[arrId] = CreateTrainerPicSprite(GetDomeBrainTrainerPicId(), TRUE, x + 48, y + 64, palSlot + 12, 0xFFFF); + else + sBattleDomeStruct->arr[arrId] = CreateTrainerPicSprite(GetFrontierTrainerFrontSpriteId(trainerId), TRUE, x + 48, y + 64, palSlot + 12, 0xFFFF); + + if (flags & 0x1E) + gSprites[sBattleDomeStruct->arr[arrId]].invisible = 1; + + for (i = 0; i < 3; i++) + { + if (trainerId == TRAINER_PLAYER) + { + sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i], + SpriteCb_MonIcon, + x | sInfoTrainerMonX[i], + y + sInfoTrainerMonY[i], + 0, 0, TRUE); + gSprites[sBattleDomeStruct->arr[2 + i + arrId]].oam.priority = 0; + } + else if (trainerId == TRAINER_FRONTIER_BRAIN) + { + sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i], + SpriteCb_MonIcon, + x | sInfoTrainerMonX[i], + y + sInfoTrainerMonY[i], + 0, 0, TRUE); + gSprites[sBattleDomeStruct->arr[2 + i + arrId]].oam.priority = 0; + } + else + { + sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]].species, + SpriteCb_MonIcon, + x | sInfoTrainerMonX[i], + y + sInfoTrainerMonY[i], + 0, 0, TRUE); + gSprites[sBattleDomeStruct->arr[2 + i + arrId]].oam.priority = 0; + } + + if (flags & 0x1E) + gSprites[sBattleDomeStruct->arr[2 + i + arrId]].invisible = 1; + } + textPrinter.fontId = 2; + textPrinter.x = 0; + textPrinter.y = 0; + textPrinter.currentX = textPrinter.x; + textPrinter.currentY = textPrinter.y; + textPrinter.letterSpacing = 2; + textPrinter.lineSpacing = 0; + textPrinter.fontColor_l = 0; + textPrinter.fgColor = 14; + textPrinter.bgColor = 0; + textPrinter.shadowColor = 13; + + i = 0; + if (trainerId == TRAINER_PLAYER) + j = gFacilityClassToTrainerClass[FACILITY_CLASS_PKMN_TRAINER_BRENDAN]; + else if (trainerId == TRAINER_FRONTIER_BRAIN) + j = GetDomeBrainTrainerClass(); + else + j = GetFrontierOpponentClass(trainerId); + + for (;gTrainerClassNames[j][i] != EOS; i++) + gStringVar1[i] = gTrainerClassNames[j][i]; + gStringVar1[i] = CHAR_SPACE; + gStringVar1[i + 1] = EOS; + + if (trainerId == TRAINER_PLAYER) + { + StringAppend(gStringVar1, gSaveBlock2Ptr->playerName); + } + else if (trainerId == TRAINER_FRONTIER_BRAIN) + { + CopyDomeBrainTrainerName(gStringVar2); + StringAppend(gStringVar1, gStringVar2); + } + else + { + CopyDomeTrainerName(gStringVar2, trainerId); + StringAppend(gStringVar1, gStringVar2); + } + + textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, gStringVar1, 0xD0, textPrinter.letterSpacing); + textPrinter.current_text_offset = gStringVar1; + textPrinter.windowId = windowId; + PutWindowTilemap(windowId); + CopyWindowToVram(windowId, 3); + AddTextPrinter(&textPrinter, 0, NULL); + textPrinter.letterSpacing = 0; + + for (i = 0; i < 3; i++) + { + textPrinter.currentY = gUnknown_0860D346[i]; + if (trainerId == TRAINER_PLAYER) + textPrinter.current_text_offset = gSpeciesNames[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]]; + else if (trainerId == TRAINER_FRONTIER_BRAIN) + textPrinter.current_text_offset = gSpeciesNames[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]]; + else + textPrinter.current_text_offset = gSpeciesNames[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]].species]; + + textPrinter.windowId = 1 + i + windowId; + if (i == 1) + textPrinter.currentX = 7; + else + textPrinter.currentX = 0; + + PutWindowTilemap(1 + i + windowId); + CopyWindowToVram(1 + i + windowId, 3); + AddTextPrinter(&textPrinter, 0, NULL); + } + + PutWindowTilemap(windowId + 4); + CopyWindowToVram(windowId + 4, 3); + if (trainerId == TRAINER_FRONTIER_BRAIN) + textPrinter.current_text_offset = gBattleDomePotentialPointers[16]; + else + textPrinter.current_text_offset = gBattleDomePotentialPointers[trainerTournamentId]; + + textPrinter.fontId = 1; + textPrinter.windowId = windowId + 4; + textPrinter.currentX = 0; + textPrinter.y = 4; + textPrinter.currentY = 4; + AddTextPrinter(&textPrinter, 0, NULL); + + for (i = 0; i < 3; i++) + { + for (j = 0; j < 4; j++) + { + for (k = 0; k < DOME_TOURNAMENT_TRAINERS_COUNT; k++) + { + if (trainerId == TRAINER_FRONTIER_BRAIN) + allocatedArray[k] += sMovePointsForDomeTrainers[sub_81A5060(i, j)][k]; + else if (trainerId == TRAINER_PLAYER) + allocatedArray[k] += sMovePointsForDomeTrainers[gSaveBlock2Ptr->frontier.field_EFC[i].moves[j]][k]; + else + allocatedArray[k] += sMovePointsForDomeTrainers[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]].moves[j]][k]; + } + } + } + + for (i = 0; i < ARRAY_COUNT(gUnknown_0860C988); i++) + { + s32 r4 = 0; + + for (k = 0, j = 0; j < DOME_TOURNAMENT_TRAINERS_COUNT; j++) + { + if (gUnknown_0860C988[i][j] != 0) + { + r4++; + if (allocatedArray[j] != 0 && allocatedArray[j] >= gUnknown_0860C988[i][j]) + k++; + } + } + if (r4 == k) + break; + } + + textPrinter.current_text_offset = gBattleDomeOpponentStylePointers[i]; + textPrinter.y = 20; + textPrinter.currentY = 20; + AddTextPrinter(&textPrinter, 0, NULL); + + for (i = 0; i < 18; i++) + allocatedArray[i] = 0; + + if (trainerId == TRAINER_FRONTIER_BRAIN || trainerId == TRAINER_PLAYER) + { + for (i = 0; i < 3; i++) + { + for (j = 0; j < 6; j++) + { + if (trainerId == TRAINER_FRONTIER_BRAIN) + allocatedArray[j] = sub_81A50F0(i, j); + else + allocatedArray[j] = gSaveBlock2Ptr->frontier.field_EFC[i].evs[j]; + } + allocatedArray[6] += allocatedArray[0]; + for (j = 0; j < 5; j++) + { + if (trainerId == TRAINER_FRONTIER_BRAIN) + nature = sub_81A50B0(i); + else + nature = gSaveBlock2Ptr->frontier.field_EFC[i].nature; + + if (gNatureStatTable[nature][j] > 0) + { + allocatedArray[j + 7] += (allocatedArray[j + 1] * 110) / 100; + } + else if (gNatureStatTable[nature][j] < 0) + { + allocatedArray[j + 7] += (allocatedArray[j + 1] * 90) / 100; + allocatedArray[j + 13]++; + } + else + { + allocatedArray[j + 7] += allocatedArray[j + 1]; + } + } + } + for (j = 0, i = 0; i < 6; i++) + j += allocatedArray[6 + i]; + for (i = 0; i < 6; i++) + allocatedArray[i] = (allocatedArray[6 + i] * 100) / j; + } + else + { + for (i = 0; i < 3; i++) + { + s32 evBits = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]].evSpread; + for (k = 0, j = 0; j < 6; j++) + { + allocatedArray[j] = 0; + if (evBits & 1) + k++; + evBits >>= 1; + } + k = MAX_TOTAL_EVS / k; + evBits = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]].evSpread; + for (j = 0; j < 6; j++) + { + if (evBits & 1) + allocatedArray[j] = k; + evBits >>= 1; + } + + allocatedArray[6] += allocatedArray[0]; + for (j = 0; j < 5; j++) + { + nature = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]].nature; + if (gNatureStatTable[nature][j] > 0) + { + allocatedArray[j + 7] += (allocatedArray[j + 1] * 110) / 100; + } + else if (gNatureStatTable[nature][j] < 0) + { + allocatedArray[j + 7] += (allocatedArray[j + 1] * 90) / 100; + allocatedArray[j + 13]++; + } + else + { + allocatedArray[j + 7] += allocatedArray[j + 1]; + } + } + } + for (j = 0, i = 0; i < 6; i++) + j += allocatedArray[i + 6]; + for (i = 0; i < 6; i++) + allocatedArray[i] = (allocatedArray[6 + i] * 100) / j; + } + + for (i = 0, j = 0, k = 0; k < 6; k++) + { + if (allocatedArray[k] > 29) + { + if (i == 2) + { + if (allocatedArray[6] < allocatedArray[k]) + { + if (allocatedArray[7] < allocatedArray[k]) + { + if (allocatedArray[6] < allocatedArray[7]) + { + allocatedArray[6] = allocatedArray[7]; + allocatedArray[7] = k; + } + else + { + allocatedArray[7] = k; + } + } + else + { + allocatedArray[6] = allocatedArray[7]; + allocatedArray[7] = k; + } + } + else + { + if (allocatedArray[7] < allocatedArray[k]) + allocatedArray[7] = k; + } + } + else + { + allocatedArray[i + 6] = k; + i++; + } + } + if (allocatedArray[k] == 0) + { + if (j == 2) + { + if (allocatedArray[k + 12] >= 2 + || ((allocatedArray[k + 12] == 1 && allocatedArray[12 + allocatedArray[8]] == 0 && allocatedArray[12 + allocatedArray[9]] == 0) + ) + ) + { + allocatedArray[8] = allocatedArray[9]; + allocatedArray[9] = k; + } + else if (allocatedArray[k + 12] == 1 && allocatedArray[12 + allocatedArray[8]] == 0) + { + allocatedArray[8] = allocatedArray[9]; + allocatedArray[9] = k; + } + else if (allocatedArray[k + 12] == 1 && allocatedArray[12 + allocatedArray[9]] == 0) + { + allocatedArray[9] = k; + } + } + else + { + allocatedArray[j + 8] = k; + j++; + } + } + } + + if (i == 2) + i = gUnknown_0860D349[allocatedArray[6]] + (allocatedArray[7] - (allocatedArray[6] + 1)); + else if (i == 1) + i = allocatedArray[6] + 15; + else if (j == 2) + i = gUnknown_0860D349[allocatedArray[8]] + (allocatedArray[9] - (allocatedArray[8] + 1)) + 21; + else if (j == 1) + i = allocatedArray[8] + 36; + else + i = 42; + + textPrinter.current_text_offset = gBattleDomeOpponentStatsPointers[i]; + textPrinter.y = 36; + textPrinter.currentY = 36; + AddTextPrinter(&textPrinter, 0, NULL); + Free(allocatedArray); +} + +static s32 sub_8192F08(u8 arg0, u8 *arg1) +{ + s32 i; + u8 tournamentId; + s32 retVal = 0; + s32 count = 0; + + for (i = gUnknown_0860D3C4[arg0][0]; i < gUnknown_0860D3C4[arg0][0] + gUnknown_0860D3C4[arg0][1]; i++) + { + tournamentId = gUnknown_0860D3B4[i]; + if (!gSaveBlock2Ptr->frontier.domeTrainers[tournamentId].isEliminated) + { + arg1[count] = tournamentId; + if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentId].trainerId == TRAINER_PLAYER) + StringCopy(gStringVar1, gSaveBlock2Ptr->playerName); + else if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentId].trainerId == TRAINER_FRONTIER_BRAIN) + CopyDomeBrainTrainerName(gStringVar1); + else + CopyDomeTrainerName(gStringVar1, gSaveBlock2Ptr->frontier.domeTrainers[tournamentId].trainerId); + count++; + } + } + + if (count == 2) + return 0; + + for (i = gUnknown_0860D3C4[arg0][0]; i < gUnknown_0860D3C4[arg0][0] + gUnknown_0860D3C4[arg0][1]; i++) + { + tournamentId = gUnknown_0860D3B4[i]; + if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentId].isEliminated + && gSaveBlock2Ptr->frontier.domeTrainers[tournamentId].eliminatedAt >= gUnknown_0860D3C4[arg0][2]) + { + arg1[count] = tournamentId; + count++; + if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentId].eliminatedAt == gUnknown_0860D3C4[arg0][2]) + { + StringCopy(gStringVar2, gMoveNames[gSaveBlock2Ptr->frontier.field_EC0[tournamentId]]); + retVal = gSaveBlock2Ptr->frontier.domeTrainers[tournamentId].unk3 * 2; + if (gSaveBlock2Ptr->frontier.field_EC0[tournamentId] == 0 && gSaveBlock2Ptr->frontier.domeTrainers[tournamentId].unk3 == 0) + retVal = 4; + } + else + { + if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentId].trainerId == TRAINER_PLAYER) + StringCopy(gStringVar1, gSaveBlock2Ptr->playerName); + else if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentId].trainerId == TRAINER_FRONTIER_BRAIN) + CopyDomeBrainTrainerName(gStringVar1); + else + CopyDomeTrainerName(gStringVar1, gSaveBlock2Ptr->frontier.domeTrainers[tournamentId].trainerId); + } + } + + if (count == 2) + break; + } + + if (arg0 == 14) + return retVal + 2; + else + return retVal + 1; +} + +static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo) +{ + struct TextSubPrinter textPrinter; + s32 tournamentIds[2]; + s32 trainerIds[2]; + bool32 lost[2]; + s32 i; + s32 winStringId = 0; + s32 arrId = 0; + s32 windowId = 0; + s32 x = 0, y = 0; + u8 palSlot = 0; + + if (flags & 1) + arrId = 8, windowId = 9, palSlot = 2; + if (flags & 2) + x = 256; + if (flags & 4) + y = 160; + if (flags & 8) + x = -256; + if (flags & 0x10) + y = -160; + + // Copy trainers information to handy arrays. + winStringId = sub_8192F08(matchNo, sBattleDomeStruct->unk_11); + for (i = 0; i < 2; i++) + { + tournamentIds[i] = sBattleDomeStruct->unk_11[i]; + trainerIds[i] = gSaveBlock2Ptr->frontier.domeTrainers[tournamentIds[i]].trainerId; + if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentIds[i]].eliminatedAt <= gUnknown_0860D3C4[matchNo][2] + && gSaveBlock2Ptr->frontier.domeTrainers[tournamentIds[i]].isEliminated) + lost[i] = TRUE; + else + lost[i] = FALSE; + } + + // Draw first trainer sprite. + if (trainerIds[0] == TRAINER_PLAYER) + sBattleDomeStruct->arr[arrId] = CreateTrainerPicSprite(PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender), TRUE, x + 48, y + 88, palSlot + 12, 0xFFFF); + else if (trainerIds[0] == TRAINER_FRONTIER_BRAIN) + sBattleDomeStruct->arr[arrId] = CreateTrainerPicSprite(GetDomeBrainTrainerPicId(), TRUE, x + 48, y + 88, palSlot + 12, 0xFFFF); + else + sBattleDomeStruct->arr[arrId] = CreateTrainerPicSprite(GetFrontierTrainerFrontSpriteId(trainerIds[0]), TRUE, x + 48, y + 88, palSlot + 12, 0xFFFF); + + if (flags & 0x1E) + gSprites[sBattleDomeStruct->arr[arrId]].invisible = 1; + if (lost[0]) + gSprites[sBattleDomeStruct->arr[arrId]].oam.paletteNum = 3; + + // Draw second trainer sprite. + if (trainerIds[1] == TRAINER_PLAYER) + sBattleDomeStruct->arr[1 + arrId] = CreateTrainerPicSprite(PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender), TRUE, x + 192, y + 88, palSlot + 13, 0xFFFF); + else if (trainerIds[1] == TRAINER_FRONTIER_BRAIN) + sBattleDomeStruct->arr[1 + arrId] = CreateTrainerPicSprite(GetDomeBrainTrainerPicId(), TRUE, x + 192, y + 88, palSlot + 13, 0xFFFF); + else + sBattleDomeStruct->arr[1 + arrId] = CreateTrainerPicSprite(GetFrontierTrainerFrontSpriteId(trainerIds[1]), TRUE, x + 192, y + 88, palSlot + 13, 0xFFFF); + + if (flags & 0x1E) + gSprites[sBattleDomeStruct->arr[1 + arrId]].invisible = 1; + if (lost[1]) + gSprites[sBattleDomeStruct->arr[1 + arrId]].oam.paletteNum = 3; + + // Draw first trainer's pokemon icons. + for (i = 0; i < 3; i++) + { + if (trainerIds[0] == TRAINER_PLAYER) + { + sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonId[tournamentIds[0]][i], + SpriteCb_MonIcon, + x | sFirstTrainerMonX[i], + y + sFirstTrainerMonY[i], + 0, 0, TRUE); + gSprites[sBattleDomeStruct->arr[2 + i + arrId]].oam.priority = 0; + } + else if (trainerIds[0] == TRAINER_FRONTIER_BRAIN) + { + sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonId[tournamentIds[0]][i], + SpriteCb_MonIcon, + x | sFirstTrainerMonX[i], + y + sFirstTrainerMonY[i], + 0, 0, TRUE); + gSprites[sBattleDomeStruct->arr[2 + i + arrId]].oam.priority = 0; + } + else + { + sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentIds[0]][i]].species, + SpriteCb_MonIcon, + x | sFirstTrainerMonX[i], + y + sFirstTrainerMonY[i], + 0, 0, TRUE); + gSprites[sBattleDomeStruct->arr[2 + i + arrId]].oam.priority = 0; + } + + if (flags & 0x1E) + gSprites[sBattleDomeStruct->arr[2 + i + arrId]].invisible = 1; + if (lost[0]) + { + gSprites[sBattleDomeStruct->arr[2 + i + arrId]].oam.paletteNum = 3; + gSprites[sBattleDomeStruct->arr[2 + i + arrId]].sMonIconStill = TRUE; + } + } + + // Draw second trainer's pokemon icons. + for (i = 0; i < 3; i++) + { + if (trainerIds[1] == TRAINER_PLAYER) + { + sBattleDomeStruct->arr[5 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonId[tournamentIds[1]][i], + SpriteCb_MonIcon, + x | sSecondTrainerMonX[i], + y + sSecondTrainerMonY[i], + 0, 0, TRUE); + gSprites[sBattleDomeStruct->arr[5 + i + arrId]].oam.priority = 0; + } + else if (trainerIds[1] == TRAINER_FRONTIER_BRAIN) + { + sBattleDomeStruct->arr[5 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonId[tournamentIds[1]][i], + SpriteCb_MonIcon, + x | sSecondTrainerMonX[i], + y + sSecondTrainerMonY[i], + 0, 0, TRUE); + gSprites[sBattleDomeStruct->arr[5 + i + arrId]].oam.priority = 0; + } + else + { + sBattleDomeStruct->arr[5 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentIds[1]][i]].species, + SpriteCb_MonIcon, + x | sSecondTrainerMonX[i], + y + sSecondTrainerMonY[i], + 0, 0, TRUE); + gSprites[sBattleDomeStruct->arr[5 + i + arrId]].oam.priority = 0; + } + + if (flags & 0x1E) + gSprites[sBattleDomeStruct->arr[5 + i + arrId]].invisible = 1; + if (lost[1]) + { + gSprites[sBattleDomeStruct->arr[5 + i + arrId]].oam.paletteNum = 3; + gSprites[sBattleDomeStruct->arr[5 + i + arrId]].sMonIconStill = TRUE; + } + } + + // Print the win string (or 'Let the battle begin!' one). + textPrinter.x = 0; + textPrinter.y = 2; + textPrinter.currentX = textPrinter.x; + textPrinter.currentY = textPrinter.y; + textPrinter.letterSpacing = 0; + textPrinter.lineSpacing = 0; + textPrinter.fontColor_l = 0; + textPrinter.fgColor = 14; + textPrinter.bgColor = 0; + textPrinter.shadowColor = 13; + StringExpandPlaceholders(gStringVar4, gBattleDomeWinStringsPointers[winStringId]); + textPrinter.current_text_offset = gStringVar4; + textPrinter.windowId = windowId + 8; + textPrinter.fontId = 1; + PutWindowTilemap(windowId + 8); + CopyWindowToVram(windowId + 8, 3); + textPrinter.currentX = 0; + textPrinter.currentY = textPrinter.y = 0; + AddTextPrinter(&textPrinter, 0, NULL); + + // Print first trainer's name. + if (trainerIds[0] == TRAINER_PLAYER) + StringCopy(gStringVar1, gSaveBlock2Ptr->playerName); + else if (trainerIds[0] == TRAINER_FRONTIER_BRAIN) + CopyDomeBrainTrainerName(gStringVar1); + else + CopyDomeTrainerName(gStringVar1, trainerIds[0]); + + textPrinter.fontId = 2; + textPrinter.letterSpacing = 2; + textPrinter.current_text_offset = gStringVar1; + textPrinter.windowId = windowId + 6; + textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.current_text_offset, 0x40, textPrinter.letterSpacing); + textPrinter.currentY = textPrinter.y = 2; + PutWindowTilemap(windowId + 6); + CopyWindowToVram(windowId + 6, 3); + AddTextPrinter(&textPrinter, 0, NULL); + + // Print second trainer's name. + if (trainerIds[1] == TRAINER_PLAYER) + StringCopy(gStringVar1, gSaveBlock2Ptr->playerName); + else if (trainerIds[1] == TRAINER_FRONTIER_BRAIN) + CopyDomeBrainTrainerName(gStringVar1); + else + CopyDomeTrainerName(gStringVar1, trainerIds[1]); + + textPrinter.current_text_offset = gStringVar1; + textPrinter.windowId = windowId + 7; + textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.current_text_offset, 0x40, textPrinter.letterSpacing); + textPrinter.currentY = textPrinter.y = 2; + PutWindowTilemap(windowId + 7); + CopyWindowToVram(windowId + 7, 3); + AddTextPrinter(&textPrinter, 0, NULL); + + // Print match number. + textPrinter.letterSpacing = 0; + textPrinter.current_text_offset = gBattleDomeMatchNumberPointers[matchNo]; + textPrinter.windowId = windowId + 5; + textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.current_text_offset, 0xA0, textPrinter.letterSpacing); + textPrinter.currentY = textPrinter.y = 2; + PutWindowTilemap(windowId + 5); + CopyWindowToVram(windowId + 5, 3); + AddTextPrinter(&textPrinter, 0, NULL); +} + +static void sub_81938A4(void) +{ + u8 taskId = CreateTask(sub_8194220, 0); + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = 0; + gTasks[taskId].data[2] = 2; + gTasks[taskId].data[4] = 0; + SetMainCallback2(CB2_BattleDome); +} + +static void sub_81938E0(void) +{ + u8 taskId; + + sub_8194D48(); + gSaveBlock2Ptr->frontier.lvlMode = gSaveBlock2Ptr->frontier.field_D0A - 1; + gSaveBlock2Ptr->frontier.field_CB2 = 3; + taskId = CreateTask(sub_8194220, 0); + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = 0; + gTasks[taskId].data[2] = 2; + gTasks[taskId].data[4] = 1; + SetMainCallback2(CB2_BattleDome); +} + +static void sub_819395C(u8 taskId) +{ + u8 newTaskId = 0; + s32 spriteId = gTasks[taskId].data[1]; + + switch (gTasks[taskId].data[0]) + { + case 0: + if (!gPaletteFade.active) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + gTasks[taskId].data[0] = 1; + StartSpriteAnim(&gSprites[spriteId], 1); + } + break; + case 1: + if (!gPaletteFade.active) + gTasks[taskId].data[0] = 2; + break; + case 2: + switch (sub_8193BDC(taskId)) + { + case 0: + default: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + gTasks[taskId].data[0] = 7; + break; + case 1: + break; + case 2: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + gTasks[taskId].data[0] = 3; + break; + case 3: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + gTasks[taskId].data[0] = 5; + break; + } + break; + case 3: + if (!gPaletteFade.active) + { + FreeAllWindowBuffers(); + ScanlineEffect_Stop(); + FREE_AND_SET_NULL(sTilemapBuffer); + newTaskId = CreateTask(sub_8190400, 0); + gTasks[newTaskId].data[0] = 0; + gTasks[newTaskId].data[1] = gUnknown_0860D080[spriteId]; + gTasks[newTaskId].data[2] = 1; + gTasks[newTaskId].data[3] = taskId; + + gTasks[taskId].data[0] = 4; + sBattleDomeStruct->unk_10 = 0; + } + break; + case 4: + break; + case 5: + if (!gPaletteFade.active) + { + FreeAllWindowBuffers(); + ScanlineEffect_Stop(); + FREE_AND_SET_NULL(sTilemapBuffer); + newTaskId = CreateTask(sub_8190400, 0); + gTasks[newTaskId].data[0] = 0; + gTasks[newTaskId].data[1] = spriteId - 16; + gTasks[newTaskId].data[2] = 2; + gTasks[newTaskId].data[3] = taskId; + + gTasks[taskId].data[0] = 6; + } + break; + case 6: + break; + case 7: + if (!gPaletteFade.active) + { + FreeAllWindowBuffers(); + ScanlineEffect_Stop(); + FREE_AND_SET_NULL(sTilemapBuffer); + SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic); + DestroyTask(gTasks[taskId].data[7]); + DestroyTask(taskId); + } + break; + } +} + +static u8 sub_8193BDC(u8 taskId) +{ + u8 retVal = 1; + s32 arrId = 4; + s32 spriteId = gTasks[taskId].data[1]; + s32 roundId = gSaveBlock2Ptr->frontier.field_CB2; + + if (gMain.newKeys == B_BUTTON || (gMain.newKeys & A_BUTTON && spriteId == 31)) + { + PlaySE(SE_SELECT); + retVal = 0; + } + else if (gMain.newKeys & A_BUTTON) + { + if (spriteId < 16) + { + PlaySE(SE_SELECT); + retVal = 2; + } + else + { + PlaySE(SE_SELECT); + retVal = 3; + } + } + else + { + if (gMain.newKeys == DPAD_UP && gUnknown_0860CBF1[spriteId][roundId][0] != 0xFF) + arrId = 0; + else if (gMain.newKeys == DPAD_DOWN && gUnknown_0860CBF1[spriteId][roundId][1] != 0xFF) + arrId = 1; + else if (gMain.newKeys == DPAD_LEFT && gUnknown_0860CBF1[spriteId][roundId][2] != 0xFF) + arrId = 2; + else if (gMain.newKeys == DPAD_RIGHT && gUnknown_0860CBF1[spriteId][roundId][3] != 0xFF) + arrId = 3; + } + + if (arrId != 4) + { + PlaySE(SE_SELECT); + StartSpriteAnim(&gSprites[spriteId], 0); + spriteId = gUnknown_0860CBF1[spriteId][roundId][arrId]; + StartSpriteAnim(&gSprites[spriteId], 1); + gTasks[taskId].data[1] = spriteId; + } + + return retVal; +} + +static void sub_8193D40(void) +{ + u8 taskId = CreateTask(sub_8194220, 0); + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = 1; + gTasks[taskId].data[2] = 2; + gTasks[taskId].data[4] = 0; + SetMainCallback2(CB2_BattleDome); +} + +static void sub_8193D7C(void) +{ + s32 i; + + if (gSpecialVar_0x8005 == 1) + { + gSaveBlock2Ptr->frontier.domeTrainers[TrainerIdToTournamentId(gTrainerBattleOpponent_A)].isEliminated = 1; + gSaveBlock2Ptr->frontier.domeTrainers[TrainerIdToTournamentId(gTrainerBattleOpponent_A)].eliminatedAt = gSaveBlock2Ptr->frontier.field_CB2; + gSaveBlock2Ptr->frontier.field_EC0[TrainerIdToTournamentId(gTrainerBattleOpponent_A)] = gBattleResults.lastUsedMovePlayer; + if (gSaveBlock2Ptr->frontier.field_CB2 < DOME_FINAL) + DecideRoundWinners(gSaveBlock2Ptr->frontier.field_CB2); + } + else + { + gSaveBlock2Ptr->frontier.domeTrainers[TrainerIdToTournamentId(TRAINER_PLAYER)].isEliminated = 1; + gSaveBlock2Ptr->frontier.domeTrainers[TrainerIdToTournamentId(TRAINER_PLAYER)].eliminatedAt = gSaveBlock2Ptr->frontier.field_CB2; + gSaveBlock2Ptr->frontier.field_EC0[TrainerIdToTournamentId(TRAINER_PLAYER)] = gBattleResults.lastUsedMoveOpponent; + if (gBattleOutcome == B_OUTCOME_FORFEITED || gSpecialVar_0x8005 == 9) + gSaveBlock2Ptr->frontier.domeTrainers[TrainerIdToTournamentId(TRAINER_PLAYER)].unk3 = 1; + for (i = gSaveBlock2Ptr->frontier.field_CB2; i < DOME_ROUNDS_COUNT; i++) + DecideRoundWinners(i); + } +} + +static u16 GetWinningMove(s32 winnerTournamentId, s32 loserTournamentId, u8 roundId) +{ + s32 i, j, k; + s32 moveScores[4 * 3]; + u16 moveIds[4 * 3]; + u16 bestScore = 0; + u16 bestId = 0; + s32 movePower = 0; + GetFacilityEnemyMonLevel(); // Unused return variable. + + // Calc move points of all 4 moves for all 3 pokemon hitting all 3 target mons. + for (i = 0; i < 3; i++) + { + for (j = 0; j < 4; j++) + { + moveScores[i * 4 + j] = 0; + if (gSaveBlock2Ptr->frontier.domeTrainers[winnerTournamentId].trainerId == TRAINER_FRONTIER_BRAIN) + moveIds[i * 4 + j] = sub_81A5060(i, j); + else + moveIds[i * 4 + j] = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[winnerTournamentId][i]].moves[j]; + + movePower = gBattleMoves[moveIds[i * 4 + j]].power; + if (movePower == 0) + movePower = 40; + else if (movePower == 1) + movePower = 60; + else if (moveIds[i * 4 + j] == MOVE_SELF_DESTRUCT || moveIds[i * 4 + j] == MOVE_EXPLOSION) + movePower /= 2; + + for (k = 0; k < 3; k++) + { + u32 var = 0; + u32 targetSpecies = 0; + u32 targetAbility = 0; + do + { + var = Random32(); + } while (gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[loserTournamentId][k]].nature != GetNatureFromPersonality(var)); + + targetSpecies = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[loserTournamentId][k]].species; + if (var & 1) + targetAbility = gBaseStats[targetSpecies].ability2; + else + targetAbility = gBaseStats[targetSpecies].ability1; + + var = AI_TypeCalc(moveIds[i * 4 + j], targetSpecies, targetAbility); + if (var & MOVE_RESULT_NOT_VERY_EFFECTIVE && var & MOVE_RESULT_SUPER_EFFECTIVE) + moveScores[i * 4 + j] += movePower; + else if (var & MOVE_RESULT_NO_EFFECT) + moveScores[i * 4 + j] += 0; + else if (var & MOVE_RESULT_SUPER_EFFECTIVE) + moveScores[i * 4 + j] += movePower * 2; + else if (var & MOVE_RESULT_NOT_VERY_EFFECTIVE) + moveScores[i * 4 + j] += movePower / 2; + else + moveScores[i * 4 + j] += movePower; + } + + if (bestScore < moveScores[i * 4 + j]) + { + bestId = i * 4 + j; + bestScore = moveScores[i * 4 + j]; + } + else if (bestScore == moveScores[i * 4 + j]) + { + if (moveIds[bestId] < moveIds[i * 4 + j]) // Why not use (Random() & 1) instead of promoting moves with a higher id? + bestId = i * 4 + j; + } + } + } + + j = bestId; + goto LABEL; + while (j != 0) + { + for (j = 0, k = 0; k < 4 * 3; k++) + { + if (bestScore < moveScores[k]) + { + j = k; + bestScore = moveScores[k]; + } + else if (bestScore == moveScores[k] && moveIds[j] < moveIds[k]) + { + j = k; + } + } + if (i == roundId - 1) + break; + LABEL: + { + for (i = 0; i < roundId - 1; i++) + { + if (gSaveBlock2Ptr->frontier.field_EC0[sub_81953E8(winnerTournamentId, i)] == moveIds[j]) + break; + } + if (i == roundId - 1) + break; + + moveScores[j] = 0; + bestScore = 0; + j = 0; + for (k = 0; k < 4 * 3; k++) + j += moveScores[k]; + } + } + + if (moveScores[j] == 0) + j = bestId; + + return moveIds[j]; +} + +static void sub_8194220(u8 taskId) +{ + s32 i; + struct TextSubPrinter textPrinter; + s32 r10 = gTasks[taskId].data[1]; + s32 r4 = gTasks[taskId].data[2]; + + switch (gTasks[taskId].data[0]) + { + case 0: + SetHBlankCallback(NULL); + SetVBlankCallback(NULL); + EnableInterrupts(INTR_FLAG_HBLANK | INTR_FLAG_VBLANK); + CpuFill32(0, (void *)VRAM, VRAM_SIZE); + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, gUnknown_0860CE74, ARRAY_COUNT(gUnknown_0860CE74)); + InitWindows(gUnknown_0860CE94); + DeactivateAllTextPrinters(); + gBattle_BG0_X = 0; + gBattle_BG0_Y = 0; + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + ChangeBgX(2, 0, 0); + ChangeBgY(2, 0, 0); + ChangeBgX(3, 0, 0); + ChangeBgY(3, 0xB00, 0); + gTasks[taskId].data[0]++; + break; + case 1: + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); + SetGpuReg(REG_OFFSET_MOSAIC, 0); + SetGpuReg(REG_OFFSET_WIN0H, 0x5860); + SetGpuReg(REG_OFFSET_WIN0V, 0x9F); + SetGpuReg(REG_OFFSET_WIN1H, 0x9098); + SetGpuReg(REG_OFFSET_WIN1V, 0x9F); + SetGpuReg(REG_OFFSET_WININ, 0); + SetGpuReg(REG_OFFSET_WINOUT, 0x3F); + ResetPaletteFade(); + ResetSpriteData(); + FreeAllSpritePalettes(); + gTasks[taskId].data[0]++; + break; + case 2: + sTilemapBuffer = AllocZeroed(0x800); + LZDecompressWram(gUnknown_08D83900, sTilemapBuffer); + SetBgTilemapBuffer(1, sTilemapBuffer); + CopyBgTilemapBufferToVram(1); + DecompressAndLoadBgGfxUsingHeap(1, gUnknown_08D82F10, 0x2000, 0, 0); + DecompressAndLoadBgGfxUsingHeap(2, gUnknown_08D834FC, 0x2000, 0, 0); + DecompressAndLoadBgGfxUsingHeap(2, gUnknown_08D83B2C, 0x2000, 0, 1); + DecompressAndLoadBgGfxUsingHeap(3, gUnknown_08D83C3C, 0x2000, 0, 1); + LoadCompressedPalette(gUnknown_08D85358, 0, 0x200); + LoadCompressedPalette(gUnknown_08D85444, 0x100, 0x200); + LoadCompressedPalette(gUnknown_08D85600, 0xF0, 0x20); + CpuFill32(0, gPlttBufferFaded, 0x400); + ShowBg(0); + ShowBg(1); + ShowBg(2); + ShowBg(3); + gTasks[taskId].data[0]++; + break; + case 3: + LoadCompressedObjectPic(gUnknown_0860CF50); + if (r10 == 0) + { + for (i = 0; i < (unsigned) 31; i++) + CreateSprite(&gUnknown_0860CFA8, gUnknown_0860D411[i][0], gUnknown_0860D411[i][1], 0); + if (gTasks[taskId].data[4]) + CreateSprite(&gUnknown_0860D008, 218, 12, 0); + else + CreateSprite(&gUnknown_0860CFD8, 218, 12, 0); + } + + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON | DISPCNT_WIN1_ON | DISPCNT_OBJ_1D_MAP); + gTasks[taskId].data[0]++; + break; + case 4: + textPrinter.fontId = 2; + textPrinter.current_text_offset = gText_BattleTourney; + textPrinter.windowId = 2; + textPrinter.x = 0; + textPrinter.y = 0; + textPrinter.letterSpacing = 2; + textPrinter.lineSpacing = 0; + textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.current_text_offset, 0x70, textPrinter.letterSpacing); + textPrinter.currentY = 1; + textPrinter.fontColor_l = 0; + textPrinter.fgColor = 14; + textPrinter.bgColor = 0; + textPrinter.shadowColor = 13; + AddTextPrinter(&textPrinter, 0, NULL); + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + s32 var, var2; + + CopyDomeTrainerName(gDisplayedStringBattle, gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId); + if (r10 == 1) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[i].isEliminated) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[i].eliminatedAt != 0) + { + var2 = gSaveBlock2Ptr->frontier.domeTrainers[i].eliminatedAt - 1; + sub_81948EC(i, var2); + } + } + else if (gSaveBlock2Ptr->frontier.field_CB2 != DOME_ROUND2) + { + sub_81948EC(i, gSaveBlock2Ptr->frontier.field_CB2 - 2); + } + } + else if (r10 == 0) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[i].isEliminated) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[i].eliminatedAt != 0) + { + var2 = gSaveBlock2Ptr->frontier.domeTrainers[i].eliminatedAt - 1; + sub_81948EC(i, var2); + } + } + else if (gSaveBlock2Ptr->frontier.field_CB2 != DOME_ROUND1) + { + if (gTasks[taskId].data[4]) + var2 = gSaveBlock2Ptr->frontier.field_CB2; + else + var2 = gSaveBlock2Ptr->frontier.field_CB2 - 1; + sub_81948EC(i, var2); + } + } + + if (gTasks[taskId].data[4]) + var = gSaveBlock2Ptr->frontier.field_CB2; + else + var = gSaveBlock2Ptr->frontier.field_CB2 - 1; + + if ( ((r10 == 1 && gSaveBlock2Ptr->frontier.domeTrainers[i].eliminatedAt < gSaveBlock2Ptr->frontier.field_CB2 - 1) + || (r10 == 0 && gSaveBlock2Ptr->frontier.domeTrainers[i].eliminatedAt <= var)) + && gSaveBlock2Ptr->frontier.domeTrainers[i].isEliminated) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId == TRAINER_PLAYER) + { + textPrinter.fgColor = 3; + textPrinter.shadowColor = 4; + } + else + { + textPrinter.fgColor = 11; + textPrinter.shadowColor = 13; + } + } + else + { + if (gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId == TRAINER_PLAYER) + { + textPrinter.fgColor = 3; + textPrinter.shadowColor = 4; + } + else + { + textPrinter.fgColor = 14; + textPrinter.shadowColor = 13; + } + } + + if (gUnknown_0860D3F1[i][0] == 0) + textPrinter.currentX = GetStringWidthDifference(textPrinter.fontId, gDisplayedStringBattle, 0x3D, textPrinter.letterSpacing); + else + textPrinter.currentX = 3; + textPrinter.current_text_offset = gDisplayedStringBattle; + textPrinter.windowId = gUnknown_0860D3F1[i][0]; + textPrinter.currentY = gUnknown_0860D3F1[i][1]; + AddTextPrinter(&textPrinter, 0, NULL); + } + gTasks[taskId].data[0]++; + break; + case 5: + PutWindowTilemap(0); + PutWindowTilemap(1); + PutWindowTilemap(2); + CopyWindowToVram(0, 3); + CopyWindowToVram(1, 3); + CopyWindowToVram(2, 3); + SetHBlankCallback(HblankCb_BattleDome); + SetVBlankCallback(VblankCb1_BattleDome); + if (r4 == 2) + { + if (r10 == 0) + { + i = CreateTask(sub_819395C, 0); + gTasks[i].data[0] = r10; + gTasks[i].data[1] = r10; + gTasks[i].data[6] = gTasks[taskId].data[4]; + } + else + { + i = CreateTask(sub_8194950, 0); + gTasks[i].data[0] = 0; + } + } + else + { + i = gTasks[taskId].data[3]; + gTasks[i].data[0] = 0; + } + ScanlineEffect_Clear(); + for (i = 0; i < 91; i++) + { + gScanlineEffectRegBuffers[0][i] = 0x1F0A; + gScanlineEffectRegBuffers[1][i] = 0x1F0A; + } + for (i = 91; i < 160; i++) + { + asm(""::"r"(i)); + gScanlineEffectRegBuffers[0][i] = 0x1F09; + gScanlineEffectRegBuffers[1][i] = 0x1F09; + } + ScanlineEffect_SetParams(gUnknown_0860CF44); + DestroyTask(taskId); + break; + } +} + +static void sub_81948EC(u8 tournamentId, u8 arg1) +{ + s32 i; + const struct UnkStruct_860DD10 *structPtr = gUnknown_0860DD10[tournamentId][arg1]; + + for (i = 0; i < gUnknown_0860DE10[tournamentId][arg1]; i++) + CopyToBgTilemapBufferRect_ChangePalette(1, &structPtr[i].src, structPtr[i].x, structPtr[i].y, 1, 1, 0x11); + + CopyBgTilemapBufferToVram(1); +} + +static void sub_8194950(u8 taskId) +{ + s32 i; + struct TextSubPrinter textPrinter; + + switch (gTasks[taskId].data[0]) + { + case 0: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + gTasks[taskId].data[0] = 1; + break; + case 1: + if (!gPaletteFade.active) + { + gTasks[taskId].data[0] = 2; + gTasks[taskId].data[3] = 64; + textPrinter.fontId = 2; + textPrinter.x = 0; + textPrinter.y = 0; + textPrinter.letterSpacing = 2; + textPrinter.lineSpacing = 0; + textPrinter.fontColor_l = 0; + textPrinter.fgColor = 11; + textPrinter.bgColor = 0; + textPrinter.shadowColor = 13; + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + CopyDomeTrainerName(gDisplayedStringBattle, gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId); + if (gSaveBlock2Ptr->frontier.domeTrainers[i].eliminatedAt == gSaveBlock2Ptr->frontier.field_CB2 - 1 + && gSaveBlock2Ptr->frontier.domeTrainers[i].isEliminated) + { + if (gUnknown_0860D3F1[i][0] == 0) + textPrinter.currentX = GetStringWidthDifference(textPrinter.fontId, gDisplayedStringBattle, 0x3D, textPrinter.letterSpacing); + else + textPrinter.currentX = 3; + + textPrinter.current_text_offset = gDisplayedStringBattle; + textPrinter.windowId = gUnknown_0860D3F1[i][0]; + textPrinter.currentY = gUnknown_0860D3F1[i][1]; + AddTextPrinter(&textPrinter, 0, NULL); + } + if (!gSaveBlock2Ptr->frontier.domeTrainers[i].isEliminated) + { + s32 var = gSaveBlock2Ptr->frontier.field_CB2 - 1; + sub_81948EC(i, var); + } + } + } + break; + case 2: + if (--gTasks[taskId].data[3] == 0) + gTasks[taskId].data[0] = 3; + break; + case 3: + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + gTasks[taskId].data[0] = 4; + } + break; + case 4: + if (!gPaletteFade.active) + { + SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic); + DestroyTask(taskId); + } + break; + } +} + +static void CB2_BattleDome(void) +{ + AnimateSprites(); + BuildOamBuffer(); + RunTextPrinters(); + UpdatePaletteFade(); + RunTasks(); +} + +static void VblankCb0_BattleDome(void) +{ + ChangeBgX(3, 0x80, 1); + ChangeBgY(3, 0x80, 2); + SetGpuReg(REG_OFFSET_BG0HOFS, gBattle_BG0_X); + SetGpuReg(REG_OFFSET_BG0VOFS, gBattle_BG0_Y); + SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); + SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); + SetGpuReg(REG_OFFSET_BG2HOFS, gBattle_BG2_X); + SetGpuReg(REG_OFFSET_BG2VOFS, gBattle_BG2_Y); + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); +} + +#define SET_WIN0H_WIN1H(win0H, win1H) \ +{ \ + *(vu32*)(REG_ADDR_WIN0H) = ((win0H << 16) | (win1H)); \ +} + +static void HblankCb_BattleDome(void) +{ + register u32 vCount asm("r0") = REG_VCOUNT; + register u32 vCount_ asm("r1") = vCount; + if (vCount > 41) + { + if (vCount < 50) + { + REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR; + SET_WIN0H_WIN1H(WINHV_COORDS(152, 155), WINHV_COORDS(85, 88)); + return; + } + else if (vCount > 57) + { + if (vCount < 75) + { + REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR; + SET_WIN0H_WIN1H(WINHV_COORDS(144, 152), WINHV_COORDS(88, 96)); + return; + } + else if (vCount < 82) + { + REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR; + SET_WIN0H_WIN1H(WINHV_COORDS(152, 155), WINHV_COORDS(85, 88)); + return; + } + else if (vCount > 94) + { + if (vCount < 103) + { + REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR; + SET_WIN0H_WIN1H(WINHV_COORDS(152, 155), WINHV_COORDS(85, 88)); + return; + } + else if (vCount < 119) + { + REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR; + SET_WIN0H_WIN1H(WINHV_COORDS(144, 152), WINHV_COORDS(88, 96)); + return; + } + else if (vCount > 126) + { + if (vCount_ < 135) + { + REG_WININ = WININ_WIN0_BG0 | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG0 | WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_OBJ | WININ_WIN1_CLR; + SET_WIN0H_WIN1H(WINHV_COORDS(152, 155), WINHV_COORDS(85, 88)); + return; + } + } + } + } + } + + REG_WININ = WININ_WIN0_BG_ALL | WININ_WIN0_CLR | WININ_WIN0_OBJ | WININ_WIN1_BG_ALL | WININ_WIN1_CLR | WININ_WIN1_OBJ; + SET_WIN0H_WIN1H(0, 0); +} + +static void VblankCb1_BattleDome(void) +{ + SetGpuReg(REG_OFFSET_BG0HOFS, gBattle_BG0_X); + SetGpuReg(REG_OFFSET_BG0VOFS, gBattle_BG0_Y); + SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); + SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); + ChangeBgY(2, 0x80, 2); + ChangeBgY(3, 0x80, 1); + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); + ScanlineEffect_InitHBlankDmaTransfer(); +} + +static void sub_8194D48(void) +{ + gFacilityTrainerMons = gBattleFrontierMons; + gFacilityTrainers = gBattleFrontierTrainers; +} + +static void sub_8194D68(void) +{ + s32 i, moveSlot; + + for (i = 0; i < 2; i++) + { + s32 playerMonId = gSaveBlock2Ptr->frontier.field_CAA[gUnknown_0203CEF8[i] - 1] - 1; + s32 count; + + for (moveSlot = 0; moveSlot < 4; moveSlot++) + { + count = 0; + while (count < 4) + { + if (GetMonData(&gSaveBlock1Ptr->playerParty[playerMonId], MON_DATA_MOVE1 + count, NULL) == GetMonData(&gPlayerParty[i], MON_DATA_MOVE1 + moveSlot, NULL)) + break; + count++; + } + if (count == 4) + SetMonMoveSlot(&gPlayerParty[i], MOVE_SKETCH, moveSlot); + } + + gSaveBlock1Ptr->playerParty[playerMonId] = gPlayerParty[i]; + } +} + +static void sub_8194E44(void) +{ + s32 i; + + for (i = 0; i < 2; i++) + { + s32 playerMonId = gSaveBlock2Ptr->frontier.field_CAA[gUnknown_0203CEF8[i] - 1] - 1; + u16 item = GetMonData(&gSaveBlock1Ptr->playerParty[playerMonId], MON_DATA_HELD_ITEM, NULL); + SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &item); + } +} + +static void sub_8194EB4(void) +{ + sub_80F94E8(); +} + +static void sub_8194EC0(void) +{ + if (TrainerIdToTournamentId(gTrainerBattleOpponent_A) > TrainerIdToTournamentId(TRAINER_PLAYER)) + gSpecialVar_Result = 1; + else + gSpecialVar_Result = 2; +} + +static void sub_8194EF8(void) +{ + s32 i; + + sub_8194D48(); + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (!gSaveBlock2Ptr->frontier.domeTrainers[i].isEliminated) + break; + } + CopyDomeTrainerName(gStringVar1, gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId); +} + +static void sub_8194F58(void) +{ + s32 i, j, k; + s32 monLevel; + s32 species[3]; + s32 monTypesBits; + s32 trainerId; + s32 monTournamentId; + u8 lvlMode; + u16 *statSums; + s32 *statValues; + u8 ivs = 0; + + species[0] = 0; + species[1] = 0; + species[2] = 0; + if ((gSaveBlock2Ptr->frontier.field_D0A != -gSaveBlock2Ptr->frontier.field_D0B) && gSaveBlock2Ptr->frontier.field_CA8 != 1) + return; + + statSums = AllocZeroed(sizeof(u16) * DOME_TOURNAMENT_TRAINERS_COUNT); + statValues = AllocZeroed(sizeof(s32) * 6); + lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + gSaveBlock2Ptr->frontier.lvlMode = 0; + // This one, I'd like to call a 'C fakematching'. + { + u8 one; + gSaveBlock2Ptr->frontier.field_D0A = (one = 1); + gSaveBlock2Ptr->frontier.field_D0B = one; + } + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + do + { + if (i < 5) + trainerId = Random() % 10; + else if (i < 15) + trainerId = Random() % 20 + 10; + else + trainerId = Random() % 10 + 30; + + for (j = 0; j < i; j++) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[j].trainerId == trainerId) + break; + } + } while (j != i); + + gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId = trainerId; + for (j = 0; j < 3; j++) + { + // Make sure the mon is valid. + do + { + monTournamentId = RandomizeFacilityTrainerMonId(trainerId); + for (k = 0; k < j; k++) + { + s32 checkingMonId = gSaveBlock2Ptr->frontier.domeMonId[i][k]; + if (checkingMonId == monTournamentId + || species[0] == gFacilityTrainerMons[monTournamentId].species + || species[1] == gFacilityTrainerMons[monTournamentId].species + || gFacilityTrainerMons[checkingMonId].itemTableId == gFacilityTrainerMons[monTournamentId].itemTableId) + break; + } + } while (k != j); + + gSaveBlock2Ptr->frontier.domeMonId[i][j] = monTournamentId; + species[j] = gFacilityTrainerMons[monTournamentId].species; + } + gSaveBlock2Ptr->frontier.domeTrainers[i].isEliminated = 0; + gSaveBlock2Ptr->frontier.domeTrainers[i].eliminatedAt = 0; + gSaveBlock2Ptr->frontier.domeTrainers[i].unk3 = 0; + } + + monLevel = 50; + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + monTypesBits = 0; + statSums[i] = 0; + ivs = GetDomeTrainerMonIvs(gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId); + for (j = 0; j < 3; j++) + { + CalcDomeMonStats(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].species, + monLevel, ivs, + gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].evSpread, + gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].nature, + statValues); + + statSums[i] += statValues[STAT_ATK]; + statSums[i] += statValues[STAT_DEF]; + statSums[i] += statValues[STAT_SPATK]; + statSums[i] += statValues[STAT_SPDEF]; + statSums[i] += statValues[STAT_SPEED]; + statSums[i] += statValues[STAT_HP]; + monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].species].type1]; + monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].species].type2]; + } + + // Because GF hates temporary vars, trainerId acts like monTypesCount here. + for (trainerId = 0, j = 0; j < 32; j++) + { + if (monTypesBits & 1) + trainerId++; + monTypesBits >>= 1; + } + statSums[i] += (trainerId * monLevel) / 20; + } + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT - 1; i++) + { + for (j = i + 1; j < DOME_TOURNAMENT_TRAINERS_COUNT; j++) + { + if (statSums[i] < statSums[j]) + { + SwapDomeTrainers(i, j, statSums); + } + else if (statSums[i] == statSums[j]) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId > gSaveBlock2Ptr->frontier.domeTrainers[j].trainerId) + SwapDomeTrainers(i, j, statSums); + } + } + } + + Free(statSums); + Free(statValues); + + for (i = 0; i < 4; i++) + DecideRoundWinners(i); + + gSaveBlock2Ptr->frontier.lvlMode = lvlMode; +} + +static s32 TrainerIdToTournamentId(u16 trainerId) +{ + s32 i; + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId == trainerId) + break; + } + + return i; +} + +// The same as the above one, but has global scope. +s32 TrainerIdToDomeTournamentId(u16 trainerId) +{ + s32 i; + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId == trainerId) + break; + } + + return i; +} + +static u8 sub_81953E8(u8 tournamentId, u8 arg1) +{ + u8 arr[2]; + sub_8192F08(gUnknown_0860D1A0[gUnknown_0860D1C0[tournamentId] / 2][arg1] - 16, arr); + if (tournamentId == arr[0]) + return arr[1]; + else + return arr[0]; +} + +static void DecideRoundWinners(u8 roundId) +{ + s32 i; + s32 moveSlot, monId1, monId2; + s32 tournamentId1, tournamentId2; + s32 species; + s32 points1 = 0, points2 = 0; + + for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) + { + if (gSaveBlock2Ptr->frontier.domeTrainers[i].isEliminated || gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId == TRAINER_PLAYER) + continue; + + tournamentId1 = i; + tournamentId2 = TournamentIdOfOpponent(roundId, gSaveBlock2Ptr->frontier.domeTrainers[tournamentId1].trainerId); + // Frontier Brain always wins, check tournamentId1. + if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentId1].trainerId == TRAINER_FRONTIER_BRAIN && tournamentId2 != 0xFF) + { + gSaveBlock2Ptr->frontier.domeTrainers[tournamentId2].isEliminated = 1; + gSaveBlock2Ptr->frontier.domeTrainers[tournamentId2].eliminatedAt = roundId; + gSaveBlock2Ptr->frontier.field_EC0[tournamentId2] = GetWinningMove(tournamentId1, tournamentId2, roundId); + } + // Frontier Brain always wins, check tournamentId2. + else if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentId2].trainerId == TRAINER_FRONTIER_BRAIN && tournamentId1 != 0xFF) + { + gSaveBlock2Ptr->frontier.domeTrainers[tournamentId1].isEliminated = 1; + gSaveBlock2Ptr->frontier.domeTrainers[tournamentId1].eliminatedAt = roundId; + gSaveBlock2Ptr->frontier.field_EC0[tournamentId1] = GetWinningMove(tournamentId2, tournamentId1, roundId); + } + // Decide which one of two trainers wins! + else if (tournamentId2 != 0xFF) + { + // BUG: points1 and points2 are not cleared at the beginning of the loop resulting in not fair results. + + // Calculate points for both trainers. + for (monId1 = 0; monId1 < 3; monId1++) + { + for (moveSlot = 0; moveSlot < 4; moveSlot++) + { + for (monId2 = 0; monId2 < 3; monId2++) + { + points1 += GetTypeEffectivenessPoints(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentId1][monId1]].moves[moveSlot], + gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentId2][monId2]].species, 2); + } + } + species = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentId1][monId1]].species; + points1 += ( gBaseStats[species].baseHP + + gBaseStats[species].baseAttack + + gBaseStats[species].baseDefense + + gBaseStats[species].baseSpeed + + gBaseStats[species].baseSpAttack + + gBaseStats[species].baseSpDefense) / 10; + } + // Random part of the formula. + points1 += (Random() & 0x1F); + // Favor trainers with higher id; + points1 += tournamentId1; + + for (monId1 = 0; monId1 < 3; monId1++) + { + for (moveSlot = 0; moveSlot < 4; moveSlot++) + { + for (monId2 = 0; monId2 < 3; monId2++) + { + points2 += GetTypeEffectivenessPoints(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentId2][monId1]].moves[moveSlot], + gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentId1][monId2]].species, 2); + } + } + species = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentId2][monId1]].species; + points2 += ( gBaseStats[species].baseHP + + gBaseStats[species].baseAttack + + gBaseStats[species].baseDefense + + gBaseStats[species].baseSpeed + + gBaseStats[species].baseSpAttack + + gBaseStats[species].baseSpDefense) / 10; + } + // Random part of the formula. + points2 += (Random() & 0x1F); + // Favor trainers with higher id; + points2 += tournamentId2; + + if (points1 > points2) + { + gSaveBlock2Ptr->frontier.domeTrainers[tournamentId2].isEliminated = 1; + gSaveBlock2Ptr->frontier.domeTrainers[tournamentId2].eliminatedAt = roundId; + gSaveBlock2Ptr->frontier.field_EC0[tournamentId2] = GetWinningMove(tournamentId1, tournamentId2, roundId); + } + else if (points1 < points2) + { + gSaveBlock2Ptr->frontier.domeTrainers[tournamentId1].isEliminated = 1; + gSaveBlock2Ptr->frontier.domeTrainers[tournamentId1].eliminatedAt = roundId; + gSaveBlock2Ptr->frontier.field_EC0[tournamentId1] = GetWinningMove(tournamentId2, tournamentId1, roundId); + } + // Points are the same, so we favor the one with the higher id. + else if (tournamentId1 > tournamentId2) + { + gSaveBlock2Ptr->frontier.domeTrainers[tournamentId2].isEliminated = 1; + gSaveBlock2Ptr->frontier.domeTrainers[tournamentId2].eliminatedAt = roundId; + gSaveBlock2Ptr->frontier.field_EC0[tournamentId2] = GetWinningMove(tournamentId1, tournamentId2, roundId); + } + else + { + gSaveBlock2Ptr->frontier.domeTrainers[tournamentId1].isEliminated = 1; + gSaveBlock2Ptr->frontier.domeTrainers[tournamentId1].eliminatedAt = roundId; + gSaveBlock2Ptr->frontier.field_EC0[tournamentId1] = GetWinningMove(tournamentId2, tournamentId1, roundId); + } + } + } +} + +static void CopyDomeTrainerName(u8 *dst, u16 trainerId) +{ + s32 i = 0; + GetFacilityEnemyMonLevel(); // Unused return value. + + if (trainerId == TRAINER_FRONTIER_BRAIN) + { + CopyDomeBrainTrainerName(dst); + } + else + { + if (trainerId == TRAINER_PLAYER) + { + for (i = 0; i < PLAYER_NAME_LENGTH; i++) + dst[i] = gSaveBlock2Ptr->playerName[i]; + } + else if (trainerId < 300) + { + for (i = 0; i < FRONTIER_TRAINER_NAME_LENGTH; i++) + dst[i] = gFacilityTrainers[trainerId].trainerName[i]; + } + dst[i] = EOS; + } +} + +static u8 GetDomeBrainTrainerPicId(void) +{ + return gTrainers[TRAINER_TUCKER].trainerPic; +} + +static u8 GetDomeBrainTrainerClass(void) +{ + return gTrainers[TRAINER_TUCKER].trainerClass; +} + +static void CopyDomeBrainTrainerName(u8 *dst) +{ + s32 i; + + for (i = 0; i < FRONTIER_TRAINER_NAME_LENGTH; i++) + dst[i] = gTrainers[TRAINER_TUCKER].trainerName[i]; + dst[i] = EOS; +} diff --git a/src/battle_frontier_1.c b/src/battle_frontier_1.c new file mode 100644 index 000000000..ee8a42954 --- /dev/null +++ b/src/battle_frontier_1.c @@ -0,0 +1,118 @@ +#include "global.h" +#include "event_data.h" +#include "battle_setup.h" +#include "overworld.h" +#include "random.h" +#include "battle_tower.h" + +extern void sub_8162614(u16, u8); + +extern void (* const gUnknown_0860DE50[])(void); +extern const u32 gUnknown_0860DE98[][2]; +extern const u32 gUnknown_0860DEA8[][2]; + +// code +void sub_8195960(void) +{ + gUnknown_0860DE50[gSpecialVar_0x8004](); +} + +void sub_8195980(void) +{ + u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + + gSaveBlock2Ptr->frontier.field_CA8 = 0; + gSaveBlock2Ptr->frontier.field_CB2 = 0; + gSaveBlock2Ptr->frontier.field_CA9_a = 0; + gSaveBlock2Ptr->frontier.field_CA9_b = 0; + if (!(gSaveBlock2Ptr->frontier.field_CDC & gUnknown_0860DE98[battleMode][lvlMode])) + gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode] = 0; + + saved_warp2_set(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + gTrainerBattleOpponent_A = 0; +} + +void sub_8195A38(void) +{ + u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + + switch (gSpecialVar_0x8005) + { + case 0: + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_DC4[1]; + break; + case 1: + gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode]; + break; + case 2: + gSpecialVar_Result = ((gSaveBlock2Ptr->frontier.field_CDC & gUnknown_0860DE98[battleMode][lvlMode]) != 0); + break; + } +} + +void sub_8195AE4(void) +{ + u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + + switch (gSpecialVar_0x8005) + { + case 0: + gSaveBlock2Ptr->frontier.field_DC4[1] = gSpecialVar_0x8006; + break; + case 1: + gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode] = gSpecialVar_0x8006; + break; + case 2: + if (gSpecialVar_0x8006) + gSaveBlock2Ptr->frontier.field_CDC |= gUnknown_0860DE98[battleMode][lvlMode]; + else + gSaveBlock2Ptr->frontier.field_CDC &= gUnknown_0860DEA8[battleMode][lvlMode]; + break; + } +} + +void sub_8195BB0(void) +{ + u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + + if (gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode] < 50) + gSpecialVar_Result = Random() % 3; + else if (gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode] < 99) + gSpecialVar_Result = 3; + else + gSpecialVar_Result = 4; +} + +void sub_8195C20(void) +{ + gTrainerBattleOpponent_A = 5 *(Random() % 255) / 64u; + sub_8162614(gTrainerBattleOpponent_A, 0); +} + +void sub_8195C50(void) +{ + if (gTrainerBattleOpponent_A < 300) + ConvertBattleFrontierTrainerSpeechToString(gFacilityTrainers[gTrainerBattleOpponent_A].speechBefore); +} + +/* +void sub_8195C7C(void) +{ + u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + + if (gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode] < 9999) + { + u16 wat = 0; + gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode]++; + if (lvlMode < gSaveBlock2Ptr->frontier.field_DD0[battleMode][lvlMode]) + wat = 1; + if (gSaveBlock2Ptr->frontier.field_DC8[battleMode][wat] != 0) + gSaveBlock2Ptr->frontier.field_DD0[battleMode][lvlMode] = gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode]; + } +} +*/ diff --git a/src/battle_main.c b/src/battle_main.c index 86937f85f..1a1f6f61a 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -734,7 +734,7 @@ static void SetPlayerBerryDataInBattleStruct(void) if (IsEnigmaBerryValid() == TRUE) { - for (i = 0; i < BERRY_NAME_COUNT - 1; i++) + for (i = 0; i < BERRY_NAME_LENGTH; i++) battleBerry->name[i] = gSaveBlock1Ptr->enigmaBerry.berry.name[i]; battleBerry->name[i] = EOS; @@ -748,7 +748,7 @@ static void SetPlayerBerryDataInBattleStruct(void) { const struct Berry *berryData = GetBerryInfo(ItemIdToBerryType(ITEM_ENIGMA_BERRY)); - for (i = 0; i < BERRY_NAME_COUNT - 1; i++) + for (i = 0; i < BERRY_NAME_LENGTH; i++) battleBerry->name[i] = berryData->name[i]; battleBerry->name[i] = EOS; @@ -769,7 +769,7 @@ static void SetAllPlayersBerryData(void) { if (IsEnigmaBerryValid() == TRUE) { - for (i = 0; i < BERRY_NAME_COUNT - 1; i++) + for (i = 0; i < BERRY_NAME_LENGTH; i++) { gEnigmaBerries[0].name[i] = gSaveBlock1Ptr->enigmaBerry.berry.name[i]; gEnigmaBerries[2].name[i] = gSaveBlock1Ptr->enigmaBerry.berry.name[i]; @@ -792,7 +792,7 @@ static void SetAllPlayersBerryData(void) { const struct Berry *berryData = GetBerryInfo(ItemIdToBerryType(ITEM_ENIGMA_BERRY)); - for (i = 0; i < BERRY_NAME_COUNT - 1; i++) + for (i = 0; i < BERRY_NAME_LENGTH; i++) { gEnigmaBerries[0].name[i] = berryData->name[i]; gEnigmaBerries[2].name[i] = berryData->name[i]; @@ -830,7 +830,7 @@ static void SetAllPlayersBerryData(void) src = (struct BattleEnigmaBerry *)(gBlockRecvBuffer[i] + 2); battlerId = gLinkPlayers[i].id; - for (j = 0; j < BERRY_NAME_COUNT - 1; j++) + for (j = 0; j < BERRY_NAME_LENGTH; j++) gEnigmaBerries[battlerId].name[j] = src->name[j]; gEnigmaBerries[battlerId].name[j] = EOS; @@ -847,7 +847,7 @@ static void SetAllPlayersBerryData(void) { src = (struct BattleEnigmaBerry *)(gBlockRecvBuffer[i] + 2); - for (j = 0; j < BERRY_NAME_COUNT - 1; j++) + for (j = 0; j < BERRY_NAME_LENGTH; j++) { gEnigmaBerries[i].name[j] = src->name[j]; gEnigmaBerries[i + 2].name[j] = src->name[j]; @@ -3888,7 +3888,7 @@ static void TryDoEventsBeforeFirstTurn(void) // Check all switch in items having effect from the fastest mon to slowest. while (gBattleStruct->switchInItemsCounter < gBattlersCount) { - if (ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gBattlerByTurnOrder[gBattleStruct->switchInItemsCounter], 0) != 0) + if (ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gBattlerByTurnOrder[gBattleStruct->switchInItemsCounter], FALSE)) effect++; gBattleStruct->switchInItemsCounter++; @@ -3929,7 +3929,7 @@ static void TryDoEventsBeforeFirstTurn(void) if (gBattleTypeFlags & BATTLE_TYPE_ARENA) { StopCryAndClearCrySongs(); - BattleScriptExecute(BattleScript_82DB8BE); + BattleScriptExecute(BattleScript_ArenaTurnBeginning); } } @@ -4019,7 +4019,7 @@ void BattleTurnPassed(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) BattleScriptExecute(BattleScript_82DB881); else if (gBattleTypeFlags & BATTLE_TYPE_ARENA && gBattleStruct->field_DA == 0) - BattleScriptExecute(BattleScript_82DB8BE); + BattleScriptExecute(BattleScript_ArenaTurnBeginning); } u8 IsRunningFromBattleImpossible(void) @@ -4596,13 +4596,10 @@ static void sub_803CDF8(void) void SwapTurnOrder(u8 id1, u8 id2) { - u32 temp = gActionsByTurnOrder[id1]; - gActionsByTurnOrder[id1] = gActionsByTurnOrder[id2]; - gActionsByTurnOrder[id2] = temp; - - temp = gBattlerByTurnOrder[id1]; - gBattlerByTurnOrder[id1] = gBattlerByTurnOrder[id2]; - gBattlerByTurnOrder[id2] = temp; + u32 temp; + + SWAP(gActionsByTurnOrder[id1], gActionsByTurnOrder[id2], temp); + SWAP(gBattlerByTurnOrder[id1], gBattlerByTurnOrder[id2], temp); } u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) diff --git a/src/battle_message.c b/src/battle_message.c index 13502d6f2..78b9ac53b 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1248,7 +1248,7 @@ static const u8 sText_Round2[] = _("Round 2"); static const u8 sText_Semifinal[] = _("Semifinal"); static const u8 sText_Final[] = _("Final"); -const u8 * const gRoundsStringTable[] = +const u8 *const gRoundsStringTable[] = { sText_Round1, sText_Round2, diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c deleted file mode 100644 index f9cc48a9a..000000000 --- a/src/battle_pyramid.c +++ /dev/null @@ -1,248 +0,0 @@ -#include "global.h" -#include "main.h" -#include "battle_controllers.h" -#include "bg.h" -#include "field_effect.h" -#include "field_weather.h" -#include "gpu_regs.h" -#include "malloc.h" -#include "menu.h" -#include "menu_helpers.h" -#include "overworld.h" -#include "palette.h" -#include "party_menu.h" -#include "scanline_effect.h" -#include "script.h" -#include "task.h" -#include "constants/rgb.h" - -EWRAM_DATA struct -{ - u32 unk0; - u8 filler4[0x804 - 0x4]; - u8 unk804[11]; - u8 unk80F[5]; - u8 unk814; - u8 filler815; - s8 unk816; - u8 filler817[0x984 - 0x817]; - u16 unk984; - u8 filler986[0x98C - 0x986]; -} *gUnknown_0203CF2C = NULL; -EWRAM_DATA struct -{ - void (*callback)(void); - u8 unk4; - u16 unk6; - u16 unk8; -} gUnknown_0203CF30 = {0}; - -extern const struct BgTemplate gUnknown_0861F2B4[3]; - -void sub_81C4F98(u8 a0, void (*callback)(void)); -void sub_81C4F44(u8 taskId); -void sub_81C504C(void); -bool8 sub_81C5078(void); -void sub_81C51DC(void); -bool8 sub_81C5238(void); -void sub_81C5314(void); -void sub_81C5674(void); -void sub_81C56F8(void); -void sub_81C5924(void); -void sub_81C59BC(void); -void sub_81C5A20(void); -void sub_81C6BD8(void); -void sub_81C6EF4(void); -void sub_81C700C(void); - -void sub_81C4EEC(void) -{ - gUnknown_0203CF30.unk6 = 0; - gUnknown_0203CF30.unk8 = 0; -} - -void sub_81C4EFC(void) -{ - sub_81C4F98(0, CB2_ReturnToFieldWithOpenMenu); -} - -void sub_81C4F10(void) -{ - sub_81C4F98(1, SetCB2ToReshowScreenAfterMenu2); -} - -void sub_81C4F24(void) -{ - ScriptContext2_Enable(); - FadeScreen(1, 0); - CreateTask(sub_81C4F44, 10); -} - -void sub_81C4F44(u8 taskId) -{ - if (!gPaletteFade.active) - { - overworld_free_bg_tilemaps(); - gFieldCallback2 = hm_add_c3_without_phase_2; - sub_81C4F98(3, CB2_ReturnToField); - DestroyTask(taskId); - } -} - -void sub_81C4F84(void) -{ - sub_81C4F98(4, gUnknown_0203CF30.callback); -} - -void sub_81C4F98(u8 a0, void (*callback)(void)) -{ - gUnknown_0203CF2C = AllocZeroed(sizeof(*gUnknown_0203CF2C)); - - if (a0 != 4) - { - gUnknown_0203CF30.unk4 = a0; - } - - if (callback != NULL) - { - gUnknown_0203CF30.callback = callback; - } - - gUnknown_0203CF2C->unk0 = 0; - gUnknown_0203CF2C->unk814 = -1; - gUnknown_0203CF2C->unk816 = -1; - - memset(gUnknown_0203CF2C->unk804, 0xFF, sizeof(gUnknown_0203CF2C->unk804)); - memset(gUnknown_0203CF2C->unk80F, 0xFF, sizeof(gUnknown_0203CF2C->unk80F)); - - SetMainCallback2(sub_81C504C); -} - -void sub_81C501C(void) -{ - RunTasks(); - AnimateSprites(); - BuildOamBuffer(); - do_scheduled_bg_tilemap_copies_to_vram(); - UpdatePaletteFade(); -} - -void sub_81C5038(void) -{ - LoadOam(); - ProcessSpriteCopyRequests(); - TransferPlttBuffer(); -} - -void sub_81C504C(void) -{ - while (sub_81221EC() != TRUE && sub_81C5078() != TRUE && sub_81221AC() != TRUE); -} - -bool8 sub_81C5078(void) -{ - switch (gMain.state) - { - case 0: - SetVBlankHBlankCallbacksToNull(); - clear_scheduled_bg_copies_to_vram(); - gMain.state++; - break; - case 1: - ScanlineEffect_Stop(); - gMain.state++; - break; - case 2: - FreeAllSpritePalettes(); - gMain.state++; - break; - case 3: - ResetPaletteFade(); - gPaletteFade.bufferTransferDisabled = TRUE; - gMain.state++; - break; - case 4: - ResetSpriteData(); - gMain.state++; - break; - case 5: - if (!sub_81221AC()) - { - ResetTasks(); - } - gMain.state++; - break; - case 6: - sub_81C51DC(); - gUnknown_0203CF2C->unk984 = 0; - gMain.state++; - break; - case 7: - if (sub_81C5238()) - { - gMain.state++; - } - break; - case 8: - sub_81C6BD8(); - gMain.state++; - break; - case 9: - sub_81C5924(); - sub_81C59BC(); - sub_81C5A20(); - gMain.state++; - break; - case 10: - sub_81C5314(); - gMain.state++; - break; - case 11: - sub_81C56F8(); - gMain.state++; - break; - case 12: - sub_81C6EF4(); - gMain.state++; - break; - case 13: - sub_81C5674(); - gMain.state++; - break; - case 14: - sub_81C700C(); - gMain.state++; - break; - case 15: - BlendPalettes(0xFFFFFFFF, 0x10, 0); - gMain.state++; - break; - case 16: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); - gPaletteFade.bufferTransferDisabled = FALSE; - gMain.state++; - break; - default: - SetVBlankCallback(sub_81C5038); - SetMainCallback2(sub_81C501C); - return TRUE; - } - return FALSE; -} - -void sub_81C51DC(void) -{ - ResetVramOamAndBgCntRegs(); - ResetBgsAndClearDma3BusyFlags(0); - InitBgsFromTemplates(0, gUnknown_0861F2B4, ARRAY_COUNT(gUnknown_0861F2B4)); - SetBgTilemapBuffer(2, gUnknown_0203CF2C->filler4); - ResetAllBgsCoordinates(); - schedule_bg_copy_tilemap_to_vram(2); - SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | - DISPCNT_OBJ_1D_MAP | - DISPCNT_OBJ_ON); - ShowBg(0); - ShowBg(1); - ShowBg(2); - SetGpuReg(REG_OFFSET_BLDCNT, 0); -} diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c new file mode 100644 index 000000000..6629e6a0a --- /dev/null +++ b/src/battle_pyramid_bag.c @@ -0,0 +1,1506 @@ +#include "global.h" +#include "battle_pyramid_bag.h" +#include "main.h" +#include "battle_controllers.h" +#include "bg.h" +#include "field_effect.h" +#include "field_weather.h" +#include "gpu_regs.h" +#include "malloc.h" +#include "menu.h" +#include "overworld.h" +#include "menu_helpers.h" +#include "overworld.h" +#include "palette.h" +#include "party_menu.h" +#include "scanline_effect.h" +#include "script.h" +#include "task.h" +#include "decompress.h" +#include "graphics.h" +#include "string_util.h" +#include "list_menu.h" +#include "strings.h" +#include "item.h" +#include "sound.h" +#include "item_menu.h" +#include "mail.h" +#include "item_use.h" +#include "event_data.h" +#include "text_window.h" +#include "international_string_util.h" +#include "item_icon.h" +#include "constants/items.h" +#include "constants/rgb.h" +#include "constants/songs.h" + +EWRAM_DATA struct PyramidBagResources *gPyramidBagResources = NULL; +EWRAM_DATA struct PyramidBagCursorData gPyramidBagCursorData = {0}; + +// gfx +extern const u8 gUnknown_08D9ADD0[]; +extern const u8 gUnknown_08D9AE04[]; +extern const u8 gUnknown_08D9AF44[]; +extern const u16 gUnknown_0860F074[]; + +// This file's functions. +static void Task_HandlePyramidBagInput(u8 taskId); +static void sub_81C4F44(u8 taskId); +static void sub_81C5B4C(u8 taskId); +static void Task_BeginItemSwap(u8 taskId); +static void sub_81C5D20(u8 taskId); +static void sub_81C674C(u8 taskId); +static void HandleMenuActionInput(u8 taskId); +static void HandleFewMenuActionsInput(u8 taskId); +static void sub_81C66EC(u8 taskId); +static void SetTaskToMainPyramidBagInputHandler(u8 taskId); +static void sub_81C6350(u8 taskId); +static void sub_81C64B4(u8 taskId); +static void sub_81C65CC(u8 taskId); +static void sub_81C66AC(u8 taskId); +static void PerformItemSwap(u8 taskId); +static void Task_ItemSwapHandleInput(u8 taskId); +static void sub_81C6A14(u8 taskId); +static void SetBagItemsListTemplate(void); +static void sub_81C504C(void); +static void sub_81C51DC(void); +static void AddScrollArrow(void); +static void sub_81C56F8(void); +static void sub_81C5A20(void); +static void sub_81C6BD8(void); +static void sub_81C6EF4(void); +static void sub_81C700C(void); +static void sub_81C6E98(void); +static void sub_81C6F20(void); +static void sub_81C6404(void); +static void sub_81C6E1C(void); +static bool8 sub_81C5238(void); +static bool8 sub_81C5078(void); +static void ShowItemImage(u16 itemId, u8 itemSpriteArrayId); +static void PyramidBag_CopyItemName(u8 *dst, u16 itemId); +static void sub_81C6FF8(u8 arg0); +static void PrintItemDescription(s32 listMenuId); +static void sub_81C5AB8(u8 y, u8 arg1); +static void PrintOnWindow_Font1(u8 windowId, const u8 *src, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, u8 speed, u8 colorTableId); +static void PrintOnWindow_Font7(u8 windowId, const u8 *src, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, u8 speed, u8 colorTableId); +static u8 sub_81C6D24(u8 windowArrayId); +static void sub_81C6D6C(u8 windowArrayId); +static void sub_81C5EAC(u8 windowId); +static void sub_81C5F08(u8 windowId, u8 horizontalCount, u8 verticalCount); +static bool8 IsValidMenuAction(s8 arg0); +static void sub_81C6DAC(u8 taskId, const struct YesNoFuncTable *yesNoTable); +static void sub_81C6CEC(u8 windowId); +static void sub_81C704C(u8 y); +static void sub_81C7028(bool8 invisible); +static void sub_81C6F68(struct Sprite *sprite); +static void BagAction_UseOnField(u8 taskId); +static void BagAction_Toss(u8 taskId); +static void BagAction_Give(u8 taskId); +static void BagAction_Cancel(u8 taskId); +static void BagAction_UseInBattle(u8 taskId); +static void PyramidBagMoveCursorFunc(s32 itemIndex, bool8 onInit, struct ListMenu *list); +static void PrintItemQuantity(u8 windowId, s32 itemIndex, u8 y); +static void TossItem(u8 taskId); +static void DontTossItem(u8 taskId); + +// Const rom data. +static const struct BgTemplate gUnknown_0861F2B4[] = +{ + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 0, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 3, + .mapBaseIndex = 29, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, +}; + +static const struct ListMenuTemplate gUnknown_0861F2C0 = +{ + .items = NULL, + .moveCursorFunc = PyramidBagMoveCursorFunc, + .itemPrintFunc = PrintItemQuantity, + .totalItems = 0, + .maxShowed = 0, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 1, + .cursorPal = 2, + .fillValue = 0, + .cursorShadowPal = 3, + .lettersSpacing = 0, + .itemVerticalPadding = 0, + .scrollMultiple = LIST_NO_MULTIPLE_SCROLL, + .fontId = 7, + .cursorKind = 0 +}; + +#define ACTION_USE_FIELD 0 +#define ACTION_TOSS 1 +#define ACTION_GIVE 2 +#define ACTION_CANCEL 3 +#define ACTION_USE_BATTLE 4 +#define ACTION_DUMMY 5 + +static const struct MenuAction sMenuActions[] = +{ + [ACTION_USE_FIELD] = { gMenuText_Use, BagAction_UseOnField }, + [ACTION_TOSS] = { gMenuText_Toss, BagAction_Toss }, + [ACTION_GIVE] = { gMenuText_Give, BagAction_Give }, + [ACTION_CANCEL] = { gText_Cancel2, BagAction_Cancel }, + [ACTION_USE_BATTLE] = { gMenuText_Use, BagAction_UseInBattle }, + [ACTION_DUMMY] = { gText_EmptyString2, NULL }, +}; + +static const u8 sFieldMenuActionIds[] = {ACTION_USE_FIELD, ACTION_GIVE, ACTION_TOSS, ACTION_CANCEL}; +static const u8 gUnknown_0861F30C[] = {ACTION_TOSS, ACTION_CANCEL}; +static const u8 sBattleMenuActionIds[] = {ACTION_USE_BATTLE, ACTION_CANCEL}; +static const u8 gUnknown_0861F310[] = {ACTION_CANCEL}; + +static const struct YesNoFuncTable sYesNoTossFuncions = +{ + TossItem, DontTossItem +}; + +static const u8 sColorTable[][3] = +{ + {0, 2, 3}, + {0, 3, 1}, + {1, 2, 3}, +}; + +static const struct WindowTemplate gUnknown_0861F328[] = +{ + { + .priority = 0, + .tilemapLeft = 14, + .tilemapTop = 2, + .width = 15, + .height = 16, + .paletteNum = 15, + .baseBlock = 30 + }, + { + .priority = 0, + .tilemapLeft = 0, + .tilemapTop = 13, + .width = 14, + .height = 6, + .paletteNum = 15, + .baseBlock = 270 + }, + { + .priority = 1, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 27, + .height = 4, + .paletteNum = 15, + .baseBlock = 354 + }, + { + .priority = 1, + .tilemapLeft = 24, + .tilemapTop = 17, + .width = 5, + .height = 2, + .paletteNum = 15, + .baseBlock = 462 + }, + DUMMY_WIN_TEMPLATE, +}; + +static const struct WindowTemplate gUnknown_0861F350[] = +{ + { + .priority = 1, + .tilemapLeft = 22, + .tilemapTop = 17, + .width = 7, + .height = 2, + .paletteNum = 15, + .baseBlock = 472 + }, + { + .priority = 1, + .tilemapLeft = 22, + .tilemapTop = 15, + .width = 7, + .height = 4, + .paletteNum = 15, + .baseBlock = 472 + }, + { + .priority = 1, + .tilemapLeft = 15, + .tilemapTop = 15, + .width = 14, + .height = 4, + .paletteNum = 15, + .baseBlock = 472 + }, + { + .priority = 1, + .tilemapLeft = 15, + .tilemapTop = 13, + .width = 14, + .height = 6, + .paletteNum = 15, + .baseBlock = 472 + }, + { + .priority = 1, + .tilemapLeft = 24, + .tilemapTop = 15, + .width = 5, + .height = 4, + .paletteNum = 15, + .baseBlock = 472 + }, +}; + +extern const struct CompressedSpriteSheet gUnknown_0861F3CC; +extern const struct SpriteTemplate gUnknown_0861F3D4; + +// code +void sub_81C4EEC(void) +{ + gPyramidBagCursorData.cursorPosition = 0; + gPyramidBagCursorData.scrollPosition = 0; +} + +void CB2_PyramidBagMenuFromStartMenu(void) +{ + sub_81C4F98(0, CB2_ReturnToFieldWithOpenMenu); +} + +static void sub_81C4F10(void) +{ + sub_81C4F98(1, SetCB2ToReshowScreenAfterMenu2); +} + +void sub_81C4F24(void) +{ + ScriptContext2_Enable(); + FadeScreen(1, 0); + CreateTask(sub_81C4F44, 10); +} + +static void sub_81C4F44(u8 taskId) +{ + if (!gPaletteFade.active) + { + overworld_free_bg_tilemaps(); + gFieldCallback2 = hm_add_c3_without_phase_2; + sub_81C4F98(3, CB2_ReturnToField); + DestroyTask(taskId); + } +} + +void sub_81C4F84(void) +{ + sub_81C4F98(4, gPyramidBagCursorData.callback); +} + +void sub_81C4F98(u8 a0, void (*callback)(void)) +{ + gPyramidBagResources = AllocZeroed(sizeof(*gPyramidBagResources)); + + if (a0 != 4) + gPyramidBagCursorData.unk4 = a0; + + if (callback != NULL) + gPyramidBagCursorData.callback = callback; + + gPyramidBagResources->callback2 = NULL; + gPyramidBagResources->unk814 = 0xFF; + gPyramidBagResources->scrollArrowSpriteId = 0xFF; + + memset(gPyramidBagResources->itemsSpriteIds, 0xFF, sizeof(gPyramidBagResources->itemsSpriteIds)); + memset(gPyramidBagResources->windowIds, 0xFF, sizeof(gPyramidBagResources->windowIds)); + + SetMainCallback2(sub_81C504C); +} + +static void sub_81C501C(void) +{ + RunTasks(); + AnimateSprites(); + BuildOamBuffer(); + do_scheduled_bg_tilemap_copies_to_vram(); + UpdatePaletteFade(); +} + +static void sub_81C5038(void) +{ + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); +} + +static void sub_81C504C(void) +{ + while (sub_81221EC() != TRUE && sub_81C5078() != TRUE && sub_81221AC() != TRUE); +} + +static bool8 sub_81C5078(void) +{ + switch (gMain.state) + { + case 0: + SetVBlankHBlankCallbacksToNull(); + clear_scheduled_bg_copies_to_vram(); + gMain.state++; + break; + case 1: + ScanlineEffect_Stop(); + gMain.state++; + break; + case 2: + FreeAllSpritePalettes(); + gMain.state++; + break; + case 3: + ResetPaletteFade(); + gPaletteFade.bufferTransferDisabled = TRUE; + gMain.state++; + break; + case 4: + ResetSpriteData(); + gMain.state++; + break; + case 5: + if (!sub_81221AC()) + { + ResetTasks(); + } + gMain.state++; + break; + case 6: + sub_81C51DC(); + gPyramidBagResources->state = 0; + gMain.state++; + break; + case 7: + if (sub_81C5238()) + { + gMain.state++; + } + break; + case 8: + sub_81C6BD8(); + gMain.state++; + break; + case 9: + sub_81C5924(); + sub_81C59BC(); + sub_81C5A20(); + gMain.state++; + break; + case 10: + SetBagItemsListTemplate(); + gMain.state++; + break; + case 11: + sub_81C56F8(); + gMain.state++; + break; + case 12: + sub_81C6EF4(); + gMain.state++; + break; + case 13: + AddScrollArrow(); + gMain.state++; + break; + case 14: + sub_81C700C(); + gMain.state++; + break; + case 15: + BlendPalettes(0xFFFFFFFF, 0x10, 0); + gMain.state++; + break; + case 16: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + gPaletteFade.bufferTransferDisabled = FALSE; + gMain.state++; + break; + default: + SetVBlankCallback(sub_81C5038); + SetMainCallback2(sub_81C501C); + return TRUE; + } + return FALSE; +} + +static void sub_81C51DC(void) +{ + ResetVramOamAndBgCntRegs(); + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, gUnknown_0861F2B4, ARRAY_COUNT(gUnknown_0861F2B4)); + SetBgTilemapBuffer(2, gPyramidBagResources->tilemapBuffer); + ResetAllBgsCoordinates(); + schedule_bg_copy_tilemap_to_vram(2); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | + DISPCNT_OBJ_1D_MAP | + DISPCNT_OBJ_ON); + ShowBg(0); + ShowBg(1); + ShowBg(2); + SetGpuReg(REG_OFFSET_BLDCNT, 0); +} + +static bool8 sub_81C5238(void) +{ + switch (gPyramidBagResources->state) + { + case 0: + reset_temp_tile_data_buffers(); + decompress_and_copy_tile_data_to_vram(2, gBagScreen_Gfx, 0, 0, 0); + gPyramidBagResources->state++; + break; + case 1: + if (free_temp_tile_data_buffers_if_possible() != TRUE) + { + LZDecompressWram(gUnknown_08D9AE04, gPyramidBagResources->tilemapBuffer); + gPyramidBagResources->state++; + } + break; + case 2: + LoadCompressedPalette(gUnknown_08D9AF44, 0, 0x20); + gPyramidBagResources->state++; + break; + case 3: + LoadCompressedObjectPic(&gUnknown_0861F3CC); + gPyramidBagResources->state++; + break; + case 4: + sub_81C6E98(); + gPyramidBagResources->state++; + break; + default: + LoadListMenuArrowsGfx(); + gPyramidBagResources->state = 0; + return TRUE; + } + + return FALSE; +} + +static void SetBagItemsListTemplate(void) +{ + u16 i; + u16 *pyramidItems = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode]; + + for (i = 0; i < gPyramidBagResources->listMenuCount - 1; i++) + { + PyramidBag_CopyItemName(gPyramidBagResources->itemStrings[i], pyramidItems[i]); + gPyramidBagResources->bagListItems[i].name = gPyramidBagResources->itemStrings[i]; + gPyramidBagResources->bagListItems[i].id = i; + } + StringCopy(gPyramidBagResources->itemStrings[i], gText_CloseBag); + gPyramidBagResources->bagListItems[i].name = gPyramidBagResources->itemStrings[i]; + gPyramidBagResources->bagListItems[i].id = LIST_B_PRESSED; + gMultiuseListMenuTemplate = gUnknown_0861F2C0; + gMultiuseListMenuTemplate.totalItems = gPyramidBagResources->listMenuCount; + gMultiuseListMenuTemplate.items = gPyramidBagResources->bagListItems; + gMultiuseListMenuTemplate.maxShowed = gPyramidBagResources->listMenuMaxShown; +} + +static void PyramidBag_CopyItemName(u8 *dst, u16 itemId) +{ + if (ItemId_GetPocket(itemId) == POCKET_BERRIES) + { + ConvertIntToDecimalStringN(gStringVar1, ITEM_TO_BERRY(itemId), STR_CONV_MODE_LEADING_ZEROS, 2); + CopyItemName(itemId, gStringVar2); + StringExpandPlaceholders(dst, gText_UnkF908Var1Clear7Var2); + } + else + { + CopyItemName(itemId, dst); + } +} + +static void PyramidBagMoveCursorFunc(s32 itemIndex, bool8 onInit, struct ListMenu *list) +{ + if (onInit != TRUE) + { + PlaySE(SE_SELECT); + sub_81C6F20(); + } + if (gPyramidBagResources->unk814 == 0xFF) + { + sub_81C6FF8(gPyramidBagResources->unk815 ^ 1); + if (itemIndex != LIST_B_PRESSED) + ShowItemImage(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode][itemIndex], gPyramidBagResources->unk815); + else + ShowItemImage(0xFFFF, gPyramidBagResources->unk815); + gPyramidBagResources->unk815 ^= 1; + PrintItemDescription(itemIndex); + } +} + +static void PrintItemQuantity(u8 windowId, s32 itemIndex, u8 y) +{ + s32 xAlign; + if (itemIndex == LIST_B_PRESSED) + return; + + if (gPyramidBagResources->unk814 != 0xFF) + { + if (gPyramidBagResources->unk814 == (u8)(itemIndex)) + sub_81C5AB8(y, 1); + else + sub_81C5AB8(y, 0xFF); + } + ConvertIntToDecimalStringN(gStringVar1, + gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode][itemIndex], + STR_CONV_MODE_RIGHT_ALIGN, + 2); + StringExpandPlaceholders(gStringVar4, gText_xVar1); + xAlign = GetStringRightAlignXOffset(7, gStringVar4, 0x77); + PrintOnWindow_Font7(windowId, gStringVar4, xAlign, y, 0, 0, TEXT_SPEED_FF, 0); +} + +static void PrintItemDescription(s32 listMenuId) +{ + const u8 *desc; + if (listMenuId != LIST_B_PRESSED) + { + desc = ItemId_GetDescription(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode][listMenuId]); + } + else + { + StringCopy(gStringVar1, gReturnToXStringsTable2[gPyramidBagCursorData.unk4]); + StringExpandPlaceholders(gStringVar4, gText_ReturnToVar1); + desc = gStringVar4; + } + FillWindowPixelBuffer(1, 0); + PrintOnWindow_Font1(1, desc, 3, 0, 0, 1, 0, 0); +} + +static void AddScrollArrow(void) +{ + if (gPyramidBagResources->scrollArrowSpriteId == 0xFF) + gPyramidBagResources->scrollArrowSpriteId = AddScrollIndicatorArrowPairParameterized(2, 172, 12, 148, gPyramidBagResources->listMenuCount - gPyramidBagResources->listMenuMaxShown, 0xB5E, 0xB5E, &gPyramidBagCursorData.scrollPosition); +} + +static void RemoveScrollArrow(void) +{ + if (gPyramidBagResources->scrollArrowSpriteId != 0xFF) + { + RemoveScrollIndicatorArrowPair(gPyramidBagResources->scrollArrowSpriteId); + gPyramidBagResources->scrollArrowSpriteId = 0xFF; + } +} + +static void sub_81C56F8(void) +{ + u8 taskId = CreateTask(Task_HandlePyramidBagInput, 0); + s16 *data = gTasks[taskId].data; + data[0] = ListMenuInit(&gMultiuseListMenuTemplate, gPyramidBagCursorData.scrollPosition, gPyramidBagCursorData.cursorPosition); +} + +static void SwapItems(u8 id1, u8 id2) +{ + u16 temp; + u16 *itemIds = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode]; + u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode]; + + SWAP(itemIds[id1], itemIds[id2], temp); + SWAP(quantities[id1], quantities[id2], temp); +} + +static void MovePyramidBagItemSlotInList(u8 from, u8 to) +{ + u16 *itemIds = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode]; + u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode]; + + if (from != to) + { + s16 i; + u16 firstSlotItemId = itemIds[from]; + u8 firstSlotQuantity = quantities[from]; + + if (to > from) + { + to--; + for (i = from; i < to; i++) + { + itemIds[i] = itemIds[i + 1]; + quantities[i] = quantities[i + 1]; + } + } + else + { + for (i = from; i > to; i--) + { + itemIds[i] = itemIds[i - 1]; + quantities[i] = quantities[i - 1]; + } + } + itemIds[to] = firstSlotItemId; + quantities[to] = firstSlotQuantity; + } +} + +static void CompactItems(void) +{ + u8 i, j; + u16 *itemIds = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode]; + u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode]; + + for (i = 0; i < PYRAMID_BAG_ITEMS_COUNT; i++) + { + if (itemIds[i] == 0 || quantities[i] == 0) + { + itemIds[i] = 0; + quantities[i] = 0; + } + } + for (i = 0; i < PYRAMID_BAG_ITEMS_COUNT - 1; i++) + { + for (j = i + 1; j < PYRAMID_BAG_ITEMS_COUNT; j++) + { + if (itemIds[i] == 0 || quantities[i] == 0) + SwapItems(i, j); + } + } +} + +void sub_81C5924(void) +{ + u16 i; + u16 *itemIds = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode]; + + CompactItems(); + gPyramidBagResources->listMenuCount = 0; + for (i = 0; i < PYRAMID_BAG_ITEMS_COUNT; i++) + { + if (itemIds[i] != 0) + gPyramidBagResources->listMenuCount++; + } + gPyramidBagResources->listMenuCount++; + if (gPyramidBagResources->listMenuCount > 8) + gPyramidBagResources->listMenuMaxShown = 8; + else + gPyramidBagResources->listMenuMaxShown = gPyramidBagResources->listMenuCount; +} + +void sub_81C59BC(void) +{ + if (gPyramidBagCursorData.scrollPosition != 0 && gPyramidBagCursorData.scrollPosition + gPyramidBagResources->listMenuMaxShown > gPyramidBagResources->listMenuCount) + gPyramidBagCursorData.scrollPosition = gPyramidBagResources->listMenuCount - gPyramidBagResources->listMenuMaxShown; + if (gPyramidBagCursorData.scrollPosition + gPyramidBagCursorData.cursorPosition >= gPyramidBagResources->listMenuCount) + { + if (gPyramidBagResources->listMenuCount == 0) + gPyramidBagCursorData.cursorPosition = 0; + else + gPyramidBagCursorData.cursorPosition = gPyramidBagResources->listMenuCount - 1; + } +} + +static void sub_81C5A20(void) +{ + u8 i; + + if (gPyramidBagCursorData.cursorPosition > 4) + { + for (i = 0; i <= gPyramidBagCursorData.cursorPosition - 4; i++) + { + if (gPyramidBagCursorData.scrollPosition + gPyramidBagResources->listMenuMaxShown == gPyramidBagResources->listMenuCount) + { + // daycare.c sends its regards. + break; + } + gPyramidBagCursorData.cursorPosition--; + gPyramidBagCursorData.scrollPosition++; + } + } +} + +static void sub_81C5A98(u8 listMenuTaskId, u8 arg1) +{ + u8 y = ListMenuGetYCoordForPrintingArrowCursor(listMenuTaskId); + sub_81C5AB8(y, arg1); +} + +static void sub_81C5AB8(u8 y, u8 arg1) +{ + if (arg1 == 0xFF) + FillWindowPixelRect(0, 0, 0, y, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); + else + PrintOnWindow_Font1(0, gText_SelectorArrow2, 0, y, 0, 0, 0, arg1); +} + +void sub_81C5B14(u8 taskId) +{ + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + gTasks[taskId].func = sub_81C5B4C; +} + +static void sub_81C5B4C(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + if (!gPaletteFade.active) + { + DestroyListMenuTask(data[0], &gPyramidBagCursorData.scrollPosition, &gPyramidBagCursorData.cursorPosition); + if (gPyramidBagResources->callback2 != NULL) + SetMainCallback2(gPyramidBagResources->callback2); + else + SetMainCallback2(gPyramidBagCursorData.callback); + RemoveScrollArrow(); + ResetSpriteData(); + FreeAllSpritePalettes(); + FreeAllWindowBuffers(); + Free(gPyramidBagResources); + DestroyTask(taskId); + } +} + +static void Task_HandlePyramidBagInput(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + if (sub_81221EC() != TRUE && !gPaletteFade.active) + { + if (gMain.newKeys & SELECT_BUTTON) + { + if (gPyramidBagCursorData.unk4 != 2) + { + ListMenuGetScrollAndRow(data[0], &gPyramidBagCursorData.scrollPosition, &gPyramidBagCursorData.cursorPosition); + if (gPyramidBagCursorData.scrollPosition + gPyramidBagCursorData.cursorPosition != gPyramidBagResources->listMenuCount - 1) + { + PlaySE(SE_SELECT); + Task_BeginItemSwap(taskId); + } + } + } + else + { + s32 listId = ListMenuHandleInputGetItemId(data[0]); + ListMenuGetScrollAndRow(data[0], &gPyramidBagCursorData.scrollPosition, &gPyramidBagCursorData.cursorPosition); + switch (listId) + { + case LIST_NOTHING_CHOSEN: + break; + case LIST_B_PRESSED: + PlaySE(SE_SELECT); + gSpecialVar_ItemId = 0; + sub_81C5B14(taskId); + break; + default: + PlaySE(SE_SELECT); + gSpecialVar_ItemId = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode][listId]; + data[1] = listId; + data[2] = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode][listId]; + if (gPyramidBagCursorData.unk4 == 2) + sub_81C674C(taskId); + else + sub_81C5D20(taskId); + break; + } + } + } +} + +static void sub_81C5D20(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + RemoveScrollArrow(); + sub_81C5A98(data[0], 1); + switch (gPyramidBagCursorData.unk4) + { + default: + gPyramidBagResources->menuActionIds = sFieldMenuActionIds; + gPyramidBagResources->menuActionsCount = ARRAY_COUNT(sFieldMenuActionIds); + break; + case 1: + if (ItemId_GetBattleUsage(gSpecialVar_ItemId)) + { + gPyramidBagResources->menuActionIds = sBattleMenuActionIds; + gPyramidBagResources->menuActionsCount = ARRAY_COUNT(sBattleMenuActionIds); + } + else + { + gPyramidBagResources->menuActionIds = gUnknown_0861F310; + gPyramidBagResources->menuActionsCount = ARRAY_COUNT(gUnknown_0861F310); + } + break; + case 3: + gPyramidBagResources->menuActionIds = gUnknown_0861F30C; + gPyramidBagResources->menuActionsCount = ARRAY_COUNT(gUnknown_0861F30C); + break; + } + + CopyItemName(gSpecialVar_ItemId, gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_Var1IsSelected); + FillWindowPixelBuffer(1, 0); + PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); + if (gPyramidBagResources->menuActionsCount == 1) + sub_81C5EAC(sub_81C6D24(0)); + else if (gPyramidBagResources->menuActionsCount == 2) + sub_81C5EAC(sub_81C6D24(1)); + else + sub_81C5F08(sub_81C6D24(2), 2, 2); + + if (gPyramidBagResources->menuActionsCount == 4) + gTasks[taskId].func = HandleMenuActionInput; + else + gTasks[taskId].func = HandleFewMenuActionsInput; +} + +static void sub_81C5EAC(u8 windowId) +{ + AddItemMenuActionTextPrinters(windowId, 7, 8, 1, 0, 0x10, gPyramidBagResources->menuActionsCount, sMenuActions, gPyramidBagResources->menuActionIds); + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, gPyramidBagResources->menuActionsCount, 0); +} + +static void sub_81C5F08(u8 windowId, u8 horizontalCount, u8 verticalCount) +{ + sub_8198DBC(windowId, 7, 8, 1, 0x38, horizontalCount, verticalCount, sMenuActions, gPyramidBagResources->menuActionIds); + sub_8199944(windowId, 0x38, horizontalCount, verticalCount, 0); +} + +static void HandleFewMenuActionsInput(u8 taskId) +{ + if (sub_81221EC() != TRUE) + { + s32 id = Menu_ProcessInputNoWrapAround(); + switch (id) + { + case -2: + break; + case -1: + PlaySE(SE_SELECT); + sMenuActions[ACTION_CANCEL].func.void_u8(taskId); + break; + default: + PlaySE(SE_SELECT); + if (sMenuActions[gPyramidBagResources->menuActionIds[id]].func.void_u8 != NULL) + sMenuActions[gPyramidBagResources->menuActionIds[id]].func.void_u8(taskId); + break; + } + } +} + +static void HandleMenuActionInput(u8 taskId) +{ + if (sub_81221EC() != TRUE) + { + s8 id = GetMenuCursorPos(); + if (gMain.newKeys & DPAD_UP) + { + if (id > 0 && IsValidMenuAction(id - 2)) + { + PlaySE(SE_SELECT); + sub_8199134(0, -1); + } + } + else if (gMain.newKeys & DPAD_DOWN) + { + if (id < gPyramidBagResources->menuActionsCount - 2 && IsValidMenuAction(id + 2)) + { + PlaySE(SE_SELECT); + sub_8199134(0, 1); + } + } + else if (gMain.newKeys & DPAD_LEFT || GetLRKeysState() == 1) + { + if (id & 1 && IsValidMenuAction(id - 1)) + { + PlaySE(SE_SELECT); + sub_8199134(-1, 0); + } + } + else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysState() == 2) + { + if (!(id & 1) && IsValidMenuAction(id + 1)) + { + PlaySE(SE_SELECT); + sub_8199134(1, 0); + } + } + else if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + if (sMenuActions[gPyramidBagResources->menuActionIds[id]].func.void_u8 != NULL) + sMenuActions[gPyramidBagResources->menuActionIds[id]].func.void_u8(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + sMenuActions[ACTION_CANCEL].func.void_u8(taskId); + } + } +} + +static bool8 IsValidMenuAction(s8 actionTableId) +{ + if (actionTableId < 0) + return FALSE; + else if (actionTableId > gPyramidBagResources->menuActionsCount) + return FALSE; + else if (gPyramidBagResources->menuActionIds[actionTableId] == ACTION_DUMMY) + return FALSE; + else + return TRUE; +} + +static void sub_81C61A8(void) +{ + if (gPyramidBagResources->menuActionsCount == 1) + sub_81C6D6C(0); + else if (gPyramidBagResources->menuActionsCount == 2) + sub_81C6D6C(1); + else + sub_81C6D6C(2); +} + +static void BagAction_UseOnField(u8 taskId) +{ + u8 pocketId = ItemId_GetPocket(gSpecialVar_ItemId); + + if (pocketId == POCKET_KEY_ITEMS + || pocketId == POCKET_POKE_BALLS + || pocketId == POCKET_TM_HM + || ItemIsMail(gSpecialVar_ItemId) == TRUE) + { + sub_81C61A8(); + DisplayItemMessageInBattlePyramid(taskId, gText_DadsAdvice, sub_81C6714); + } + else if (ItemId_GetFieldFunc(gSpecialVar_ItemId) != NULL) + { + sub_81C61A8(); + FillWindowPixelBuffer(1, 0); + schedule_bg_copy_tilemap_to_vram(0); + ItemId_GetFieldFunc(gSpecialVar_ItemId)(taskId); + } +} + +static void BagAction_Cancel(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + sub_81C61A8(); + PrintItemDescription(data[1]); + schedule_bg_copy_tilemap_to_vram(0); + schedule_bg_copy_tilemap_to_vram(1); + sub_81C5A98(data[0], 0); + SetTaskToMainPyramidBagInputHandler(taskId); +} + +static void SetTaskToMainPyramidBagInputHandler(u8 taskId) +{ + AddScrollArrow(); + gTasks[taskId].func = Task_HandlePyramidBagInput; +} + +static void BagAction_Toss(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + sub_81C61A8(); + data[8] = 1; + if (data[2] == 1) + { + sub_81C6350(taskId); + } + else + { + CopyItemName(gSpecialVar_ItemId, gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_TossHowManyVar1s); + FillWindowPixelBuffer(1, 0); + PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); + sub_81C6404(); + gTasks[taskId].func = sub_81C64B4; + } +} + +static void sub_81C6350(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + CopyItemName(gSpecialVar_ItemId, gStringVar1); + ConvertIntToDecimalStringN(gStringVar2, data[8], STR_CONV_MODE_LEFT_ALIGN, 2); + StringExpandPlaceholders(gStringVar4, gText_ConfirmTossItems); + FillWindowPixelBuffer(1, 0); + PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); + sub_81C6DAC(taskId, &sYesNoTossFuncions); +} + +static void DontTossItem(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + PrintItemDescription(data[1]); + sub_81C5A98(data[0], 0); + SetTaskToMainPyramidBagInputHandler(taskId); +} + +static void sub_81C6404(void) +{ + s32 x; + + ConvertIntToDecimalStringN(gStringVar1, 1, STR_CONV_MODE_LEADING_ZEROS, 2); + StringExpandPlaceholders(gStringVar4, gText_xVar1); + sub_81C6CEC(3); + x = GetStringCenterAlignXOffset(1, gStringVar4, 0x28); + PrintTextOnWindow(3, 1, gStringVar4, x, 2, 0, NULL); +} + +static void sub_81C645C(s16 value) +{ + s32 x; + + ConvertIntToDecimalStringN(gStringVar1, value, STR_CONV_MODE_LEADING_ZEROS, 2); + StringExpandPlaceholders(gStringVar4, gText_xVar1); + x = GetStringCenterAlignXOffset(1, gStringVar4, 0x28); + PrintTextOnWindow(3, 1, gStringVar4, x, 2, 0, NULL); +} + +static void sub_81C64B4(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + if (AdjustQuantityAccordingToDPadInput(&data[8], data[2]) == TRUE) + { + sub_81C645C(data[8]); + } + else if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + sub_8198070(3, 0); + ClearWindowTilemap(3); + schedule_bg_copy_tilemap_to_vram(1); + sub_81C6350(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + sub_8198070(3, 0); + ClearWindowTilemap(3); + schedule_bg_copy_tilemap_to_vram(1); + DontTossItem(taskId); + } +} + +static void TossItem(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + CopyItemName(gSpecialVar_ItemId, gStringVar1); + ConvertIntToDecimalStringN(gStringVar2, data[8], STR_CONV_MODE_LEFT_ALIGN, 2); + StringExpandPlaceholders(gStringVar4, gText_ThrewAwayVar2Var1s); + FillWindowPixelBuffer(1, 0); + PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); + gTasks[taskId].func = sub_81C65CC; +} + +static void sub_81C65CC(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + u16 *scrollOffset = &gPyramidBagCursorData.scrollPosition; + u16 *selectedRow = &gPyramidBagCursorData.cursorPosition; + + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + { + PlaySE(SE_SELECT); + RemovePyramidBagItem(gSpecialVar_ItemId, data[8]); + DestroyListMenuTask(data[0], scrollOffset, selectedRow); + sub_81C5924(); + sub_81C59BC(); + SetBagItemsListTemplate(); + data[0] = ListMenuInit(&gMultiuseListMenuTemplate, *scrollOffset, *selectedRow); + schedule_bg_copy_tilemap_to_vram(0); + SetTaskToMainPyramidBagInputHandler(taskId); + } +} + +static void BagAction_Give(u8 taskId) +{ + sub_81C61A8(); + if (ItemIsMail(gSpecialVar_ItemId) == TRUE) + { + DisplayItemMessageInBattlePyramid(taskId, gText_CantWriteMail, sub_81C66EC); + } + else if (!ItemId_GetImportance(gSpecialVar_ItemId)) + { + gPyramidBagResources->callback2 = sub_81B7F60; + sub_81C5B14(taskId); + } + else + { + sub_81C66AC(taskId); + } +} + +static void sub_81C66AC(u8 taskId) +{ + CopyItemName(gSpecialVar_ItemId, gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_Var1CantBeHeld); + DisplayItemMessageInBattlePyramid(taskId, gStringVar4, sub_81C66EC); +} + +static void sub_81C66EC(u8 taskId) +{ + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + sub_81C6714(taskId); + } +} + +void sub_81C6714(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + sub_81C6E1C(); + PrintItemDescription(data[1]); + sub_81C5A98(data[0], 0); + SetTaskToMainPyramidBagInputHandler(taskId); +} + +static void sub_81C674C(u8 taskId) +{ + if (!itemid_80BF6D8_mail_related(gSpecialVar_ItemId)) + DisplayItemMessageInBattlePyramid(taskId, gText_CantWriteMail, sub_81C66EC); + else if (!ItemId_GetImportance(gSpecialVar_ItemId)) + sub_81C5B14(taskId); + else + sub_81C66AC(taskId); +} + +static void BagAction_UseInBattle(u8 taskId) +{ + if (ItemId_GetBattleFunc(gSpecialVar_ItemId) != NULL) + { + sub_81C61A8(); + ItemId_GetBattleFunc(gSpecialVar_ItemId)(taskId); + } +} + +static void Task_BeginItemSwap(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + data[1] = gPyramidBagCursorData.scrollPosition + gPyramidBagCursorData.cursorPosition; + gPyramidBagResources->unk814 = data[1]; + ListMenuSetUnkIndicatorsStructField(data[0], 0x10, 1); + CopyItemName(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode][data[1]], gStringVar1); + StringExpandPlaceholders(gStringVar4, gText_MoveVar1Where); + FillWindowPixelBuffer(1, 0); + PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); + sub_81C5A98(data[0], 1); + sub_81C704C(data[1]); + gTasks[taskId].func = Task_ItemSwapHandleInput; +} + +static void Task_ItemSwapHandleInput(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + if (sub_81221EC() != TRUE) + { + if (gMain.newKeys & SELECT_BUTTON) + { + PlaySE(SE_SELECT); + ListMenuGetScrollAndRow(data[0], &gPyramidBagCursorData.scrollPosition, &gPyramidBagCursorData.cursorPosition); + PerformItemSwap(taskId); + } + else + { + s32 id = ListMenuHandleInputGetItemId(data[0]); + ListMenuGetScrollAndRow(data[0], &gPyramidBagCursorData.scrollPosition, &gPyramidBagCursorData.cursorPosition); + sub_81C7028(FALSE); + sub_81C704C(gPyramidBagCursorData.cursorPosition); + switch (id) + { + case LIST_NOTHING_CHOSEN: + break; + case LIST_B_PRESSED: + PlaySE(SE_SELECT); + if (gMain.newKeys & A_BUTTON) + PerformItemSwap(taskId); + else + sub_81C6A14(taskId); + break; + default: + PlaySE(SE_SELECT); + PerformItemSwap(taskId); + break; + } + } + } +} + +static void PerformItemSwap(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + u16 *scrollOffset = &gPyramidBagCursorData.scrollPosition; + u16 *selectedRow = &gPyramidBagCursorData.cursorPosition; + u16 var = *scrollOffset + *selectedRow; + + if (data[1] == var || data[1] == var - 1) + { + sub_81C6A14(taskId); + } + else + { + MovePyramidBagItemSlotInList(data[1], var); + gPyramidBagResources->unk814 = 0xFF; + sub_81C7028(TRUE); + DestroyListMenuTask(data[0], scrollOffset, selectedRow); + if (data[1] < var) + gPyramidBagCursorData.cursorPosition--; + SetBagItemsListTemplate(); + data[0] = ListMenuInit(&gMultiuseListMenuTemplate, *scrollOffset, *selectedRow); + SetTaskToMainPyramidBagInputHandler(taskId); + } +} + +static void sub_81C6A14(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + u16 *scrollOffset = &gPyramidBagCursorData.scrollPosition; + u16 *selectedRow = &gPyramidBagCursorData.cursorPosition; + + gPyramidBagResources->unk814 = 0xFF; + sub_81C7028(TRUE); + DestroyListMenuTask(data[0], scrollOffset, selectedRow); + if (data[1] < *scrollOffset + *selectedRow) + gPyramidBagCursorData.cursorPosition--; + SetBagItemsListTemplate(); + data[0] = ListMenuInit(&gMultiuseListMenuTemplate, *scrollOffset, *selectedRow); + SetTaskToMainPyramidBagInputHandler(taskId); +} + +void sub_81C6A94(void) +{ + u8 i; + struct Pokemon *party = gPlayerParty; + u16 *newItems = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(u16)); + u8 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(u8)); + u16 heldItem; + + memcpy(newItems, gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(u16)); + memcpy(newQuantities, gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(u8)); + for (i = 0; i < 3; i++) + { + heldItem = GetMonData(&party[i], MON_DATA_HELD_ITEM); + if (heldItem != 0 && !AddBagItem(heldItem, 1)) + { + memcpy(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], newItems, PYRAMID_BAG_ITEMS_COUNT * sizeof(u16)); + memcpy(gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], newQuantities, PYRAMID_BAG_ITEMS_COUNT * sizeof(u8)); + Free(newItems); + Free(newQuantities); + gSpecialVar_Result = 1; + return; + } + } + + heldItem = 0; + for (i = 0; i < 3; i++) + { + SetMonData(&party[i], MON_DATA_HELD_ITEM, &heldItem); + } + gSpecialVar_Result = 0; + Free(newItems); + Free(newQuantities); +} + +static void sub_81C6BD8(void) +{ + u8 i; + + InitWindows(gUnknown_0861F328); + DeactivateAllTextPrinters(); + LoadUserWindowBorderGfx(0, 0x1, 0xE0); + LoadMessageBoxGfx(0, 0xA, 0xD0); + LoadPalette(gUnknown_0860F074, 0xF0, 0x20); + + for (i = 0; i < 5; i++) + FillWindowPixelBuffer(i, 0); + + PutWindowTilemap(0); + PutWindowTilemap(1); + schedule_bg_copy_tilemap_to_vram(0); + schedule_bg_copy_tilemap_to_vram(1); +} + +static void PrintOnWindow_Font1(u8 windowId, const u8 *src, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, u8 speed, u8 colorTableId) +{ + AddTextPrinterParameterized2(windowId, 1, x, y, letterSpacing, lineSpacing, sColorTable[colorTableId], speed, src); +} + +static void PrintOnWindow_Font7(u8 windowId, const u8 *src, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, u8 speed, u8 colorTableId) +{ + AddTextPrinterParameterized2(windowId, 7, x, y, letterSpacing, lineSpacing, sColorTable[colorTableId], speed, src); +} + +static void sub_81C6CEC(u8 windowId) +{ + SetWindowBorderStyle(windowId, 0, 1, 0xE); + schedule_bg_copy_tilemap_to_vram(1); +} + +static u8 sub_81C6D08(u8 windowArrayId) +{ + return gPyramidBagResources->windowIds[windowArrayId]; +} + +static u8 sub_81C6D24(u8 windowArrayId) +{ + u8 *windowId = &gPyramidBagResources->windowIds[windowArrayId]; + if (*windowId == 0xFF) + { + *windowId = AddWindow(&gUnknown_0861F350[windowArrayId]); + SetWindowBorderStyle(*windowId, FALSE, 1, 0xE); + schedule_bg_copy_tilemap_to_vram(1); + } + return *windowId; +} + +static void sub_81C6D6C(u8 windowArrayId) +{ + u8 *windowId = &gPyramidBagResources->windowIds[windowArrayId]; + if (*windowId != 0xFF) + { + sub_8198070(*windowId, FALSE); + ClearWindowTilemap(*windowId); + RemoveWindow(*windowId); + schedule_bg_copy_tilemap_to_vram(1); + *windowId = 0xFF; + } +} + +static void sub_81C6DAC(u8 taskId, const struct YesNoFuncTable *yesNoTable) +{ + CreateYesNoMenuWithCallbacks(taskId, &gUnknown_0861F350[4], 1, 0, 2, 1, 0xE, yesNoTable); +} + +void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId)) +{ + FillWindowPixelBuffer(2, 0x11); + DisplayMessageAndContinueTask(taskId, 2, 0xA, 0xD, 1, GetPlayerTextSpeed(), str, callback); + schedule_bg_copy_tilemap_to_vram(1); +} + +static void sub_81C6E1C(void) +{ + sub_8197DF8(2, FALSE); + ClearWindowTilemap(2); + schedule_bg_copy_tilemap_to_vram(1); +} + +#define ITEM_IMAGE_TAG 0x1024 + +static void sub_81C6E38(u8 itemSpriteArrayId) +{ + u8 *spriteId = &gPyramidBagResources->itemsSpriteIds[itemSpriteArrayId]; + if (*spriteId != 0xFF) + { + FreeSpriteTilesByTag(ITEM_IMAGE_TAG + itemSpriteArrayId); + FreeSpritePaletteByTag(ITEM_IMAGE_TAG + itemSpriteArrayId); + FreeSpriteOamMatrix(&gSprites[*spriteId]); + DestroySprite(&gSprites[*spriteId]); + *spriteId = 0xFF; + } +} + +static void sub_81C6E98(void) +{ + struct SpritePalette spritePalette; + u16 *palPtr = Alloc(0x40); + + LZDecompressWram(gUnknown_08D9ADD0, palPtr); + spritePalette.data = palPtr + (gSaveBlock2Ptr->frontier.lvlMode * 16); + spritePalette.tag = ITEM_IMAGE_TAG; + LoadSpritePalette(&spritePalette); + Free(palPtr); +} + +static void sub_81C6EF4(void) +{ + u8 *spriteId = &gPyramidBagResources->itemsSpriteIds[0]; + *spriteId = CreateSprite(&gUnknown_0861F3D4, 0x44, 0x38, 0); +} + +static void sub_81C6F20(void) +{ + struct Sprite *sprite = &gSprites[gPyramidBagResources->itemsSpriteIds[0]]; + if (sprite->affineAnimEnded) + { + StartSpriteAffineAnim(sprite, 1); + sprite->callback = sub_81C6F68; + } +} + +static void sub_81C6F68(struct Sprite *sprite) +{ + if (sprite->affineAnimEnded) + { + StartSpriteAffineAnim(sprite, 0); + sprite->callback = SpriteCallbackDummy; + } +} + +static void ShowItemImage(u16 itemId, u8 itemSpriteArrayId) +{ + u8 itemSpriteId; + u8 *spriteId = &gPyramidBagResources->itemsSpriteIds[itemSpriteArrayId + 1]; + if (*spriteId == 0xFF) + { + FreeSpriteTilesByTag(ITEM_IMAGE_TAG + 1 + itemSpriteArrayId); + FreeSpritePaletteByTag(ITEM_IMAGE_TAG + 1 + itemSpriteArrayId); + itemSpriteId = AddItemIconSprite(ITEM_IMAGE_TAG + 1 + itemSpriteArrayId, ITEM_IMAGE_TAG + 1 + itemSpriteArrayId, itemId); + if (itemSpriteId != MAX_SPRITES) + { + *spriteId = itemSpriteId; + gSprites[itemSpriteId].pos2.x = 24; + gSprites[itemSpriteId].pos2.y = 88; + } + } +} + +static void sub_81C6FF8(u8 itemSpriteArrayId) +{ + sub_81C6E38(itemSpriteArrayId + 1); +} + +static void sub_81C700C(void) +{ + sub_8122344(&gPyramidBagResources->itemsSpriteIds[3], 8); +} + +static void sub_81C7028(bool8 invisible) +{ + sub_81223FC(&gPyramidBagResources->itemsSpriteIds[3], 8, invisible); +} + +static void sub_81C704C(u8 y) +{ + sub_8122448(&gPyramidBagResources->itemsSpriteIds[3], 8 | 0x80, 120, (y + 1) * 16); +} diff --git a/src/battle_records.c b/src/battle_records.c index 8e9d045cb..fc9826e5b 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -64,11 +64,28 @@ static const struct BgTemplate sTrainerHillRecordsBgTemplates[] = static const struct WindowTemplate sTrainerHillRecordsWindowTemplates[] = { - {0x0, 0x2, 0x1, 0x1A, 0x12, 0xF, 0x14}, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 1, + .width = 26, + .height = 18, + .paletteNum = 15, + .baseBlock = 20 + }, DUMMY_WIN_TEMPLATE }; -static const struct WindowTemplate sLinkBattleRecordsWindow = {0x0, 0x2, 0x1, 0x1A, 0x11, 0xF, 0x1}; +static const struct WindowTemplate sLinkBattleRecordsWindow = +{ + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 1, + .width = 26, + .height = 17, + .paletteNum = 15, + .baseBlock = 1 +}; static const u8 sText_DashesNoPlayer[] = _("-------"); static const u8 sText_DashesNoScore[] = _("----"); @@ -107,7 +124,7 @@ static s32 FindLinkBattleRecord(struct LinkBattleRecord *records, const u8 *name for (i = 0; i < LINK_B_RECORDS_COUNT; i++) { - if (!StringCompareN(records[i].name, name, OT_NAME_LENGTH) && records[i].trainerId == trainerId) + if (!StringCompareN(records[i].name, name, PLAYER_NAME_LENGTH) && records[i].trainerId == trainerId) return i; } @@ -198,7 +215,7 @@ static void UpdateLinkBattleRecords(struct LinkBattleRecords *records, const u8 { index = LINK_B_RECORDS_COUNT - 1; ClearLinkBattleRecord(&records->entries[index]); - StringCopyN(records->entries[index].name, name, OT_NAME_LENGTH); + StringCopyN(records->entries[index].name, name, PLAYER_NAME_LENGTH); records->entries[index].trainerId = trainerId; records->languages[index] = gLinkPlayers[battlerId].language; } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b13727a12..44194deda 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -700,7 +700,7 @@ static const u8* const sMoveEffectBS_Ptrs[] = BattleScript_MoveEffectPayDay, // MOVE_EFFECT_PAYDAY BattleScript_MoveEffectSleep, // MOVE_EFFECT_CHARGING BattleScript_MoveEffectWrap, // MOVE_EFFECT_WRAP - BattleScript_MoveEffectRecoil33, // MOVE_EFFECT_RECOIL_25 + BattleScript_MoveEffectRecoil, // MOVE_EFFECT_RECOIL_25 BattleScript_MoveEffectSleep, // MOVE_EFFECT_ATK_PLUS_1 BattleScript_MoveEffectSleep, // MOVE_EFFECT_DEF_PLUS_1 BattleScript_MoveEffectSleep, // MOVE_EFFECT_SPD_PLUS_1 @@ -724,7 +724,7 @@ static const u8* const sMoveEffectBS_Ptrs[] = BattleScript_MoveEffectSleep, // MOVE_EFFECT_RAPIDSPIN BattleScript_MoveEffectSleep, // MOVE_EFFECT_REMOVE_PARALYSIS BattleScript_MoveEffectSleep, // MOVE_EFFECT_ATK_DEF_DOWN - BattleScript_MoveEffectRecoil33, // MOVE_EFFECT_RECOIL_33_PARALYSIS + BattleScript_MoveEffectRecoil, // MOVE_EFFECT_RECOIL_33 }; static const struct WindowTemplate sUnusedWinTemplate = {0, 1, 3, 7, 0xF, 0x1F, 0x3F}; @@ -2843,7 +2843,7 @@ void SetMoveEffect(bool8 primary, u8 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_AtkDefDown; break; - case MOVE_EFFECT_RECOIL_33_PARALYSIS: // Volt Tackle + case MOVE_EFFECT_RECOIL_33: // Double Edge gBattleMoveDamage = gHpDealt / 3; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; @@ -4497,20 +4497,38 @@ static void atk48_playstatchangeanimation(void) } } -#define ATK49_LAST_CASE 17 +enum +{ + ATK49_RAGE, + ATK49_DEFROST, + ATK49_SYNCHRONIZE_TARGET, + ATK49_MOVE_END_ABILITIES, + ATK49_STATUS_IMMUNITY_ABILITIES, + ATK49_SYNCHRONIZE_ATTACKER, + ATK49_CHOICE_MOVE, + ATK49_CHANGED_ITEMS, + ATK49_ATTACKER_INVISIBLE, + ATK49_ATTACKER_VISIBLE, + ATK49_TARGET_VISIBLE, + ATK49_ITEM_EFFECTS_ALL, + ATK49_KINGSROCK_SHELLBELL, + ATK49_SUBSTITUTE, + ATK49_UPDATE_LAST_MOVES, + ATK49_MIRROR_MOVE, + ATK49_NEXT_TARGET, + ATK49_COUNT, +}; static void atk49_moveend(void) { s32 i; - bool32 effect; - u8 moveType; - u8 holdEffectAtk; - u16 *choicedMoveAtk; + bool32 effect = FALSE; + u8 moveType = 0; + u8 holdEffectAtk = 0; + u16 *choicedMoveAtk = NULL; u8 arg1, arg2; u16 originallyUsedMove; - effect = FALSE; - if (gChosenMove == 0xFFFF) originallyUsedMove = 0; else @@ -4531,7 +4549,7 @@ static void atk49_moveend(void) { switch (gBattleScripting.atk49_state) { - case 0: // rage check + case ATK49_RAGE: // rage check if (gBattleMons[gBattlerTarget].status2 & STATUS2_RAGE && gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget) @@ -4545,7 +4563,7 @@ static void atk49_moveend(void) } gBattleScripting.atk49_state++; break; - case 1: // defrosting check + case ATK49_DEFROST: // defrosting check if (gBattleMons[gBattlerTarget].status1 & STATUS1_FREEZE && gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget && gSpecialStatuses[gBattlerTarget].specialDmg @@ -4561,28 +4579,28 @@ static void atk49_moveend(void) } gBattleScripting.atk49_state++; break; - case 2: // target synchronize + case ATK49_SYNCHRONIZE_TARGET: // target synchronize if (AbilityBattleEffects(ABILITYEFFECT_SYNCHRONIZE, gBattlerTarget, 0, 0, 0)) effect = TRUE; gBattleScripting.atk49_state++; break; - case 3: // contact abilities - if (AbilityBattleEffects(ABILITYEFFECT_CONTACT, gBattlerTarget, 0, 0, 0)) + case ATK49_MOVE_END_ABILITIES: // Such as abilities activating on contact(Poison Spore, Rough Skin, etc.). + if (AbilityBattleEffects(ABILITYEFFECT_MOVE_END, gBattlerTarget, 0, 0, 0)) effect = TRUE; gBattleScripting.atk49_state++; break; - case 4: // status immunities + case ATK49_STATUS_IMMUNITY_ABILITIES: // status immunities if (AbilityBattleEffects(ABILITYEFFECT_IMMUNITY, 0, 0, 0, 0)) effect = TRUE; // it loops through all battlers, so we increment after its done with all battlers else gBattleScripting.atk49_state++; break; - case 5: // attacker synchronize + case ATK49_SYNCHRONIZE_ATTACKER: // attacker synchronize if (AbilityBattleEffects(ABILITYEFFECT_ATK_SYNCHRONIZE, gBattlerAttacker, 0, 0, 0)) effect = TRUE; gBattleScripting.atk49_state++; break; - case 6: // update choice band move + case ATK49_CHOICE_MOVE: // update choice band move if (!(gHitMarker & HITMARKER_OBEYS) || holdEffectAtk != HOLD_EFFECT_CHOICE_BAND || gChosenMove == MOVE_STRUGGLE || (*choicedMoveAtk != 0 && *choicedMoveAtk != 0xFFFF)) goto LOOP; @@ -4605,7 +4623,7 @@ static void atk49_moveend(void) gBattleScripting.atk49_state++; } break; - case 7: // changed held items + case ATK49_CHANGED_ITEMS: // changed held items for (i = 0; i < gBattlersCount; i++) { u16* changedItem = &gBattleStruct->changedItems[i]; @@ -4617,18 +4635,18 @@ static void atk49_moveend(void) } gBattleScripting.atk49_state++; break; - case 11: // item effects for all battlers - if (ItemBattleEffects(3, 0, FALSE)) + case ATK49_ITEM_EFFECTS_ALL: // item effects for all battlers + if (ItemBattleEffects(ITEMEFFECT_MOVE_END, 0, FALSE)) effect = TRUE; else gBattleScripting.atk49_state++; break; - case 12: // king's rock and shell bell - if (ItemBattleEffects(4, 0, FALSE)) + case ATK49_KINGSROCK_SHELLBELL: // king's rock and shell bell + if (ItemBattleEffects(ITEMEFFECT_KINGSROCK_SHELLBELL, 0, FALSE)) effect = TRUE; gBattleScripting.atk49_state++; break; - case 8: // make attacker sprite invisible + case ATK49_ATTACKER_INVISIBLE: // make attacker sprite invisible if (gStatuses3[gBattlerAttacker] & (STATUS3_SEMI_INVULNERABLE) && gHitMarker & HITMARKER_NO_ANIMATIONS) { @@ -4640,7 +4658,7 @@ static void atk49_moveend(void) } gBattleScripting.atk49_state++; break; - case 9: // make attacker sprite visible + case ATK49_ATTACKER_VISIBLE: // make attacker sprite visible if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT || !(gStatuses3[gBattlerAttacker] & (STATUS3_SEMI_INVULNERABLE)) || WasUnableToUseMove(gBattlerAttacker)) @@ -4655,7 +4673,7 @@ static void atk49_moveend(void) } gBattleScripting.atk49_state++; break; - case 10: // make target sprite visible + case ATK49_TARGET_VISIBLE: // make target sprite visible if (!gSpecialStatuses[gBattlerTarget].restoredBattlerSprite && gBattlerTarget < gBattlersCount && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)) { @@ -4668,7 +4686,7 @@ static void atk49_moveend(void) } gBattleScripting.atk49_state++; break; - case 13: // update substitute + case ATK49_SUBSTITUTE: // update substitute for (i = 0; i < gBattlersCount; i++) { if (gDisableStructs[i].substituteHP == 0) @@ -4676,7 +4694,7 @@ static void atk49_moveend(void) } gBattleScripting.atk49_state++; break; - case 14: // This case looks interesting, although I am not certain what it does. Probably fine tunes edge cases. + case ATK49_UPDATE_LAST_MOVES: if (gHitMarker & HITMARKER_SWAP_ATTACKER_TARGET) { gActiveBattler = gBattlerAttacker; @@ -4725,7 +4743,7 @@ static void atk49_moveend(void) } gBattleScripting.atk49_state++; break; - case 15: // mirror move + case ATK49_MIRROR_MOVE: // mirror move if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker]) && !(gBattleStruct->field_91 & gBitTable[gBattlerAttacker]) && gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED && gHitMarker & HITMARKER_OBEYS && gBattlerAttacker != gBattlerTarget && !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget)) @@ -4746,7 +4764,7 @@ static void atk49_moveend(void) } gBattleScripting.atk49_state++; break; - case 16: // + case ATK49_NEXT_TARGET: // For moves hitting two opposing Pokemon. if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !gProtectStructs[gBattlerAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH && !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) @@ -4759,7 +4777,7 @@ static void atk49_moveend(void) gBattleScripting.atk49_state = 0; MoveValuesCleanUp(); BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); - gBattlescriptCurrInstr = BattleScript_82DB87D; + gBattlescriptCurrInstr = BattleScript_FlushMessageBox; return; } else @@ -4769,18 +4787,18 @@ static void atk49_moveend(void) } gBattleScripting.atk49_state++; break; - case ATK49_LAST_CASE: + case ATK49_COUNT: break; } if (arg1 == 1 && effect == FALSE) - gBattleScripting.atk49_state = ATK49_LAST_CASE; + gBattleScripting.atk49_state = ATK49_COUNT; if (arg1 == 2 && arg2 == gBattleScripting.atk49_state) - gBattleScripting.atk49_state = ATK49_LAST_CASE; + gBattleScripting.atk49_state = ATK49_COUNT; - } while (gBattleScripting.atk49_state != ATK49_LAST_CASE && effect == FALSE); + } while (gBattleScripting.atk49_state != ATK49_COUNT && effect == FALSE); - if (gBattleScripting.atk49_state == ATK49_LAST_CASE && effect == FALSE) + if (gBattleScripting.atk49_state == ATK49_COUNT && effect == FALSE) gBattlescriptCurrInstr += 3; } @@ -5550,8 +5568,8 @@ static void atk52_switchineffects(void) gDisableStructs[gActiveBattler].truantUnknownBit = 0; - if (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gActiveBattler, 0, 0, 0) == 0 && - ItemBattleEffects(0, gActiveBattler, 0) == 0) + if (!AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gActiveBattler, 0, 0, 0) + && !ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gActiveBattler, FALSE)) { gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~(SIDE_STATUS_SPIKES_DAMAGED); @@ -6750,10 +6768,10 @@ static void atk76_various(void) } } break; - case 21: + case VARIOUS_VOLUME_DOWN: m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x55); break; - case 22: + case VARIOUS_VOLUME_UP: m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); break; case 23: diff --git a/src/battle_setup.c b/src/battle_setup.c index 2955a33fc..17ab20ccd 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -33,6 +33,7 @@ #include "field_weather.h" #include "gym_leader_rematch.h" #include "constants/map_types.h" +#include "constants/battle_frontier.h" enum { @@ -863,7 +864,7 @@ u8 sub_80B100C(s32 arg0) return sUnknown_0854FEA7[Random() % ARRAY_COUNT(sUnknown_0854FEA7)]; } - if (VarGet(VAR_0x40CE) != 3) + if (VarGet(VAR_FRONTIER_BATTLE_MODE) != FRONTIER_MODE_LINK_MULTIS) return sUnknown_0854FE98[Random() % ARRAY_COUNT(sUnknown_0854FE98)]; } else @@ -880,7 +881,7 @@ u8 sub_80B100C(s32 arg0) return sUnknown_0854FEA7[Random() % ARRAY_COUNT(sUnknown_0854FEA7)]; } - if (VarGet(VAR_0x40CE) != 3) + if (VarGet(VAR_FRONTIER_BATTLE_MODE) != FRONTIER_MODE_LINK_MULTIS) return sUnknown_0854FE98[Random() % ARRAY_COUNT(sUnknown_0854FE98)]; } diff --git a/src/battle_tent.c b/src/battle_tent.c index 68d7c5e83..516f3fc4d 100644 --- a/src/battle_tent.c +++ b/src/battle_tent.c @@ -11,7 +11,11 @@ #include "constants/items.h" #include "constants/region_map_sections.h" -// this file's functions +extern const struct BattleFrontierTrainer gSlateportBattleTentTrainers[]; +extern const struct FacilityMon gSlateportBattleTentMons[]; +extern const u16 gBattleFrontierHeldItems[]; + +// This file's functions. void sub_81B99D4(void); void sub_81B9A28(void); void sub_81B9A44(void); @@ -51,7 +55,7 @@ void (*const gUnknown_086160B4[])(void) = sub_81B9B28 }; -const u16 gUnknown_086160D4[] = {ITEM_NEST_BALL, ITEM_NONE}; +static const u16 sVerdanturfTentRewards[] = {ITEM_NEST_BALL}; void (*const gUnknown_086160D8[])(void) = { @@ -64,7 +68,7 @@ void (*const gUnknown_086160D8[])(void) = sub_81B9CF0 }; -const u16 gUnknown_086160F4[] = {ITEM_HYPER_POTION, ITEM_NONE}; +static const u16 sFallarborTentRewards[] = {ITEM_HYPER_POTION}; void (*const gUnknown_086160F8[])(void) = { @@ -80,7 +84,7 @@ void (*const gUnknown_086160F8[])(void) = sub_81B9EC0 }; -const u16 gUnknown_08616120[] = {ITEM_FULL_HEAL, ITEM_NONE}; +static const u16 sSlateportTentRewards[] = {ITEM_FULL_HEAL}; // code void sub_81B99B4(void) @@ -115,7 +119,7 @@ void sub_81B9A60(void) void sub_81B9A90(void) { if (gTrainerBattleOpponent_A < 300) - ConvertBattleFrontierTrainerSpeechToString(gUnknown_0203BC88[gTrainerBattleOpponent_A].speechBefore); + ConvertBattleFrontierTrainerSpeechToString(gFacilityTrainers[gTrainerBattleOpponent_A].speechBefore); } void sub_81B9ABC(void) @@ -128,7 +132,7 @@ void sub_81B9ABC(void) void sub_81B9B00(void) { - gSaveBlock2Ptr->frontier.field_E6A = gUnknown_086160D4[Random() % 1]; + gSaveBlock2Ptr->frontier.field_E6A = sVerdanturfTentRewards[Random() % ARRAY_COUNT(sVerdanturfTentRewards)]; } void sub_81B9B28(void) @@ -178,7 +182,7 @@ void sub_81B9C2C(void) void sub_81B9C70(void) { - gSaveBlock2Ptr->frontier.field_E6C = gUnknown_086160F4[Random() % 1]; + gSaveBlock2Ptr->frontier.field_E6C = sFallarborTentRewards[Random() % ARRAY_COUNT(sFallarborTentRewards)]; } void sub_81B9C98(void) @@ -233,7 +237,7 @@ void sub_81B9DB4(void) void sub_81B9DF8(void) { - gSaveBlock2Ptr->frontier.field_E6E = gUnknown_08616120[Random() % 1]; + gSaveBlock2Ptr->frontier.field_E6E = sSlateportTentRewards[Random() % ARRAY_COUNT(sSlateportTentRewards)]; } void sub_81B9E20(void) @@ -266,3 +270,259 @@ bool8 sub_81B9E94(void) return (gMapHeader.regionMapSectionId == MAPSEC_SLATEPORT_CITY && ((gMapHeader.mapLayoutId == 385) | (gMapHeader.mapLayoutId == 386))); } + +// This function was written very...oddly. +#ifdef NONMATCHING +void sub_81B9EC0(void) +{ + s32 i, j; + u16 currMonId = 0, currSpecies = 0; + u16 species[PARTY_SIZE]; + u16 monIds[PARTY_SIZE]; + u16 heldItems[PARTY_SIZE]; + s32 zero = 0; + + gFacilityTrainers = gSlateportBattleTentTrainers; + for (i = 0; i < PARTY_SIZE; i++) + { + species[i] = 0; + monIds[i] = 0; + heldItems[i] = 0; + } + gFacilityTrainerMons = gSlateportBattleTentMons; + currSpecies = 0; + for (i = 0; i != PARTY_SIZE;) + { + // Cannot have two pokemon of the same species. + currMonId = Random() % 70; + for (j = zero; j < i + zero; j++) + { + if (monIds[j] == currMonId) + break; + if (species[j] == gFacilityTrainerMons[currMonId].species) + { + if (currSpecies == 0) + currSpecies = gFacilityTrainerMons[currMonId].species; + else + break; + } + } + if (j != i + zero) + continue; + + // Cannot have two same held items. + for (j = zero; j < i + zero; j++) + { + if (heldItems[j] == 0) + continue; + if (heldItems[j] == gBattleFrontierHeldItems[gFacilityTrainerMons[currMonId].itemTableId]) + { + if (gFacilityTrainerMons[currMonId].species == currSpecies) + currSpecies = 0; + else + break; + } + } + if (j != i + zero) + continue; + + gSaveBlock2Ptr->frontier.field_E70[i].monId = currMonId; + species[i] = gFacilityTrainerMons[currMonId].species; + heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[currMonId].itemTableId]; + monIds[i] = currMonId; + i++; + } +} +#else +NAKED +void sub_81B9EC0(void) +{ + asm_unified("\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x3C\n\ + ldr r1, =gFacilityTrainers\n\ + ldr r0, =gSlateportBattleTentTrainers\n\ + str r0, [r1]\n\ + add r0, sp, 0xC\n\ + mov r9, r0\n\ + mov r1, sp\n\ + adds r1, 0x18\n\ + str r1, [sp, 0x2C]\n\ + ldr r5, =gFacilityTrainerMons\n\ + ldr r4, =gSlateportBattleTentMons\n\ + movs r2, 0\n\ + adds r3, r1, 0\n\ + mov r1, r9\n\ + mov r0, sp\n\ + movs r6, 0x5\n\ + mov r8, r6\n\ +_081B9EEC:\n\ + strh r2, [r0]\n\ + strh r2, [r1]\n\ + strh r2, [r3]\n\ + adds r3, 0x2\n\ + adds r1, 0x2\n\ + adds r0, 0x2\n\ + movs r7, 0x1\n\ + negs r7, r7\n\ + add r8, r7\n\ + mov r6, r8\n\ + cmp r6, 0\n\ + bge _081B9EEC\n\ + str r4, [r5]\n\ + movs r7, 0\n\ + mov r10, r7\n\ + movs r0, 0\n\ + mov r8, r0\n\ + ldr r1, [sp, 0x2C]\n\ + str r1, [sp, 0x30]\n\ + mov r2, sp\n\ + str r2, [sp, 0x34]\n\ + lsls r6, r0, 1\n\ + str r6, [sp, 0x24]\n\ + add r6, r9\n\ + str r6, [sp, 0x28]\n\ +_081B9F1E:\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0x46\n\ + bl __umodsi3\n\ + lsls r0, 16\n\ + lsrs r5, r0, 16\n\ + movs r2, 0\n\ + mov r7, r8\n\ + adds r6, r2, r7\n\ + cmp r2, r6\n\ + bge _081B9F7C\n\ + ldr r1, [sp, 0x28]\n\ + ldrh r0, [r1]\n\ + cmp r0, r5\n\ + beq _081B9F7C\n\ + ldr r0, =gFacilityTrainerMons\n\ + ldr r1, [r0]\n\ + lsls r0, r5, 4\n\ + adds r4, r0, r1\n\ + ldrh r7, [r4]\n\ + mov r12, r7\n\ + lsls r3, r2, 1\n\ + ldr r1, [sp, 0x24]\n\ + add r1, sp\n\ + str r6, [sp, 0x38]\n\ +_081B9F56:\n\ + ldrh r0, [r1]\n\ + cmp r0, r12\n\ + bne _081B9F66\n\ + mov r0, r10\n\ + cmp r0, 0\n\ + bne _081B9F7C\n\ + ldrh r7, [r4]\n\ + mov r10, r7\n\ +_081B9F66:\n\ + adds r3, 0x2\n\ + adds r1, 0x2\n\ + adds r2, 0x1\n\ + ldr r0, [sp, 0x38]\n\ + cmp r2, r0\n\ + bge _081B9F7C\n\ + mov r7, r9\n\ + adds r0, r7, r3\n\ + ldrh r0, [r0]\n\ + cmp r0, r5\n\ + bne _081B9F56\n\ +_081B9F7C:\n\ + cmp r2, r6\n\ + bne _081BA01C\n\ + movs r2, 0\n\ + cmp r2, r6\n\ + bge _081B9FD4\n\ + ldr r0, =gBattleFrontierHeldItems\n\ + mov r12, r0\n\ + ldr r7, =gFacilityTrainerMons\n\ + ldr r1, [sp, 0x24]\n\ + ldr r0, [sp, 0x2C]\n\ + adds r4, r1, r0\n\ +_081B9F92:\n\ + ldrh r3, [r4]\n\ + cmp r3, 0\n\ + beq _081B9FCC\n\ + ldr r1, [r7]\n\ + lsls r0, r5, 4\n\ + adds r1, r0, r1\n\ + ldrb r0, [r1, 0xA]\n\ + lsls r0, 1\n\ + add r0, r12\n\ + ldrh r0, [r0]\n\ + cmp r3, r0\n\ + bne _081B9FCC\n\ + ldrh r0, [r1]\n\ + cmp r0, r10\n\ + bne _081B9FD4\n\ + movs r1, 0\n\ + mov r10, r1\n\ + b _081B9FD4\n\ + .pool\n\ +_081B9FCC:\n\ + adds r4, 0x2\n\ + adds r2, 0x1\n\ + cmp r2, r6\n\ + blt _081B9F92\n\ +_081B9FD4:\n\ + cmp r2, r6\n\ + bne _081BA01C\n\ + ldr r0, =gSaveBlock2Ptr\n\ + ldr r1, [r0]\n\ + mov r2, r8\n\ + lsls r3, r2, 1\n\ + adds r0, r3, r2\n\ + lsls r0, 2\n\ + adds r1, r0\n\ + movs r6, 0xE7\n\ + lsls r6, 4\n\ + adds r1, r6\n\ + strh r5, [r1]\n\ + ldr r0, =gFacilityTrainerMons\n\ + ldr r0, [r0]\n\ + lsls r1, r5, 4\n\ + adds r1, r0\n\ + ldrh r0, [r1]\n\ + ldr r7, [sp, 0x34]\n\ + strh r0, [r7]\n\ + ldr r2, =gBattleFrontierHeldItems\n\ + ldrb r0, [r1, 0xA]\n\ + lsls r0, 1\n\ + adds r0, r2\n\ + ldrh r0, [r0]\n\ + ldr r1, [sp, 0x30]\n\ + strh r0, [r1]\n\ + add r3, r9\n\ + strh r5, [r3]\n\ + adds r1, 0x2\n\ + str r1, [sp, 0x30]\n\ + adds r2, r7, 0\n\ + adds r2, 0x2\n\ + str r2, [sp, 0x34]\n\ + movs r6, 0x1\n\ + add r8, r6\n\ +_081BA01C:\n\ + mov r7, r8\n\ + cmp r7, 0x6\n\ + beq _081BA024\n\ + b _081B9F1E\n\ +_081BA024:\n\ + add sp, 0x3C\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + "); +} +#endif // NONMATCHING diff --git a/src/battle_tower.c b/src/battle_tower.c new file mode 100644 index 000000000..e70d4af91 --- /dev/null +++ b/src/battle_tower.c @@ -0,0 +1,85 @@ +#include "global.h" +#include "event_data.h" +#include "battle_setup.h" +#include "overworld.h" +#include "random.h" +#include "battle_tower.h" + +extern void sub_81A3ACC(void); + +extern const u32 gUnknown_085DF9AC[][2]; +extern const u32 gUnknown_085DF9CC[][2]; +extern void (* const gUnknown_085DF96C[])(void); + +// This file's functions. +void sub_8164ED8(void); +u16 sub_8164FCC(u8, u8); + +// code +void sub_8161F74(void) +{ + gUnknown_085DF96C[gSpecialVar_0x8004](); +} + +void sub_8161F94(void) +{ + u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + + gSaveBlock2Ptr->frontier.field_CA8 = 1; + gSaveBlock2Ptr->frontier.field_CB2 = 0; + gSaveBlock2Ptr->frontier.field_CA9_a = 0; + gSaveBlock2Ptr->frontier.field_CA9_b = 0; + sub_81A3ACC(); + if (!(gSaveBlock2Ptr->frontier.field_CDC & gUnknown_085DF9AC[battleMode][lvlMode])) + gSaveBlock2Ptr->frontier.field_CE0[battleMode][lvlMode] = 0; + + sub_8164ED8(); + saved_warp2_set(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1); + gTrainerBattleOpponent_A = 0; +} + +void sub_8162054(void) +{ + u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + + switch (gSpecialVar_0x8005) + { + case 0: + break; + case 1: + gSpecialVar_Result = sub_8164FCC(lvlMode, battleMode); + break; + case 2: + gSpecialVar_Result = ((gSaveBlock2Ptr->frontier.field_CDC & gUnknown_085DF9AC[battleMode][lvlMode]) != 0); + break; + case 3: + gSaveBlock2Ptr->frontier.field_D07 = gSaveBlock2Ptr->frontier.lvlMode; + break; + } +} + +void sub_81620F4(void) +{ + u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + + switch (gSpecialVar_0x8005) + { + case 0: + break; + case 1: + gSaveBlock2Ptr->frontier.field_CE0[battleMode][lvlMode] = gSpecialVar_0x8006; + break; + case 2: + if (gSpecialVar_0x8006) + gSaveBlock2Ptr->frontier.field_CDC |= gUnknown_085DF9AC[battleMode][lvlMode]; + else + gSaveBlock2Ptr->frontier.field_CDC &= gUnknown_085DF9CC[battleMode][lvlMode]; + break; + case 3: + gSaveBlock2Ptr->frontier.field_D07 = gSaveBlock2Ptr->frontier.lvlMode; + break; + } +} diff --git a/src/battle_util.c b/src/battle_util.c index 875244d79..5096a2f3a 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -821,12 +821,12 @@ u8 DoBattlerEndTurnEffects(void) gBattleStruct->turnEffectsTracker++; break; case ENDTURN_ITEMS1: // item effects - if (ItemBattleEffects(1, gActiveBattler, 0)) + if (ItemBattleEffects(1, gActiveBattler, FALSE)) effect++; gBattleStruct->turnEffectsTracker++; break; case ENDTURN_ITEMS2: // item effects again - if (ItemBattleEffects(1, gActiveBattler, 1)) + if (ItemBattleEffects(1, gActiveBattler, TRUE)) effect++; gBattleStruct->turnEffectsTracker++; break; @@ -1280,7 +1280,7 @@ bool8 HandleFaintedMonActions(void) gBattleStruct->faintedActionsState = 4; break; case 6: - if (AbilityBattleEffects(ABILITYEFFECT_INTIMIDATE1, 0, 0, 0, 0) || AbilityBattleEffects(ABILITYEFFECT_TRACE, 0, 0, 0, 0) || ItemBattleEffects(1, 0, 1) || AbilityBattleEffects(ABILITYEFFECT_FORECAST, 0, 0, 0, 0)) + if (AbilityBattleEffects(ABILITYEFFECT_INTIMIDATE1, 0, 0, 0, 0) || AbilityBattleEffects(ABILITYEFFECT_TRACE, 0, 0, 0, 0) || ItemBattleEffects(1, 0, TRUE) || AbilityBattleEffects(ABILITYEFFECT_FORECAST, 0, 0, 0, 0)) return TRUE; gBattleStruct->faintedActionsState++; break; @@ -2083,7 +2083,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA } } break; - case ABILITYEFFECT_CONTACT: // 4 + case ABILITYEFFECT_MOVE_END: // Think contact abilities. switch (gLastUsedAbility) { case ABILITY_COLOR_CHANGE: @@ -2343,7 +2343,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA { gLastUsedAbility = ABILITY_INTIMIDATE; gStatuses3[i] &= ~(STATUS3_INTIMIDATE_POKES); - BattleScriptPushCursorAndCallback(BattleScript_82DB4B8); + BattleScriptPushCursorAndCallback(BattleScript_IntimidateActivatesEnd3); gBattleStruct->intimidateBattler = i; effect++; break; @@ -2415,7 +2415,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA gLastUsedAbility = ABILITY_INTIMIDATE; gStatuses3[i] &= ~(STATUS3_INTIMIDATE_POKES); BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_82DB4C1; + gBattlescriptCurrInstr = BattleScript_IntimidateActivates; gBattleStruct->intimidateBattler = i; effect++; break; @@ -3044,7 +3044,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) break; case 2: break; - case 3: + case ITEMEFFECT_MOVE_END: for (battlerId = 0; battlerId < gBattlersCount; battlerId++) { gLastUsedItem = gBattleMons[battlerId].item; @@ -3177,7 +3177,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gPotentialItemEffectBattler = battlerId; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_WhiteHerbRet; - return effect; // unnecessary return + return effect; } break; } @@ -3192,7 +3192,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) } } break; - case 4: + case ITEMEFFECT_KINGSROCK_SHELLBELL: if (gBattleMoveDamage) { switch (atkHoldEffect) @@ -3386,7 +3386,7 @@ u8 IsMonDisobedient(void) gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_RAGE); if (gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP && (gCurrentMove == MOVE_SNORE || gCurrentMove == MOVE_SLEEP_TALK)) { - gBattlescriptCurrInstr = BattleScript_82DB695; + gBattlescriptCurrInstr = BattleScript_IgnoresWhileAsleep; return 1; } @@ -3440,7 +3440,7 @@ u8 IsMonDisobedient(void) { gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerAttacker], MOVE_POUND, 0, 40, 0, gBattlerAttacker, gBattlerAttacker); gBattlerTarget = gBattlerAttacker; - gBattlescriptCurrInstr = BattleScript_82DB6F0; + gBattlescriptCurrInstr = BattleScript_IgnoresAndHitsItself; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; return 2; } diff --git a/src/berry.c b/src/berry.c index f8a0204c4..ea216b61c 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1076,8 +1076,8 @@ u16 BerryTypeToItemId(u16 berry) void GetBerryNameByBerryType(u8 berry, u8 *string) { - memcpy(string, GetBerryInfo(berry)->name, BERRY_NAME_COUNT - 1); - string[BERRY_NAME_COUNT - 1] = EOS; + memcpy(string, GetBerryInfo(berry)->name, BERRY_NAME_LENGTH); + string[BERRY_NAME_LENGTH] = EOS; } void GetBerryCountStringByBerryType(u8 berry, u8* dest, u32 berryCount) diff --git a/src/berry_blender.c b/src/berry_blender.c index 46b0f76ad..96c3a933d 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -51,7 +51,7 @@ enum struct BlenderBerry { u16 itemId; - u8 name[BERRY_NAME_COUNT]; + u8 name[BERRY_NAME_LENGTH + 1]; u8 flavors[FLAVOR_COUNT]; u8 smoothness; }; @@ -188,7 +188,7 @@ static bool8 sub_8083380(void); static void sub_808074C(void); static void Blender_PrintPlayerNames(void); static void sub_8080588(void); -static void Blender_SetBankBerryData(u8 bank, u16 itemId); +static void Blender_SetParticipantBerryData(u8 participantId, u16 itemId); static void Blender_AddTextPrinter(u8 windowId, const u8 *string, u8 x, u8 y, s32 speed, s32 caseId); static void sub_8080DF8(void); static void sub_8082E84(void); @@ -322,18 +322,72 @@ static const struct BgTemplate sBerryBlenderBgTemplates[3] = static const struct WindowTemplate sBerryBlender_WindowTemplates[] = { - {0, 1, 6, 7, 2, 0xE, 0x28}, - {0, 0x16, 6, 7, 2, 0xE, 0x36}, - {0, 1, 0xC, 7, 2, 0xE, 0x44}, - {0, 0x16, 0xC, 7, 2, 0xE, 0x52}, - {0, 2, 0xF, 0x1B, 4, 0xE, 0x60}, - {0, 5, 3, 0x15, 0xE, 0xE, 0x60}, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 6, + .width = 7, + .height = 2, + .paletteNum = 14, + .baseBlock = 0x28, + }, + { + .priority = 0, + .tilemapLeft = 22, + .tilemapTop = 6, + .width = 7, + .height = 2, + .paletteNum = 14, + .baseBlock = 0x36, + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 12, + .width = 7, + .height = 2, + .paletteNum = 14, + .baseBlock = 0x44, + }, + { + .priority = 0, + .tilemapLeft = 22, + .tilemapTop = 12, + .width = 7, + .height = 2, + .paletteNum = 14, + .baseBlock = 0x52, + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 27, + .height = 4, + .paletteNum = 14, + .baseBlock = 0x60, + }, + { + .priority = 0, + .tilemapLeft = 5, + .tilemapTop = 3, + .width = 21, + .height = 14, + .paletteNum = 14, + .baseBlock = 0x60, + }, DUMMY_WIN_TEMPLATE }; static const struct WindowTemplate sBlender_YesNoWindowTemplate = { - 0, 0x15, 9, 5, 4, 0xE, 0xCC + .priority = 0, + .tilemapLeft = 21, + .tilemapTop = 9, + .width = 5, + .height = 4, + .paletteNum = 14, + .baseBlock = 0xCC }; static const s8 sUnknown_083399C0[][2] = @@ -790,7 +844,16 @@ static const u8 sUnknown_08339CD2[] = 0x05, 0x03, 0x03, 0x03, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x02 }; -static const struct WindowTemplate sBlenderRecordWindowTemplate = {0, 6, 4, 0x12, 0xB, 0xF, 8}; +static const struct WindowTemplate sBlenderRecordWindowTemplate = +{ + .priority = 0, + .tilemapLeft = 6, + .tilemapTop = 4, + .width = 18, + .height = 11, + .paletteNum = 15, + .baseBlock = 8 +}; // code @@ -1391,7 +1454,7 @@ static void Blender_SetOpponentsBerryData(u16 playerBerryItemId, u8 playersNum, if (var <= 4) opponentBerryId -= 5; } - Blender_SetBankBerryData(i + 1, opponentBerryId + FIRST_BERRY_INDEX); + Blender_SetParticipantBerryData(i + 1, opponentBerryId + FIRST_BERRY_INDEX); } } @@ -1454,7 +1517,7 @@ static void sub_80808D4(void) case 0: sub_800B4C0(); sub_8080588(); - Blender_SetBankBerryData(0, gSpecialVar_ItemId); + Blender_SetParticipantBerryData(0, gSpecialVar_ItemId); Blender_CopyBerryData(&sBerryBlenderData->blendedBerries[0], gSpecialVar_ItemId); Blender_SetOpponentsBerryData(gSpecialVar_ItemId, sBerryBlenderData->playersNo, &sBerryBlenderData->blendedBerries[0]); @@ -2956,10 +3019,10 @@ static void sub_8082F9C(struct Sprite* sprite) DestroySprite(sprite); } -static void Blender_SetBankBerryData(u8 bank, u16 itemId) +static void Blender_SetParticipantBerryData(u8 participantId, u16 itemId) { - sBerryBlenderData->chosenItemId[bank] = itemId; - Blender_CopyBerryData(&sBerryBlenderData->blendedBerries[bank], itemId); + sBerryBlenderData->chosenItemId[participantId] = itemId; + Blender_CopyBerryData(&sBerryBlenderData->blendedBerries[participantId], itemId); } static void sub_8083010(struct Sprite* sprite) diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index fb4bf6817..0c13e7085 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -101,10 +101,42 @@ static const u8 sTextColors[2][3] = static const struct WindowTemplate sWindowTemplates[] = { - {0x01, 0x0b, 0x04, 0x08, 0x02, 0x0f, 0x0045}, // WIN_BERRY_NAME - {0x01, 0x0b, 0x07, 0x12, 0x04, 0x0f, 0x0055}, // WIN_SIZE_FIRM - {0x01, 0x04, 0x0e, 0x19, 0x04, 0x0f, 0x009d}, // WIN_DESC - {0x00, 0x02, 0x00, 0x08, 0x02, 0x0f, 0x0101}, // WIN_BERRY_TAG + { // WIN_BERRY_NAME + .priority = 1, + .tilemapLeft = 11, + .tilemapTop = 4, + .width = 8, + .height = 2, + .paletteNum = 15, + .baseBlock = 69, + }, + { // WIN_SIZE_FIRM + .priority = 1, + .tilemapLeft = 11, + .tilemapTop = 7, + .width = 18, + .height = 4, + .paletteNum = 15, + .baseBlock = 85, + }, + { // WIN_DESC + .priority = 1, + .tilemapLeft = 4, + .tilemapTop = 14, + .width = 25, + .height = 4, + .paletteNum = 15, + .baseBlock = 157, + }, + { // WIN_BERRY_TAG + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 0, + .width = 8, + .height = 2, + .paletteNum = 15, + .baseBlock = 257, + }, DUMMY_WIN_TEMPLATE }; @@ -1001,7 +1001,7 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi } } -void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette) +void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, const void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette) { CopyRectToBgTilemapBufferRect(bg, src, 0, 0, rectWidth, rectHeight, destX, destY, rectWidth, rectHeight, palette, 0, 0); } diff --git a/src/credits.c b/src/credits.c index a88e4b549..cbf77f1b3 100644 --- a/src/credits.c +++ b/src/credits.c @@ -12,7 +12,7 @@ #include "gpu_regs.h" #include "m4a.h" #include "constants/rgb.h" -#include "battle_dome_cards.h" +#include "trainer_pokemon_sprites.h" #include "starter_choose.h" #include "decompress.h" #include "intro_credits_graphics.h" @@ -948,7 +948,15 @@ static const struct BgTemplate gUnknown_085E6F68[] = }; static const struct WindowTemplate gUnknown_085E6F6C[] = { - { 0x00, 0x00, 0x09, 0x1E, 0x0C, 0x08, 0x0001 }, + { + .priority = 0, + .tilemapLeft = 0, + .tilemapTop = 9, + .width = 30, + .height = 12, + .paletteNum = 8, + .baseBlock = 1 + }, DUMMY_WIN_TEMPLATE, }; static const u8 gUnknown_085E6F7C[][2] = @@ -1197,7 +1205,6 @@ void sub_8175620(void) u8 taskIdA; s16 taskIdC; u8 taskIdB; - u16 savedIme; sub_8175CE4(); SetVBlankCallback(NULL); @@ -1333,7 +1340,7 @@ static void sub_81758E4(u8 taskIdA) u16 *temp; ResetSpriteData(); - dp13_810BB8C(); + ResetAllPicSprites(); FreeAllSpritePalettes(); gReservedSpritePaletteCount = 8; LZ77UnCompVram(&gBirchHelpGfx, (void *)VRAM); @@ -2164,7 +2171,7 @@ static void sub_8177050(struct Sprite *sprite) { if (gUnknown_0203BD28) { - sub_818D820(sprite->data[6]); + FreeAndDestroyMonPicSprite(sprite->data[6]); return; } @@ -2242,7 +2249,7 @@ static void sub_8177050(struct Sprite *sprite) case 10: SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0); - sub_818D820(sprite->data[6]); + FreeAndDestroyMonPicSprite(sprite->data[6]); break; } } diff --git a/src/data/pokemon_graphics/back_pic_coordinates.h b/src/data/pokemon_graphics/back_pic_coordinates.h new file mode 100644 index 000000000..f54b409e4 --- /dev/null +++ b/src/data/pokemon_graphics/back_pic_coordinates.h @@ -0,0 +1,443 @@ +const struct MonCoords gUnknown_083021D8[] = +{ + {0x88, 0x00}, // SPECIES_NONE + {0x64, 0x10}, // SPECIES_BULBASAUR + {0x66, 0x09}, // SPECIES_IVYSAUR + {0x87, 0x07}, // SPECIES_VENUSAUR + {0x65, 0x0e}, // SPECIES_CHARMANDER + {0x66, 0x09}, // SPECIES_CHARMELEON + {0x87, 0x04}, // SPECIES_CHARIZARD + {0x65, 0x0e}, // SPECIES_SQUIRTLE + {0x76, 0x0a}, // SPECIES_WARTORTLE + {0x86, 0x08}, // SPECIES_BLASTOISE + {0x55, 0x0f}, // SPECIES_CATERPIE + {0x65, 0x0c}, // SPECIES_METAPOD + {0x87, 0x06}, // SPECIES_BUTTERFREE + {0x56, 0x0b}, // SPECIES_WEEDLE + {0x46, 0x0a}, // SPECIES_KAKUNA + {0x86, 0x09}, // SPECIES_BEEDRILL + {0x66, 0x08}, // SPECIES_PIDGEY + {0x85, 0x0c}, // SPECIES_PIDGEOTTO + {0x78, 0x02}, // SPECIES_PIDGEOT + {0x65, 0x0d}, // SPECIES_RATTATA + {0x75, 0x0d}, // SPECIES_RATICATE + {0x65, 0x0c}, // SPECIES_SPEAROW + {0x87, 0x05}, // SPECIES_FEAROW + {0x66, 0x09}, // SPECIES_EKANS + {0x77, 0x04}, // SPECIES_ARBOK + {0x77, 0x07}, // SPECIES_PIKACHU + {0x66, 0x08}, // SPECIES_RAICHU + {0x65, 0x0d}, // SPECIES_SANDSHREW + {0x86, 0x09}, // SPECIES_SANDSLASH + {0x55, 0x0c}, // SPECIES_NIDORAN_F + {0x86, 0x0a}, // SPECIES_NIDORINA + {0x77, 0x06}, // SPECIES_NIDOQUEEN + {0x56, 0x08}, // SPECIES_NIDORAN_M + {0x86, 0x09}, // SPECIES_NIDORINO + {0x88, 0x03}, // SPECIES_NIDOKING + {0x65, 0x0d}, // SPECIES_CLEFAIRY + {0x76, 0x0a}, // SPECIES_CLEFABLE + {0x76, 0x09}, // SPECIES_VULPIX + {0x77, 0x05}, // SPECIES_NINETALES + {0x65, 0x0d}, // SPECIES_JIGGLYPUFF + {0x66, 0x08}, // SPECIES_WIGGLYTUFF + {0x76, 0x0b}, // SPECIES_ZUBAT + {0x87, 0x06}, // SPECIES_GOLBAT + {0x56, 0x0b}, // SPECIES_ODDISH + {0x66, 0x0a}, // SPECIES_GLOOM + {0x87, 0x07}, // SPECIES_VILEPLUME + {0x63, 0x14}, // SPECIES_PARAS + {0x87, 0x07}, // SPECIES_VENONAT + {0x77, 0x06}, // SPECIES_VENOMOTH + {0x77, 0x04}, // SPECIES_DIGLETT + {0x54, 0x10}, // SPECIES_DUGTRIO + {0x66, 0x0b}, // SPECIES_MEOWTH + {0x65, 0x0c}, // SPECIES_PERSIAN + {0x87, 0x07}, // SPECIES_PSYDUCK + {0x67, 0x07}, // SPECIES_GOLDUCK + {0x77, 0x05}, // SPECIES_MANKEY + {0x76, 0x0b}, // SPECIES_PRIMEAPE + {0x77, 0x07}, // SPECIES_GROWLITHE + {0x66, 0x08}, // SPECIES_ARCANINE + {0x87, 0x06}, // SPECIES_POLIWAG + {0x74, 0x10}, // SPECIES_POLIWHIRL + {0x65, 0x0c}, // SPECIES_POLIWRATH + {0x86, 0x0b}, // SPECIES_ABRA + {0x66, 0x0b}, // SPECIES_KADABRA + {0x76, 0x08}, // SPECIES_ALAKAZAM + {0x67, 0x05}, // SPECIES_MACHOP + {0x65, 0x0c}, // SPECIES_MACHOKE + {0x76, 0x09}, // SPECIES_MACHAMP + {0x67, 0x04}, // SPECIES_BELLSPROUT + {0x66, 0x0a}, // SPECIES_WEEPINBELL + {0x66, 0x09}, // SPECIES_VICTREEBEL + {0x87, 0x06}, // SPECIES_TENTACOOL + {0x56, 0x0a}, // SPECIES_TENTACRUEL + {0x86, 0x0b}, // SPECIES_GEODUDE + {0x66, 0x0b}, // SPECIES_GRAVELER + {0x75, 0x0c}, // SPECIES_GOLEM + {0x84, 0x10}, // SPECIES_PONYTA + {0x66, 0x09}, // SPECIES_RAPIDASH + {0x87, 0x05}, // SPECIES_SLOWPOKE + {0x85, 0x0e}, // SPECIES_SLOWBRO + {0x86, 0x0a}, // SPECIES_MAGNEMITE + {0x43, 0x14}, // SPECIES_MAGNETON + {0x66, 0x0a}, // SPECIES_FARFETCHD + {0x66, 0x0a}, // SPECIES_DODUO + {0x66, 0x08}, // SPECIES_DODRIO + {0x88, 0x01}, // SPECIES_SEEL + {0x66, 0x0a}, // SPECIES_DEWGONG + {0x77, 0x05}, // SPECIES_GRIMER + {0x75, 0x0c}, // SPECIES_MUK + {0x87, 0x05}, // SPECIES_SHELLDER + {0x76, 0x0b}, // SPECIES_CLOYSTER + {0x87, 0x06}, // SPECIES_GASTLY + {0x85, 0x0e}, // SPECIES_HAUNTER + {0x76, 0x08}, // SPECIES_GENGAR + {0x76, 0x09}, // SPECIES_ONIX + {0x78, 0x00}, // SPECIES_DROWZEE + {0x65, 0x0d}, // SPECIES_HYPNO + {0x66, 0x09}, // SPECIES_KRABBY + {0x66, 0x0a}, // SPECIES_KINGLER + {0x77, 0x04}, // SPECIES_VOLTORB + {0x55, 0x0e}, // SPECIES_ELECTRODE + {0x65, 0x0d}, // SPECIES_EXEGGCUTE + {0x65, 0x0d}, // SPECIES_EXEGGUTOR + {0x87, 0x04}, // SPECIES_CUBONE + {0x66, 0x0a}, // SPECIES_MAROWAK + {0x66, 0x08}, // SPECIES_HITMONLEE + {0x65, 0x0c}, // SPECIES_HITMONCHAN + {0x65, 0x0c}, // SPECIES_LICKITUNG + {0x65, 0x0e}, // SPECIES_KOFFING + {0x66, 0x09}, // SPECIES_WEEZING + {0x77, 0x06}, // SPECIES_RHYHORN + {0x85, 0x0c}, // SPECIES_RHYDON + {0x88, 0x03}, // SPECIES_CHANSEY + {0x86, 0x0b}, // SPECIES_TANGELA + {0x85, 0x0e}, // SPECIES_KANGASKHAN + {0x77, 0x05}, // SPECIES_HORSEA + {0x66, 0x09}, // SPECIES_SEADRA + {0x66, 0x08}, // SPECIES_GOLDEEN + {0x66, 0x08}, // SPECIES_SEAKING + {0x76, 0x0b}, // SPECIES_STARYU + {0x65, 0x0d}, // SPECIES_STARMIE + {0x85, 0x0e}, // SPECIES_MR_MIME + {0x85, 0x0d}, // SPECIES_SCYTHER + {0x77, 0x07}, // SPECIES_JYNX + {0x86, 0x0a}, // SPECIES_ELECTABUZZ + {0x66, 0x08}, // SPECIES_MAGMAR + {0x66, 0x08}, // SPECIES_PINSIR + {0x66, 0x09}, // SPECIES_TAUROS + {0x85, 0x0d}, // SPECIES_MAGIKARP + {0x76, 0x09}, // SPECIES_GYARADOS + {0x78, 0x00}, // SPECIES_LAPRAS + {0x77, 0x04}, // SPECIES_DITTO + {0x54, 0x11}, // SPECIES_EEVEE + {0x66, 0x0a}, // SPECIES_VAPOREON + {0x66, 0x0a}, // SPECIES_JOLTEON + {0x87, 0x06}, // SPECIES_FLAREON + {0x67, 0x05}, // SPECIES_PORYGON + {0x65, 0x0d}, // SPECIES_OMANYTE + {0x66, 0x0a}, // SPECIES_OMASTAR + {0x66, 0x08}, // SPECIES_KABUTO + {0x65, 0x0d}, // SPECIES_KABUTOPS + {0x77, 0x05}, // SPECIES_AERODACTYL + {0x86, 0x08}, // SPECIES_SNORLAX + {0x86, 0x0b}, // SPECIES_ARTICUNO + {0x65, 0x0c}, // SPECIES_ZAPDOS + {0x76, 0x0b}, // SPECIES_MOLTRES + {0x87, 0x04}, // SPECIES_DRATINI + {0x66, 0x09}, // SPECIES_DRAGONAIR + {0x78, 0x00}, // SPECIES_DRAGONITE + {0x87, 0x06}, // SPECIES_MEWTWO + {0x78, 0x01}, // SPECIES_MEW + {0x66, 0x08}, // SPECIES_CHIKORITA + {0x56, 0x0a}, // SPECIES_BAYLEEF + {0x66, 0x08}, // SPECIES_MEGANIUM + {0x78, 0x00}, // SPECIES_CYNDAQUIL + {0x76, 0x09}, // SPECIES_QUILAVA + {0x87, 0x04}, // SPECIES_TYPHLOSION + {0x87, 0x04}, // SPECIES_TOTODILE + {0x66, 0x0b}, // SPECIES_CROCONAW + {0x67, 0x07}, // SPECIES_FERALIGATR + {0x88, 0x01}, // SPECIES_SENTRET + {0x67, 0x05}, // SPECIES_FURRET + {0x66, 0x08}, // SPECIES_HOOTHOOT + {0x66, 0x08}, // SPECIES_NOCTOWL + {0x68, 0x03}, // SPECIES_LEDYBA + {0x76, 0x0b}, // SPECIES_LEDIAN + {0x77, 0x07}, // SPECIES_SPINARAK + {0x73, 0x15}, // SPECIES_ARIADOS + {0x86, 0x0b}, // SPECIES_CROBAT + {0x87, 0x05}, // SPECIES_CHINCHOU + {0x86, 0x08}, // SPECIES_LANTURN + {0x86, 0x08}, // SPECIES_PICHU + {0x66, 0x0b}, // SPECIES_CLEFFA + {0x65, 0x0f}, // SPECIES_IGGLYBUFF + {0x66, 0x0b}, // SPECIES_TOGEPI + {0x54, 0x10}, // SPECIES_TOGETIC + {0x66, 0x08}, // SPECIES_NATU + {0x54, 0x11}, // SPECIES_XATU + {0x76, 0x08}, // SPECIES_MAREEP + {0x66, 0x09}, // SPECIES_FLAAFFY + {0x66, 0x09}, // SPECIES_AMPHAROS + {0x88, 0x01}, // SPECIES_BELLOSSOM + {0x66, 0x0b}, // SPECIES_MARILL + {0x75, 0x0c}, // SPECIES_AZUMARILL + {0x86, 0x08}, // SPECIES_SUDOWOODO + {0x66, 0x08}, // SPECIES_POLITOED + {0x66, 0x09}, // SPECIES_HOPPIP + {0x66, 0x0b}, // SPECIES_SKIPLOOM + {0x65, 0x0d}, // SPECIES_JUMPLUFF + {0x87, 0x04}, // SPECIES_AIPOM + {0x66, 0x09}, // SPECIES_SUNKERN + {0x56, 0x0a}, // SPECIES_SUNFLORA + {0x66, 0x08}, // SPECIES_YANMA + {0x77, 0x04}, // SPECIES_WOOPER + {0x85, 0x0f}, // SPECIES_QUAGSIRE + {0x76, 0x08}, // SPECIES_ESPEON + {0x76, 0x0b}, // SPECIES_UMBREON + {0x87, 0x04}, // SPECIES_MURKROW + {0x66, 0x09}, // SPECIES_SLOWKING + {0x66, 0x08}, // SPECIES_MISDREAVUS + {0x66, 0x0a}, // SPECIES_UNOWN + {0x36, 0x08}, // SPECIES_WOBBUFFET + {0x75, 0x0c}, // SPECIES_GIRAFARIG + {0x87, 0x05}, // SPECIES_PINECO + {0x65, 0x0f}, // SPECIES_FORRETRESS + {0x84, 0x10}, // SPECIES_DUNSPARCE + {0x85, 0x0f}, // SPECIES_GLIGAR + {0x87, 0x05}, // SPECIES_STEELIX + {0x88, 0x00}, // SPECIES_SNUBBULL + {0x76, 0x0a}, // SPECIES_GRANBULL + {0x87, 0x05}, // SPECIES_QWILFISH + {0x77, 0x07}, // SPECIES_SCIZOR + {0x77, 0x04}, // SPECIES_SHUCKLE + {0x56, 0x0b}, // SPECIES_HERACROSS + {0x77, 0x04}, // SPECIES_SNEASEL + {0x66, 0x08}, // SPECIES_TEDDIURSA + {0x66, 0x08}, // SPECIES_URSARING + {0x88, 0x03}, // SPECIES_SLUGMA + {0x66, 0x08}, // SPECIES_MAGCARGO + {0x76, 0x09}, // SPECIES_SWINUB + {0x63, 0x15}, // SPECIES_PILOSWINE + {0x75, 0x0d}, // SPECIES_CORSOLA + {0x65, 0x0c}, // SPECIES_REMORAID + {0x75, 0x0d}, // SPECIES_OCTILLERY + {0x66, 0x0a}, // SPECIES_DELIBIRD + {0x67, 0x06}, // SPECIES_MANTINE + {0x87, 0x07}, // SPECIES_SKARMORY + {0x87, 0x04}, // SPECIES_HOUNDOUR + {0x55, 0x0c}, // SPECIES_HOUNDOOM + {0x87, 0x07}, // SPECIES_KINGDRA + {0x87, 0x06}, // SPECIES_PHANPY + {0x65, 0x0e}, // SPECIES_DONPHAN + {0x85, 0x0d}, // SPECIES_PORYGON2 + {0x76, 0x0a}, // SPECIES_STANTLER + {0x78, 0x03}, // SPECIES_SMEARGLE + {0x76, 0x0a}, // SPECIES_TYROGUE + {0x66, 0x08}, // SPECIES_HITMONTOP + {0x87, 0x05}, // SPECIES_SMOOCHUM + {0x56, 0x09}, // SPECIES_ELEKID + {0x66, 0x08}, // SPECIES_MAGBY + {0x66, 0x0b}, // SPECIES_MILTANK + {0x87, 0x07}, // SPECIES_BLISSEY + {0x85, 0x0d}, // SPECIES_RAIKOU + {0x86, 0x0a}, // SPECIES_ENTEI + {0x87, 0x06}, // SPECIES_SUICUNE + {0x88, 0x03}, // SPECIES_LARVITAR + {0x66, 0x08}, // SPECIES_PUPITAR + {0x67, 0x05}, // SPECIES_TYRANITAR + {0x88, 0x00}, // SPECIES_LUGIA + {0x88, 0x01}, // SPECIES_HO_OH + {0x88, 0x01}, // SPECIES_CELEBI + {0x66, 0x08}, // SPECIES_OLD_UNOWN_B + {0x88, 0x02}, // SPECIES_OLD_UNOWN_C + {0x88, 0x02}, // SPECIES_OLD_UNOWN_D + {0x88, 0x02}, // SPECIES_OLD_UNOWN_E + {0x88, 0x02}, // SPECIES_OLD_UNOWN_F + {0x88, 0x02}, // SPECIES_OLD_UNOWN_G + {0x88, 0x02}, // SPECIES_OLD_UNOWN_H + {0x88, 0x02}, // SPECIES_OLD_UNOWN_I + {0x88, 0x02}, // SPECIES_OLD_UNOWN_J + {0x88, 0x02}, // SPECIES_OLD_UNOWN_K + {0x88, 0x02}, // SPECIES_OLD_UNOWN_L + {0x88, 0x02}, // SPECIES_OLD_UNOWN_M + {0x88, 0x02}, // SPECIES_OLD_UNOWN_N + {0x88, 0x02}, // SPECIES_OLD_UNOWN_O + {0x88, 0x02}, // SPECIES_OLD_UNOWN_P + {0x88, 0x02}, // SPECIES_OLD_UNOWN_Q + {0x88, 0x02}, // SPECIES_OLD_UNOWN_R + {0x88, 0x02}, // SPECIES_OLD_UNOWN_S + {0x88, 0x02}, // SPECIES_OLD_UNOWN_T + {0x88, 0x02}, // SPECIES_OLD_UNOWN_U + {0x88, 0x02}, // SPECIES_OLD_UNOWN_V + {0x88, 0x02}, // SPECIES_OLD_UNOWN_W + {0x88, 0x02}, // SPECIES_OLD_UNOWN_X + {0x88, 0x02}, // SPECIES_OLD_UNOWN_Y + {0x88, 0x02}, // SPECIES_OLD_UNOWN_Z + {0x88, 0x02}, // SPECIES_TREECKO + {0x87, 0x06}, // SPECIES_GROVYLE + {0x86, 0x08}, // SPECIES_SCEPTILE + {0x88, 0x01}, // SPECIES_TORCHIC + {0x67, 0x05}, // SPECIES_COMBUSKEN + {0x88, 0x00}, // SPECIES_BLAZIKEN + {0x88, 0x00}, // SPECIES_MUDKIP + {0x77, 0x05}, // SPECIES_MARSHTOMP + {0x87, 0x04}, // SPECIES_SWAMPERT + {0x87, 0x05}, // SPECIES_POOCHYENA + {0x76, 0x09}, // SPECIES_MIGHTYENA + {0x87, 0x04}, // SPECIES_ZIGZAGOON + {0x76, 0x0b}, // SPECIES_LINOONE + {0x85, 0x0f}, // SPECIES_WURMPLE + {0x76, 0x0b}, // SPECIES_SILCOON + {0x83, 0x15}, // SPECIES_BEAUTIFLY + {0x88, 0x00}, // SPECIES_CASCOON + {0x73, 0x14}, // SPECIES_DUSTOX + {0x83, 0x14}, // SPECIES_LOTAD + {0x75, 0x0f}, // SPECIES_LOMBRE + {0x86, 0x08}, // SPECIES_LUDICOLO + {0x86, 0x0a}, // SPECIES_SEEDOT + {0x86, 0x09}, // SPECIES_NUZLEAF + {0x76, 0x0a}, // SPECIES_SHIFTRY + {0x86, 0x08}, // SPECIES_NINCADA + {0x83, 0x14}, // SPECIES_NINJASK + {0x86, 0x08}, // SPECIES_SHEDINJA + {0x77, 0x06}, // SPECIES_TAILLOW + {0x64, 0x11}, // SPECIES_SWELLOW + {0x86, 0x08}, // SPECIES_SHROOMISH + {0x85, 0x0d}, // SPECIES_BRELOOM + {0x87, 0x04}, // SPECIES_SPINDA + {0x77, 0x04}, // SPECIES_WINGULL + {0x85, 0x0e}, // SPECIES_PELIPPER + {0x87, 0x06}, // SPECIES_SURSKIT + {0x86, 0x0b}, // SPECIES_MASQUERAIN + {0x88, 0x00}, // SPECIES_WAILMER + {0x83, 0x15}, // SPECIES_WAILORD + {0x83, 0x16}, // SPECIES_SKITTY + {0x86, 0x0a}, // SPECIES_DELCATTY + {0x86, 0x08}, // SPECIES_KECLEON + {0x87, 0x06}, // SPECIES_BALTOY + {0x86, 0x08}, // SPECIES_CLAYDOL + {0x87, 0x07}, // SPECIES_NOSEPASS + {0x85, 0x0c}, // SPECIES_TORKOAL + {0x86, 0x0a}, // SPECIES_SABLEYE + {0x76, 0x08}, // SPECIES_BARBOACH + {0x66, 0x0a}, // SPECIES_WHISCASH + {0x86, 0x0a}, // SPECIES_LUVDISC + {0x46, 0x0a}, // SPECIES_CORPHISH + {0x77, 0x07}, // SPECIES_CRAWDAUNT + {0x87, 0x05}, // SPECIES_FEEBAS + {0x67, 0x07}, // SPECIES_MILOTIC + {0x68, 0x02}, // SPECIES_CARVANHA + {0x87, 0x07}, // SPECIES_SHARPEDO + {0x88, 0x02}, // SPECIES_TRAPINCH + {0x75, 0x0e}, // SPECIES_VIBRAVA + {0x74, 0x11}, // SPECIES_FLYGON + {0x88, 0x02}, // SPECIES_MAKUHITA + {0x76, 0x0b}, // SPECIES_HARIYAMA + {0x87, 0x07}, // SPECIES_ELECTRIKE + {0x84, 0x10}, // SPECIES_MANECTRIC + {0x87, 0x04}, // SPECIES_NUMEL + {0x86, 0x0b}, // SPECIES_CAMERUPT + {0x84, 0x13}, // SPECIES_SPHEAL + {0x64, 0x12}, // SPECIES_SEALEO + {0x86, 0x0a}, // SPECIES_WALREIN + {0x87, 0x06}, // SPECIES_CACNEA + {0x85, 0x0f}, // SPECIES_CACTURNE + {0x87, 0x07}, // SPECIES_SNORUNT + {0x76, 0x0a}, // SPECIES_GLALIE + {0x85, 0x0c}, // SPECIES_LUNATONE + {0x87, 0x05}, // SPECIES_SOLROCK + {0x87, 0x05}, // SPECIES_AZURILL + {0x86, 0x0a}, // SPECIES_SPOINK + {0x56, 0x0b}, // SPECIES_GRUMPIG + {0x87, 0x04}, // SPECIES_PLUSLE + {0x76, 0x08}, // SPECIES_MINUN + {0x76, 0x08}, // SPECIES_MAWILE + {0x87, 0x04}, // SPECIES_MEDITITE + {0x76, 0x0b}, // SPECIES_MEDICHAM + {0x68, 0x03}, // SPECIES_SWABLU + {0x86, 0x09}, // SPECIES_ALTARIA + {0x87, 0x06}, // SPECIES_WYNAUT + {0x77, 0x07}, // SPECIES_DUSKULL + {0x66, 0x0b}, // SPECIES_DUSCLOPS + {0x86, 0x08}, // SPECIES_ROSELIA + {0x86, 0x08}, // SPECIES_SLAKOTH + {0x85, 0x0f}, // SPECIES_VIGOROTH + {0x86, 0x0a}, // SPECIES_SLAKING + {0x86, 0x08}, // SPECIES_GULPIN + {0x66, 0x0b}, // SPECIES_SWALOT + {0x77, 0x06}, // SPECIES_TROPIUS + {0x87, 0x07}, // SPECIES_WHISMUR + {0x85, 0x0d}, // SPECIES_LOUDRED + {0x86, 0x09}, // SPECIES_EXPLOUD + {0x88, 0x03}, // SPECIES_CLAMPERL + {0x85, 0x0d}, // SPECIES_HUNTAIL + {0x68, 0x02}, // SPECIES_GOREBYSS + {0x77, 0x05}, // SPECIES_ABSOL + {0x78, 0x03}, // SPECIES_SHUPPET + {0x77, 0x06}, // SPECIES_BANETTE + {0x65, 0x0c}, // SPECIES_SEVIPER + {0x88, 0x03}, // SPECIES_ZANGOOSE + {0x88, 0x01}, // SPECIES_RELICANTH + {0x86, 0x0a}, // SPECIES_ARON + {0x54, 0x11}, // SPECIES_LAIRON + {0x84, 0x11}, // SPECIES_AGGRON + {0x87, 0x07}, // SPECIES_CASTFORM + {0x45, 0x0d}, // SPECIES_VOLBEAT + {0x76, 0x08}, // SPECIES_ILLUMISE + {0x67, 0x06}, // SPECIES_LILEEP + {0x86, 0x09}, // SPECIES_CRADILY + {0x77, 0x04}, // SPECIES_ANORITH + {0x83, 0x17}, // SPECIES_ARMALDO + {0x77, 0x05}, // SPECIES_RALTS + {0x45, 0x0d}, // SPECIES_KIRLIA + {0x57, 0x06}, // SPECIES_GARDEVOIR + {0x77, 0x04}, // SPECIES_BAGON + {0x66, 0x08}, // SPECIES_SHELGON + {0x85, 0x0d}, // SPECIES_SALAMENCE + {0x77, 0x06}, // SPECIES_BELDUM + {0x66, 0x0a}, // SPECIES_METANG + {0x84, 0x10}, // SPECIES_METAGROSS + {0x83, 0x14}, // SPECIES_REGIROCK + {0x86, 0x0a}, // SPECIES_REGICE + {0x85, 0x0e}, // SPECIES_REGISTEEL + {0x85, 0x0e}, // SPECIES_KYOGRE + {0x84, 0x13}, // SPECIES_GROUDON + {0x87, 0x07}, // SPECIES_RAYQUAZA + {0x78, 0x00}, // SPECIES_LATIAS + {0x88, 0x02}, // SPECIES_LATIOS + {0x88, 0x03}, // SPECIES_JIRACHI + {0x87, 0x05}, // SPECIES_DEOXYS + {0x86, 0x09}, // SPECIES_CHIMECHO + {0x47, 0x07}, // SPECIES_EGG + {0x36, 0x0a}, // SPECIES_UNOWN_B + {0x56, 0x09}, // SPECIES_UNOWN_C + {0x67, 0x06}, // SPECIES_UNOWN_D + {0x56, 0x08}, // SPECIES_UNOWN_E + {0x56, 0x0a}, // SPECIES_UNOWN_F + {0x66, 0x0a}, // SPECIES_UNOWN_G + {0x57, 0x05}, // SPECIES_UNOWN_H + {0x66, 0x08}, // SPECIES_UNOWN_I + {0x37, 0x07}, // SPECIES_UNOWN_J + {0x46, 0x09}, // SPECIES_UNOWN_K + {0x57, 0x07}, // SPECIES_UNOWN_L + {0x46, 0x0a}, // SPECIES_UNOWN_M + {0x65, 0x0d}, // SPECIES_UNOWN_N + {0x65, 0x0d}, // SPECIES_UNOWN_O + {0x66, 0x08}, // SPECIES_UNOWN_P + {0x46, 0x0a}, // SPECIES_UNOWN_Q + {0x55, 0x0f}, // SPECIES_UNOWN_R + {0x45, 0x0c}, // SPECIES_UNOWN_S + {0x57, 0x04}, // SPECIES_UNOWN_T + {0x45, 0x0d}, // SPECIES_UNOWN_U + {0x65, 0x0d}, // SPECIES_UNOWN_V + {0x56, 0x0b}, // SPECIES_UNOWN_W + {0x55, 0x0d}, // SPECIES_UNOWN_X + {0x55, 0x0f}, // SPECIES_UNOWN_Y + {0x46, 0x0a}, // SPECIES_UNOWN_Z + {0x46, 0x0a}, // SPECIES_UNOWN_EMARK + {0x37, 0x06}, // SPECIES_UNOWN_QMARK + {0x47, 0x06}, +}; diff --git a/src/data/pokemon_graphics/front_pic_coordinates.h b/src/data/pokemon_graphics/front_pic_coordinates.h new file mode 100644 index 000000000..fde423570 --- /dev/null +++ b/src/data/pokemon_graphics/front_pic_coordinates.h @@ -0,0 +1,443 @@ +const struct MonCoords gMonFrontPicCoords[] = +{ + {0x88, 0x00}, // SPECIES_NONE + {0x45, 0x0e}, // SPECIES_BULBASAUR + {0x56, 0x0a}, // SPECIES_IVYSAUR + {0x88, 0x03}, // SPECIES_VENUSAUR + {0x55, 0x0c}, // SPECIES_CHARMANDER + {0x66, 0x09}, // SPECIES_CHARMELEON + {0x88, 0x01}, // SPECIES_CHARIZARD + {0x65, 0x0d}, // SPECIES_SQUIRTLE + {0x66, 0x08}, // SPECIES_WARTORTLE + {0x88, 0x00}, // SPECIES_BLASTOISE + {0x45, 0x10}, // SPECIES_CATERPIE + {0x54, 0x14}, // SPECIES_METAPOD + {0x76, 0x09}, // SPECIES_BUTTERFREE + {0x54, 0x12}, // SPECIES_WEEDLE + {0x45, 0x0e}, // SPECIES_KAKUNA + {0x86, 0x09}, // SPECIES_BEEDRILL + {0x65, 0x0d}, // SPECIES_PIDGEY + {0x67, 0x0b}, // SPECIES_PIDGEOTTO + {0x88, 0x01}, // SPECIES_PIDGEOT + {0x44, 0x10}, // SPECIES_RATTATA + {0x66, 0x0b}, // SPECIES_RATICATE + {0x45, 0x0f}, // SPECIES_SPEAROW + {0x78, 0x00}, // SPECIES_FEAROW + {0x65, 0x0c}, // SPECIES_EKANS + {0x88, 0x02}, // SPECIES_ARBOK + {0x67, 0x09}, // SPECIES_PIKACHU + {0x67, 0x04}, // SPECIES_RAICHU + {0x55, 0x0e}, // SPECIES_SANDSHREW + {0x76, 0x09}, // SPECIES_SANDSLASH + {0x45, 0x0f}, // SPECIES_NIDORAN_F + {0x66, 0x0b}, // SPECIES_NIDORINA + {0x78, 0x03}, // SPECIES_NIDOQUEEN + {0x55, 0x0c}, // SPECIES_NIDORAN_M + {0x66, 0x09}, // SPECIES_NIDORINO + {0x78, 0x02}, // SPECIES_NIDOKING + {0x55, 0x10}, // SPECIES_CLEFAIRY + {0x66, 0x08}, // SPECIES_CLEFABLE + {0x65, 0x0c}, // SPECIES_VULPIX + {0x88, 0x03}, // SPECIES_NINETALES + {0x45, 0x10}, // SPECIES_JIGGLYPUFF + {0x67, 0x08}, // SPECIES_WIGGLYTUFF + {0x67, 0x06}, // SPECIES_ZUBAT + {0x88, 0x03}, // SPECIES_GOLBAT + {0x45, 0x0f}, // SPECIES_ODDISH + {0x66, 0x0a}, // SPECIES_GLOOM + {0x77, 0x06}, // SPECIES_VILEPLUME + {0x55, 0x0f}, // SPECIES_PARAS + {0x86, 0x08}, // SPECIES_VENONAT + {0x66, 0x08}, // SPECIES_VENOMOTH + {0x88, 0x02}, // SPECIES_DIGLETT + {0x54, 0x12}, // SPECIES_DUGTRIO + {0x75, 0x0d}, // SPECIES_MEOWTH + {0x55, 0x0c}, // SPECIES_PERSIAN + {0x77, 0x07}, // SPECIES_PSYDUCK + {0x56, 0x09}, // SPECIES_GOLDUCK + {0x78, 0x02}, // SPECIES_MANKEY + {0x65, 0x0e}, // SPECIES_PRIMEAPE + {0x77, 0x07}, // SPECIES_GROWLITHE + {0x66, 0x0b}, // SPECIES_ARCANINE + {0x88, 0x02}, // SPECIES_POLIWAG + {0x74, 0x13}, // SPECIES_POLIWHIRL + {0x76, 0x0a}, // SPECIES_POLIWRATH + {0x76, 0x08}, // SPECIES_ABRA + {0x66, 0x0b}, // SPECIES_KADABRA + {0x77, 0x05}, // SPECIES_ALAKAZAM + {0x87, 0x04}, // SPECIES_MACHOP + {0x56, 0x0b}, // SPECIES_MACHOKE + {0x67, 0x06}, // SPECIES_MACHAMP + {0x88, 0x01}, // SPECIES_BELLSPROUT + {0x65, 0x0f}, // SPECIES_WEEPINBELL + {0x66, 0x0b}, // SPECIES_VICTREEBEL + {0x77, 0x05}, // SPECIES_TENTACOOL + {0x46, 0x09}, // SPECIES_TENTACRUEL + {0x87, 0x04}, // SPECIES_GEODUDE + {0x54, 0x12}, // SPECIES_GRAVELER + {0x87, 0x04}, // SPECIES_GOLEM + {0x77, 0x05}, // SPECIES_PONYTA + {0x66, 0x08}, // SPECIES_RAPIDASH + {0x88, 0x01}, // SPECIES_SLOWPOKE + {0x66, 0x0b}, // SPECIES_SLOWBRO + {0x86, 0x08}, // SPECIES_MAGNEMITE + {0x43, 0x15}, // SPECIES_MAGNETON + {0x76, 0x08}, // SPECIES_FARFETCHD + {0x66, 0x09}, // SPECIES_DODUO + {0x57, 0x05}, // SPECIES_DODRIO + {0x88, 0x00}, // SPECIES_SEEL + {0x76, 0x0a}, // SPECIES_DEWGONG + {0x87, 0x07}, // SPECIES_GRIMER + {0x65, 0x0c}, // SPECIES_MUK + {0x87, 0x04}, // SPECIES_SHELLDER + {0x55, 0x10}, // SPECIES_CLOYSTER + {0x87, 0x05}, // SPECIES_GASTLY + {0x77, 0x06}, // SPECIES_HAUNTER + {0x77, 0x05}, // SPECIES_GENGAR + {0x77, 0x05}, // SPECIES_ONIX + {0x78, 0x02}, // SPECIES_DROWZEE + {0x77, 0x07}, // SPECIES_HYPNO + {0x77, 0x04}, // SPECIES_KRABBY + {0x65, 0x0d}, // SPECIES_KINGLER + {0x88, 0x03}, // SPECIES_VOLTORB + {0x44, 0x13}, // SPECIES_ELECTRODE + {0x55, 0x0e}, // SPECIES_EXEGGCUTE + {0x87, 0x07}, // SPECIES_EXEGGUTOR + {0x88, 0x00}, // SPECIES_CUBONE + {0x55, 0x0f}, // SPECIES_MAROWAK + {0x76, 0x0b}, // SPECIES_HITMONLEE + {0x87, 0x04}, // SPECIES_HITMONCHAN + {0x67, 0x04}, // SPECIES_LICKITUNG + {0x86, 0x08}, // SPECIES_KOFFING + {0x66, 0x08}, // SPECIES_WEEZING + {0x88, 0x02}, // SPECIES_RHYHORN + {0x76, 0x09}, // SPECIES_RHYDON + {0x88, 0x02}, // SPECIES_CHANSEY + {0x76, 0x09}, // SPECIES_TANGELA + {0x67, 0x07}, // SPECIES_KANGASKHAN + {0x88, 0x00}, // SPECIES_HORSEA + {0x45, 0x0f}, // SPECIES_SEADRA + {0x67, 0x07}, // SPECIES_GOLDEEN + {0x66, 0x0a}, // SPECIES_SEAKING + {0x77, 0x04}, // SPECIES_STARYU + {0x66, 0x0a}, // SPECIES_STARMIE + {0x77, 0x06}, // SPECIES_MR_MIME + {0x66, 0x08}, // SPECIES_SCYTHER + {0x88, 0x00}, // SPECIES_JYNX + {0x77, 0x04}, // SPECIES_ELECTABUZZ + {0x78, 0x02}, // SPECIES_MAGMAR + {0x77, 0x04}, // SPECIES_PINSIR + {0x77, 0x04}, // SPECIES_TAUROS + {0x78, 0x00}, // SPECIES_MAGIKARP + {0x67, 0x06}, // SPECIES_GYARADOS + {0x88, 0x08}, // SPECIES_LAPRAS + {0x85, 0x0d}, // SPECIES_DITTO + {0x54, 0x11}, // SPECIES_EEVEE + {0x56, 0x09}, // SPECIES_VAPOREON + {0x67, 0x06}, // SPECIES_JOLTEON + {0x76, 0x09}, // SPECIES_FLAREON + {0x66, 0x0a}, // SPECIES_PORYGON + {0x55, 0x0d}, // SPECIES_OMANYTE + {0x45, 0x0f}, // SPECIES_OMASTAR + {0x67, 0x07}, // SPECIES_KABUTO + {0x54, 0x11}, // SPECIES_KABUTOPS + {0x88, 0x03}, // SPECIES_AERODACTYL + {0x88, 0x01}, // SPECIES_SNORLAX + {0x87, 0x05}, // SPECIES_ARTICUNO + {0x88, 0x03}, // SPECIES_ZAPDOS + {0x87, 0x04}, // SPECIES_MOLTRES + {0x88, 0x00}, // SPECIES_DRATINI + {0x75, 0x0e}, // SPECIES_DRAGONAIR + {0x87, 0x06}, // SPECIES_DRAGONITE + {0x88, 0x00}, // SPECIES_MEWTWO + {0x88, 0x00}, // SPECIES_MEW + {0x55, 0x0d}, // SPECIES_CHIKORITA + {0x75, 0x0d}, // SPECIES_BAYLEEF + {0x77, 0x04}, // SPECIES_MEGANIUM + {0x88, 0x00}, // SPECIES_CYNDAQUIL + {0x55, 0x0e}, // SPECIES_QUILAVA + {0x76, 0x08}, // SPECIES_TYPHLOSION + {0x78, 0x00}, // SPECIES_TOTODILE + {0x55, 0x0f}, // SPECIES_CROCONAW + {0x67, 0x06}, // SPECIES_FERALIGATR + {0x88, 0x00}, // SPECIES_SENTRET + {0x47, 0x04}, // SPECIES_FURRET + {0x67, 0x07}, // SPECIES_HOOTHOOT + {0x55, 0x0d}, // SPECIES_NOCTOWL + {0x58, 0x03}, // SPECIES_LEDYBA + {0x56, 0x0c}, // SPECIES_LEDIAN + {0x67, 0x04}, // SPECIES_SPINARAK + {0x54, 0x13}, // SPECIES_ARIADOS + {0x87, 0x05}, // SPECIES_CROBAT + {0x88, 0x00}, // SPECIES_CHINCHOU + {0x75, 0x10}, // SPECIES_LANTURN + {0x87, 0x0b}, // SPECIES_PICHU + {0x45, 0x0c}, // SPECIES_CLEFFA + {0x44, 0x14}, // SPECIES_IGGLYBUFF + {0x44, 0x12}, // SPECIES_TOGEPI + {0x34, 0x14}, // SPECIES_TOGETIC + {0x46, 0x09}, // SPECIES_NATU + {0x44, 0x14}, // SPECIES_XATU + {0x47, 0x07}, // SPECIES_MAREEP + {0x55, 0x10}, // SPECIES_FLAAFFY + {0x56, 0x0a}, // SPECIES_AMPHAROS + {0x77, 0x05}, // SPECIES_BELLOSSOM + {0x45, 0x0e}, // SPECIES_MARILL + {0x65, 0x0e}, // SPECIES_AZUMARILL + {0x76, 0x09}, // SPECIES_SUDOWOODO + {0x67, 0x06}, // SPECIES_POLITOED + {0x67, 0x06}, // SPECIES_HOPPIP + {0x66, 0x0a}, // SPECIES_SKIPLOOM + {0x55, 0x0f}, // SPECIES_JUMPLUFF + {0x77, 0x07}, // SPECIES_AIPOM + {0x58, 0x03}, // SPECIES_SUNKERN + {0x44, 0x10}, // SPECIES_SUNFLORA + {0x56, 0x08}, // SPECIES_YANMA + {0x86, 0x0a}, // SPECIES_WOOPER + {0x54, 0x10}, // SPECIES_QUAGSIRE + {0x77, 0x07}, // SPECIES_ESPEON + {0x66, 0x08}, // SPECIES_UMBREON + {0x67, 0x08}, // SPECIES_MURKROW + {0x66, 0x0b}, // SPECIES_SLOWKING + {0x58, 0x01}, // SPECIES_MISDREAVUS + {0x55, 0x0c}, // SPECIES_UNOWN + {0x35, 0x0f}, // SPECIES_WOBBUFFET + {0x77, 0x06}, // SPECIES_GIRAFARIG + {0x88, 0x03}, // SPECIES_PINECO + {0x56, 0x0a}, // SPECIES_FORRETRESS + {0x76, 0x09}, // SPECIES_DUNSPARCE + {0x74, 0x11}, // SPECIES_GLIGAR + {0x78, 0x03}, // SPECIES_STEELIX + {0x88, 0x00}, // SPECIES_SNUBBULL + {0x55, 0x0d}, // SPECIES_GRANBULL + {0x57, 0x06}, // SPECIES_QWILFISH + {0x56, 0x0a}, // SPECIES_SCIZOR + {0x88, 0x00}, // SPECIES_SHUCKLE + {0x66, 0x09}, // SPECIES_HERACROSS + {0x88, 0x03}, // SPECIES_SNEASEL + {0x67, 0x05}, // SPECIES_TEDDIURSA + {0x45, 0x0d}, // SPECIES_URSARING + {0x78, 0x01}, // SPECIES_SLUGMA + {0x45, 0x0d}, // SPECIES_MAGCARGO + {0x57, 0x0d}, // SPECIES_SWINUB + {0x43, 0x14}, // SPECIES_PILOSWINE + {0x66, 0x08}, // SPECIES_CORSOLA + {0x65, 0x0c}, // SPECIES_REMORAID + {0x55, 0x0e}, // SPECIES_OCTILLERY + {0x66, 0x0a}, // SPECIES_DELIBIRD + {0x56, 0x08}, // SPECIES_MANTINE + {0x88, 0x01}, // SPECIES_SKARMORY + {0x88, 0x00}, // SPECIES_HOUNDOUR + {0x56, 0x0b}, // SPECIES_HOUNDOOM + {0x77, 0x05}, // SPECIES_KINGDRA + {0x78, 0x04}, // SPECIES_PHANPY + {0x54, 0x10}, // SPECIES_DONPHAN + {0x86, 0x08}, // SPECIES_PORYGON2 + {0x55, 0x0f}, // SPECIES_STANTLER + {0x88, 0x00}, // SPECIES_SMEARGLE + {0x77, 0x06}, // SPECIES_TYROGUE + {0x46, 0x09}, // SPECIES_HITMONTOP + {0x67, 0x05}, // SPECIES_SMOOCHUM + {0x35, 0x0f}, // SPECIES_ELEKID + {0x76, 0x0a}, // SPECIES_MAGBY + {0x45, 0x0d}, // SPECIES_MILTANK + {0x77, 0x04}, // SPECIES_BLISSEY + {0x77, 0x06}, // SPECIES_RAIKOU + {0x88, 0x00}, // SPECIES_ENTEI + {0x88, 0x00}, // SPECIES_SUICUNE + {0x88, 0x00}, // SPECIES_LARVITAR + {0x46, 0x09}, // SPECIES_PUPITAR + {0x56, 0x09}, // SPECIES_TYRANITAR + {0x88, 0x00}, // SPECIES_LUGIA + {0x88, 0x00}, // SPECIES_HO_OH + {0x88, 0x00}, // SPECIES_CELEBI + {0x55, 0x0e}, // SPECIES_OLD_UNOWN_B + {0x87, 0x04}, // SPECIES_OLD_UNOWN_C + {0x87, 0x04}, // SPECIES_OLD_UNOWN_D + {0x87, 0x04}, // SPECIES_OLD_UNOWN_E + {0x87, 0x04}, // SPECIES_OLD_UNOWN_F + {0x87, 0x04}, // SPECIES_OLD_UNOWN_G + {0x87, 0x04}, // SPECIES_OLD_UNOWN_H + {0x87, 0x04}, // SPECIES_OLD_UNOWN_I + {0x87, 0x04}, // SPECIES_OLD_UNOWN_J + {0x87, 0x04}, // SPECIES_OLD_UNOWN_K + {0x87, 0x04}, // SPECIES_OLD_UNOWN_L + {0x87, 0x04}, // SPECIES_OLD_UNOWN_M + {0x87, 0x04}, // SPECIES_OLD_UNOWN_N + {0x87, 0x04}, // SPECIES_OLD_UNOWN_O + {0x87, 0x04}, // SPECIES_OLD_UNOWN_P + {0x87, 0x04}, // SPECIES_OLD_UNOWN_Q + {0x87, 0x04}, // SPECIES_OLD_UNOWN_R + {0x87, 0x04}, // SPECIES_OLD_UNOWN_S + {0x87, 0x04}, // SPECIES_OLD_UNOWN_T + {0x87, 0x04}, // SPECIES_OLD_UNOWN_U + {0x87, 0x04}, // SPECIES_OLD_UNOWN_V + {0x87, 0x04}, // SPECIES_OLD_UNOWN_W + {0x87, 0x04}, // SPECIES_OLD_UNOWN_X + {0x87, 0x04}, // SPECIES_OLD_UNOWN_Y + {0x87, 0x04}, // SPECIES_OLD_UNOWN_Z + {0x87, 0x04}, // SPECIES_TREECKO + {0x66, 0x08}, // SPECIES_GROVYLE + {0x87, 0x04}, // SPECIES_SCEPTILE + {0x88, 0x00}, // SPECIES_TORCHIC + {0x56, 0x08}, // SPECIES_COMBUSKEN + {0x88, 0x01}, // SPECIES_BLAZIKEN + {0x88, 0x00}, // SPECIES_MUDKIP + {0x56, 0x0c}, // SPECIES_MARSHTOMP + {0x67, 0x06}, // SPECIES_SWAMPERT + {0x88, 0x00}, // SPECIES_POOCHYENA + {0x55, 0x0c}, // SPECIES_MIGHTYENA + {0x87, 0x04}, // SPECIES_ZIGZAGOON + {0x85, 0x0f}, // SPECIES_LINOONE + {0x78, 0x03}, // SPECIES_WURMPLE + {0x45, 0x0e}, // SPECIES_SILCOON + {0x75, 0x11}, // SPECIES_BEAUTIFLY + {0x86, 0x09}, // SPECIES_CASCOON + {0x74, 0x10}, // SPECIES_DUSTOX + {0x86, 0x0f}, // SPECIES_LOTAD + {0x65, 0x0e}, // SPECIES_LOMBRE + {0x66, 0x09}, // SPECIES_LUDICOLO + {0x88, 0x00}, // SPECIES_SEEDOT + {0x46, 0x10}, // SPECIES_NUZLEAF + {0x56, 0x08}, // SPECIES_SHIFTRY + {0x88, 0x02}, // SPECIES_NINCADA + {0x74, 0x12}, // SPECIES_NINJASK + {0x86, 0x0a}, // SPECIES_SHEDINJA + {0x66, 0x0a}, // SPECIES_TAILLOW + {0x64, 0x10}, // SPECIES_SWELLOW + {0x87, 0x06}, // SPECIES_SHROOMISH + {0x54, 0x10}, // SPECIES_BRELOOM + {0x77, 0x04}, // SPECIES_SPINDA + {0x68, 0x08}, // SPECIES_WINGULL + {0x84, 0x18}, // SPECIES_PELIPPER + {0x77, 0x04}, // SPECIES_SURSKIT + {0x65, 0x0f}, // SPECIES_MASQUERAIN + {0x88, 0x01}, // SPECIES_WAILMER + {0x75, 0x0f}, // SPECIES_WAILORD + {0x87, 0x0a}, // SPECIES_SKITTY + {0x66, 0x0b}, // SPECIES_DELCATTY + {0x66, 0x08}, // SPECIES_KECLEON + {0x67, 0x07}, // SPECIES_BALTOY + {0x55, 0x10}, // SPECIES_CLAYDOL + {0x78, 0x06}, // SPECIES_NOSEPASS + {0x56, 0x0c}, // SPECIES_TORKOAL + {0x88, 0x02}, // SPECIES_SABLEYE + {0x66, 0x09}, // SPECIES_BARBOACH + {0x46, 0x0b}, // SPECIES_WHISCASH + {0x76, 0x09}, // SPECIES_LUVDISC + {0x46, 0x18}, // SPECIES_CORPHISH + {0x66, 0x0c}, // SPECIES_CRAWDAUNT + {0x88, 0x01}, // SPECIES_FEEBAS + {0x46, 0x0d}, // SPECIES_MILOTIC + {0x88, 0x00}, // SPECIES_CARVANHA + {0x67, 0x06}, // SPECIES_SHARPEDO + {0x78, 0x03}, // SPECIES_TRAPINCH + {0x54, 0x10}, // SPECIES_VIBRAVA + {0x86, 0x0c}, // SPECIES_FLYGON + {0x88, 0x01}, // SPECIES_MAKUHITA + {0x65, 0x0c}, // SPECIES_HARIYAMA + {0x88, 0x01}, // SPECIES_ELECTRIKE + {0x64, 0x12}, // SPECIES_MANECTRIC + {0x67, 0x04}, // SPECIES_NUMEL + {0x65, 0x0f}, // SPECIES_CAMERUPT + {0x87, 0x09}, // SPECIES_SPHEAL + {0x65, 0x10}, // SPECIES_SEALEO + {0x86, 0x0a}, // SPECIES_WALREIN + {0x88, 0x01}, // SPECIES_CACNEA + {0x74, 0x10}, // SPECIES_CACTURNE + {0x88, 0x00}, // SPECIES_SNORUNT + {0x56, 0x0b}, // SPECIES_GLALIE + {0x76, 0x0a}, // SPECIES_LUNATONE + {0x66, 0x09}, // SPECIES_SOLROCK + {0x88, 0x01}, // SPECIES_AZURILL + {0x55, 0x0f}, // SPECIES_SPOINK + {0x46, 0x09}, // SPECIES_GRUMPIG + {0x77, 0x05}, // SPECIES_PLUSLE + {0x56, 0x0e}, // SPECIES_MINUN + {0x66, 0x0c}, // SPECIES_MAWILE + {0x76, 0x08}, // SPECIES_MEDITITE + {0x65, 0x0c}, // SPECIES_MEDICHAM + {0x68, 0x01}, // SPECIES_SWABLU + {0x76, 0x11}, // SPECIES_ALTARIA + {0x88, 0x02}, // SPECIES_WYNAUT + {0x55, 0x0c}, // SPECIES_DUSKULL + {0x66, 0x0a}, // SPECIES_DUSCLOPS + {0x77, 0x05}, // SPECIES_ROSELIA + {0x76, 0x08}, // SPECIES_SLAKOTH + {0x74, 0x12}, // SPECIES_VIGOROTH + {0x78, 0x00}, // SPECIES_SLAKING + {0x86, 0x08}, // SPECIES_GULPIN + {0x55, 0x12}, // SPECIES_SWALOT + {0x66, 0x08}, // SPECIES_TROPIUS + {0x88, 0x00}, // SPECIES_WHISMUR + {0x55, 0x0e}, // SPECIES_LOUDRED + {0x78, 0x03}, // SPECIES_EXPLOUD + {0x88, 0x01}, // SPECIES_CLAMPERL + {0x55, 0x0e}, // SPECIES_HUNTAIL + {0x78, 0x03}, // SPECIES_GOREBYSS + {0x86, 0x0b}, // SPECIES_ABSOL + {0x68, 0x00}, // SPECIES_SHUPPET + {0x56, 0x0e}, // SPECIES_BANETTE + {0x55, 0x0c}, // SPECIES_SEVIPER + {0x77, 0x08}, // SPECIES_ZANGOOSE + {0x87, 0x05}, // SPECIES_RELICANTH + {0x77, 0x0b}, // SPECIES_ARON + {0x43, 0x14}, // SPECIES_LAIRON + {0x75, 0x0d}, // SPECIES_AGGRON + {0x88, 0x00}, // SPECIES_CASTFORM + {0x34, 0x11}, // SPECIES_VOLBEAT + {0x66, 0x08}, // SPECIES_ILLUMISE + {0x56, 0x08}, // SPECIES_LILEEP + {0x67, 0x07}, // SPECIES_CRADILY + {0x78, 0x00}, // SPECIES_ANORITH + {0x66, 0x08}, // SPECIES_ARMALDO + {0x88, 0x00}, // SPECIES_RALTS + {0x35, 0x0f}, // SPECIES_KIRLIA + {0x47, 0x06}, // SPECIES_GARDEVOIR + {0x78, 0x01}, // SPECIES_BAGON + {0x56, 0x0b}, // SPECIES_SHELGON + {0x66, 0x09}, // SPECIES_SALAMENCE + {0x87, 0x04}, // SPECIES_BELDUM + {0x55, 0x0f}, // SPECIES_METANG + {0x87, 0x07}, // SPECIES_METAGROSS + {0x87, 0x06}, // SPECIES_REGIROCK + {0x78, 0x04}, // SPECIES_REGICE + {0x88, 0x02}, // SPECIES_REGISTEEL + {0x88, 0x03}, // SPECIES_KYOGRE + {0x87, 0x04}, // SPECIES_GROUDON + {0x88, 0x01}, // SPECIES_RAYQUAZA + {0x88, 0x00}, // SPECIES_LATIAS + {0x88, 0x01}, // SPECIES_LATIOS + {0x88, 0x02}, // SPECIES_JIRACHI + {0x66, 0x0d}, // SPECIES_DEOXYS + {0x88, 0x01}, // SPECIES_CHIMECHO + {0x37, 0x06}, // SPECIES_EGG + {0x33, 0x14}, // SPECIES_UNOWN_B + {0x34, 0x10}, // SPECIES_UNOWN_C + {0x44, 0x10}, // SPECIES_UNOWN_D + {0x44, 0x10}, // SPECIES_UNOWN_E + {0x44, 0x11}, // SPECIES_UNOWN_F + {0x44, 0x11}, // SPECIES_UNOWN_G + {0x35, 0x0e}, // SPECIES_UNOWN_H + {0x44, 0x10}, // SPECIES_UNOWN_I + {0x34, 0x10}, // SPECIES_UNOWN_J + {0x34, 0x11}, // SPECIES_UNOWN_K + {0x44, 0x11}, // SPECIES_UNOWN_L + {0x34, 0x13}, // SPECIES_UNOWN_M + {0x44, 0x13}, // SPECIES_UNOWN_N + {0x43, 0x14}, // SPECIES_UNOWN_O + {0x44, 0x10}, // SPECIES_UNOWN_P + {0x34, 0x13}, // SPECIES_UNOWN_Q + {0x43, 0x15}, // SPECIES_UNOWN_R + {0x34, 0x13}, // SPECIES_UNOWN_S + {0x45, 0x0c}, // SPECIES_UNOWN_T + {0x34, 0x12}, // SPECIES_UNOWN_U + {0x44, 0x12}, // SPECIES_UNOWN_V + {0x44, 0x12}, // SPECIES_UNOWN_W + {0x44, 0x13}, // SPECIES_UNOWN_X + {0x33, 0x15}, // SPECIES_UNOWN_Y + {0x34, 0x11}, // SPECIES_UNOWN_Z + {0x34, 0x10}, // SPECIES_UNOWN_EMARK + {0x35, 0x0f}, // SPECIES_UNOWN_QMARK + {0x35, 0x0d}, +}; diff --git a/src/data/pokemon_graphics/still_front_pic_table.h b/src/data/pokemon_graphics/still_front_pic_table.h new file mode 100644 index 000000000..a345a3d43 --- /dev/null +++ b/src/data/pokemon_graphics/still_front_pic_table.h @@ -0,0 +1,446 @@ +const struct CompressedSpriteSheet gMonStillFrontPicTable[] = +{ //.data .size .tag + gMonStillFrontPic_CircledQuestionMark, 0x800, 0, + gMonStillFrontPic_Bulbasaur, 0x800, 1, + gMonStillFrontPic_Ivysaur, 0x800, 2, + gMonStillFrontPic_Venusaur, 0x800, 3, + gMonStillFrontPic_Charmander, 0x800, 4, + gMonStillFrontPic_Charmeleon, 0x800, 5, + gMonStillFrontPic_Charizard, 0x800, 6, + gMonStillFrontPic_Squirtle, 0x800, 7, + gMonStillFrontPic_Wartortle, 0x800, 8, + gMonStillFrontPic_Blastoise, 0x800, 9, + gMonStillFrontPic_Caterpie, 0x800, 10, + gMonStillFrontPic_Metapod, 0x800, 11, + gMonStillFrontPic_Butterfree, 0x800, 12, + gMonStillFrontPic_Weedle, 0x800, 13, + gMonStillFrontPic_Kakuna, 0x800, 14, + gMonStillFrontPic_Beedrill, 0x800, 15, + gMonStillFrontPic_Pidgey, 0x800, 16, + gMonStillFrontPic_Pidgeotto, 0x800, 17, + gMonStillFrontPic_Pidgeot, 0x800, 18, + gMonStillFrontPic_Rattata, 0x800, 19, + gMonStillFrontPic_Raticate, 0x800, 20, + gMonStillFrontPic_Spearow, 0x800, 21, + gMonStillFrontPic_Fearow, 0x800, 22, + gMonStillFrontPic_Ekans, 0x800, 23, + gMonStillFrontPic_Arbok, 0x800, 24, + gMonStillFrontPic_Pikachu, 0x800, 25, + gMonStillFrontPic_Raichu, 0x800, 26, + gMonStillFrontPic_Sandshrew, 0x800, 27, + gMonStillFrontPic_Sandslash, 0x800, 28, + gMonStillFrontPic_NidoranF, 0x800, 29, + gMonStillFrontPic_Nidorina, 0x800, 30, + gMonStillFrontPic_Nidoqueen, 0x800, 31, + gMonStillFrontPic_NidoranM, 0x800, 32, + gMonStillFrontPic_Nidorino, 0x800, 33, + gMonStillFrontPic_Nidoking, 0x800, 34, + gMonStillFrontPic_Clefairy, 0x800, 35, + gMonStillFrontPic_Clefable, 0x800, 36, + gMonStillFrontPic_Vulpix, 0x800, 37, + gMonStillFrontPic_Ninetales, 0x800, 38, + gMonStillFrontPic_Jigglypuff, 0x800, 39, + gMonStillFrontPic_Wigglytuff, 0x800, 40, + gMonStillFrontPic_Zubat, 0x800, 41, + gMonStillFrontPic_Golbat, 0x800, 42, + gMonStillFrontPic_Oddish, 0x800, 43, + gMonStillFrontPic_Gloom, 0x800, 44, + gMonStillFrontPic_Vileplume, 0x800, 45, + gMonStillFrontPic_Paras, 0x800, 46, + gMonStillFrontPic_Parasect, 0x800, 47, + gMonStillFrontPic_Venonat, 0x800, 48, + gMonStillFrontPic_Venomoth, 0x800, 49, + gMonStillFrontPic_Diglett, 0x800, 50, + gMonStillFrontPic_Dugtrio, 0x800, 51, + gMonStillFrontPic_Meowth, 0x800, 52, + gMonStillFrontPic_Persian, 0x800, 53, + gMonStillFrontPic_Psyduck, 0x800, 54, + gMonStillFrontPic_Golduck, 0x800, 55, + gMonStillFrontPic_Mankey, 0x800, 56, + gMonStillFrontPic_Primeape, 0x800, 57, + gMonStillFrontPic_Growlithe, 0x800, 58, + gMonStillFrontPic_Arcanine, 0x800, 59, + gMonStillFrontPic_Poliwag, 0x800, 60, + gMonStillFrontPic_Poliwhirl, 0x800, 61, + gMonStillFrontPic_Poliwrath, 0x800, 62, + gMonStillFrontPic_Abra, 0x800, 63, + gMonStillFrontPic_Kadabra, 0x800, 64, + gMonStillFrontPic_Alakazam, 0x800, 65, + gMonStillFrontPic_Machop, 0x800, 66, + gMonStillFrontPic_Machoke, 0x800, 67, + gMonStillFrontPic_Machamp, 0x800, 68, + gMonStillFrontPic_Bellsprout, 0x800, 69, + gMonStillFrontPic_Weepinbell, 0x800, 70, + gMonStillFrontPic_Victreebel, 0x800, 71, + gMonStillFrontPic_Tentacool, 0x800, 72, + gMonStillFrontPic_Tentacruel, 0x800, 73, + gMonStillFrontPic_Geodude, 0x800, 74, + gMonStillFrontPic_Graveler, 0x800, 75, + gMonStillFrontPic_Golem, 0x800, 76, + gMonStillFrontPic_Ponyta, 0x800, 77, + gMonStillFrontPic_Rapidash, 0x800, 78, + gMonStillFrontPic_Slowpoke, 0x800, 79, + gMonStillFrontPic_Slowbro, 0x800, 80, + gMonStillFrontPic_Magnemite, 0x800, 81, + gMonStillFrontPic_Magneton, 0x800, 82, + gMonStillFrontPic_Farfetchd, 0x800, 83, + gMonStillFrontPic_Doduo, 0x800, 84, + gMonStillFrontPic_Dodrio, 0x800, 85, + gMonStillFrontPic_Seel, 0x800, 86, + gMonStillFrontPic_Dewgong, 0x800, 87, + gMonStillFrontPic_Grimer, 0x800, 88, + gMonStillFrontPic_Muk, 0x800, 89, + gMonStillFrontPic_Shellder, 0x800, 90, + gMonStillFrontPic_Cloyster, 0x800, 91, + gMonStillFrontPic_Gastly, 0x800, 92, + gMonStillFrontPic_Haunter, 0x800, 93, + gMonStillFrontPic_Gengar, 0x800, 94, + gMonStillFrontPic_Onix, 0x800, 95, + gMonStillFrontPic_Drowzee, 0x800, 96, + gMonStillFrontPic_Hypno, 0x800, 97, + gMonStillFrontPic_Krabby, 0x800, 98, + gMonStillFrontPic_Kingler, 0x800, 99, + gMonStillFrontPic_Voltorb, 0x800, 100, + gMonStillFrontPic_Electrode, 0x800, 101, + gMonStillFrontPic_Exeggcute, 0x800, 102, + gMonStillFrontPic_Exeggutor, 0x800, 103, + gMonStillFrontPic_Cubone, 0x800, 104, + gMonStillFrontPic_Marowak, 0x800, 105, + gMonStillFrontPic_Hitmonlee, 0x800, 106, + gMonStillFrontPic_Hitmonchan, 0x800, 107, + gMonStillFrontPic_Lickitung, 0x800, 108, + gMonStillFrontPic_Koffing, 0x800, 109, + gMonStillFrontPic_Weezing, 0x800, 110, + gMonStillFrontPic_Rhyhorn, 0x800, 111, + gMonStillFrontPic_Rhydon, 0x800, 112, + gMonStillFrontPic_Chansey, 0x800, 113, + gMonStillFrontPic_Tangela, 0x800, 114, + gMonStillFrontPic_Kangaskhan, 0x800, 115, + gMonStillFrontPic_Horsea, 0x800, 116, + gMonStillFrontPic_Seadra, 0x800, 117, + gMonStillFrontPic_Goldeen, 0x800, 118, + gMonStillFrontPic_Seaking, 0x800, 119, + gMonStillFrontPic_Staryu, 0x800, 120, + gMonStillFrontPic_Starmie, 0x800, 121, + gMonStillFrontPic_Mrmime, 0x800, 122, + gMonStillFrontPic_Scyther, 0x800, 123, + gMonStillFrontPic_Jynx, 0x800, 124, + gMonStillFrontPic_Electabuzz, 0x800, 125, + gMonStillFrontPic_Magmar, 0x800, 126, + gMonStillFrontPic_Pinsir, 0x800, 127, + gMonStillFrontPic_Tauros, 0x800, 128, + gMonStillFrontPic_Magikarp, 0x800, 129, + gMonStillFrontPic_Gyarados, 0x800, 130, + gMonStillFrontPic_Lapras, 0x800, 131, + gMonStillFrontPic_Ditto, 0x800, 132, + gMonStillFrontPic_Eevee, 0x800, 133, + gMonStillFrontPic_Vaporeon, 0x800, 134, + gMonStillFrontPic_Jolteon, 0x800, 135, + gMonStillFrontPic_Flareon, 0x800, 136, + gMonStillFrontPic_Porygon, 0x800, 137, + gMonStillFrontPic_Omanyte, 0x800, 138, + gMonStillFrontPic_Omastar, 0x800, 139, + gMonStillFrontPic_Kabuto, 0x800, 140, + gMonStillFrontPic_Kabutops, 0x800, 141, + gMonStillFrontPic_Aerodactyl, 0x800, 142, + gMonStillFrontPic_Snorlax, 0x800, 143, + gMonStillFrontPic_Articuno, 0x800, 144, + gMonStillFrontPic_Zapdos, 0x800, 145, + gMonStillFrontPic_Moltres, 0x800, 146, + gMonStillFrontPic_Dratini, 0x800, 147, + gMonStillFrontPic_Dragonair, 0x800, 148, + gMonStillFrontPic_Dragonite, 0x800, 149, + gMonStillFrontPic_Mewtwo, 0x800, 150, + gMonStillFrontPic_Mew, 0x800, 151, +// Gen II + gMonStillFrontPic_Chikorita, 0x800, 152, + gMonStillFrontPic_Bayleef, 0x800, 153, + gMonStillFrontPic_Meganium, 0x800, 154, + gMonStillFrontPic_Cyndaquil, 0x800, 155, + gMonStillFrontPic_Quilava, 0x800, 156, + gMonStillFrontPic_Typhlosion, 0x800, 157, + gMonStillFrontPic_Totodile, 0x800, 158, + gMonStillFrontPic_Croconaw, 0x800, 159, + gMonStillFrontPic_Feraligatr, 0x800, 160, + gMonStillFrontPic_Sentret, 0x800, 161, + gMonStillFrontPic_Furret, 0x800, 162, + gMonStillFrontPic_Hoothoot, 0x800, 163, + gMonStillFrontPic_Noctowl, 0x800, 164, + gMonStillFrontPic_Ledyba, 0x800, 165, + gMonStillFrontPic_Ledian, 0x800, 166, + gMonStillFrontPic_Spinarak, 0x800, 167, + gMonStillFrontPic_Ariados, 0x800, 168, + gMonStillFrontPic_Crobat, 0x800, 169, + gMonStillFrontPic_Chinchou, 0x800, 170, + gMonStillFrontPic_Lanturn, 0x800, 171, + gMonStillFrontPic_Pichu, 0x800, 172, + gMonStillFrontPic_Cleffa, 0x800, 173, + gMonStillFrontPic_Igglybuff, 0x800, 174, + gMonStillFrontPic_Togepi, 0x800, 175, + gMonStillFrontPic_Togetic, 0x800, 176, + gMonStillFrontPic_Natu, 0x800, 177, + gMonStillFrontPic_Xatu, 0x800, 178, + gMonStillFrontPic_Mareep, 0x800, 179, + gMonStillFrontPic_Flaaffy, 0x800, 180, + gMonStillFrontPic_Ampharos, 0x800, 181, + gMonStillFrontPic_Bellossom, 0x800, 182, + gMonStillFrontPic_Marill, 0x800, 183, + gMonStillFrontPic_Azumarill, 0x800, 184, + gMonStillFrontPic_Sudowoodo, 0x800, 185, + gMonStillFrontPic_Politoed, 0x800, 186, + gMonStillFrontPic_Hoppip, 0x800, 187, + gMonStillFrontPic_Skiploom, 0x800, 188, + gMonStillFrontPic_Jumpluff, 0x800, 189, + gMonStillFrontPic_Aipom, 0x800, 190, + gMonStillFrontPic_Sunkern, 0x800, 191, + gMonStillFrontPic_Sunflora, 0x800, 192, + gMonStillFrontPic_Yanma, 0x800, 193, + gMonStillFrontPic_Wooper, 0x800, 194, + gMonStillFrontPic_Quagsire, 0x800, 195, + gMonStillFrontPic_Espeon, 0x800, 196, + gMonStillFrontPic_Umbreon, 0x800, 197, + gMonStillFrontPic_Murkrow, 0x800, 198, + gMonStillFrontPic_Slowking, 0x800, 199, + gMonStillFrontPic_Misdreavus, 0x800, 200, + gMonStillFrontPic_UnownA, 0x800, 201, + gMonStillFrontPic_Wobbuffet, 0x800, 202, + gMonStillFrontPic_Girafarig, 0x800, 203, + gMonStillFrontPic_Pineco, 0x800, 204, + gMonStillFrontPic_Forretress, 0x800, 205, + gMonStillFrontPic_Dunsparce, 0x800, 206, + gMonStillFrontPic_Gligar, 0x800, 207, + gMonStillFrontPic_Steelix, 0x800, 208, + gMonStillFrontPic_Snubbull, 0x800, 209, + gMonStillFrontPic_Granbull, 0x800, 210, + gMonStillFrontPic_Qwilfish, 0x800, 211, + gMonStillFrontPic_Scizor, 0x800, 212, + gMonStillFrontPic_Shuckle, 0x800, 213, + gMonStillFrontPic_Heracross, 0x800, 214, + gMonStillFrontPic_Sneasel, 0x800, 215, + gMonStillFrontPic_Teddiursa, 0x800, 216, + gMonStillFrontPic_Ursaring, 0x800, 217, + gMonStillFrontPic_Slugma, 0x800, 218, + gMonStillFrontPic_Magcargo, 0x800, 219, + gMonStillFrontPic_Swinub, 0x800, 220, + gMonStillFrontPic_Piloswine, 0x800, 221, + gMonStillFrontPic_Corsola, 0x800, 222, + gMonStillFrontPic_Remoraid, 0x800, 223, + gMonStillFrontPic_Octillery, 0x800, 224, + gMonStillFrontPic_Delibird, 0x800, 225, + gMonStillFrontPic_Mantine, 0x800, 226, + gMonStillFrontPic_Skarmory, 0x800, 227, + gMonStillFrontPic_Houndour, 0x800, 228, + gMonStillFrontPic_Houndoom, 0x800, 229, + gMonStillFrontPic_Kingdra, 0x800, 230, + gMonStillFrontPic_Phanpy, 0x800, 231, + gMonStillFrontPic_Donphan, 0x800, 232, + gMonStillFrontPic_Porygon2, 0x800, 233, + gMonStillFrontPic_Stantler, 0x800, 234, + gMonStillFrontPic_Smeargle, 0x800, 235, + gMonStillFrontPic_Tyrogue, 0x800, 236, + gMonStillFrontPic_Hitmontop, 0x800, 237, + gMonStillFrontPic_Smoochum, 0x800, 238, + gMonStillFrontPic_Elekid, 0x800, 239, + gMonStillFrontPic_Magby, 0x800, 240, + gMonStillFrontPic_Miltank, 0x800, 241, + gMonStillFrontPic_Blissey, 0x800, 242, + gMonStillFrontPic_Raikou, 0x800, 243, + gMonStillFrontPic_Entei, 0x800, 244, + gMonStillFrontPic_Suicune, 0x800, 245, + gMonStillFrontPic_Larvitar, 0x800, 246, + gMonStillFrontPic_Pupitar, 0x800, 247, + gMonStillFrontPic_Tyranitar, 0x800, 248, + gMonStillFrontPic_Lugia, 0x800, 249, + gMonStillFrontPic_HoOh, 0x800, 250, + gMonStillFrontPic_Celebi, 0x800, 251, +// Empty slots + gMonStillFrontPic_DoubleQuestionMark, 0x800, 252, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 253, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 254, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 255, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 256, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 257, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 258, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 259, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 260, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 261, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 262, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 263, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 264, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 265, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 266, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 267, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 268, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 269, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 270, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 271, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 272, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 273, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 274, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 275, + gMonStillFrontPic_DoubleQuestionMark, 0x800, 276, +// Gen III + gMonStillFrontPic_Treecko, 0x800, 277, + gMonStillFrontPic_Grovyle, 0x800, 278, + gMonStillFrontPic_Sceptile, 0x800, 279, + gMonStillFrontPic_Torchic, 0x800, 280, + gMonStillFrontPic_Combusken, 0x800, 281, + gMonStillFrontPic_Blaziken, 0x800, 282, + gMonStillFrontPic_Mudkip, 0x800, 283, + gMonStillFrontPic_Marshtomp, 0x800, 284, + gMonStillFrontPic_Swampert, 0x800, 285, + gMonStillFrontPic_Poochyena, 0x800, 286, + gMonStillFrontPic_Mightyena, 0x800, 287, + gMonStillFrontPic_Zigzagoon, 0x800, 288, + gMonStillFrontPic_Linoone, 0x800, 289, + gMonStillFrontPic_Wurmple, 0x800, 290, + gMonStillFrontPic_Silcoon, 0x800, 291, + gMonStillFrontPic_Beautifly, 0x800, 292, + gMonStillFrontPic_Cascoon, 0x800, 293, + gMonStillFrontPic_Dustox, 0x800, 294, + gMonStillFrontPic_Lotad, 0x800, 295, + gMonStillFrontPic_Lombre, 0x800, 296, + gMonStillFrontPic_Ludicolo, 0x800, 297, + gMonStillFrontPic_Seedot, 0x800, 298, + gMonStillFrontPic_Nuzleaf, 0x800, 299, + gMonStillFrontPic_Shiftry, 0x800, 300, + gMonStillFrontPic_Nincada, 0x800, 301, + gMonStillFrontPic_Ninjask, 0x800, 302, + gMonStillFrontPic_Shedinja, 0x800, 303, + gMonStillFrontPic_Taillow, 0x800, 304, + gMonStillFrontPic_Swellow, 0x800, 305, + gMonStillFrontPic_Shroomish, 0x800, 306, + gMonStillFrontPic_Breloom, 0x800, 307, + gMonStillFrontPic_Spinda, 0x800, 308, + gMonStillFrontPic_Wingull, 0x800, 309, + gMonStillFrontPic_Pelipper, 0x800, 310, + gMonStillFrontPic_Surskit, 0x800, 311, + gMonStillFrontPic_Masquerain, 0x800, 312, + gMonStillFrontPic_Wailmer, 0x800, 313, + gMonStillFrontPic_Wailord, 0x800, 314, + gMonStillFrontPic_Skitty, 0x800, 315, + gMonStillFrontPic_Delcatty, 0x800, 316, + gMonStillFrontPic_Kecleon, 0x800, 317, + gMonStillFrontPic_Baltoy, 0x800, 318, + gMonStillFrontPic_Claydol, 0x800, 319, + gMonStillFrontPic_Nosepass, 0x800, 320, + gMonStillFrontPic_Torkoal, 0x800, 321, + gMonStillFrontPic_Sableye, 0x800, 322, + gMonStillFrontPic_Barboach, 0x800, 323, + gMonStillFrontPic_Whiscash, 0x800, 324, + gMonStillFrontPic_Luvdisc, 0x800, 325, + gMonStillFrontPic_Corphish, 0x800, 326, + gMonStillFrontPic_Crawdaunt, 0x800, 327, + gMonStillFrontPic_Feebas, 0x800, 328, + gMonStillFrontPic_Milotic, 0x800, 329, + gMonStillFrontPic_Carvanha, 0x800, 330, + gMonStillFrontPic_Sharpedo, 0x800, 331, + gMonStillFrontPic_Trapinch, 0x800, 332, + gMonStillFrontPic_Vibrava, 0x800, 333, + gMonStillFrontPic_Flygon, 0x800, 334, + gMonStillFrontPic_Makuhita, 0x800, 335, + gMonStillFrontPic_Hariyama, 0x800, 336, + gMonStillFrontPic_Electrike, 0x800, 337, + gMonStillFrontPic_Manectric, 0x800, 338, + gMonStillFrontPic_Numel, 0x800, 339, + gMonStillFrontPic_Camerupt, 0x800, 340, + gMonStillFrontPic_Spheal, 0x800, 341, + gMonStillFrontPic_Sealeo, 0x800, 342, + gMonStillFrontPic_Walrein, 0x800, 343, + gMonStillFrontPic_Cacnea, 0x800, 344, + gMonStillFrontPic_Cacturne, 0x800, 345, + gMonStillFrontPic_Snorunt, 0x800, 346, + gMonStillFrontPic_Glalie, 0x800, 347, + gMonStillFrontPic_Lunatone, 0x800, 348, + gMonStillFrontPic_Solrock, 0x800, 349, + gMonStillFrontPic_Azurill, 0x800, 350, + gMonStillFrontPic_Spoink, 0x800, 351, + gMonStillFrontPic_Grumpig, 0x800, 352, + gMonStillFrontPic_Plusle, 0x800, 353, + gMonStillFrontPic_Minun, 0x800, 354, + gMonStillFrontPic_Mawile, 0x800, 355, + gMonStillFrontPic_Meditite, 0x800, 356, + gMonStillFrontPic_Medicham, 0x800, 357, + gMonStillFrontPic_Swablu, 0x800, 358, + gMonStillFrontPic_Altaria, 0x800, 359, + gMonStillFrontPic_Wynaut, 0x800, 360, + gMonStillFrontPic_Duskull, 0x800, 361, + gMonStillFrontPic_Dusclops, 0x800, 362, + gMonStillFrontPic_Roselia, 0x800, 363, + gMonStillFrontPic_Slakoth, 0x800, 364, + gMonStillFrontPic_Vigoroth, 0x800, 365, + gMonStillFrontPic_Slaking, 0x800, 366, + gMonStillFrontPic_Gulpin, 0x800, 367, + gMonStillFrontPic_Swalot, 0x800, 368, + gMonStillFrontPic_Tropius, 0x800, 369, + gMonStillFrontPic_Whismur, 0x800, 370, + gMonStillFrontPic_Loudred, 0x800, 371, + gMonStillFrontPic_Exploud, 0x800, 372, + gMonStillFrontPic_Clamperl, 0x800, 373, + gMonStillFrontPic_Huntail, 0x800, 374, + gMonStillFrontPic_Gorebyss, 0x800, 375, + gMonStillFrontPic_Absol, 0x800, 376, + gMonStillFrontPic_Shuppet, 0x800, 377, + gMonStillFrontPic_Banette, 0x800, 378, + gMonStillFrontPic_Seviper, 0x800, 379, + gMonStillFrontPic_Zangoose, 0x800, 380, + gMonStillFrontPic_Relicanth, 0x800, 381, + gMonStillFrontPic_Aron, 0x800, 382, + gMonStillFrontPic_Lairon, 0x800, 383, + gMonStillFrontPic_Aggron, 0x800, 384, + gMonStillFrontPic_Castform, 0x800, 385, + gMonStillFrontPic_Volbeat, 0x800, 386, + gMonStillFrontPic_Illumise, 0x800, 387, + gMonStillFrontPic_Lileep, 0x800, 388, + gMonStillFrontPic_Cradily, 0x800, 389, + gMonStillFrontPic_Anorith, 0x800, 390, + gMonStillFrontPic_Armaldo, 0x800, 391, + gMonStillFrontPic_Ralts, 0x800, 392, + gMonStillFrontPic_Kirlia, 0x800, 393, + gMonStillFrontPic_Gardevoir, 0x800, 394, + gMonStillFrontPic_Bagon, 0x800, 395, + gMonStillFrontPic_Shelgon, 0x800, 396, + gMonStillFrontPic_Salamence, 0x800, 397, + gMonStillFrontPic_Beldum, 0x800, 398, + gMonStillFrontPic_Metang, 0x800, 399, + gMonStillFrontPic_Metagross, 0x800, 400, + gMonStillFrontPic_Regirock, 0x800, 401, + gMonStillFrontPic_Regice, 0x800, 402, + gMonStillFrontPic_Registeel, 0x800, 403, + gMonStillFrontPic_Kyogre, 0x800, 404, + gMonStillFrontPic_Groudon, 0x800, 405, + gMonStillFrontPic_Rayquaza, 0x800, 406, + gMonStillFrontPic_Latias, 0x800, 407, + gMonStillFrontPic_Latios, 0x800, 408, + gMonStillFrontPic_Jirachi, 0x800, 409, + gMonStillFrontPic_Deoxys, 0x800, 410, + gMonStillFrontPic_Chimecho, 0x800, 411, + gMonStillFrontPic_Egg, 0x800, 412, + gMonStillFrontPic_UnownB, 0x800, 413, + gMonStillFrontPic_UnownC, 0x800, 414, + gMonStillFrontPic_UnownD, 0x800, 415, + gMonStillFrontPic_UnownE, 0x800, 416, + gMonStillFrontPic_UnownF, 0x800, 417, + gMonStillFrontPic_UnownG, 0x800, 418, + gMonStillFrontPic_UnownH, 0x800, 419, + gMonStillFrontPic_UnownI, 0x800, 420, + gMonStillFrontPic_UnownJ, 0x800, 421, + gMonStillFrontPic_UnownK, 0x800, 422, + gMonStillFrontPic_UnownL, 0x800, 423, + gMonStillFrontPic_UnownM, 0x800, 424, + gMonStillFrontPic_UnownN, 0x800, 425, + gMonStillFrontPic_UnownO, 0x800, 426, + gMonStillFrontPic_UnownP, 0x800, 427, + gMonStillFrontPic_UnownQ, 0x800, 428, + gMonStillFrontPic_UnownR, 0x800, 429, + gMonStillFrontPic_UnownS, 0x800, 430, + gMonStillFrontPic_UnownT, 0x800, 431, + gMonStillFrontPic_UnownU, 0x800, 432, + gMonStillFrontPic_UnownV, 0x800, 433, + gMonStillFrontPic_UnownW, 0x800, 434, + gMonStillFrontPic_UnownX, 0x800, 435, + gMonStillFrontPic_UnownY, 0x800, 436, + gMonStillFrontPic_UnownZ, 0x800, 437, + gMonStillFrontPic_UnownExclamationMark, 0x800, 438, + gMonStillFrontPic_UnownQuestionMark, 0x800, 439, +}; diff --git a/src/data/pokemon_graphics/unknown_anims.h b/src/data/pokemon_graphics/unknown_anims.h new file mode 100644 index 000000000..a4ae43eb6 --- /dev/null +++ b/src/data/pokemon_graphics/unknown_anims.h @@ -0,0 +1,2347 @@ +const union AnimCmd gUnknown_082FF6EC[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF6F4[] = +{ + ANIMCMD_FRAME(1, 0), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF6FC[] = +{ + ANIMCMD_FRAME(2, 0), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF704[] = +{ + ANIMCMD_FRAME(3, 0), + ANIMCMD_END, +}; + +const union AnimCmd *const gPlayerMonSpriteAnimsTable[] = +{ + gUnknown_082FF6EC, + gUnknown_082FF6F4, + gUnknown_082FF6FC, + gUnknown_082FF704, +}; + +const union AnimCmd gUnknown_082FF71C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_FRAME(1, 25), + ANIMCMD_FRAME(0, 7), + ANIMCMD_FRAME(1, 7), + ANIMCMD_FRAME(0, 7), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF734[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_FRAME(2, 8), + ANIMCMD_FRAME(0, 8), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF744[] = +{ + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(2, 10), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF750[] = +{ + ANIMCMD_FRAME(0, 10), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF758[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_FRAME(1, 5), + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(1, 5), + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(1, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF774[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_FRAME(2, 12), + ANIMCMD_FRAME(0, 14), + ANIMCMD_FRAME(2, 12), + ANIMCMD_FRAME(0, 14), + ANIMCMD_FRAME(2, 12), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF790[] = +{ + ANIMCMD_FRAME(0, 14), + ANIMCMD_FRAME(2, 12), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF79C[] = +{ + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(1, 10), + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(1, 10), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF7B0[] = +{ + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(2, 10), + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(2, 10), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF7C4[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF7CC[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF7D4[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF7DC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF7E4[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF7EC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF7F4[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF7FC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF804[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF80C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF814[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF81C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF824[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF82C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF834[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF83C[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF844[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF84C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF854[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF85C[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF864[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF86C[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF874[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF87C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF884[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF88C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF894[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF89C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF8A4[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF8AC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF8B4[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF8BC[] = +{ + ANIMCMD_FRAME(0, 15), + ANIMCMD_FRAME(8, 15), + ANIMCMD_FRAME(2, 22), + ANIMCMD_FRAME(8, 5), + ANIMCMD_FRAME(3, 8), + ANIMCMD_FRAME(4, 5), + ANIMCMD_FRAME(6, 5), + ANIMCMD_FRAME(4, 5), + ANIMCMD_FRAME(6, 5), + ANIMCMD_FRAME(4, 5), + ANIMCMD_FRAME(6, 5), + ANIMCMD_FRAME(4, 5), + ANIMCMD_FRAME(6, 5), + ANIMCMD_FRAME(5, 5), + ANIMCMD_FRAME(7, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF8FC[] = +{ + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(8, 15), + ANIMCMD_FRAME(2, 15), + ANIMCMD_FRAME(8, 15), + ANIMCMD_FRAME(9, 15), + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(9, 10), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF91C[] = +{ + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(9, 10), + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(10, 20), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF930[] = +{ + ANIMCMD_FRAME(0, 15), + ANIMCMD_FRAME(11, 15), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF93C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF944[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF94C[] = +{ + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(1, 7), + ANIMCMD_FRAME(2, 7), + ANIMCMD_FRAME(3, 4), + ANIMCMD_FRAME(4, 4), + ANIMCMD_FRAME(3, 4), + ANIMCMD_FRAME(4, 4), + ANIMCMD_FRAME(3, 4), + ANIMCMD_FRAME(4, 4), + ANIMCMD_FRAME(3, 4), + ANIMCMD_FRAME(1, 6), + ANIMCMD_FRAME(5, 2), + ANIMCMD_FRAME(0, 2), + ANIMCMD_FRAME(5, 2), + ANIMCMD_FRAME(0, 2), + ANIMCMD_FRAME(5, 2), + ANIMCMD_FRAME(6, 2), + ANIMCMD_FRAME(5, 2), + ANIMCMD_FRAME(6, 2), + ANIMCMD_FRAME(6, 10), + ANIMCMD_FRAME(5, 4), + ANIMCMD_FRAME(0, 10), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FF9A8[] = +{ + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(7, 12), + ANIMCMD_FRAME(8, 12), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(7, 12), + ANIMCMD_FRAME(8, 12), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(7, 12), + ANIMCMD_FRAME(8, 12), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(7, 12), + ANIMCMD_FRAME(8, 12), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(7, 12), + ANIMCMD_FRAME(8, 12), + ANIMCMD_FRAME(9, 3), + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(9, 3), + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(7, 12), + ANIMCMD_FRAME(8, 12), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFA00[] = +{ + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(7, 12), + ANIMCMD_FRAME(8, 12), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(7, 12), + ANIMCMD_FRAME(8, 12), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(7, 12), + ANIMCMD_FRAME(8, 12), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(7, 12), + ANIMCMD_FRAME(8, 12), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(7, 12), + ANIMCMD_FRAME(8, 12), + ANIMCMD_FRAME(9, 3), + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(9, 3), + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(7, 12), + ANIMCMD_FRAME(8, 12), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFA58[] = +{ + ANIMCMD_FRAME(0,18), + ANIMCMD_FRAME(10, 18), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFA64[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFA6C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFA74[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFA7C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFA84[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFA8C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFA94[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFA9C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFAA4[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFAAC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFAB4[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFABC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFAC4[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFACC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFAD4[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFADC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFAE4[] = +{ + ANIMCMD_FRAME(0, 63), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFAEC[] = +{ + ANIMCMD_FRAME(0, 63), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFAF4[] = +{ + ANIMCMD_FRAME(0, 63), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFAFC[] = +{ + ANIMCMD_FRAME(0, 63), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFB04[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFB0C[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFB14[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFB1C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFB24[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFB2C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFB34[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFB3C[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFB44[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_FRAME(1, 18), + ANIMCMD_FRAME(0, 18), + ANIMCMD_FRAME(1, 18), + ANIMCMD_FRAME(0, 18), + ANIMCMD_FRAME(1, 18), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFB60[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_FRAME(2, 18), + ANIMCMD_FRAME(0, 18), + ANIMCMD_FRAME(2, 18), + ANIMCMD_FRAME(0, 18), + ANIMCMD_FRAME(2, 18), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFB7C[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(2, 5), + ANIMCMD_FRAME(3, 6), + ANIMCMD_FRAME(1, 5), + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(2, 5), + ANIMCMD_FRAME(3, 5), + ANIMCMD_FRAME(1, 5), + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(1, 7), + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(4, 4), + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(4, 4), + ANIMCMD_FRAME(0, 20), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFBBC[] = +{ + ANIMCMD_FRAME(0, 6), + ANIMCMD_FRAME(1, 6), + ANIMCMD_FRAME(2, 6), + ANIMCMD_FRAME(3, 6), + ANIMCMD_FRAME(1, 6), + ANIMCMD_FRAME(0, 6), + ANIMCMD_FRAME(1, 6), + ANIMCMD_FRAME(0, 30), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFBE0[] = +{ + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(5, 12), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(6, 12), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFBF4[] = +{ + ANIMCMD_FRAME(7, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFBFC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC04[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC0C[] = +{ + ANIMCMD_FRAME(0, 63), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC14[] = +{ + ANIMCMD_FRAME(0, 63), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC1C[] = +{ + ANIMCMD_FRAME(0, 63), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC24[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC2C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC34[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC3C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_FRAME(1, 10), + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(1, 10), + ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(1, 10), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC58[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_FRAME(2, 8), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(2, 8), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(2, 8), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC74[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC7C[] = +{ + ANIMCMD_FRAME(0, 10), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC84[] = +{ + ANIMCMD_FRAME(1, 9), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC8C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC94[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFC9C[] = +{ + ANIMCMD_FRAME(0, 10), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFCA4[] = +{ + ANIMCMD_FRAME(1, 10), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFCAC[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFCB4[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFCBC[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFCC4[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFCCC[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFCD4[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFCDC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFCE4[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFCEC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFCF4[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFCFC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD04[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD0C[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD14[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD1C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD24[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD2C[] = +{ + ANIMCMD_FRAME(2, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD34[] = +{ + ANIMCMD_FRAME(3, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD3C[] = +{ + ANIMCMD_FRAME(0, 63), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD44[] = +{ + ANIMCMD_FRAME(0, 63), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD4C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD54[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD5C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD64[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD6C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD74[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD7C[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD84[] = +{ + ANIMCMD_FRAME(1, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFD8C[] = +{ + ANIMCMD_FRAME(0, 20), + ANIMCMD_FRAME(1, 30), + ANIMCMD_FRAME(0, 20), + ANIMCMD_FRAME(1, 30), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFDA0[] = +{ + ANIMCMD_FRAME(0, 20), + ANIMCMD_FRAME(2, 20), + ANIMCMD_FRAME(0, 20), + ANIMCMD_FRAME(2, 20), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFDB4[] = +{ + ANIMCMD_FRAME(0, 10), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFDBC[] = +{ + ANIMCMD_FRAME(0, 10), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_082FFDC4[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_082FFDCC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFDD0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFDD4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFDD8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFDDC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFDE0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFDE4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFDE8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFDEC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFDF0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFDF4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFDF8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFDFC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE00[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE04[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE08[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE0C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE10[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE14[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE18[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE1C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE20[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE24[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE28[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE2C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE30[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE34[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE38[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE3C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE40[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE44[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE48[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE4C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE50[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE54[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE58[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE5C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE60[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE64[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE68[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE6C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE70[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE74[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE78[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE7C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE80[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE84[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE88[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE8C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE90[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE94[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE98[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFE9C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEA0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEA4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEA8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEAC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEB0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEB4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEB8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEBC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEC0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEC4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEC8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFECC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFED0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFED4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFED8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEDC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEE0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEE4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEE8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEEC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEF0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEF4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEF8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFEFC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF00[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF04[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF08[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF0C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF10[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF14[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF18[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF1C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF20[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF24[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF28[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF2C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF30[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF34[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF38[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF3C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF40[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF44[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF48[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF4C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF50[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF54[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF58[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF5C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF60[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF64[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF68[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF6C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF70[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF74[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF78[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF7C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF80[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF84[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF88[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF8C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF90[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF94[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF98[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFF9C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFA0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFA4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFA8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFAC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFB0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFB4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFB8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFBC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFC0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFC4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFC8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFCC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFD0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFD4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFD8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFDC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFE0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFE4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFE8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFEC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFF0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFF4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFF8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_082FFFFC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300000[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300004[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300008[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830000C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300010[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300014[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300018[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830001C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300020[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300024[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300028[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830002C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300030[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300034[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300038[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830003C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300040[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300044[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300048[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830004C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300050[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300054[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300058[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830005C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300060[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300064[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300068[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830006C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300070[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300074[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300078[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830007C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300080[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300084[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300088[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830008C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300090[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300094[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300098[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830009C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000A0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000A4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000A8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000AC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000B0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000B4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000B8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000BC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000C0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000C4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000C8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000CC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000D0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000D4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000D8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000DC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000E0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000E4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000E8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000EC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000F0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000F4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000F8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083000FC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300100[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300104[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300108[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830010C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300110[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300114[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300118[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830011C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300120[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300124[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300128[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830012C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300130[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300134[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300138[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830013C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300140[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300144[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300148[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830014C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300150[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300154[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300158[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830015C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300160[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300164[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300168[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830016C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300170[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300174[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300178[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830017C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300180[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300184[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300188[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830018C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300190[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300194[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300198[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830019C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001A0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001A4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001A8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001AC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001B0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001B4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001B8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001BC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001C0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001C4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001C8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001CC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083001D0[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_083001D4[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF71C, + gUnknown_082FF734, + gUnknown_082FF744, + gUnknown_082FF750, +}; + +const union AnimCmd *const gUnknown_083001E8[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_083001EC[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF758, + gUnknown_082FF774, + gUnknown_082FF790, +}; + +const union AnimCmd *const gUnknown_083001FC[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_08300200[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF79C, + gUnknown_082FF7B0, +}; + +const union AnimCmd *const gUnknown_0830020C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF7C4, +}; + +const union AnimCmd *const gUnknown_08300214[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF7CC, +}; + +const union AnimCmd *const gUnknown_0830021C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF7D4, +}; + +const union AnimCmd *const gUnknown_08300224[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF7DC, + gUnknown_082FF7E4, +}; + +const union AnimCmd *const gUnknown_08300230[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF7EC, + gUnknown_082FF7F4, +}; + +const union AnimCmd *const gUnknown_0830023C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF7FC, + gUnknown_082FF804, +}; + +const union AnimCmd *const gUnknown_08300248[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF80C, + gUnknown_082FF814, +}; + +const union AnimCmd *const gUnknown_08300254[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF81C, + gUnknown_082FF824, +}; + +const union AnimCmd *const gUnknown_08300260[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_08300264[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF82C, +}; + +const union AnimCmd *const gUnknown_0830026C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF834, + gUnknown_082FF83C, +}; + +const union AnimCmd *const gUnknown_08300278[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF844, +}; + +const union AnimCmd *const gUnknown_08300280[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF84C, +}; + +const union AnimCmd *const gUnknown_08300288[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF854, + gUnknown_082FF85C, +}; + +const union AnimCmd *const gUnknown_08300294[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300298[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830029C[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_083002A0[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF864, +}; + +const union AnimCmd *const gUnknown_083002A8[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF86C, +}; + +const union AnimCmd *const gUnknown_083002B0[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF874, +}; + +const union AnimCmd *const gUnknown_083002B8[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF87C, +}; + +const union AnimCmd *const gUnknown_083002C0[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_083002C4[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF884, +}; + +const union AnimCmd *const gUnknown_083002CC[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF88C, + gUnknown_082FF894, +}; + +const union AnimCmd *const gUnknown_083002D8[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF89C, + gUnknown_082FF8A4, +}; + +const union AnimCmd *const gUnknown_083002E4[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF8AC, + gUnknown_082FF8B4, +}; + +const union AnimCmd *const gUnknown_083002F0[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF8BC, + gUnknown_082FF8FC, + gUnknown_082FF91C, + gUnknown_082FF930, +}; + +const union AnimCmd *const gUnknown_08300304[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_08300308[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF93C, +}; + +const union AnimCmd *const gUnknown_08300310[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF944, +}; + +const union AnimCmd *const gUnknown_08300318[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FF94C, + gUnknown_082FF9A8, + gUnknown_082FFA00, + gUnknown_082FFA58, +}; + +const union AnimCmd *const gUnknown_0830032C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFA64, +}; + +const union AnimCmd *const gUnknown_08300334[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFA6C, +}; + +const union AnimCmd *const gUnknown_0830033C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFA74, +}; + +const union AnimCmd *const gUnknown_08300344[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_08300348[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFA7C, + gUnknown_082FFA84, +}; + +const union AnimCmd *const gUnknown_08300354[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300358[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_0830035C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFA8C, + gUnknown_082FFA94, +}; + +const union AnimCmd *const gUnknown_08300368[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830036C[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_08300370[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFA9C, + gUnknown_082FFAA4, +}; + +const union AnimCmd *const gUnknown_0830037C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFAAC, + gUnknown_082FFAB4, +}; + +const union AnimCmd *const gUnknown_08300388[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFABC, + gUnknown_082FFAC4, +}; + +const union AnimCmd *const gUnknown_08300394[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFACC, + gUnknown_082FFAD4, +}; + +const union AnimCmd *const gUnknown_083003A0[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFADC, +}; + +const union AnimCmd *const gUnknown_083003A8[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFAE4, +}; + +const union AnimCmd *const gUnknown_083003B0[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFAEC, +}; + +const union AnimCmd *const gUnknown_083003B8[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFAF4, +}; + +const union AnimCmd *const gUnknown_083003C0[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFAFC, +}; + +const union AnimCmd *const gUnknown_083003C8[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFB04, + gUnknown_082FFB0C, +}; + +const union AnimCmd *const gUnknown_083003D4[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFB14, +}; + +const union AnimCmd *const gUnknown_083003DC[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFB1C, + gUnknown_082FFB24, +}; + +const union AnimCmd *const gUnknown_083003E8[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFB2C, +}; + +const union AnimCmd *const gUnknown_083003F0[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFB34, +}; + +const union AnimCmd *const gUnknown_083003F8[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFB3C, +}; + +const union AnimCmd *const gUnknown_08300400[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFB44, + gUnknown_082FFB60, +}; + +const union AnimCmd *const gUnknown_0830040C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300410[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300414[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300418[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830041C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300420[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_08300424[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFB7C, + gUnknown_082FFBBC, + gUnknown_082FFBE0, + gUnknown_082FFBF4, +}; + +const union AnimCmd *const gUnknown_08300438[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFBFC, + gUnknown_082FFC04, +}; + +const union AnimCmd *const gUnknown_08300444[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFC0C, +}; + +const union AnimCmd *const gUnknown_0830044C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFC14, +}; + +const union AnimCmd *const gUnknown_08300454[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFC1C, +}; + +const union AnimCmd *const gUnknown_0830045C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFC24, +}; + +const union AnimCmd *const gUnknown_08300464[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFC2C, +}; + +const union AnimCmd *const gUnknown_0830046C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFC34, +}; + +const union AnimCmd *const gUnknown_08300474[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFC3C, + gUnknown_082FFC58, +}; + +const union AnimCmd *const gUnknown_08300480[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFC74, +}; + +const union AnimCmd *const gUnknown_08300488[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFC7C, + gUnknown_082FFC84, +}; + +const union AnimCmd *const gUnknown_08300494[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFC8C, + gUnknown_082FFC94, +}; + +const union AnimCmd *const gUnknown_083004A0[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFC9C, + gUnknown_082FFCA4, +}; + +const union AnimCmd *const gUnknown_083004AC[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_083004B0[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFCAC, +}; + +const union AnimCmd *const gUnknown_083004B8[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFCB4, +}; + +const union AnimCmd *const gUnknown_083004C0[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFCBC, +}; + +const union AnimCmd *const gUnknown_083004C8[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFCC4, +}; + +const union AnimCmd *const gUnknown_083004D0[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFCCC, +}; + +const union AnimCmd *const gUnknown_083004D8[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFCD4, +}; + +const union AnimCmd *const gUnknown_083004E0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083004E4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083004E8[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_083004EC[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFCDC, +}; + +const union AnimCmd *const gUnknown_083004F4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083004F8[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_083004FC[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFCE4, +}; + +const union AnimCmd *const gUnknown_08300504[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFCEC, + gUnknown_082FFCF4, +}; + +const union AnimCmd *const gUnknown_08300510[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFCFC, +}; + +const union AnimCmd *const gUnknown_08300518[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830051C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300520[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_08300524[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFD04, +}; + +const union AnimCmd *const gUnknown_0830052C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFD0C, +}; + +const union AnimCmd *const gUnknown_08300534[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFD14, +}; + +const union AnimCmd *const gUnknown_0830053C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFD1C, + gUnknown_082FFD24, + gUnknown_082FFD2C, + gUnknown_082FFD34, +}; + +const union AnimCmd *const gUnknown_08300550[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFD3C, +}; + +const union AnimCmd *const gUnknown_08300558[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFD44, +}; + +const union AnimCmd *const gUnknown_08300560[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300564[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300568[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830056C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300570[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300574[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300578[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_0830057C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFD4C, + gUnknown_082FFD54, +}; + +const union AnimCmd *const gUnknown_08300588[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_0830058C[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFD5C, + gUnknown_082FFD64, +}; + +const union AnimCmd *const gUnknown_08300598[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830059C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083005A0[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_083005A4[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFD6C, +}; + +const union AnimCmd *const gUnknown_083005AC[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFD74, +}; + +const union AnimCmd *const gUnknown_083005B4[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFD7C, + gUnknown_082FFD84, +}; + +const union AnimCmd *const gUnknown_083005C0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083005C4[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_083005C8[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFD8C, + gUnknown_082FFDA0, +}; + +const union AnimCmd *const gUnknown_083005D4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083005D8[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const gUnknown_083005DC[] = +{ + gAnimCmd_General_Frame0, + gUnknown_082FFDC4, +}; + +const union AnimCmd *const gUnknown_083005E4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083005E8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083005EC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083005F0[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083005F4[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083005F8[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_083005FC[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300600[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300604[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300608[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830060C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300610[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300614[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300618[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830061C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300620[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300624[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300628[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830062C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300630[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300634[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300638[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830063C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300640[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300644[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300648[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_0830064C[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300650[] = {gAnimCmd_General_Frame0}; +const union AnimCmd *const gUnknown_08300654[] = {gAnimCmd_General_Frame0}; + +const union AnimCmd *const *const gUnknownAnimationsSpriteAnimsPtrTable[] = +{ + gUnknown_082FFDCC, + gUnknown_082FFDD0, + gUnknown_082FFDD4, + gUnknown_082FFDD8, + gUnknown_082FFDDC, + gUnknown_082FFDE0, + gUnknown_082FFDE4, + gUnknown_082FFDE8, + gUnknown_082FFDEC, + gUnknown_082FFDF0, + gUnknown_082FFDF4, + gUnknown_082FFDF8, + gUnknown_082FFDFC, + gUnknown_082FFE00, + gUnknown_082FFE04, + gUnknown_082FFE08, + gUnknown_082FFE0C, + gUnknown_082FFE10, + gUnknown_082FFE14, + gUnknown_082FFE18, + gUnknown_082FFE1C, + gUnknown_082FFE20, + gUnknown_082FFE24, + gUnknown_082FFE28, + gUnknown_082FFE2C, + gUnknown_082FFE30, + gUnknown_082FFE34, + gUnknown_082FFE38, + gUnknown_082FFE3C, + gUnknown_082FFE40, + gUnknown_082FFE44, + gUnknown_082FFE48, + gUnknown_082FFE4C, + gUnknown_082FFE50, + gUnknown_082FFE54, + gUnknown_082FFE58, + gUnknown_082FFE5C, + gUnknown_082FFE60, + gUnknown_082FFE64, + gUnknown_082FFE68, + gUnknown_082FFE6C, + gUnknown_082FFE70, + gUnknown_082FFE74, + gUnknown_082FFE78, + gUnknown_082FFE7C, + gUnknown_082FFE80, + gUnknown_082FFE84, + gUnknown_082FFE88, + gUnknown_082FFE8C, + gUnknown_082FFE90, + gUnknown_082FFE94, + gUnknown_082FFE98, + gUnknown_082FFE9C, + gUnknown_082FFEA0, + gUnknown_082FFEA4, + gUnknown_082FFEA8, + gUnknown_082FFEAC, + gUnknown_082FFEB0, + gUnknown_082FFEB4, + gUnknown_082FFEB8, + gUnknown_082FFEBC, + gUnknown_082FFEC0, + gUnknown_082FFEC4, + gUnknown_082FFEC8, + gUnknown_082FFECC, + gUnknown_082FFED0, + gUnknown_082FFED4, + gUnknown_082FFED8, + gUnknown_082FFEDC, + gUnknown_082FFEE0, + gUnknown_082FFEE4, + gUnknown_082FFEE8, + gUnknown_082FFEEC, + gUnknown_082FFEF0, + gUnknown_082FFEF4, + gUnknown_082FFEF8, + gUnknown_082FFEFC, + gUnknown_082FFF00, + gUnknown_082FFF04, + gUnknown_082FFF08, + gUnknown_082FFF0C, + gUnknown_082FFF10, + gUnknown_082FFF14, + gUnknown_082FFF18, + gUnknown_082FFF1C, + gUnknown_082FFF20, + gUnknown_082FFF24, + gUnknown_082FFF28, + gUnknown_082FFF2C, + gUnknown_082FFF30, + gUnknown_082FFF34, + gUnknown_082FFF38, + gUnknown_082FFF3C, + gUnknown_082FFF40, + gUnknown_082FFF44, + gUnknown_082FFF48, + gUnknown_082FFF4C, + gUnknown_082FFF50, + gUnknown_082FFF54, + gUnknown_082FFF58, + gUnknown_082FFF5C, + gUnknown_082FFF60, + gUnknown_082FFF64, + gUnknown_082FFF68, + gUnknown_082FFF6C, + gUnknown_082FFF70, + gUnknown_082FFF74, + gUnknown_082FFF78, + gUnknown_082FFF7C, + gUnknown_082FFF80, + gUnknown_082FFF84, + gUnknown_082FFF88, + gUnknown_082FFF8C, + gUnknown_082FFF90, + gUnknown_082FFF94, + gUnknown_082FFF98, + gUnknown_082FFF9C, + gUnknown_082FFFA0, + gUnknown_082FFFA4, + gUnknown_082FFFA8, + gUnknown_082FFFAC, + gUnknown_082FFFB0, + gUnknown_082FFFB4, + gUnknown_082FFFB8, + gUnknown_082FFFBC, + gUnknown_082FFFC0, + gUnknown_082FFFC4, + gUnknown_082FFFC8, + gUnknown_082FFFCC, + gUnknown_082FFFD0, + gUnknown_082FFFD4, + gUnknown_082FFFD8, + gUnknown_082FFFDC, + gUnknown_082FFFE0, + gUnknown_082FFFE4, + gUnknown_082FFFE8, + gUnknown_082FFFEC, + gUnknown_082FFFF0, + gUnknown_082FFFF4, + gUnknown_082FFFF8, + gUnknown_082FFFFC, + gUnknown_08300000, + gUnknown_08300004, + gUnknown_08300008, + gUnknown_0830000C, + gUnknown_08300010, + gUnknown_08300014, + gUnknown_08300018, + gUnknown_0830001C, + gUnknown_08300020, + gUnknown_08300024, + gUnknown_08300028, + gUnknown_0830002C, + gUnknown_08300030, + gUnknown_08300034, + gUnknown_08300038, + gUnknown_0830003C, + gUnknown_08300040, + gUnknown_08300044, + gUnknown_08300048, + gUnknown_0830004C, + gUnknown_08300050, + gUnknown_08300054, + gUnknown_08300058, + gUnknown_0830005C, + gUnknown_08300060, + gUnknown_08300064, + gUnknown_08300068, + gUnknown_0830006C, + gUnknown_08300070, + gUnknown_08300074, + gUnknown_08300078, + gUnknown_0830007C, + gUnknown_08300080, + gUnknown_08300084, + gUnknown_08300088, + gUnknown_0830008C, + gUnknown_08300090, + gUnknown_08300094, + gUnknown_08300098, + gUnknown_0830009C, + gUnknown_083000A0, + gUnknown_083000A4, + gUnknown_083000A8, + gUnknown_083000AC, + gUnknown_083000B0, + gUnknown_083000B4, + gUnknown_083000B8, + gUnknown_083000BC, + gUnknown_083000C0, + gUnknown_083000C4, + gUnknown_083000C8, + gUnknown_083000CC, + gUnknown_083000D0, + gUnknown_083000D4, + gUnknown_083000D8, + gUnknown_083000DC, + gUnknown_083000E0, + gUnknown_083000E4, + gUnknown_083000E8, + gUnknown_083000EC, + gUnknown_083000F0, + gUnknown_083000F4, + gUnknown_083000F8, + gUnknown_083000FC, + gUnknown_08300100, + gUnknown_08300104, + gUnknown_08300108, + gUnknown_0830010C, + gUnknown_08300110, + gUnknown_08300114, + gUnknown_08300118, + gUnknown_0830011C, + gUnknown_08300120, + gUnknown_08300124, + gUnknown_08300128, + gUnknown_0830012C, + gUnknown_08300130, + gUnknown_08300134, + gUnknown_08300138, + gUnknown_0830013C, + gUnknown_08300140, + gUnknown_08300144, + gUnknown_08300148, + gUnknown_0830014C, + gUnknown_08300150, + gUnknown_08300154, + gUnknown_08300158, + gUnknown_0830015C, + gUnknown_08300160, + gUnknown_08300164, + gUnknown_08300168, + gUnknown_0830016C, + gUnknown_08300170, + gUnknown_08300174, + gUnknown_08300178, + gUnknown_0830017C, + gUnknown_08300180, + gUnknown_08300184, + gUnknown_08300188, + gUnknown_0830018C, + gUnknown_08300190, + gUnknown_08300194, + gUnknown_08300198, + gUnknown_0830019C, + gUnknown_083001A0, + gUnknown_083001A4, + gUnknown_083001A8, + gUnknown_083001AC, + gUnknown_083001B0, + gUnknown_083001B4, + gUnknown_083001B8, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001BC, + gUnknown_083001C0, + gUnknown_083001C4, + gUnknown_083001C8, + gUnknown_083001CC, + gUnknown_083001D0, + gUnknown_083001D4, + gUnknown_083001E8, + gUnknown_083001EC, + gUnknown_083001FC, + gUnknown_08300200, + gUnknown_0830020C, + gUnknown_08300214, + gUnknown_0830021C, + gUnknown_08300224, + gUnknown_08300230, + gUnknown_0830023C, + gUnknown_08300248, + gUnknown_08300254, + gUnknown_08300260, + gUnknown_08300264, + gUnknown_0830026C, + gUnknown_08300278, + gUnknown_08300280, + gUnknown_08300288, + gUnknown_08300294, + gUnknown_08300298, + gUnknown_0830029C, + gUnknown_083002A0, + gUnknown_083002A8, + gUnknown_083002B0, + gUnknown_083002B8, + gUnknown_083002C0, + gUnknown_083002C4, + gUnknown_083002CC, + gUnknown_083002D8, + gUnknown_083002E4, + gUnknown_083002F0, + gUnknown_08300304, + gUnknown_08300308, + gUnknown_08300310, + gUnknown_08300318, + gUnknown_0830032C, + gUnknown_08300334, + gUnknown_0830033C, + gUnknown_08300344, + gUnknown_08300348, + gUnknown_08300354, + gUnknown_08300358, + gUnknown_0830035C, + gUnknown_08300368, + gUnknown_0830036C, + gUnknown_08300370, + gUnknown_0830037C, + gUnknown_08300388, + gUnknown_08300394, + gUnknown_083003A0, + gUnknown_083003A8, + gUnknown_083003B0, + gUnknown_083003B8, + gUnknown_083003C0, + gUnknown_083003C8, + gUnknown_083003D4, + gUnknown_083003DC, + gUnknown_083003E8, + gUnknown_083003F0, + gUnknown_083003F8, + gUnknown_08300400, + gUnknown_0830040C, + gUnknown_08300410, + gUnknown_08300414, + gUnknown_08300418, + gUnknown_0830041C, + gUnknown_08300420, + gUnknown_08300424, + gUnknown_08300438, + gUnknown_08300444, + gUnknown_0830044C, + gUnknown_08300454, + gUnknown_0830045C, + gUnknown_08300464, + gUnknown_0830046C, + gUnknown_08300474, + gUnknown_08300480, + gUnknown_08300488, + gUnknown_08300494, + gUnknown_083004A0, + gUnknown_083004AC, + gUnknown_083004B0, + gUnknown_083004B8, + gUnknown_083004C0, + gUnknown_083004C8, + gUnknown_083004D0, + gUnknown_083004D8, + gUnknown_083004E0, + gUnknown_083004E4, + gUnknown_083004E8, + gUnknown_083004EC, + gUnknown_083004F4, + gUnknown_083004F8, + gUnknown_083004FC, + gUnknown_08300504, + gUnknown_08300510, + gUnknown_08300518, + gUnknown_0830051C, + gUnknown_08300520, + gUnknown_08300524, + gUnknown_0830052C, + gUnknown_08300534, + gUnknown_0830053C, + gUnknown_08300550, + gUnknown_08300558, + gUnknown_08300560, + gUnknown_08300564, + gUnknown_08300568, + gUnknown_0830056C, + gUnknown_08300570, + gUnknown_08300574, + gUnknown_08300578, + gUnknown_0830057C, + gUnknown_08300588, + gUnknown_0830058C, + gUnknown_08300598, + gUnknown_0830059C, + gUnknown_083005A0, + gUnknown_083005A4, + gUnknown_083005AC, + gUnknown_083005B4, + gUnknown_083005C0, + gUnknown_083005C4, + gUnknown_083005C8, + gUnknown_083005D4, + gUnknown_083005D8, + gUnknown_083005DC, + gUnknown_083005E4, + gUnknown_083005E8, + gUnknown_083005EC, + gUnknown_083005EC, + gUnknown_083005F0, + gUnknown_083005F4, + gUnknown_083005F8, + gUnknown_083005FC, + gUnknown_08300600, + gUnknown_08300604, + gUnknown_08300608, + gUnknown_0830060C, + gUnknown_08300610, + gUnknown_08300614, + gUnknown_08300618, + gUnknown_0830061C, + gUnknown_08300620, + gUnknown_08300624, + gUnknown_08300628, + gUnknown_0830062C, + gUnknown_08300630, + gUnknown_08300634, + gUnknown_08300638, + gUnknown_0830063C, + gUnknown_08300640, + gUnknown_08300644, + gUnknown_08300648, + gUnknown_0830064C, + gUnknown_08300650, + gUnknown_08300654, +}; diff --git a/src/data/trainer_graphics/back_pic_tables.h b/src/data/trainer_graphics/back_pic_tables.h index ba7f73ebb..3e74902d8 100644 --- a/src/data/trainer_graphics/back_pic_tables.h +++ b/src/data/trainer_graphics/back_pic_tables.h @@ -1,13 +1,13 @@ -const u8 gTrainerBackPicCoords[] = +const struct MonCoords gTrainerBackPicCoords[] = { - 8, 4, 0, 0, - 8, 4, 0, 0, - 8, 5, 0, 0, - 8, 5, 0, 0, - 8, 4, 0, 0, - 8, 4, 0, 0, - 8, 4, 0, 0, - 8, 4, 0, 0, + {8, 4}, + {8, 4}, + {8, 5}, + {8, 5}, + {8, 4}, + {8, 4}, + {8, 4}, + {8, 4}, }; const struct CompressedSpriteSheet gTrainerBackPicTable[] = diff --git a/src/data/trainer_graphics/front_pic_tables.h b/src/data/trainer_graphics/front_pic_tables.h index 7c1e10683..db80c9d4f 100644 --- a/src/data/trainer_graphics/front_pic_tables.h +++ b/src/data/trainer_graphics/front_pic_tables.h @@ -1,98 +1,98 @@ -const u8 gTrainerFrontPicCoords[] = +const struct MonCoords gTrainerFrontPicCoords[] = { - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 2, 0, 0, - 8, 2, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 2, 0, 0, - 8, 1, 0, 0, - 8, 2, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 2, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 2, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, - 8, 1, 0, 0, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 2}, + {8, 2}, + {8, 1}, + {8, 1}, + {8, 2}, + {8, 1}, + {8, 2}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 2}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 2}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, + {8, 1}, }; const struct CompressedSpriteSheet gTrainerFrontPicTable[] = diff --git a/src/data/trainers.h b/src/data/trainers.h index 19e210acc..214a72df1 100644 --- a/src/data/trainers.h +++ b/src/data/trainers.h @@ -6,9 +6,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _(""), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 0, .party = {.NoItemDefaultMoves = NULL } }, @@ -20,9 +20,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("SAWYER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Sawyer1 } }, @@ -34,9 +34,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt1 } }, @@ -48,9 +48,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt2 } }, @@ -62,9 +62,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt3 } }, @@ -76,9 +76,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt4 } }, @@ -90,9 +90,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt5 } }, @@ -104,9 +104,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt6 } }, @@ -118,9 +118,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt7 } }, @@ -132,9 +132,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_F, .trainerName = _("GABRIELLE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Gabrielle1 } }, @@ -146,9 +146,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt8 } }, @@ -162,7 +162,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARCEL"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Marcel } }, @@ -174,9 +174,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("ALBERTO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Alberto } }, @@ -188,9 +188,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_COLLECTOR, .trainerName = _("ED"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Ed } }, @@ -202,9 +202,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt9 } }, @@ -216,9 +216,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("DECLAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Declan } }, @@ -230,9 +230,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt10 } }, @@ -244,9 +244,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt11 } }, @@ -258,9 +258,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt12 } }, @@ -272,9 +272,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt13 } }, @@ -286,9 +286,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt14 } }, @@ -300,9 +300,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt15 } }, @@ -314,9 +314,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt16 } }, @@ -328,9 +328,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt17 } }, @@ -342,9 +342,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt18 } }, @@ -356,9 +356,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt19 } }, @@ -370,9 +370,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt20 } }, @@ -384,9 +384,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt21 } }, @@ -398,9 +398,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt22 } }, @@ -412,9 +412,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_M, .trainerName = _("FREDRICK"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Fredrick } }, @@ -428,7 +428,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MATT"), .items = {ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Matt } }, @@ -440,9 +440,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("ZANDER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Zander } }, @@ -454,9 +454,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_ADMIN_F, .trainerName = _("SHELLY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Shelly1 } }, @@ -468,9 +468,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_ADMIN_F, .trainerName = _("SHELLY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Shelly2 } }, @@ -484,7 +484,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ARCHIE"), .items = {ITEM_SUPER_POTION, ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Archie } }, @@ -496,9 +496,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_HEX_MANIAC, .trainerName = _("LEAH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Leah } }, @@ -510,9 +510,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_AROMA_LADY, .trainerName = _("DAISY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Daisy } }, @@ -524,9 +524,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_AROMA_LADY, .trainerName = _("ROSE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Rose1 } }, @@ -540,7 +540,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FELIX"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Felix } }, @@ -552,9 +552,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_AROMA_LADY, .trainerName = _("VIOLET"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Violet } }, @@ -566,9 +566,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_AROMA_LADY, .trainerName = _("ROSE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Rose2 } }, @@ -580,9 +580,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_AROMA_LADY, .trainerName = _("ROSE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Rose3 } }, @@ -594,9 +594,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_AROMA_LADY, .trainerName = _("ROSE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Rose4 } }, @@ -608,9 +608,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_AROMA_LADY, .trainerName = _("ROSE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Rose5 } }, @@ -622,9 +622,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("DUSTY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Dusty1 } }, @@ -636,9 +636,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("CHIP"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemCustomMoves = gTrainerParty_Chip } }, @@ -650,9 +650,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("FOSTER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Foster } }, @@ -664,9 +664,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("DUSTY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Dusty2 } }, @@ -678,9 +678,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("DUSTY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Dusty3 } }, @@ -692,9 +692,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("DUSTY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Dusty4 } }, @@ -706,9 +706,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("DUSTY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Dusty5 } }, @@ -720,9 +720,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTERVIEWER, .trainerPic = TRAINER_PIC_INTERVIEWER, .trainerName = _("GABBY & TY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_GabbyAndTy1 } }, @@ -734,9 +734,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTERVIEWER, .trainerPic = TRAINER_PIC_INTERVIEWER, .trainerName = _("GABBY & TY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_GabbyAndTy2 } }, @@ -748,9 +748,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTERVIEWER, .trainerPic = TRAINER_PIC_INTERVIEWER, .trainerName = _("GABBY & TY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_GabbyAndTy3 } }, @@ -762,9 +762,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTERVIEWER, .trainerPic = TRAINER_PIC_INTERVIEWER, .trainerName = _("GABBY & TY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_GabbyAndTy4 } }, @@ -776,9 +776,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTERVIEWER, .trainerPic = TRAINER_PIC_INTERVIEWER, .trainerName = _("GABBY & TY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_GabbyAndTy5 } }, @@ -790,9 +790,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTERVIEWER, .trainerPic = TRAINER_PIC_INTERVIEWER, .trainerName = _("GABBY & TY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_GabbyAndTy6 } }, @@ -804,9 +804,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_F, .trainerName = _("LOLA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Lola1 } }, @@ -818,9 +818,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_F, .trainerName = _("AUSTINA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Austina } }, @@ -832,9 +832,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_F, .trainerName = _("GWEN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Gwen } }, @@ -846,9 +846,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_F, .trainerName = _("LOLA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Lola2 } }, @@ -860,9 +860,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_F, .trainerName = _("LOLA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Lola3 } }, @@ -874,9 +874,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_F, .trainerName = _("LOLA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Lola4 } }, @@ -888,9 +888,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_F, .trainerName = _("LOLA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Lola5 } }, @@ -902,9 +902,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_M, .trainerName = _("RICKY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Ricky1 } }, @@ -916,9 +916,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_M, .trainerName = _("SIMON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Simon } }, @@ -930,9 +930,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_M, .trainerName = _("CHARLIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Charlie } }, @@ -944,9 +944,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_M, .trainerName = _("RICKY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Ricky2 } }, @@ -958,9 +958,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_M, .trainerName = _("RICKY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Ricky3 } }, @@ -972,9 +972,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_M, .trainerName = _("RICKY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Ricky4 } }, @@ -986,9 +986,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_M, .trainerName = _("RICKY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Ricky5 } }, @@ -1002,7 +1002,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RANDALL"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.ItemCustomMoves = gTrainerParty_Randall } }, @@ -1016,7 +1016,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PARKER"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.ItemCustomMoves = gTrainerParty_Parker } }, @@ -1030,7 +1030,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GEORGE"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.ItemCustomMoves = gTrainerParty_George } }, @@ -1044,7 +1044,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BERKE"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.ItemCustomMoves = gTrainerParty_Berke } }, @@ -1058,7 +1058,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRAXTON"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.NoItemCustomMoves = gTrainerParty_Braxton } }, @@ -1072,7 +1072,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VINCENT"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Vincent } }, @@ -1086,7 +1086,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LEROY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Leroy } }, @@ -1100,7 +1100,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WILTON"), .items = {ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Wilton1 } }, @@ -1114,7 +1114,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("EDGAR"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Edgar } }, @@ -1128,7 +1128,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALBERT"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Albert } }, @@ -1142,7 +1142,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SAMUEL"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Samuel } }, @@ -1156,7 +1156,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VITO"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Vito } }, @@ -1170,7 +1170,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("OWEN"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Owen } }, @@ -1184,7 +1184,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WILTON"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Wilton2 } }, @@ -1198,7 +1198,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WILTON"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Wilton3 } }, @@ -1212,7 +1212,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WILTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Wilton4 } }, @@ -1226,7 +1226,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WILTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Wilton5 } }, @@ -1240,7 +1240,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WARREN"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Warren } }, @@ -1254,7 +1254,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARY"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.ItemCustomMoves = gTrainerParty_Mary } }, @@ -1268,7 +1268,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALEXIA"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.ItemCustomMoves = gTrainerParty_Alexia } }, @@ -1282,7 +1282,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JODY"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 1, .party = {.ItemCustomMoves = gTrainerParty_Jody } }, @@ -1296,7 +1296,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WENDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 3, .party = {.NoItemCustomMoves = gTrainerParty_Wendy } }, @@ -1310,7 +1310,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KEIRA"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Keira } }, @@ -1324,7 +1324,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BROOKE"), .items = {ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Brooke1 } }, @@ -1338,7 +1338,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JENNIFER"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jennifer } }, @@ -1352,7 +1352,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HOPE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Hope } }, @@ -1366,7 +1366,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHANNON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Shannon } }, @@ -1380,7 +1380,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MICHELLE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Michelle } }, @@ -1394,7 +1394,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CAROLINE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Caroline } }, @@ -1408,7 +1408,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JULIE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Julie } }, @@ -1422,7 +1422,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BROOKE"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Brooke2 } }, @@ -1436,7 +1436,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BROOKE"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Brooke3 } }, @@ -1450,7 +1450,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BROOKE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Brooke4 } }, @@ -1464,7 +1464,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BROOKE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Brooke5 } }, @@ -1476,9 +1476,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_HEX_MANIAC, .trainerName = _("PATRICIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Patricia } }, @@ -1490,9 +1490,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_HEX_MANIAC, .trainerName = _("KINDRA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Kindra } }, @@ -1504,9 +1504,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_HEX_MANIAC, .trainerName = _("TAMMY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Tammy } }, @@ -1518,9 +1518,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_HEX_MANIAC, .trainerName = _("VALERIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Valerie1 } }, @@ -1532,9 +1532,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_HEX_MANIAC, .trainerName = _("TASHA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Tasha } }, @@ -1546,9 +1546,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_HEX_MANIAC, .trainerName = _("VALERIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Valerie2 } }, @@ -1560,9 +1560,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_HEX_MANIAC, .trainerName = _("VALERIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Valerie3 } }, @@ -1574,9 +1574,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_HEX_MANIAC, .trainerName = _("VALERIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Valerie4 } }, @@ -1588,9 +1588,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_HEX_MANIAC, .trainerName = _("VALERIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Valerie5 } }, @@ -1604,7 +1604,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CINDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Cindy1 } }, @@ -1618,7 +1618,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DAPHNE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.ItemCustomMoves = gTrainerParty_Daphne } }, @@ -1630,9 +1630,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt23 } }, @@ -1646,7 +1646,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CINDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemCustomMoves = gTrainerParty_Cindy2 } }, @@ -1660,7 +1660,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRIANNA"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Brianna } }, @@ -1674,7 +1674,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NAOMI"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Naomi } }, @@ -1688,7 +1688,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CINDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Cindy3 } }, @@ -1702,7 +1702,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CINDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Cindy4 } }, @@ -1716,7 +1716,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CINDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Cindy5 } }, @@ -1730,7 +1730,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CINDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemCustomMoves = gTrainerParty_Cindy6 } }, @@ -1742,9 +1742,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("MELISSA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Melissa } }, @@ -1756,9 +1756,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("SHEILA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Sheila } }, @@ -1770,9 +1770,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("SHIRLEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Shirley } }, @@ -1784,9 +1784,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("JESSICA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Jessica1 } }, @@ -1798,9 +1798,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("CONNIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Connie } }, @@ -1812,9 +1812,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("BRIDGET"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Bridget } }, @@ -1826,9 +1826,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("OLIVIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemCustomMoves = gTrainerParty_Olivia } }, @@ -1840,9 +1840,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("TIFFANY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Tiffany } }, @@ -1854,9 +1854,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("JESSICA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Jessica2 } }, @@ -1868,9 +1868,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("JESSICA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Jessica3 } }, @@ -1882,9 +1882,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("JESSICA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Jessica4 } }, @@ -1896,9 +1896,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("JESSICA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Jessica5 } }, @@ -1912,7 +1912,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINSTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Winston1 } }, @@ -1924,9 +1924,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_F, .trainerName = _("MOLLIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Mollie } }, @@ -1940,7 +1940,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GARRET"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Garret } }, @@ -1954,7 +1954,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINSTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Winston2 } }, @@ -1968,7 +1968,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINSTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Winston3 } }, @@ -1982,7 +1982,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINSTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Winston4 } }, @@ -1996,7 +1996,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINSTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemCustomMoves = gTrainerParty_Winston5 } }, @@ -2008,9 +2008,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_POKEMANIAC, .trainerName = _("STEVE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Steve1 } }, @@ -2022,9 +2022,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("THALIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Thalia1 } }, @@ -2036,9 +2036,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_POKEMANIAC, .trainerName = _("MARK"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Mark } }, @@ -2050,9 +2050,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt24 } }, @@ -2064,9 +2064,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_POKEMANIAC, .trainerName = _("STEVE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Steve2 } }, @@ -2078,9 +2078,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_POKEMANIAC, .trainerName = _("STEVE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Steve3 } }, @@ -2092,9 +2092,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_POKEMANIAC, .trainerName = _("STEVE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Steve4 } }, @@ -2106,9 +2106,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_POKEMANIAC, .trainerName = _("STEVE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Steve5 } }, @@ -2120,9 +2120,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("LUIS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Luis } }, @@ -2134,9 +2134,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("DOMINIK"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Dominik } }, @@ -2148,9 +2148,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("DOUGLAS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Douglas } }, @@ -2162,9 +2162,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("DARRIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Darrin } }, @@ -2176,9 +2176,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("TONY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Tony1 } }, @@ -2190,9 +2190,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("JEROME"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jerome } }, @@ -2204,9 +2204,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("MATTHEW"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Matthew } }, @@ -2218,9 +2218,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("DAVID"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_David } }, @@ -2232,9 +2232,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("SPENCER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Spencer } }, @@ -2246,9 +2246,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("ROLAND"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Roland } }, @@ -2260,9 +2260,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("NOLEN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Nolen } }, @@ -2274,9 +2274,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("STAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Stan } }, @@ -2288,9 +2288,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("BARRY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Barry } }, @@ -2302,9 +2302,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("DEAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Dean } }, @@ -2316,9 +2316,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("RODNEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Rodney } }, @@ -2330,9 +2330,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("RICHARD"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Richard } }, @@ -2344,9 +2344,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("HERMAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Herman } }, @@ -2358,9 +2358,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("SANTIAGO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Santiago } }, @@ -2372,9 +2372,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("GILBERT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Gilbert } }, @@ -2386,9 +2386,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("FRANKLIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Franklin } }, @@ -2400,9 +2400,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("KEVIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Kevin } }, @@ -2414,9 +2414,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("JACK"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jack } }, @@ -2428,9 +2428,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("DUDLEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Dudley } }, @@ -2442,9 +2442,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("CHAD"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Chad } }, @@ -2456,9 +2456,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("TONY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Tony2 } }, @@ -2470,9 +2470,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("TONY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Tony3 } }, @@ -2484,9 +2484,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("TONY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Tony4 } }, @@ -2498,9 +2498,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("TONY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Tony5 } }, @@ -2512,9 +2512,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("TAKAO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Takao } }, @@ -2526,9 +2526,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("HITOSHI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Hitoshi } }, @@ -2540,9 +2540,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("KIYO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Kiyo } }, @@ -2554,9 +2554,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("KOICHI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Koichi } }, @@ -2568,9 +2568,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("NOB"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Nob1 } }, @@ -2582,9 +2582,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("NOB"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Nob2 } }, @@ -2596,9 +2596,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("NOB"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Nob3 } }, @@ -2610,9 +2610,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("NOB"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Nob4 } }, @@ -2624,9 +2624,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("NOB"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.ItemDefaultMoves = gTrainerParty_Nob5 } }, @@ -2638,9 +2638,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("YUJI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Yuji } }, @@ -2652,9 +2652,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("DAISUKE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Daisuke } }, @@ -2666,9 +2666,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("ATSUSHI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Atsushi } }, @@ -2680,9 +2680,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("KIRK"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Kirk } }, @@ -2694,9 +2694,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt25 } }, @@ -2708,9 +2708,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt26 } }, @@ -2722,9 +2722,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("SHAWN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Shawn } }, @@ -2736,9 +2736,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("FERNANDO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Fernando1 } }, @@ -2750,9 +2750,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("DALTON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Dalton1 } }, @@ -2764,9 +2764,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("DALTON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Dalton2 } }, @@ -2778,9 +2778,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("DALTON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Dalton3 } }, @@ -2792,9 +2792,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("DALTON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Dalton4 } }, @@ -2806,9 +2806,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("DALTON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Dalton5 } }, @@ -2820,9 +2820,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("COLE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Cole } }, @@ -2834,9 +2834,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("JEFF"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jeff } }, @@ -2848,9 +2848,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("AXLE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Axle } }, @@ -2862,9 +2862,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("JACE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jace } }, @@ -2876,9 +2876,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("KEEGAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Keegan } }, @@ -2890,9 +2890,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("BERNIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Bernie1 } }, @@ -2904,9 +2904,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("BERNIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Bernie2 } }, @@ -2918,9 +2918,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("BERNIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Bernie3 } }, @@ -2932,9 +2932,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("BERNIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Bernie4 } }, @@ -2946,9 +2946,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("BERNIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Bernie5 } }, @@ -2960,9 +2960,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("DREW"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Drew } }, @@ -2974,9 +2974,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("BEAU"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemCustomMoves = gTrainerParty_Beau } }, @@ -2988,9 +2988,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("LARRY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Larry } }, @@ -3002,9 +3002,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("SHANE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Shane } }, @@ -3016,9 +3016,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("JUSTIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Justin } }, @@ -3030,9 +3030,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("ETHAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Ethan1 } }, @@ -3044,9 +3044,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("AUTUMN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Autumn } }, @@ -3058,9 +3058,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("TRAVIS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Travis } }, @@ -3072,9 +3072,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("ETHAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Ethan2 } }, @@ -3086,9 +3086,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("ETHAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Ethan3 } }, @@ -3100,9 +3100,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("ETHAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Ethan4 } }, @@ -3114,9 +3114,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("ETHAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Ethan5 } }, @@ -3128,9 +3128,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_BUG_MANIAC, .trainerName = _("BRENT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Brent } }, @@ -3142,9 +3142,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_BUG_MANIAC, .trainerName = _("DONALD"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Donald } }, @@ -3156,9 +3156,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_BUG_MANIAC, .trainerName = _("TAYLOR"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Taylor } }, @@ -3170,9 +3170,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_BUG_MANIAC, .trainerName = _("JEFFREY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Jeffrey1 } }, @@ -3184,9 +3184,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_BUG_MANIAC, .trainerName = _("DEREK"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Derek } }, @@ -3198,9 +3198,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_BUG_MANIAC, .trainerName = _("JEFFREY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Jeffrey2 } }, @@ -3212,9 +3212,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_BUG_MANIAC, .trainerName = _("JEFFREY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Jeffrey3 } }, @@ -3226,9 +3226,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_BUG_MANIAC, .trainerName = _("JEFFREY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Jeffrey4 } }, @@ -3240,9 +3240,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_BUG_MANIAC, .trainerName = _("JEFFREY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 5, .party = {.ItemDefaultMoves = gTrainerParty_Jeffrey5 } }, @@ -3254,9 +3254,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("EDWARD"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Edward } }, @@ -3268,9 +3268,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("PRESTON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Preston } }, @@ -3282,9 +3282,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("VIRGIL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Virgil } }, @@ -3296,9 +3296,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("BLAKE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Blake } }, @@ -3310,9 +3310,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("WILLIAM"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_William } }, @@ -3324,9 +3324,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("JOSHUA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Joshua } }, @@ -3338,9 +3338,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("CAMERON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Cameron1 } }, @@ -3352,9 +3352,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("CAMERON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Cameron2 } }, @@ -3366,9 +3366,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("CAMERON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Cameron3 } }, @@ -3380,9 +3380,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("CAMERON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Cameron4 } }, @@ -3394,9 +3394,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("CAMERON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Cameron5 } }, @@ -3408,9 +3408,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("JACLYN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Jaclyn } }, @@ -3422,9 +3422,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("HANNAH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Hannah } }, @@ -3436,9 +3436,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("SAMANTHA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Samantha } }, @@ -3450,9 +3450,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("MAURA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Maura } }, @@ -3464,9 +3464,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("KAYLA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Kayla } }, @@ -3478,9 +3478,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("ALEXIS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Alexis } }, @@ -3492,9 +3492,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("JACKI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jacki1 } }, @@ -3506,9 +3506,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("JACKI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jacki2 } }, @@ -3520,9 +3520,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("JACKI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jacki3 } }, @@ -3534,9 +3534,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("JACKI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jacki4 } }, @@ -3548,9 +3548,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("JACKI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jacki5 } }, @@ -3562,9 +3562,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_RICH, .trainerPic = TRAINER_PIC_GENTLEMAN, .trainerName = _("WALTER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Walter1 } }, @@ -3576,9 +3576,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_RICH, .trainerPic = TRAINER_PIC_GENTLEMAN, .trainerName = _("MICAH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Micah } }, @@ -3590,9 +3590,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_RICH, .trainerPic = TRAINER_PIC_GENTLEMAN, .trainerName = _("THOMAS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Thomas } }, @@ -3604,9 +3604,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_RICH, .trainerPic = TRAINER_PIC_GENTLEMAN, .trainerName = _("WALTER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Walter2 } }, @@ -3618,9 +3618,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_RICH, .trainerPic = TRAINER_PIC_GENTLEMAN, .trainerName = _("WALTER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Walter3 } }, @@ -3632,9 +3632,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_RICH, .trainerPic = TRAINER_PIC_GENTLEMAN, .trainerName = _("WALTER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Walter4 } }, @@ -3646,9 +3646,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_RICH, .trainerPic = TRAINER_PIC_GENTLEMAN, .trainerName = _("WALTER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemCustomMoves = gTrainerParty_Walter5 } }, @@ -3662,7 +3662,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SIDNEY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0xf, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Sidney } }, @@ -3676,7 +3676,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PHOEBE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Phoebe } }, @@ -3690,7 +3690,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GLACIA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Glacia } }, @@ -3704,7 +3704,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DRAKE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Drake } }, @@ -3718,7 +3718,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROXANNE"), .items = {ITEM_POTION, ITEM_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.ItemCustomMoves = gTrainerParty_Roxanne1 } }, @@ -3732,7 +3732,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRAWLY"), .items = {ITEM_SUPER_POTION, ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.ItemCustomMoves = gTrainerParty_Brawly1 } }, @@ -3746,7 +3746,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WATTSON"), .items = {ITEM_SUPER_POTION, ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.ItemCustomMoves = gTrainerParty_Wattson1 } }, @@ -3760,7 +3760,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FLANNERY"), .items = {ITEM_HYPER_POTION, ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.ItemCustomMoves = gTrainerParty_Flannery1 } }, @@ -3774,7 +3774,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NORMAN"), .items = {ITEM_HYPER_POTION, ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.ItemCustomMoves = gTrainerParty_Norman1 } }, @@ -3788,7 +3788,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINONA"), .items = {ITEM_HYPER_POTION, ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x17, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_RISKY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Winona1 } }, @@ -3802,7 +3802,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TATE&LIZA"), .items = {ITEM_HYPER_POTION, ITEM_HYPER_POTION, ITEM_HYPER_POTION, ITEM_HYPER_POTION}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.ItemCustomMoves = gTrainerParty_TateAndLiza1 } }, @@ -3816,7 +3816,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JUAN"), .items = {ITEM_HYPER_POTION, ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Juan1 } }, @@ -3828,9 +3828,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SCHOOL_KID_M, .trainerName = _("JERRY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jerry1 } }, @@ -3842,9 +3842,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SCHOOL_KID_M, .trainerName = _("TED"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Ted } }, @@ -3856,9 +3856,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SCHOOL_KID_M, .trainerName = _("PAUL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Paul } }, @@ -3870,9 +3870,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SCHOOL_KID_M, .trainerName = _("JERRY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jerry2 } }, @@ -3884,9 +3884,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SCHOOL_KID_M, .trainerName = _("JERRY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jerry3 } }, @@ -3898,9 +3898,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SCHOOL_KID_M, .trainerName = _("JERRY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jerry4 } }, @@ -3912,9 +3912,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SCHOOL_KID_M, .trainerName = _("JERRY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Jerry5 } }, @@ -3926,9 +3926,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_SCHOOL_KID_F, .trainerName = _("KAREN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Karen1 } }, @@ -3940,9 +3940,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_SCHOOL_KID_F, .trainerName = _("GEORGIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Georgia } }, @@ -3954,9 +3954,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_SCHOOL_KID_F, .trainerName = _("KAREN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Karen2 } }, @@ -3968,9 +3968,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_SCHOOL_KID_F, .trainerName = _("KAREN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Karen3 } }, @@ -3982,9 +3982,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_SCHOOL_KID_F, .trainerName = _("KAREN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Karen4 } }, @@ -3996,9 +3996,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_SCHOOL_KID_F, .trainerName = _("KAREN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Karen5 } }, @@ -4010,9 +4010,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_SR_AND_JR, .trainerName = _("KATE & JOY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_KateAndJoy } }, @@ -4024,9 +4024,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_SR_AND_JR, .trainerName = _("ANNA & MEG"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_AnnaAndMeg1 } }, @@ -4038,9 +4038,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_SR_AND_JR, .trainerName = _("ANNA & MEG"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_AnnaAndMeg2 } }, @@ -4052,9 +4052,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_SR_AND_JR, .trainerName = _("ANNA & MEG"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_AnnaAndMeg3 } }, @@ -4066,9 +4066,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_SR_AND_JR, .trainerName = _("ANNA & MEG"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_AnnaAndMeg4 } }, @@ -4080,9 +4080,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_SR_AND_JR, .trainerName = _("ANNA & MEG"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_AnnaAndMeg5 } }, @@ -4094,9 +4094,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_M, .trainerName = _("VICTOR"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.ItemDefaultMoves = gTrainerParty_Victor } }, @@ -4108,9 +4108,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_M, .trainerName = _("MIGUEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Miguel1 } }, @@ -4122,9 +4122,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_M, .trainerName = _("COLTON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Colton } }, @@ -4136,9 +4136,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_M, .trainerName = _("MIGUEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Miguel2 } }, @@ -4150,9 +4150,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_M, .trainerName = _("MIGUEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Miguel3 } }, @@ -4164,9 +4164,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_M, .trainerName = _("MIGUEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Miguel4 } }, @@ -4178,9 +4178,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_M, .trainerName = _("MIGUEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Miguel5 } }, @@ -4192,9 +4192,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_F, .trainerName = _("VICTORIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x3, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Victoria } }, @@ -4206,9 +4206,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_F, .trainerName = _("VANESSA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.ItemDefaultMoves = gTrainerParty_Vanessa } }, @@ -4220,9 +4220,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_F, .trainerName = _("BETHANY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.ItemDefaultMoves = gTrainerParty_Bethany } }, @@ -4234,9 +4234,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_F, .trainerName = _("ISABEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.ItemDefaultMoves = gTrainerParty_Isabel1 } }, @@ -4248,9 +4248,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_F, .trainerName = _("ISABEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.ItemDefaultMoves = gTrainerParty_Isabel2 } }, @@ -4262,9 +4262,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_F, .trainerName = _("ISABEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.ItemDefaultMoves = gTrainerParty_Isabel3 } }, @@ -4276,9 +4276,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_F, .trainerName = _("ISABEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.ItemDefaultMoves = gTrainerParty_Isabel4 } }, @@ -4290,9 +4290,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_F, .trainerName = _("ISABEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.ItemDefaultMoves = gTrainerParty_Isabel5 } }, @@ -4304,9 +4304,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_M, .trainerName = _("TIMOTHY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Timothy1 } }, @@ -4318,9 +4318,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_M, .trainerName = _("TIMOTHY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Timothy2 } }, @@ -4332,9 +4332,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_M, .trainerName = _("TIMOTHY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Timothy3 } }, @@ -4346,9 +4346,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_M, .trainerName = _("TIMOTHY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Timothy4 } }, @@ -4360,9 +4360,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_M, .trainerName = _("TIMOTHY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Timothy5 } }, @@ -4374,9 +4374,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_F, .trainerName = _("VICKY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Vicky } }, @@ -4388,9 +4388,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_F, .trainerName = _("SHELBY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Shelby1 } }, @@ -4402,9 +4402,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_F, .trainerName = _("SHELBY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Shelby2 } }, @@ -4416,9 +4416,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_F, .trainerName = _("SHELBY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Shelby3 } }, @@ -4430,9 +4430,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_F, .trainerName = _("SHELBY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Shelby4 } }, @@ -4444,9 +4444,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_F, .trainerName = _("SHELBY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Shelby5 } }, @@ -4458,9 +4458,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("CALVIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Calvin1 } }, @@ -4472,9 +4472,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("BILLY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Billy } }, @@ -4486,9 +4486,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("JOSH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Josh } }, @@ -4500,9 +4500,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("TOMMY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Tommy } }, @@ -4514,9 +4514,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("JOEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Joey } }, @@ -4528,9 +4528,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("BEN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Ben } }, @@ -4544,7 +4544,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("QUINCY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Quincy } }, @@ -4558,7 +4558,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KATELYNN"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Katelynn } }, @@ -4570,9 +4570,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("JAYLEN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jaylen } }, @@ -4584,9 +4584,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("DILLON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Dillon } }, @@ -4598,9 +4598,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("CALVIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Calvin2 } }, @@ -4612,9 +4612,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("CALVIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Calvin3 } }, @@ -4626,9 +4626,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("CALVIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Calvin4 } }, @@ -4640,9 +4640,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("CALVIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Calvin5 } }, @@ -4654,9 +4654,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("EDDIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Eddie } }, @@ -4668,9 +4668,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("ALLEN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Allen } }, @@ -4682,9 +4682,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("TIMMY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Timmy } }, @@ -4698,7 +4698,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLACE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Wallace } }, @@ -4710,9 +4710,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("ANDREW"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Andrew } }, @@ -4724,9 +4724,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("IVAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Ivan } }, @@ -4738,9 +4738,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("CLAUDE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Claude } }, @@ -4752,9 +4752,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("ELLIOT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Elliot1 } }, @@ -4766,9 +4766,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("NED"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Ned } }, @@ -4780,9 +4780,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("DALE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Dale } }, @@ -4794,9 +4794,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("NOLAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Nolan } }, @@ -4808,9 +4808,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("BARNY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Barny } }, @@ -4822,9 +4822,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("WADE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Wade } }, @@ -4836,9 +4836,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("CARTER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Carter } }, @@ -4850,9 +4850,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("ELLIOT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Elliot2 } }, @@ -4864,9 +4864,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("ELLIOT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Elliot3 } }, @@ -4878,9 +4878,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("ELLIOT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Elliot4 } }, @@ -4892,9 +4892,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("ELLIOT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x3, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Elliot5 } }, @@ -4906,9 +4906,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("RONALD"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Ronald } }, @@ -4920,9 +4920,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_M, .trainerName = _("JACOB"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Jacob } }, @@ -4934,9 +4934,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_M, .trainerName = _("ANTHONY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Anthony } }, @@ -4948,9 +4948,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_M, .trainerName = _("BENJAMIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Benjamin1 } }, @@ -4962,9 +4962,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_M, .trainerName = _("BENJAMIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Benjamin2 } }, @@ -4976,9 +4976,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_M, .trainerName = _("BENJAMIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Benjamin3 } }, @@ -4990,9 +4990,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_M, .trainerName = _("BENJAMIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Benjamin4 } }, @@ -5004,9 +5004,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_M, .trainerName = _("BENJAMIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Benjamin5 } }, @@ -5018,9 +5018,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_F, .trainerName = _("ABIGAIL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Abigail1 } }, @@ -5032,9 +5032,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_F, .trainerName = _("JASMINE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Jasmine } }, @@ -5046,9 +5046,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_F, .trainerName = _("ABIGAIL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Abigail2 } }, @@ -5060,9 +5060,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_F, .trainerName = _("ABIGAIL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Abigail3 } }, @@ -5074,9 +5074,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_F, .trainerName = _("ABIGAIL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Abigail4 } }, @@ -5088,9 +5088,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_F, .trainerName = _("ABIGAIL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Abigail5 } }, @@ -5102,9 +5102,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_RUNNING_TRIATHLETE_M, .trainerName = _("DYLAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Dylan1 } }, @@ -5116,9 +5116,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_RUNNING_TRIATHLETE_M, .trainerName = _("DYLAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Dylan2 } }, @@ -5130,9 +5130,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_RUNNING_TRIATHLETE_M, .trainerName = _("DYLAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Dylan3 } }, @@ -5144,9 +5144,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_RUNNING_TRIATHLETE_M, .trainerName = _("DYLAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Dylan4 } }, @@ -5158,9 +5158,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_RUNNING_TRIATHLETE_M, .trainerName = _("DYLAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Dylan5 } }, @@ -5172,9 +5172,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_RUNNING_TRIATHLETE_F, .trainerName = _("MARIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Maria1 } }, @@ -5186,9 +5186,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_RUNNING_TRIATHLETE_F, .trainerName = _("MARIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Maria2 } }, @@ -5200,9 +5200,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_RUNNING_TRIATHLETE_F, .trainerName = _("MARIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Maria3 } }, @@ -5214,9 +5214,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_RUNNING_TRIATHLETE_F, .trainerName = _("MARIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Maria4 } }, @@ -5228,9 +5228,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_RUNNING_TRIATHLETE_F, .trainerName = _("MARIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Maria5 } }, @@ -5242,9 +5242,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("CAMDEN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Camden } }, @@ -5256,9 +5256,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("DEMETRIUS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Demetrius } }, @@ -5270,9 +5270,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("ISAIAH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Isaiah1 } }, @@ -5284,9 +5284,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("PABLO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Pablo1 } }, @@ -5298,9 +5298,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("CHASE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Chase } }, @@ -5312,9 +5312,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("ISAIAH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Isaiah2 } }, @@ -5326,9 +5326,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("ISAIAH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Isaiah3 } }, @@ -5340,9 +5340,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("ISAIAH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Isaiah4 } }, @@ -5354,9 +5354,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("ISAIAH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Isaiah5 } }, @@ -5368,9 +5368,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_F, .trainerName = _("ISOBEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Isobel } }, @@ -5382,9 +5382,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_F, .trainerName = _("DONNY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Donny } }, @@ -5396,9 +5396,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_F, .trainerName = _("TALIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Talia } }, @@ -5410,9 +5410,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_F, .trainerName = _("KATELYN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Katelyn1 } }, @@ -5424,9 +5424,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_F, .trainerName = _("ALLISON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Allison } }, @@ -5438,9 +5438,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_F, .trainerName = _("KATELYN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Katelyn2 } }, @@ -5452,9 +5452,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_F, .trainerName = _("KATELYN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Katelyn3 } }, @@ -5466,9 +5466,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_F, .trainerName = _("KATELYN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Katelyn4 } }, @@ -5480,9 +5480,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_F, .trainerName = _("KATELYN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Katelyn5 } }, @@ -5494,9 +5494,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_DRAGON_TAMER, .trainerName = _("NICOLAS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Nicolas1 } }, @@ -5508,9 +5508,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_DRAGON_TAMER, .trainerName = _("NICOLAS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Nicolas2 } }, @@ -5522,9 +5522,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_DRAGON_TAMER, .trainerName = _("NICOLAS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Nicolas3 } }, @@ -5536,9 +5536,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_DRAGON_TAMER, .trainerName = _("NICOLAS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Nicolas4 } }, @@ -5550,9 +5550,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_DRAGON_TAMER, .trainerName = _("NICOLAS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.ItemDefaultMoves = gTrainerParty_Nicolas5 } }, @@ -5564,9 +5564,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_DRAGON_TAMER, .trainerName = _("AARON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Aaron } }, @@ -5578,9 +5578,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("PERRY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Perry } }, @@ -5592,9 +5592,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("HUGH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Hugh } }, @@ -5606,9 +5606,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("PHIL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Phil } }, @@ -5620,9 +5620,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("JARED"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Jared } }, @@ -5634,9 +5634,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("HUMBERTO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Humberto } }, @@ -5648,9 +5648,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("PRESLEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Presley } }, @@ -5662,9 +5662,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("EDWARDO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Edwardo } }, @@ -5676,9 +5676,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("COLIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Colin } }, @@ -5690,9 +5690,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("ROBERT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Robert1 } }, @@ -5704,9 +5704,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("BENNY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Benny } }, @@ -5718,9 +5718,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("CHESTER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Chester } }, @@ -5732,9 +5732,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("ROBERT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Robert2 } }, @@ -5746,9 +5746,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("ROBERT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Robert3 } }, @@ -5760,9 +5760,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("ROBERT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Robert4 } }, @@ -5774,9 +5774,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("ROBERT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Robert5 } }, @@ -5788,9 +5788,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("ALEX"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Alex } }, @@ -5802,9 +5802,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("BECK"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Beck } }, @@ -5816,9 +5816,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("YASU"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x3, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Yasu } }, @@ -5830,9 +5830,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("TAKASHI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x3, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Takashi } }, @@ -5846,7 +5846,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DIANNE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 2, .party = {.ItemCustomMoves = gTrainerParty_Dianne } }, @@ -5858,9 +5858,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_F, .trainerName = _("JANI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jani } }, @@ -5872,9 +5872,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("LAO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 3, .party = {.NoItemCustomMoves = gTrainerParty_Lao1 } }, @@ -5886,9 +5886,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("LUNG"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Lung } }, @@ -5900,9 +5900,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("LAO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 4, .party = {.NoItemCustomMoves = gTrainerParty_Lao2 } }, @@ -5914,9 +5914,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("LAO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 4, .party = {.NoItemCustomMoves = gTrainerParty_Lao3 } }, @@ -5928,9 +5928,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("LAO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 4, .party = {.NoItemCustomMoves = gTrainerParty_Lao4 } }, @@ -5942,9 +5942,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("LAO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 4, .party = {.ItemCustomMoves = gTrainerParty_Lao5 } }, @@ -5956,9 +5956,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("JOCELYN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jocelyn } }, @@ -5970,9 +5970,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("LAURA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Laura } }, @@ -5984,9 +5984,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("CYNDY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Cyndy1 } }, @@ -5998,9 +5998,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("CORA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Cora } }, @@ -6012,9 +6012,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("PAULA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Paula } }, @@ -6026,9 +6026,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("CYNDY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Cyndy2 } }, @@ -6040,9 +6040,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("CYNDY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Cyndy3 } }, @@ -6054,9 +6054,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("CYNDY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Cyndy4 } }, @@ -6068,9 +6068,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("CYNDY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Cyndy5 } }, @@ -6082,9 +6082,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_PARASOL_LADY, .trainerName = _("MADELINE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Madeline1 } }, @@ -6096,9 +6096,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_PARASOL_LADY, .trainerName = _("CLARISSA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Clarissa } }, @@ -6110,9 +6110,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_PARASOL_LADY, .trainerName = _("ANGELICA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Angelica } }, @@ -6124,9 +6124,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_PARASOL_LADY, .trainerName = _("MADELINE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Madeline2 } }, @@ -6138,9 +6138,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_PARASOL_LADY, .trainerName = _("MADELINE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Madeline3 } }, @@ -6152,9 +6152,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_PARASOL_LADY, .trainerName = _("MADELINE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Madeline4 } }, @@ -6166,9 +6166,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_PARASOL_LADY, .trainerName = _("MADELINE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Madeline5 } }, @@ -6180,9 +6180,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("BEVERLY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Beverly } }, @@ -6194,9 +6194,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("IMANI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Imani } }, @@ -6208,9 +6208,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("KYLA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Kyla } }, @@ -6222,9 +6222,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("DENISE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Denise } }, @@ -6236,9 +6236,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("BETH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Beth } }, @@ -6250,9 +6250,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("TARA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Tara } }, @@ -6264,9 +6264,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("MISSY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Missy } }, @@ -6278,9 +6278,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("ALICE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Alice } }, @@ -6292,9 +6292,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("JENNY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jenny1 } }, @@ -6306,9 +6306,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("GRACE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grace } }, @@ -6320,9 +6320,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("TANYA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Tanya } }, @@ -6334,9 +6334,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("SHARON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Sharon } }, @@ -6348,9 +6348,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("NIKKI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Nikki } }, @@ -6362,9 +6362,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("BRENDA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Brenda } }, @@ -6376,9 +6376,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("KATIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Katie } }, @@ -6390,9 +6390,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("SUSIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Susie } }, @@ -6404,9 +6404,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("KARA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Kara } }, @@ -6418,9 +6418,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("DANA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Dana } }, @@ -6432,9 +6432,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("SIENNA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Sienna } }, @@ -6446,9 +6446,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("DEBRA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Debra } }, @@ -6460,9 +6460,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("LINDA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Linda } }, @@ -6474,9 +6474,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("KAYLEE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Kaylee } }, @@ -6488,9 +6488,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("LAUREL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Laurel } }, @@ -6502,9 +6502,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("CARLEE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Carlee } }, @@ -6516,9 +6516,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("JENNY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jenny2 } }, @@ -6530,9 +6530,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("JENNY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jenny3 } }, @@ -6544,9 +6544,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("JENNY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jenny4 } }, @@ -6558,9 +6558,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("JENNY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Jenny5 } }, @@ -6572,9 +6572,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("HEIDI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Heidi } }, @@ -6586,9 +6586,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("BECKY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Becky } }, @@ -6600,9 +6600,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("CAROL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Carol } }, @@ -6614,9 +6614,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("NANCY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Nancy } }, @@ -6628,9 +6628,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("MARTHA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Martha } }, @@ -6642,9 +6642,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("DIANA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Diana1 } }, @@ -6656,9 +6656,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("CEDRIC"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Cedric } }, @@ -6670,9 +6670,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("IRENE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Irene } }, @@ -6684,9 +6684,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("DIANA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Diana2 } }, @@ -6698,9 +6698,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("DIANA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Diana3 } }, @@ -6712,9 +6712,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("DIANA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Diana4 } }, @@ -6726,9 +6726,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("DIANA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Diana5 } }, @@ -6740,9 +6740,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_TWINS, .trainerName = _("AMY & LIV"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_AmyAndLiv1 } }, @@ -6754,9 +6754,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_TWINS, .trainerName = _("AMY & LIV"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_AmyAndLiv2 } }, @@ -6768,9 +6768,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_TWINS, .trainerName = _("GINA & MIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_GinaAndMia1 } }, @@ -6782,9 +6782,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_TWINS, .trainerName = _("MIU & YUKI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_MiuAndYuki } }, @@ -6796,9 +6796,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_TWINS, .trainerName = _("AMY & LIV"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_AmyAndLiv3 } }, @@ -6810,9 +6810,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_TWINS, .trainerName = _("GINA & MIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_GinaAndMia2 } }, @@ -6824,9 +6824,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_TWINS, .trainerName = _("AMY & LIV"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_AmyAndLiv4 } }, @@ -6838,9 +6838,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_TWINS, .trainerName = _("AMY & LIV"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_AmyAndLiv5 } }, @@ -6852,9 +6852,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_TWINS, .trainerName = _("AMY & LIV"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_AmyAndLiv6 } }, @@ -6866,9 +6866,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("HUEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Huey } }, @@ -6880,9 +6880,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("EDMOND"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Edmond } }, @@ -6894,9 +6894,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("ERNEST"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Ernest1 } }, @@ -6908,9 +6908,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("DWAYNE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Dwayne } }, @@ -6922,9 +6922,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("PHILLIP"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Phillip } }, @@ -6936,9 +6936,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("LEONARD"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Leonard } }, @@ -6950,9 +6950,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("DUNCAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Duncan } }, @@ -6964,9 +6964,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("ERNEST"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Ernest2 } }, @@ -6978,9 +6978,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("ERNEST"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Ernest3 } }, @@ -6992,9 +6992,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("ERNEST"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Ernest4 } }, @@ -7006,9 +7006,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("ERNEST"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Ernest5 } }, @@ -7020,9 +7020,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("ELI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Eli } }, @@ -7034,9 +7034,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_F, .trainerName = _("ANNIKA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.ItemCustomMoves = gTrainerParty_Annika } }, @@ -7050,7 +7050,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JAZMYN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jazmyn } }, @@ -7062,9 +7062,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("JONAS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Jonas } }, @@ -7076,9 +7076,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_PARASOL_LADY, .trainerName = _("KAYLEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Kayley } }, @@ -7090,9 +7090,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_M, .trainerName = _("AURON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Auron } }, @@ -7104,9 +7104,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("KELVIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Kelvin } }, @@ -7120,7 +7120,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARLEY"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.ItemCustomMoves = gTrainerParty_Marley } }, @@ -7132,9 +7132,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("REYNA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Reyna } }, @@ -7146,9 +7146,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("HUDSON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Hudson } }, @@ -7160,9 +7160,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_M, .trainerName = _("CONOR"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Conor } }, @@ -7174,9 +7174,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_COLLECTOR, .trainerName = _("EDWIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Edwin1 } }, @@ -7188,9 +7188,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_COLLECTOR, .trainerName = _("HECTOR"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Hector } }, @@ -7202,9 +7202,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_ADMIN, .trainerName = _("TABITHA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Tabitha1 } }, @@ -7216,9 +7216,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_COLLECTOR, .trainerName = _("EDWIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Edwin2 } }, @@ -7230,9 +7230,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_COLLECTOR, .trainerName = _("EDWIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Edwin3 } }, @@ -7244,9 +7244,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_COLLECTOR, .trainerName = _("EDWIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Edwin4 } }, @@ -7258,9 +7258,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_COLLECTOR, .trainerName = _("EDWIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Edwin5 } }, @@ -7274,7 +7274,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.NoItemCustomMoves = gTrainerParty_Wally1 } }, @@ -7286,9 +7286,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan1 } }, @@ -7300,9 +7300,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan2 } }, @@ -7314,9 +7314,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan3 } }, @@ -7328,9 +7328,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan4 } }, @@ -7342,9 +7342,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan5 } }, @@ -7356,9 +7356,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan6 } }, @@ -7370,9 +7370,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan7 } }, @@ -7384,9 +7384,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan8 } }, @@ -7398,9 +7398,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan9 } }, @@ -7412,9 +7412,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_May1 } }, @@ -7426,9 +7426,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_May2 } }, @@ -7440,9 +7440,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_May3 } }, @@ -7454,9 +7454,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_May4 } }, @@ -7468,9 +7468,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_May5 } }, @@ -7482,9 +7482,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_May6 } }, @@ -7496,9 +7496,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_May7 } }, @@ -7510,9 +7510,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_May8 } }, @@ -7524,9 +7524,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_May9 } }, @@ -7538,9 +7538,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_M, .trainerName = _("ISAAC"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Isaac1 } }, @@ -7552,9 +7552,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BUG_CATCHER, .trainerName = _("DAVIS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Davis } }, @@ -7566,9 +7566,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_COOL_TRAINER_M, .trainerName = _("MITCHELL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Mitchell } }, @@ -7580,9 +7580,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_M, .trainerName = _("ISAAC"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Isaac2 } }, @@ -7594,9 +7594,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_M, .trainerName = _("ISAAC"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Isaac3 } }, @@ -7608,9 +7608,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_M, .trainerName = _("ISAAC"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Isaac4 } }, @@ -7622,9 +7622,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_M, .trainerName = _("ISAAC"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Isaac5 } }, @@ -7636,9 +7636,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_F, .trainerName = _("LYDIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Lydia1 } }, @@ -7652,7 +7652,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HALLE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Halle } }, @@ -7664,9 +7664,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("GARRISON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Garrison } }, @@ -7678,9 +7678,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_F, .trainerName = _("LYDIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Lydia2 } }, @@ -7692,9 +7692,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_F, .trainerName = _("LYDIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Lydia3 } }, @@ -7706,9 +7706,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_F, .trainerName = _("LYDIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Lydia4 } }, @@ -7720,9 +7720,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_F, .trainerName = _("LYDIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Lydia5 } }, @@ -7736,7 +7736,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKSON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jackson1 } }, @@ -7750,7 +7750,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LORENZO"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Lorenzo } }, @@ -7764,7 +7764,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SEBASTIAN"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Sebastian } }, @@ -7778,7 +7778,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKSON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jackson2 } }, @@ -7792,7 +7792,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKSON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jackson3 } }, @@ -7806,7 +7806,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKSON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Jackson4 } }, @@ -7820,7 +7820,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKSON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jackson5 } }, @@ -7834,7 +7834,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CATHERINE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Catherine1 } }, @@ -7848,7 +7848,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JENNA"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Jenna } }, @@ -7862,7 +7862,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SOPHIA"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Sophia } }, @@ -7876,7 +7876,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CATHERINE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Catherine2 } }, @@ -7890,7 +7890,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CATHERINE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Catherine3 } }, @@ -7904,7 +7904,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CATHERINE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Catherine4 } }, @@ -7918,7 +7918,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CATHERINE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Catherine5 } }, @@ -7930,9 +7930,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_M, .trainerName = _("JULIO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Julio } }, @@ -7944,9 +7944,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt27 } }, @@ -7958,9 +7958,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt28 } }, @@ -7972,9 +7972,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt29 } }, @@ -7986,9 +7986,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt30 } }, @@ -8000,9 +8000,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("MARC"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Marc } }, @@ -8014,9 +8014,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("BRENDEN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Brenden } }, @@ -8028,9 +8028,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("LILITH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Lilith } }, @@ -8042,9 +8042,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("CRISTIAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Cristian } }, @@ -8056,9 +8056,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_HEX_MANIAC, .trainerName = _("SYLVIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Sylvia } }, @@ -8070,9 +8070,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("LEONARDO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Leonardo } }, @@ -8086,7 +8086,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ATHENA"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.ItemCustomMoves = gTrainerParty_Athena } }, @@ -8098,9 +8098,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("HARRISON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Harrison } }, @@ -8112,9 +8112,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt31 } }, @@ -8126,9 +8126,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("CLARENCE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Clarence } }, @@ -8140,9 +8140,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("TERRY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Terry } }, @@ -8154,9 +8154,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_RICH, .trainerPic = TRAINER_PIC_GENTLEMAN, .trainerName = _("NATE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Nate } }, @@ -8168,9 +8168,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_HEX_MANIAC, .trainerName = _("KATHLEEN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Kathleen } }, @@ -8182,9 +8182,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_RICH, .trainerPic = TRAINER_PIC_GENTLEMAN, .trainerName = _("CLIFFORD"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Clifford } }, @@ -8196,9 +8196,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("NICHOLAS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Nicholas } }, @@ -8210,9 +8210,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt32 } }, @@ -8224,9 +8224,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt33 } }, @@ -8238,9 +8238,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt34 } }, @@ -8252,9 +8252,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt35 } }, @@ -8266,9 +8266,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt36 } }, @@ -8280,9 +8280,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("MACEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Macey } }, @@ -8294,9 +8294,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan10 } }, @@ -8308,9 +8308,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan11 } }, @@ -8322,9 +8322,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_EXPERT_M, .trainerName = _("PAXTON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Paxton } }, @@ -8336,9 +8336,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_F, .trainerName = _("ISABELLA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Isabella } }, @@ -8350,9 +8350,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_AQUA, .trainerPic = TRAINER_PIC_AQUA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt37 } }, @@ -8364,9 +8364,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_ADMIN, .trainerName = _("TABITHA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Tabitha2 } }, @@ -8380,7 +8380,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JONATHAN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jonathan } }, @@ -8392,9 +8392,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan12 } }, @@ -8406,9 +8406,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_May10 } }, @@ -8422,7 +8422,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAXIE"), .items = {ITEM_SUPER_POTION, ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Maxie1 } }, @@ -8436,7 +8436,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAXIE"), .items = {ITEM_SUPER_POTION, ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Maxie2 } }, @@ -8448,9 +8448,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_LASS, .trainerName = _("TIANA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Tiana } }, @@ -8462,9 +8462,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_LASS, .trainerName = _("HALEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Haley1 } }, @@ -8476,9 +8476,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_LASS, .trainerName = _("JANICE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Janice } }, @@ -8490,9 +8490,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_LASS, .trainerName = _("VIVI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Vivi } }, @@ -8504,9 +8504,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_LASS, .trainerName = _("HALEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Haley2 } }, @@ -8518,9 +8518,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_LASS, .trainerName = _("HALEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Haley3 } }, @@ -8532,9 +8532,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_LASS, .trainerName = _("HALEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Haley4 } }, @@ -8546,9 +8546,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_LASS, .trainerName = _("HALEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Haley5 } }, @@ -8560,9 +8560,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_LASS, .trainerName = _("SALLY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Sally } }, @@ -8574,9 +8574,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_LASS, .trainerName = _("ROBIN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Robin } }, @@ -8588,9 +8588,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_LASS, .trainerName = _("ANDREA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Andrea } }, @@ -8602,9 +8602,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_LASS, .trainerName = _("CRISSY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Crissy } }, @@ -8616,9 +8616,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BUG_CATCHER, .trainerName = _("RICK"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Rick } }, @@ -8630,9 +8630,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BUG_CATCHER, .trainerName = _("LYLE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Lyle } }, @@ -8644,9 +8644,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BUG_CATCHER, .trainerName = _("JOSE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jose } }, @@ -8658,9 +8658,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BUG_CATCHER, .trainerName = _("DOUG"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Doug } }, @@ -8672,9 +8672,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BUG_CATCHER, .trainerName = _("GREG"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Greg } }, @@ -8686,9 +8686,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BUG_CATCHER, .trainerName = _("KENT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Kent } }, @@ -8700,9 +8700,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BUG_CATCHER, .trainerName = _("JAMES"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_James1 } }, @@ -8714,9 +8714,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BUG_CATCHER, .trainerName = _("JAMES"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_James2 } }, @@ -8728,9 +8728,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BUG_CATCHER, .trainerName = _("JAMES"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_James3 } }, @@ -8742,9 +8742,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BUG_CATCHER, .trainerName = _("JAMES"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_James4 } }, @@ -8756,9 +8756,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BUG_CATCHER, .trainerName = _("JAMES"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_James5 } }, @@ -8770,9 +8770,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("BRICE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Brice } }, @@ -8784,9 +8784,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("TRENT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Trent1 } }, @@ -8798,9 +8798,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("LENNY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Lenny } }, @@ -8812,9 +8812,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("LUCAS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Lucas1 } }, @@ -8826,9 +8826,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("ALAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Alan } }, @@ -8840,9 +8840,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("CLARK"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Clark } }, @@ -8854,9 +8854,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("ERIC"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Eric } }, @@ -8868,9 +8868,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("LUCAS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Lucas2 } }, @@ -8882,9 +8882,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("MIKE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Mike1 } }, @@ -8896,9 +8896,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("MIKE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Mike2 } }, @@ -8910,9 +8910,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("TRENT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Trent2 } }, @@ -8924,9 +8924,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("TRENT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Trent3 } }, @@ -8938,9 +8938,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("TRENT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Trent4 } }, @@ -8952,9 +8952,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("TRENT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Trent5 } }, @@ -8966,9 +8966,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_YOUNG_COUPLE, .trainerName = _("DEZ & LUKE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_DezAndLuke } }, @@ -8980,9 +8980,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_YOUNG_COUPLE, .trainerName = _("LEA & JED"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_LeaAndJed } }, @@ -8994,9 +8994,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_YOUNG_COUPLE, .trainerName = _("KIRA & DAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_KiraAndDan1 } }, @@ -9008,9 +9008,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_YOUNG_COUPLE, .trainerName = _("KIRA & DAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_KiraAndDan2 } }, @@ -9022,9 +9022,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_YOUNG_COUPLE, .trainerName = _("KIRA & DAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_KiraAndDan3 } }, @@ -9036,9 +9036,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_YOUNG_COUPLE, .trainerName = _("KIRA & DAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_KiraAndDan4 } }, @@ -9050,9 +9050,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_YOUNG_COUPLE, .trainerName = _("KIRA & DAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_KiraAndDan5 } }, @@ -9064,9 +9064,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("JOHANNA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Johanna } }, @@ -9080,7 +9080,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GERALD"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Gerald } }, @@ -9092,9 +9092,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("VIVIAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Vivian } }, @@ -9106,9 +9106,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("DANIELLE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Danielle } }, @@ -9120,9 +9120,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("HIDEO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x3, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Hideo } }, @@ -9134,9 +9134,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("KEIGO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x3, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Keigo } }, @@ -9148,9 +9148,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("RILEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x3, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_Riley } }, @@ -9162,9 +9162,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("FLINT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Flint } }, @@ -9176,9 +9176,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("ASHLEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Ashley } }, @@ -9190,9 +9190,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_WALLY, .trainerName = _("WALLY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Wally2 } }, @@ -9206,7 +9206,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.NoItemCustomMoves = gTrainerParty_Wally3 } }, @@ -9220,7 +9220,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.NoItemCustomMoves = gTrainerParty_Wally4 } }, @@ -9234,7 +9234,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.NoItemCustomMoves = gTrainerParty_Wally5 } }, @@ -9248,7 +9248,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.NoItemCustomMoves = gTrainerParty_Wally6 } }, @@ -9260,9 +9260,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan13 } }, @@ -9274,9 +9274,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan14 } }, @@ -9288,9 +9288,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan15 } }, @@ -9302,9 +9302,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_May11 } }, @@ -9316,9 +9316,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_May12 } }, @@ -9330,9 +9330,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_May13 } }, @@ -9344,9 +9344,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("JONAH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Jonah } }, @@ -9358,9 +9358,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("HENRY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Henry } }, @@ -9372,9 +9372,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("ROGER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Roger } }, @@ -9388,7 +9388,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALEXA"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Alexa } }, @@ -9402,7 +9402,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RUBEN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Ruben } }, @@ -9414,9 +9414,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("KOJI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Koji1 } }, @@ -9428,9 +9428,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("WAYNE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Wayne } }, @@ -9442,9 +9442,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("AIDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Aidan } }, @@ -9456,9 +9456,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("REED"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Reed } }, @@ -9470,9 +9470,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("TISHA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Tisha } }, @@ -9484,9 +9484,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_TWINS, .trainerName = _("TORI & TIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_ToriAndTia } }, @@ -9498,9 +9498,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_SR_AND_JR, .trainerName = _("KIM & IRIS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_KimAndIris } }, @@ -9512,9 +9512,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_SR_AND_JR, .trainerName = _("TYRA & IVY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_TyraAndIvy } }, @@ -9526,9 +9526,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_YOUNG_COUPLE, .trainerName = _("MEL & PAUL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_MelAndPaul } }, @@ -9540,9 +9540,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_OLD_COUPLE, .trainerName = _("JOHN & JAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_JohnAndJay1 } }, @@ -9554,9 +9554,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_OLD_COUPLE, .trainerName = _("JOHN & JAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_JohnAndJay2 } }, @@ -9568,9 +9568,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_OLD_COUPLE, .trainerName = _("JOHN & JAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_JohnAndJay3 } }, @@ -9582,9 +9582,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_OLD_COUPLE, .trainerName = _("JOHN & JAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0xb, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_JohnAndJay4 } }, @@ -9596,9 +9596,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_OLD_COUPLE, .trainerName = _("JOHN & JAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemCustomMoves = gTrainerParty_JohnAndJay5 } }, @@ -9610,9 +9610,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SIS_AND_BRO, .trainerName = _("RELI & IAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_ReliAndIan } }, @@ -9624,9 +9624,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SIS_AND_BRO, .trainerName = _("LILA & ROY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_LilaAndRoy1 } }, @@ -9638,9 +9638,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SIS_AND_BRO, .trainerName = _("LILA & ROY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_LilaAndRoy2 } }, @@ -9652,9 +9652,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SIS_AND_BRO, .trainerName = _("LILA & ROY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_LilaAndRoy3 } }, @@ -9666,9 +9666,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SIS_AND_BRO, .trainerName = _("LILA & ROY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_LilaAndRoy4 } }, @@ -9680,9 +9680,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SIS_AND_BRO, .trainerName = _("LILA & ROY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_LilaAndRoy5 } }, @@ -9694,9 +9694,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SIS_AND_BRO, .trainerName = _("LISA & RAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = TRUE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_LisaAndRay } }, @@ -9708,9 +9708,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("CHRIS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Chris } }, @@ -9722,9 +9722,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_RICH, .trainerPic = TRAINER_PIC_RICH_BOY, .trainerName = _("DAWSON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.ItemDefaultMoves = gTrainerParty_Dawson } }, @@ -9738,7 +9738,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SARAH"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.ItemDefaultMoves = gTrainerParty_Sarah } }, @@ -9750,9 +9750,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("DARIAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Darian } }, @@ -9764,9 +9764,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_F, .trainerName = _("HAILEY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Hailey } }, @@ -9778,9 +9778,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_TUBER_M, .trainerName = _("CHANDLER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Chandler } }, @@ -9792,9 +9792,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_TWINS, .trainerPic = TRAINER_PIC_WINSTRATE_M, .trainerName = _("KALEB"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.ItemDefaultMoves = gTrainerParty_Kaleb } }, @@ -9806,9 +9806,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("JOSEPH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Joseph } }, @@ -9820,9 +9820,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_CYCLING_TRIATHLETE_F, .trainerName = _("ALYSSA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Alyssa } }, @@ -9834,9 +9834,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("MARCOS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Marcos } }, @@ -9848,9 +9848,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("RHETT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Rhett } }, @@ -9862,9 +9862,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("TYRON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Tyron } }, @@ -9876,9 +9876,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_AROMA_LADY, .trainerName = _("CELINA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Celina } }, @@ -9890,9 +9890,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("BIANCA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Bianca } }, @@ -9904,9 +9904,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("HAYDEN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Hayden } }, @@ -9918,9 +9918,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("SOPHIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Sophie } }, @@ -9932,9 +9932,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("COBY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Coby } }, @@ -9946,9 +9946,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("LAWRENCE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Lawrence } }, @@ -9960,9 +9960,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_POKEMANIAC, .trainerName = _("WYATT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Wyatt } }, @@ -9974,9 +9974,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("ANGELINA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Angelina } }, @@ -9988,9 +9988,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_FISHERMAN, .trainerName = _("KAI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Kai } }, @@ -10002,9 +10002,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("CHARLOTTE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Charlotte } }, @@ -10016,9 +10016,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("DEANDRE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Deandre } }, @@ -10030,9 +10030,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt38 } }, @@ -10044,9 +10044,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt39 } }, @@ -10058,9 +10058,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt40 } }, @@ -10072,9 +10072,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt41 } }, @@ -10086,9 +10086,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt42 } }, @@ -10100,9 +10100,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt43 } }, @@ -10114,9 +10114,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt44 } }, @@ -10128,9 +10128,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt45 } }, @@ -10142,9 +10142,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt46 } }, @@ -10156,9 +10156,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt47 } }, @@ -10170,9 +10170,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt48 } }, @@ -10184,9 +10184,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt49 } }, @@ -10198,9 +10198,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_M, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt50 } }, @@ -10212,9 +10212,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt51 } }, @@ -10226,9 +10226,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt52 } }, @@ -10240,9 +10240,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_GRUNT_F, .trainerName = _("GRUNT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Grunt53 } }, @@ -10254,9 +10254,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_ADMIN, .trainerName = _("TABITHA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 4, .party = {.NoItemDefaultMoves = gTrainerParty_Tabitha3 } }, @@ -10270,7 +10270,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DARCY"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Darcy } }, @@ -10282,9 +10282,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MAGMA, .trainerPic = TRAINER_PIC_MAGMA_LEADER_MAXIE, .trainerName = _("MAXIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Maxie3 } }, @@ -10296,9 +10296,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_M, .trainerName = _("PETE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Pete } }, @@ -10310,9 +10310,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMER_F, .trainerName = _("ISABELLE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Isabelle } }, @@ -10324,9 +10324,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("ANDRES"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Andres1 } }, @@ -10338,9 +10338,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("JOSUE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Josue } }, @@ -10352,9 +10352,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("CAMRON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Camron } }, @@ -10366,9 +10366,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("CORY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Cory1 } }, @@ -10382,7 +10382,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CAROLINA"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Carolina } }, @@ -10394,9 +10394,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("ELIJAH"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Elijah } }, @@ -10408,9 +10408,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_GIRL, .trainerPic = TRAINER_PIC_PICNICKER, .trainerName = _("CELIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Celia } }, @@ -10422,9 +10422,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("BRYAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Bryan } }, @@ -10436,9 +10436,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_CAMPER, .trainerName = _("BRANDEN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Branden } }, @@ -10450,9 +10450,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("BRYANT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Bryant } }, @@ -10464,9 +10464,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_AROMA_LADY, .trainerName = _("SHAYLA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Shayla } }, @@ -10478,9 +10478,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_RUNNING_TRIATHLETE_F, .trainerName = _("KYRA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Kyra } }, @@ -10492,9 +10492,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_NINJA_BOY, .trainerName = _("JAIDEN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Jaiden } }, @@ -10506,9 +10506,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("ALIX"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Alix } }, @@ -10520,9 +10520,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("HELENE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Helene } }, @@ -10534,9 +10534,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("MARLENE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Marlene } }, @@ -10548,9 +10548,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("DEVAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Devan } }, @@ -10562,9 +10562,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_YOUNGSTER, .trainerName = _("JOHNSON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Johnson } }, @@ -10576,9 +10576,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_RUNNING_TRIATHLETE_F, .trainerName = _("MELINA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Melina } }, @@ -10590,9 +10590,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("BRANDI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Brandi } }, @@ -10604,9 +10604,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("AISHA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Aisha } }, @@ -10620,7 +10620,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAKAYLA"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Makayla } }, @@ -10632,9 +10632,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("FABIAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Fabian } }, @@ -10646,9 +10646,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_KINDLER, .trainerName = _("DAYTON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Dayton } }, @@ -10660,9 +10660,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_PARASOL_LADY, .trainerName = _("RACHEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Rachel } }, @@ -10676,7 +10676,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LEONEL"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemCustomMoves = gTrainerParty_Leonel } }, @@ -10688,9 +10688,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BATTLE_GIRL, .trainerName = _("CALLIE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Callie } }, @@ -10702,9 +10702,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_BUG_MANIAC, .trainerName = _("CALE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Cale } }, @@ -10716,9 +10716,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_M, .trainerName = _("MYLES"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Myles } }, @@ -10730,9 +10730,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_F, .trainerName = _("PAT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Pat } }, @@ -10746,7 +10746,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CRISTIN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Cristin1 } }, @@ -10758,9 +10758,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_May14 } }, @@ -10772,9 +10772,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_May15 } }, @@ -10788,7 +10788,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROXANNE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.ItemCustomMoves = gTrainerParty_Roxanne2 } }, @@ -10802,7 +10802,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROXANNE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Roxanne3 } }, @@ -10816,7 +10816,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROXANNE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Roxanne4 } }, @@ -10830,7 +10830,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROXANNE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Roxanne5 } }, @@ -10844,7 +10844,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRAWLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.ItemCustomMoves = gTrainerParty_Brawly2 } }, @@ -10858,7 +10858,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRAWLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.ItemCustomMoves = gTrainerParty_Brawly3 } }, @@ -10872,7 +10872,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRAWLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Brawly4 } }, @@ -10886,7 +10886,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRAWLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Brawly5 } }, @@ -10900,7 +10900,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WATTSON"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.ItemCustomMoves = gTrainerParty_Wattson2 } }, @@ -10914,7 +10914,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WATTSON"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Wattson3 } }, @@ -10928,7 +10928,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WATTSON"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Wattson4 } }, @@ -10942,7 +10942,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WATTSON"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Wattson5 } }, @@ -10956,7 +10956,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FLANNERY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.ItemCustomMoves = gTrainerParty_Flannery2 } }, @@ -10970,7 +10970,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FLANNERY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Flannery3 } }, @@ -10984,7 +10984,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FLANNERY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Flannery4 } }, @@ -10998,7 +10998,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FLANNERY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Flannery5 } }, @@ -11012,7 +11012,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NORMAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 4, .party = {.ItemCustomMoves = gTrainerParty_Norman2 } }, @@ -11026,7 +11026,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NORMAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Norman3 } }, @@ -11040,7 +11040,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NORMAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Norman4 } }, @@ -11054,7 +11054,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NORMAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Norman5 } }, @@ -11068,7 +11068,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINONA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x17, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_RISKY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Winona2 } }, @@ -11082,7 +11082,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINONA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x17, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_RISKY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Winona3 } }, @@ -11096,7 +11096,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINONA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x17, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_RISKY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Winona4 } }, @@ -11110,7 +11110,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINONA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x17, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_RISKY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Winona5 } }, @@ -11124,7 +11124,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TATE&LIZA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_TateAndLiza2 } }, @@ -11138,7 +11138,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TATE&LIZA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_TateAndLiza3 } }, @@ -11152,7 +11152,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TATE&LIZA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_TateAndLiza4 } }, @@ -11166,7 +11166,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TATE&LIZA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_TateAndLiza5 } }, @@ -11180,7 +11180,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JUAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Juan2 } }, @@ -11194,7 +11194,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JUAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 5, .party = {.ItemCustomMoves = gTrainerParty_Juan3 } }, @@ -11208,7 +11208,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JUAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Juan4 } }, @@ -11222,7 +11222,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JUAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Juan5 } }, @@ -11234,9 +11234,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS, .trainerPic = TRAINER_PIC_BUG_MANIAC, .trainerName = _("ANGELO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.ItemCustomMoves = gTrainerParty_Angelo } }, @@ -11248,9 +11248,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_COOL, .trainerPic = TRAINER_PIC_BIRD_KEEPER, .trainerName = _("DARIUS"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Darius } }, @@ -11264,7 +11264,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("STEVEN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 6, .party = {.ItemCustomMoves = gTrainerParty_Steven } }, @@ -11276,9 +11276,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SALON_MAIDEN_ANABEL, .trainerName = _("ANABEL"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Anabel } }, @@ -11290,9 +11290,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_DOME_ACE_TUCKER, .trainerName = _("TUCKER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Tucker } }, @@ -11304,9 +11304,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_PALACE_MAVEN_SPENSER, .trainerName = _("SPENSER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Spenser } }, @@ -11318,9 +11318,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_ARENA_TYCOON_GRETA, .trainerName = _("GRETA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Greta } }, @@ -11332,9 +11332,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_FACTORY_HEAD_NOLAND, .trainerName = _("NOLAND"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Noland } }, @@ -11346,9 +11346,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_PIKE_QUEEN_LUCY, .trainerName = _("LUCY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Lucy } }, @@ -11360,9 +11360,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_PYRAMID_KING_BRANDON, .trainerName = _("BRANDON"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Brandon } }, @@ -11374,9 +11374,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("ANDRES"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Andres2 } }, @@ -11388,9 +11388,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("ANDRES"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Andres3 } }, @@ -11402,9 +11402,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("ANDRES"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Andres4 } }, @@ -11416,9 +11416,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_RUIN_MANIAC, .trainerName = _("ANDRES"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Andres5 } }, @@ -11430,9 +11430,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("CORY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Cory2 } }, @@ -11444,9 +11444,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("CORY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Cory3 } }, @@ -11458,9 +11458,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("CORY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Cory4 } }, @@ -11472,9 +11472,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_SAILOR, .trainerName = _("CORY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Cory5 } }, @@ -11486,9 +11486,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("PABLO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Pablo2 } }, @@ -11500,9 +11500,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("PABLO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Pablo3 } }, @@ -11514,9 +11514,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("PABLO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Pablo4 } }, @@ -11528,9 +11528,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_SWIMMER, .trainerPic = TRAINER_PIC_SWIMMING_TRIATHLETE_M, .trainerName = _("PABLO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Pablo5 } }, @@ -11542,9 +11542,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("KOJI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Koji2 } }, @@ -11556,9 +11556,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("KOJI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Koji3 } }, @@ -11570,9 +11570,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("KOJI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Koji4 } }, @@ -11584,9 +11584,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_BLACK_BELT, .trainerName = _("KOJI"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Koji5 } }, @@ -11600,7 +11600,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CRISTIN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Cristin2 } }, @@ -11614,7 +11614,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CRISTIN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Cristin3 } }, @@ -11628,7 +11628,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CRISTIN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Cristin4 } }, @@ -11642,7 +11642,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CRISTIN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Cristin5 } }, @@ -11654,9 +11654,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("FERNANDO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Fernando2 } }, @@ -11668,9 +11668,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("FERNANDO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Fernando3 } }, @@ -11682,9 +11682,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("FERNANDO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Fernando4 } }, @@ -11696,9 +11696,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_GUITARIST, .trainerName = _("FERNANDO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Fernando5 } }, @@ -11710,9 +11710,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("SAWYER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Sawyer2 } }, @@ -11724,9 +11724,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("SAWYER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Sawyer3 } }, @@ -11738,9 +11738,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("SAWYER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Sawyer4 } }, @@ -11752,9 +11752,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_HIKER, .trainerPic = TRAINER_PIC_HIKER, .trainerName = _("SAWYER"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x7, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Sawyer5 } }, @@ -11766,9 +11766,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_F, .trainerName = _("GABRIELLE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Gabrielle2 } }, @@ -11780,9 +11780,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_F, .trainerName = _("GABRIELLE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Gabrielle3 } }, @@ -11794,9 +11794,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_F, .trainerName = _("GABRIELLE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Gabrielle4 } }, @@ -11808,9 +11808,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_POKEMON_BREEDER_F, .trainerName = _("GABRIELLE"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 6, .party = {.NoItemDefaultMoves = gTrainerParty_Gabrielle5 } }, @@ -11822,9 +11822,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("THALIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Thalia2 } }, @@ -11836,9 +11836,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("THALIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Thalia3 } }, @@ -11850,9 +11850,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("THALIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Thalia4 } }, @@ -11864,9 +11864,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE, .trainerPic = TRAINER_PIC_BEAUTY, .trainerName = _("THALIA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x1, + .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, .partySize = 3, .party = {.NoItemDefaultMoves = gTrainerParty_Thalia5 } }, @@ -11878,9 +11878,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_F, .trainerName = _("MARIELA"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Mariela } }, @@ -11892,9 +11892,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_INTENSE, .trainerPic = TRAINER_PIC_PSYCHIC_M, .trainerName = _("ALVARO"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 2, .party = {.NoItemDefaultMoves = gTrainerParty_Alvaro } }, @@ -11906,9 +11906,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_RICH, .trainerPic = TRAINER_PIC_GENTLEMAN, .trainerName = _("EVERETT"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Everett } }, @@ -11920,9 +11920,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_RED, .trainerName = _("RED"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Red } }, @@ -11934,9 +11934,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_LEAF, .trainerName = _("LEAF"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Leaf } }, @@ -11948,9 +11948,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_RUBY_SAPPHIRE_BRENDAN, .trainerName = _("BRENDAN"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_Brendan16 } }, @@ -11962,9 +11962,9 @@ const struct Trainer gTrainers[] = { .encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_MALE, .trainerPic = TRAINER_PIC_RUBY_SAPPHIRE_MAY, .trainerName = _("MAY"), - .items = {ITEM_NONE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, + .items = {}, .doubleBattle = FALSE, - .aiFlags = 0x0, + .aiFlags = 0, .partySize = 1, .party = {.NoItemDefaultMoves = gTrainerParty_May16 } }, diff --git a/src/data2b.c b/src/data2b.c index e7ca473a9..46a158e09 100644 --- a/src/data2b.c +++ b/src/data2b.c @@ -1,9 +1,15 @@ #include "global.h" +#include "data2.h" #include "graphics.h" extern const union AnimCmd gAnimCmd_General_Frame0[]; extern const union AnimCmd AnimCmd_82FF540[]; +#include "data/pokemon_graphics/unknown_anims.h" +#include "data/pokemon_graphics/front_pic_coordinates.h" +#include "data/pokemon_graphics/still_front_pic_table.h" +#include "data/pokemon_graphics/back_pic_coordinates.h" + #include "data/pokemon_graphics/back_pic_table.h" #include "data/pokemon_graphics/palette_table.h" #include "data/pokemon_graphics/shiny_palette_table.h" diff --git a/src/daycare.c b/src/daycare.c index c73d91521..934cdea43 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -61,7 +61,16 @@ EWRAM_DATA static u16 sHatchedEggMotherMoves[4] = {0}; #include "data/pokemon/egg_moves.h" -static const struct WindowTemplate sDaycareLevelMenuWindowTemplate = {0, 0xF, 1, 0xE, 6, 0xF, 8}; +static const struct WindowTemplate sDaycareLevelMenuWindowTemplate = +{ + .priority = 0, + .tilemapLeft = 15, + .tilemapTop = 1, + .width = 14, + .height = 6, + .paletteNum = 15, + .baseBlock = 8 +}; static const struct ListMenuItem sLevelMenuItems[] = { @@ -368,7 +377,7 @@ static void ClearDaycareMonMail(struct DayCareMail *mail) { s32 i; - for (i = 0; i < OT_NAME_LENGTH + 1; i++) + for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++) mail->OT_name[i] = 0; for (i = 0; i < POKEMON_NAME_LENGTH + 1; i++) mail->monName[i] = 0; diff --git a/src/decoration.c b/src/decoration.c index b21d51278..e1def6d38 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -214,22 +214,67 @@ void (*const SecretBasePC_SelectedDecorActions[][2])(u8 taskId) = { } }; -const struct WindowTemplate gUnknown_085A6B90[4] = { - { 0, 1, 1, 18, 8, 15, 0x0001 }, - { 0, 1, 1, 13, 18, 13, 0x0091 }, - { 0, 17, 1, 12, 2, 15, 0x017b }, - { 0, 16, 13, 13, 6, 15, 0x0193 } +const struct WindowTemplate gUnknown_085A6B90[4] = +{ + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 18, + .height = 8, + .paletteNum = 15, + .baseBlock = 0x0001 + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 13, + .height = 18, + .paletteNum = 13, + .baseBlock = 0x0091 + }, + { + .priority = 0, + .tilemapLeft = 17, + .tilemapTop = 1, + .width = 12, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x017b + }, + { + .priority = 0, + .tilemapLeft = 16, + .tilemapTop = 13, + .width = 13, + .height = 6, + .paletteNum = 15, + .baseBlock = 0x0193 + } }; const u16 gUnknown_085A6BB0[] = INCBIN_U16("graphics/decorations/unk_85a6bb0.gbapal"); -const struct ListMenuTemplate gUnknown_085A6BD0 = { - NULL, - sub_8127480, - sub_81274A0, - 0, 0, - 0, 0, 8, 0, - 9, 2, 1, 3, FALSE, 0, FALSE, 7 +const struct ListMenuTemplate gUnknown_085A6BD0 = +{ + .items = NULL, + .moveCursorFunc = sub_8127480, + .itemPrintFunc = sub_81274A0, + .totalItems = 0, + .maxShowed = 0, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 9, + .cursorPal = 2, + .fillValue = 1, + .cursorShadowPal = 3, + .lettersSpacing = FALSE, + .itemVerticalPadding = 0, + .scrollMultiple = FALSE, + .fontId = 7 }; #include "data/decoration/icon.h" @@ -1087,7 +1132,7 @@ void sub_8127B04(u8 taskId) { DrawWholeMapView(); Overworld_SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, gTasks[taskId].data[3], gTasks[taskId].data[4]); - warp_in(); + WarpIntoMap(); } u16 sub_8127B54(u8 decor, u8 a1) diff --git a/src/egg_hatch.c b/src/egg_hatch.c index ab0cd92a2..25af28da4 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -253,13 +253,27 @@ static const struct BgTemplate sBgTemplates_EggHatch[2] = static const struct WindowTemplate sWinTemplates_EggHatch[2] = { - {0, 2, 0xF, 0x1A, 4, 0, 0x40}, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 26, + .height = 4, + .paletteNum = 0, + .baseBlock = 64 + }, DUMMY_WIN_TEMPLATE }; static const struct WindowTemplate sYesNoWinTemplate = { - 0, 0x15, 9, 5, 4, 0xF, 0x1A8 + .priority = 0, + .tilemapLeft = 21, + .tilemapTop = 9, + .width = 5, + .height = 4, + .paletteNum = 15, + .baseBlock = 424 }; static const s16 sEggShardVelocities[][2] = @@ -512,7 +526,7 @@ static void CB2_EggHatch_0(void) gMain.state++; break; case 2: - copy_decompressed_tile_data_to_vram_autofree(0, gBattleTextboxTiles, 0, 0, 0); + DecompressAndLoadBgGfxUsingHeap(0, gBattleTextboxTiles, 0, 0, 0); CopyToBgTilemapBuffer(0, gBattleTextboxTilemap, 0, 0); LoadCompressedPalette(gBattleTextboxPalette, 0, 0x20); gMain.state++; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 5fdceb4c3..9a1e711c3 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -26,9 +26,9 @@ // this file was known as evobjmv.c in Game Freak's original source -extern u8 gUnknown_020375B4; -extern u16 gUnknown_020375B6; -extern struct LockedAnimEventObjects *gLockedAnimEventObjects; +EWRAM_DATA u8 sCurrentReflectionType = 0; +EWRAM_DATA u16 sCurrentSpecialObjectPaletteTag = 0; +EWRAM_DATA struct LockedAnimEventObjects *gLockedAnimEventObjects = {0}; static void MoveCoordsInDirection(u32, s16 *, s16 *, s16, s16); static bool8 EventObjectExecSingleMovementAction(struct EventObject *, struct Sprite *); @@ -102,7 +102,7 @@ static struct EventObjectTemplate *FindEventObjectTemplateByLocalId(u8 localId, static void ClearEventObjectMovement(struct EventObject *, struct Sprite *); static void EventObjectSetSingleMovement(struct EventObject *, struct Sprite *, u8); -const u8 gUnknown_084975C4[] = {1, 1, 6, 7, 8, 9, 6, 7, 8, 9, 11, 11, 0, 0, 0, 0}; +const u8 gReflectionEffectPaletteMap[] = {1, 1, 6, 7, 8, 9, 6, 7, 8, 9, 11, 11, 0, 0, 0, 0}; const struct SpriteTemplate gCameraSpriteTemplate = {0, 0xFFFF, &gDummyOamData, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, ObjectCB_CameraObject}; @@ -376,7 +376,7 @@ const u8 gInitialMovementTypeFacingDirections[] = { #include "data/field_event_obj/event_object_subsprites.h" #include "data/field_event_obj/event_object_graphics_info.h" -const struct SpritePalette gUnknown_0850BBC8[] = { +const struct SpritePalette sEventObjectSpritePalettes[] = { {gEventObjectPalette0, 0x1103}, {gEventObjectPalette1, 0x1104}, {gEventObjectPalette2, 0x1105}, @@ -415,7 +415,7 @@ const struct SpritePalette gUnknown_0850BBC8[] = { {NULL, 0x0000}, }; -const u16 Unknown_0850BCE8[] = { +const u16 gPlayerReflectionPaletteTags[] = { 0x1101, 0x1101, 0x1101, @@ -429,115 +429,115 @@ const u16 Unknown_0850BCF0[] = { 0x1111, }; -const u16 Unknown_0850BCF8[] = { +const u16 gPlayerUnderwaterReflectionPaletteTags[] = { 0x1115, 0x1115, 0x1115, 0x1115, }; -const struct PairedPalettes gUnknown_0850BD00[] = { - {0x1100, Unknown_0850BCE8}, +const struct PairedPalettes gPlayerReflectionPaletteSets[] = { + {0x1100, gPlayerReflectionPaletteTags}, {0x1110, Unknown_0850BCF0}, - {0x1115, Unknown_0850BCF8}, + {0x1115, gPlayerUnderwaterReflectionPaletteTags}, {0x11FF, NULL}, }; -const u16 Unknown_0850BD20[] = { +const u16 gQuintyPlumpReflectionPaletteTags[] = { 0x110C, 0x110C, 0x110C, 0x110C, }; -const u16 Unknown_0850BD28[] = { +const u16 gTruckReflectionPaletteTags[] = { 0x110D, 0x110D, 0x110D, 0x110D, }; -const u16 Unknown_0850BD30[] = { +const u16 gVigorothMoverReflectionPaletteTags[] = { 0x110E, 0x110E, 0x110E, 0x110E, }; -const u16 Unknown_0850BD38[] = { +const u16 gMovingBoxReflectionPaletteTags[] = { 0x1112, 0x1112, 0x1112, 0x1112, }; -const u16 Unknown_0850BD40[] = { +const u16 gCableCarReflectionPaletteTags[] = { 0x1113, 0x1113, 0x1113, 0x1113, }; -const u16 Unknown_0850BD48[] = { +const u16 gSSTidalReflectionPaletteTags[] = { 0x1114, 0x1114, 0x1114, 0x1114, }; -const u16 Unknown_0850BD50[] = { +const u16 gSubmarineShadowReflectionPaletteTags[] = { 0x111B, 0x111B, 0x111B, 0x111B, }; -const u16 Unknown_0850BD58[] = { +const u16 Unknown_0850BD58[] = { // Kyogre2? 0x1117, 0x1117, 0x1117, 0x1117, }; -const u16 Unknown_0850BD60[] = { +const u16 Unknown_0850BD60[] = { // Groudon2? 0x1119, 0x1119, 0x1119, 0x1119, }; -const u16 Unknown_0850BD68[] = { +const u16 Unknown_0850BD68[] = { // Invisible Keckleon? 0x1109, 0x1109, 0x1109, 0x1109, }; -const u16 Unknown_0850BD70[] = { +const u16 gRedLeafReflectionPaletteTags[] = { 0x111D, 0x111D, 0x111D, 0x111D, }; -const struct PairedPalettes gUnknown_0850BD78[] = { - {4352, Unknown_0850BCE8}, +const struct PairedPalettes gSpecialObjectReflectionPaletteSets[] = { + {4352, gPlayerReflectionPaletteTags}, {4368, Unknown_0850BCF0}, - {4363, Unknown_0850BD20}, - {4365, Unknown_0850BD28}, - {4366, Unknown_0850BD30}, - {4370, Unknown_0850BD38}, - {4371, Unknown_0850BD40}, - {4372, Unknown_0850BD48}, + {4363, gQuintyPlumpReflectionPaletteTags}, + {4365, gTruckReflectionPaletteTags}, + {4366, gVigorothMoverReflectionPaletteTags}, + {4370, gMovingBoxReflectionPaletteTags}, + {4371, gCableCarReflectionPaletteTags}, + {4372, gSSTidalReflectionPaletteTags}, {4374, Unknown_0850BD58}, {4376, Unknown_0850BD60}, {4357, Unknown_0850BD68}, - {4379, Unknown_0850BD50}, - {4381, Unknown_0850BD70}, + {4379, gSubmarineShadowReflectionPaletteTags}, + {4381, gRedLeafReflectionPaletteTags}, {4607, NULL}, }; -const u16 gUnknown_0850BDE8[] = { +const u16 gObjectPaletteTags0[] = { 0x1100, 0x1101, 0x1103, @@ -550,7 +550,7 @@ const u16 gUnknown_0850BDE8[] = { 0x110A, }; -const u16 gUnknown_0850BDFC[] = { +const u16 gObjectPaletteTags1[] = { 0x1100, 0x1101, 0x1103, @@ -563,7 +563,7 @@ const u16 gUnknown_0850BDFC[] = { 0x110A, }; -const u16 gUnknown_0850BE10[] = { +const u16 gObjectPaletteTags2[] = { 0x1100, 0x1101, 0x1103, @@ -576,7 +576,7 @@ const u16 gUnknown_0850BE10[] = { 0x110A, }; -const u16 gUnknown_0850BE24[] = { +const u16 gObjectPaletteTags3[] = { 0x1100, 0x1101, 0x1103, @@ -590,11 +590,11 @@ const u16 gUnknown_0850BE24[] = { }; -const u16 *const gUnknown_0850BE38[] = { - gUnknown_0850BDE8, - gUnknown_0850BDFC, - gUnknown_0850BE10, - gUnknown_0850BE24, +const u16 *const gObjectPaletteTagSets[] = { + gObjectPaletteTags0, + gObjectPaletteTags1, + gObjectPaletteTags2, + gObjectPaletteTags3, }; #include "data/field_event_obj/berry_tree_graphics_tables.h" @@ -798,7 +798,7 @@ bool8 (*const gDirectionBlockedMetatileFuncs[])(u8) = { MetatileBehavior_IsWestBlocked }; -const struct Coords16 gDirectionToVectors[] = { +static const struct Coords16 sDirectionToVectors[] = { { 0, 0}, { 0, 1}, { 0, -1}, @@ -1461,11 +1461,11 @@ static u8 TrySetupEventObjectSprite(struct EventObjectTemplate *eventObjectTempl paletteSlot = graphicsInfo->paletteSlot; if (paletteSlot == 0) { - npc_load_two_palettes__no_record(graphicsInfo->paletteTag1, 0); + LoadPlayerObjectReflectionPalette(graphicsInfo->paletteTag1, 0); } else if (paletteSlot == 10) { - npc_load_two_palettes__and_record(graphicsInfo->paletteTag1, 10); + LoadSpecialObjectReflectionPalette(graphicsInfo->paletteTag1, 10); } else if (paletteSlot >= 16) { @@ -1653,7 +1653,7 @@ u8 sprite_new(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction) sprite->data[1] = z; if (graphicsInfo->paletteSlot == 10) { - npc_load_two_palettes__and_record(graphicsInfo->paletteTag1, graphicsInfo->paletteSlot); + LoadSpecialObjectReflectionPalette(graphicsInfo->paletteTag1, graphicsInfo->paletteSlot); } else if (graphicsInfo->paletteSlot >= 16) { @@ -1806,11 +1806,11 @@ static void sub_808E1B8(u8 eventObjectId, s16 x, s16 y) paletteSlot = graphicsInfo->paletteSlot; if (paletteSlot == 0) { - npc_load_two_palettes__no_record(graphicsInfo->paletteTag1, graphicsInfo->paletteSlot); + LoadPlayerObjectReflectionPalette(graphicsInfo->paletteTag1, graphicsInfo->paletteSlot); } else if (paletteSlot == 10) { - npc_load_two_palettes__and_record(graphicsInfo->paletteTag1, graphicsInfo->paletteSlot); + LoadSpecialObjectReflectionPalette(graphicsInfo->paletteTag1, graphicsInfo->paletteSlot); } else if (paletteSlot >= 16) { @@ -1882,11 +1882,11 @@ void EventObjectSetGraphicsId(struct EventObject *eventObject, u8 graphicsId) paletteSlot = graphicsInfo->paletteSlot; if (paletteSlot == 0) { - pal_patch_for_npc(graphicsInfo->paletteTag1, graphicsInfo->paletteSlot); + PatchObjectPalette(graphicsInfo->paletteTag1, graphicsInfo->paletteSlot); } else if (paletteSlot == 10) { - npc_load_two_palettes__and_record(graphicsInfo->paletteTag1, graphicsInfo->paletteSlot); + LoadSpecialObjectReflectionPalette(graphicsInfo->paletteTag1, graphicsInfo->paletteSlot); } else if (paletteSlot >= 16) { @@ -1980,14 +1980,14 @@ const struct EventObjectGraphicsInfo *GetEventObjectGraphicsInfo(u8 graphicsId) { graphicsId = VarGetEventObjectGraphicsId(graphicsId - SPRITE_VAR); } - if (graphicsId == 0x45) + if (graphicsId == EVENT_OBJ_GFX_BARD) { bard = GetCurrentMauvilleOldMan(); return gMauvilleOldManGraphicsInfoPointers[bard]; } if (graphicsId >= NUM_OBJECT_GRAPHICS_INFO) { - graphicsId = 0x05; // LittleBoy1 + graphicsId = EVENT_OBJ_GFX_LITTLE_BOY_1; } return gEventObjectGraphicsInfoPointers[graphicsId]; } @@ -2071,7 +2071,7 @@ void sub_808E82C(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y) } } -void gpu_pal_allocator_reset__manage_upper_four(void) +void FreeAndReserveObjectSpritePalettes(void) { FreeAllSpritePalettes(); gReservedSpritePaletteCount = 12; @@ -2084,7 +2084,7 @@ static void sub_808E894(u16 paletteTag) paletteSlot = FindEventObjectPaletteIndexByTag(paletteTag); if (paletteSlot != 0x11ff) // always true { - sub_808E8F4(&gUnknown_0850BBC8[paletteSlot]); + sub_808E8F4(&sEventObjectSpritePalettes[paletteSlot]); } } @@ -2107,19 +2107,19 @@ static u8 sub_808E8F4(const struct SpritePalette *spritePalette) return LoadSpritePalette(spritePalette); } -void pal_patch_for_npc(u16 paletteTag, u8 paletteSlot) +void PatchObjectPalette(u16 paletteTag, u8 paletteSlot) { u16 paletteIdx; paletteIdx = FindEventObjectPaletteIndexByTag(paletteTag); - LoadPalette(gUnknown_0850BBC8[paletteIdx].data, 16 * paletteSlot + 256, 0x20); + LoadPalette(sEventObjectSpritePalettes[paletteIdx].data, 16 * paletteSlot + 256, 0x20); } -void pal_patch_for_npc_range(const u16 *paletteTags, u8 minSlot, u8 maxSlot) +void PatchObjectPaletteRange(const u16 *paletteTags, u8 minSlot, u8 maxSlot) { while (minSlot < maxSlot) { - pal_patch_for_npc(*paletteTags, minSlot); + PatchObjectPalette(*paletteTags, minSlot); paletteTags++; minSlot++; } @@ -2129,9 +2129,9 @@ static u8 FindEventObjectPaletteIndexByTag(u16 tag) { u8 i; - for (i = 0; gUnknown_0850BBC8[i].tag != 0x11ff; i++) + for (i = 0; sEventObjectSpritePalettes[i].tag != 0x11ff; i++) { - if (gUnknown_0850BBC8[i].tag == tag) + if (sEventObjectSpritePalettes[i].tag == tag) { return i; } @@ -2139,32 +2139,32 @@ static u8 FindEventObjectPaletteIndexByTag(u16 tag) return 0xff; } -void npc_load_two_palettes__no_record(u16 tag, u8 slot) +void LoadPlayerObjectReflectionPalette(u16 tag, u8 slot) { u8 i; - pal_patch_for_npc(tag, slot); - for (i = 0; gUnknown_0850BD00[i].tag != 0x11ff; i++) + PatchObjectPalette(tag, slot); + for (i = 0; gPlayerReflectionPaletteSets[i].tag != 0x11ff; i++) { - if (gUnknown_0850BD00[i].tag == tag) + if (gPlayerReflectionPaletteSets[i].tag == tag) { - pal_patch_for_npc(gUnknown_0850BD00[i].data[gUnknown_020375B4], gUnknown_084975C4[slot]); + PatchObjectPalette(gPlayerReflectionPaletteSets[i].data[sCurrentReflectionType], gReflectionEffectPaletteMap[slot]); return; } } } -void npc_load_two_palettes__and_record(u16 tag, u8 slot) +void LoadSpecialObjectReflectionPalette(u16 tag, u8 slot) { u8 i; - gUnknown_020375B6 = tag; - pal_patch_for_npc(tag, slot); - for (i = 0; gUnknown_0850BD78[i].tag != 0x11ff; i++) + sCurrentSpecialObjectPaletteTag = tag; + PatchObjectPalette(tag, slot); + for (i = 0; gSpecialObjectReflectionPaletteSets[i].tag != 0x11ff; i++) { - if (gUnknown_0850BD78[i].tag == tag) + if (gSpecialObjectReflectionPaletteSets[i].tag == tag) { - pal_patch_for_npc(gUnknown_0850BD78[i].data[gUnknown_020375B4], gUnknown_084975C4[slot]); + PatchObjectPalette(gSpecialObjectReflectionPaletteSets[i].data[sCurrentReflectionType], gReflectionEffectPaletteMap[slot]); return; } } @@ -2172,7 +2172,7 @@ void npc_load_two_palettes__and_record(u16 tag, u8 slot) static void sub_808EAB0(u16 tag, u8 slot) { - pal_patch_for_npc(tag, slot); + PatchObjectPalette(tag, slot); } void unref_sub_808EAC4(struct EventObject *eventObject, s16 x, s16 y) @@ -2191,7 +2191,7 @@ void ShiftEventObjectCoords(struct EventObject *eventObject, s16 x, s16 y) eventObject->currentCoords.y = y; } -/*static*/ void npc_coords_set(struct EventObject *eventObject, s16 x, s16 y) +/*static*/ void SetEventObjectCoords(struct EventObject *eventObject, s16 x, s16 y) { eventObject->previousCoords.x = x; eventObject->previousCoords.y = y; @@ -2206,7 +2206,7 @@ void sub_808EB08(struct EventObject *eventObject, s16 x, s16 y) sprite = &gSprites[eventObject->spriteId]; graphicsInfo = GetEventObjectGraphicsInfo(eventObject->graphicsId); - npc_coords_set(eventObject, x, y); + SetEventObjectCoords(eventObject, x, y); sub_8093038(eventObject->currentCoords.x, eventObject->currentCoords.y, &sprite->pos1.x, &sprite->pos1.y); sprite->centerToCornerVecX = -(graphicsInfo->width >> 1); sprite->centerToCornerVecY = -(graphicsInfo->height >> 1); @@ -2414,7 +2414,7 @@ u8 CopySprite(struct Sprite *sprite, s16 x, s16 y, u8 subpriority) return i; } -u8 obj_unfreeze(struct Sprite *sprite, s16 x, s16 y, u8 subpriority) +u8 CreateCopySpriteAt(struct Sprite *sprite, s16 x, s16 y, u8 subpriority) { s16 i; @@ -2610,35 +2610,35 @@ void sub_808F28C(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat) } } -void npc_paltag_set_load(u8 palSlot) +void InitEventObjectPalettes(u8 palSlot) { - gpu_pal_allocator_reset__manage_upper_four(); - gUnknown_020375B6 = 0x11ff; - gUnknown_020375B4 = palSlot; + FreeAndReserveObjectSpritePalettes(); + sCurrentSpecialObjectPaletteTag = 0x11ff; + sCurrentReflectionType = palSlot; if (palSlot == 1) { - pal_patch_for_npc_range(gUnknown_0850BE38[gUnknown_020375B4], 0, 6); + PatchObjectPaletteRange(gObjectPaletteTagSets[sCurrentReflectionType], 0, 6); gReservedSpritePaletteCount = 8; } else { - pal_patch_for_npc_range(gUnknown_0850BE38[gUnknown_020375B4], 0, 10); + PatchObjectPaletteRange(gObjectPaletteTagSets[sCurrentReflectionType], 0, 10); } } -u16 npc_paltag_by_palslot(u8 palSlot) +u16 GetObjectPaletteTag(u8 palSlot) { u8 i; if (palSlot < 10) { - return gUnknown_0850BE38[gUnknown_020375B4][palSlot]; + return gObjectPaletteTagSets[sCurrentReflectionType][palSlot]; } - for (i = 0; gUnknown_0850BD78[i].tag != 0x11ff; i++) + for (i = 0; gSpecialObjectReflectionPaletteSets[i].tag != 0x11ff; i++) { - if (gUnknown_0850BD78[i].tag == gUnknown_020375B6) + if (gSpecialObjectReflectionPaletteSets[i].tag == sCurrentSpecialObjectPaletteTag) { - return gUnknown_0850BD78[i].data[gUnknown_020375B4]; + return gSpecialObjectReflectionPaletteSets[i].data[sCurrentReflectionType]; } } return 0x11ff; @@ -4957,14 +4957,14 @@ void sub_8092EF0(u8 localId, u8 mapNum, u8 mapGroup) void MoveCoords(u8 direction, s16 *x, s16 *y) { - *x += gDirectionToVectors[direction].x; - *y += gDirectionToVectors[direction].y; + *x += sDirectionToVectors[direction].x; + *y += sDirectionToVectors[direction].y; } void sub_8092F60(u8 direction, s16 *x, s16 *y) { - *x += gDirectionToVectors[direction].x << 4; - *y += gDirectionToVectors[direction].y << 4; + *x += sDirectionToVectors[direction].x << 4; + *y += sDirectionToVectors[direction].y << 4; } static void MoveCoordsInDirection(u32 dir, s16 *x, s16 *y, s16 deltaX, s16 deltaY) @@ -4972,13 +4972,13 @@ static void MoveCoordsInDirection(u32 dir, s16 *x, s16 *y, s16 deltaX, s16 delta u8 direction = dir; s16 dx2 = (u16)deltaX; s16 dy2 = (u16)deltaY; - if (gDirectionToVectors[direction].x > 0) + if (sDirectionToVectors[direction].x > 0) *x += dx2; - if (gDirectionToVectors[direction].x < 0) + if (sDirectionToVectors[direction].x < 0) *x -= dx2; - if (gDirectionToVectors[direction].y > 0) + if (sDirectionToVectors[direction].y > 0) *y += dy2; - if (gDirectionToVectors[direction].y < 0) + if (sDirectionToVectors[direction].y < 0) *y -= dy2; } @@ -8389,32 +8389,32 @@ void UnfreezeEventObjects(void) void Step1(struct Sprite *sprite, u8 dir) { - sprite->pos1.x += gDirectionToVectors[dir].x; - sprite->pos1.y += gDirectionToVectors[dir].y; + sprite->pos1.x += sDirectionToVectors[dir].x; + sprite->pos1.y += sDirectionToVectors[dir].y; } void Step2(struct Sprite *sprite, u8 dir) { - sprite->pos1.x += 2 * (u16) gDirectionToVectors[dir].x; - sprite->pos1.y += 2 * (u16) gDirectionToVectors[dir].y; + sprite->pos1.x += 2 * (u16) sDirectionToVectors[dir].x; + sprite->pos1.y += 2 * (u16) sDirectionToVectors[dir].y; } void Step3(struct Sprite *sprite, u8 dir) { - sprite->pos1.x += 2 * (u16) gDirectionToVectors[dir].x + (u16) gDirectionToVectors[dir].x; - sprite->pos1.y += 2 * (u16) gDirectionToVectors[dir].y + (u16) gDirectionToVectors[dir].y; + sprite->pos1.x += 2 * (u16) sDirectionToVectors[dir].x + (u16) sDirectionToVectors[dir].x; + sprite->pos1.y += 2 * (u16) sDirectionToVectors[dir].y + (u16) sDirectionToVectors[dir].y; } void Step4(struct Sprite *sprite, u8 dir) { - sprite->pos1.x += 4 * (u16) gDirectionToVectors[dir].x; - sprite->pos1.y += 4 * (u16) gDirectionToVectors[dir].y; + sprite->pos1.x += 4 * (u16) sDirectionToVectors[dir].x; + sprite->pos1.y += 4 * (u16) sDirectionToVectors[dir].y; } void Step8(struct Sprite *sprite, u8 dir) { - sprite->pos1.x += 8 * (u16) gDirectionToVectors[dir].x; - sprite->pos1.y += 8 * (u16) gDirectionToVectors[dir].y; + sprite->pos1.x += 8 * (u16) sDirectionToVectors[dir].x; + sprite->pos1.y += 8 * (u16) sDirectionToVectors[dir].y; } void oamt_npc_ministep_reset(struct Sprite *sprite, u8 a2, u8 a3) diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 7960d6cba..ae15e79fe 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -1484,7 +1484,7 @@ static void InitMovingBackgroundTask(bool8 isLink) LoadPalette(sUnknown_085B51E4, 0xA0, 0x20); - copy_decompressed_tile_data_to_vram_autofree(1, sUnknown_085B4134, FALSE, 0, 0); + DecompressAndLoadBgGfxUsingHeap(1, sUnknown_085B4134, FALSE, 0, 0); CopyToBgTilemapBuffer(1, sUnknown_085B482C, 0, 0); CopyToBgTilemapBuffer(outerBgId, sUnknown_085B4D10, 0, 0); CopyBgTilemapBufferToVram(1); diff --git a/src/field_effect.c b/src/field_effect.c index f047c78a3..ecda8578b 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1,8 +1,6 @@ - -// Includes #include "global.h" #include "field_effect.h" -#include "battle_dome_cards.h" +#include "trainer_pokemon_sprites.h" #include "decompress.h" #include "field_camera.h" #include "field_effect_helpers.h" @@ -557,7 +555,7 @@ u8 AddNewGameBirchObject(s16 x, s16 y, u8 subpriority) #ifdef NONMATCHING u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y) { - u16 spriteId = sub_818D7D8(species, 0, 0x8000, 1, x, y, 0, gMonPaletteTable[species].tag); + u16 spriteId = CreateMonPicSprite_HandleDeoxys(species, 0, 0x8000, 1, x, y, 0, gMonPaletteTable[species].tag); PreservePaletteInWeather(IndexOfSpritePaletteTag(gMonPaletteTable[species].tag) + 0x10); if (spriteId == 0xFFFF) return 0x40; @@ -590,7 +588,7 @@ u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y) movs r1, 0\n\ adds r2, r3, 0\n\ movs r3, 0x1\n\ - bl sub_818D7D8\n\ + bl CreateMonPicSprite_HandleDeoxys\n\ lsls r0, 16\n\ lsrs r5, r0, 16\n\ ldrh r0, [r4, 0x4]\n\ @@ -619,7 +617,7 @@ _080B5FDE:\n\ u8 CreateMonSprite_FieldMove(u16 species, u32 d, u32 g, s16 x, s16 y, u8 subpriority) { const struct CompressedSpritePalette *spritePalette = GetMonSpritePalStructFromOtIdPersonality(species, d, g); - u16 spriteId = sub_818D7D8(species, d, g, 1, x, y, 0, spritePalette->tag); + u16 spriteId = CreateMonPicSprite_HandleDeoxys(species, d, g, 1, x, y, 0, spritePalette->tag); PreservePaletteInWeather(IndexOfSpritePaletteTag(spritePalette->tag) + 0x10); if (spriteId == 0xFFFF) return 0x40; @@ -634,7 +632,7 @@ void FreeResourcesAndDestroySprite(struct Sprite *sprite, u8 spriteId) { FreeOamMatrix(sprite->oam.matrixNum); } - sub_818D820(spriteId); + FreeAndDestroyMonPicSprite(spriteId); } #ifdef NONMATCHING @@ -1172,7 +1170,7 @@ void task00_8084310(u8 taskId) if (!FieldEffectActiveListContains(FLDEFF_USE_FLY)) { Overworld_ResetStateAfterFly(); - warp_in(); + WarpIntoMap(); SetMainCallback2(CB2_LoadMap); gFieldCallback = mapldr_08084390; DestroyTask(taskId); @@ -1357,7 +1355,7 @@ void sub_80B6FB8(struct Task *); void sub_80B7004(struct Task *); void sub_80B7050(void); void sub_80B7060(void); -bool8 sub_80859A0(void); +bool8 BGMusicStopped(void); void sub_80B70B4(void); void sub_80E1570(void); void sub_80B70DC(u8); @@ -1478,10 +1476,10 @@ void sub_80B7050(void) void sub_80B7060(void) { - if (!gPaletteFade.active && sub_80859A0() == TRUE) + if (!gPaletteFade.active && BGMusicStopped() == TRUE) { sub_80E1570(); - warp_in(); + WarpIntoMap(); gFieldCallback = sub_80B70B4; SetMainCallback2(CB2_LoadMap); DestroyTask(FindTaskIdByFunc(sub_80B6E88)); @@ -1840,9 +1838,9 @@ bool8 sub_80B77F8(struct Task *task, struct EventObject *eventObject, struct Spr bool8 sub_80B7814(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite) { - if (!gPaletteFade.active && sub_80859A0() == TRUE) + if (!gPaletteFade.active && BGMusicStopped() == TRUE) { - warp_in(); + WarpIntoMap(); gFieldCallback = mapldr_080851BC; SetMainCallback2(CB2_LoadMap); DestroyTask(FindTaskIdByFunc(sub_80B75F0)); @@ -2006,9 +2004,9 @@ void mapldr_080859D4(void); bool8 sub_80B7BF4(struct Task *task, struct EventObject *eventObject, struct Sprite *sprite) { - if (!gPaletteFade.active && sub_80859A0() == TRUE) + if (!gPaletteFade.active && BGMusicStopped() == TRUE) { - warp_in(); + WarpIntoMap(); gFieldCallback = sub_80B6B68; SetMainCallback2(CB2_LoadMap); DestroyTask(FindTaskIdByFunc(sub_80B7A8C)); @@ -2065,11 +2063,11 @@ void sub_80B7D34(struct Task *task) eventObject = &gEventObjects[gPlayerAvatar.eventObjectId]; if (!EventObjectIsMovementOverridden(eventObject) || EventObjectClearHeldMovementIfFinished(eventObject)) { - if (task->data[14] == 0 && !gPaletteFade.active && sub_80859A0() == TRUE) + if (task->data[14] == 0 && !gPaletteFade.active && BGMusicStopped() == TRUE) { SetEventObjectDirection(eventObject, task->data[15]); sub_8084E14(); - warp_in(); + WarpIntoMap(); gFieldCallback = mapldr_080859D4; SetMainCallback2(CB2_LoadMap); DestroyTask(FindTaskIdByFunc(sub_80B7CE4)); @@ -2236,10 +2234,10 @@ static void TeleportFieldEffectTask4(struct Task *task) task->data[5] = TRUE; } - if (sub_80859A0() == TRUE) + if (BGMusicStopped() == TRUE) { Overworld_SetWarpDestToLastHealLoc(); - warp_in(); + WarpIntoMap(); SetMainCallback2(CB2_LoadMap); gFieldCallback = mapldr_08085D88; DestroyTask(FindTaskIdByFunc(ExecuteTeleportFieldEffectTask)); diff --git a/src/field_message_box.c b/src/field_message_box.c index 8ca291e33..7ed87e837 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -4,7 +4,9 @@ #include "string_util.h" #include "task.h" #include "text.h" -#include "battle_frontier_1.h" + +extern bool32 sub_8196094(void); +extern void sub_8196080(u8*); EWRAM_DATA u8 gUnknown_020375BC = 0; @@ -23,7 +25,7 @@ void sub_8098128(void) void sub_8098154(u8 taskId) { struct Task *task = &gTasks[taskId]; - + switch (task->data[0]) { case 0: @@ -61,12 +63,12 @@ bool8 ShowFieldMessage(u8 *str) return FALSE; textbox_fdecode_auto_and_task_add(str, 1); gUnknown_020375BC = 2; - return TRUE; + return TRUE; } void sub_8098214(u8 taskId) { - if (sub_8196094() == 0) + if (!sub_8196094()) { gUnknown_020375BC = 0; DestroyTask(taskId); diff --git a/src/field_region_map.c b/src/field_region_map.c index f56548068..d77bde01b 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -55,9 +55,26 @@ static const struct BgTemplate gUnknown_085E5068[] = { } }; -static const struct WindowTemplate gUnknown_085E5070[] = { - { 0, 17, 17, 12, 2, 15, 0x0001 }, - { 0, 22, 1, 7, 2, 15, 0x0019 }, +static const struct WindowTemplate gUnknown_085E5070[] = +{ + { + .priority = 0, + .tilemapLeft = 17, + .tilemapTop = 17, + .width = 12, + .height = 2, + .paletteNum = 15, + .baseBlock = 1 + }, + { + .priority = 0, + .tilemapLeft = 22, + .tilemapTop = 1, + .width = 7, + .height = 2, + .paletteNum = 15, + .baseBlock = 25 + }, DUMMY_WIN_TEMPLATE }; diff --git a/src/field_specials.c b/src/field_specials.c index 897bcc8d7..14f99b426 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -52,6 +52,7 @@ #include "constants/species.h" #include "constants/moves.h" #include "constants/vars.h" +#include "constants/battle_frontier.h" EWRAM_DATA bool8 gBikeCyclingChallenge = FALSE; EWRAM_DATA u8 gBikeCollisions = 0; @@ -268,7 +269,7 @@ u16 GetRecordedCyclingRoadResults(void) { } void UpdateCyclingRoadState(void) { - if (gUnknown_020322DC.mapNum == MAP_NUM(ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE) && gUnknown_020322DC.mapGroup == MAP_GROUP(ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE)) + if (gLastUsedWarp.mapNum == MAP_NUM(ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE) && gLastUsedWarp.mapGroup == MAP_GROUP(ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE)) { return; } @@ -1645,7 +1646,7 @@ bool8 sub_81398C0(void) StringCopy(gStringVar2, gMoveNames[ItemIdToBattleMoveId(gSpecialVar_0x8004)]); return TRUE; } - + return FALSE; } @@ -1667,7 +1668,7 @@ bool8 InMultiBattleRoom(void) { if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM) && - VarGet(VAR_0x40CE) == 2) + VarGet(VAR_FRONTIER_BATTLE_MODE) == FRONTIER_MODE_MULTIS) return TRUE; return FALSE; } @@ -1799,7 +1800,7 @@ void ShakeScreenInElevator(void) if (floorDelta > 8) floorDelta = 8; - + data[5] = gUnknown_085B2C18[floorDelta]; SetCameraPanningCallback(NULL); @@ -1830,16 +1831,16 @@ static void sub_8139AF4(u8 taskId) void sub_8139B60(void) { int xPos; - + gUnknown_0203AB5E = AddWindow(&gUnknown_085B2BAC); SetStandardWindowBorderStyle(gUnknown_0203AB5E, 0); - + xPos = GetStringCenterAlignXOffset(1, gText_ElevatorNowOn, 64); PrintTextOnWindow(gUnknown_0203AB5E, 1, gText_ElevatorNowOn, xPos, 1, TEXT_SPEED_FF, NULL); - + xPos = GetStringCenterAlignXOffset(1, gElevatorFloorsTable[gSpecialVar_0x8005], 64); PrintTextOnWindow(gUnknown_0203AB5E, 1, gElevatorFloorsTable[gSpecialVar_0x8005], xPos, 17, TEXT_SPEED_FF, NULL); - + PutWindowTilemap(gUnknown_0203AB5E); CopyWindowToVram(gUnknown_0203AB5E, 3); } @@ -2093,7 +2094,7 @@ bool32 warp0_in_pokecenter(void) static const u16 gUnknown_085B2C2A[] = { 0x0202, 0x0301, 0x0405, 0x0504, 0x0604, 0x0700, 0x0804, 0x090b, 0x0a05, 0x0b05, 0x0c02, 0x0d06, 0x0e03, 0x0f02, 0x100c, 0x100a, 0x1a35, 0x193c, 0xffff }; int i; - u16 map = (gUnknown_020322DC.mapGroup << 8) + gUnknown_020322DC.mapNum; + u16 map = (gLastUsedWarp.mapGroup << 8) + gLastUsedWarp.mapNum; for (i = 0; gUnknown_085B2C2A[i] != 0xFFFF; i++) { @@ -2167,13 +2168,13 @@ void sub_8139F20(void) } break; case 4: - if (gSaveBlock2Ptr->frontier.field_D0C[0] >= gSaveBlock2Ptr->frontier.field_D0C[1]) + if (gSaveBlock2Ptr->frontier.field_D0C[0][0] >= gSaveBlock2Ptr->frontier.field_D0C[0][1]) { - unk = gSaveBlock2Ptr->frontier.field_D0C[0]; + unk = gSaveBlock2Ptr->frontier.field_D0C[0][0]; } else { - unk = gSaveBlock2Ptr->frontier.field_D0C[1]; + unk = gSaveBlock2Ptr->frontier.field_D0C[0][1]; } break; case 5: @@ -2187,13 +2188,13 @@ void sub_8139F20(void) } break; case 6: - if (gSaveBlock2Ptr->frontier.field_DC8[0] >= gSaveBlock2Ptr->frontier.field_DC8[1]) + if (gSaveBlock2Ptr->frontier.field_DC8[0][0] >= gSaveBlock2Ptr->frontier.field_DC8[0][1]) { - unk = gSaveBlock2Ptr->frontier.field_DC8[0]; + unk = gSaveBlock2Ptr->frontier.field_DC8[0][0]; } else { - unk = gSaveBlock2Ptr->frontier.field_DC8[1]; + unk = gSaveBlock2Ptr->frontier.field_DC8[0][1]; } break; case 7: @@ -2240,10 +2241,10 @@ void sub_813A080(void) }; u8 i; - u16 var = VarGet(VAR_0x40CE); - u8 chosenLevel = gSaveBlock2Ptr->frontier.chosenLvl; + u16 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; - if (var == 2 && !FlagGet(FLAG_0x152)) + if (battleMode == 2 && !FlagGet(FLAG_0x152)) { gSpecialVar_0x8005 = 5; gSpecialVar_0x8006 = 4; @@ -2252,7 +2253,7 @@ void sub_813A080(void) for (i = 0; i < 9; i++) { - if (gUnknown_085B2CDC[i] > gSaveBlock2Ptr->frontier.field_CE0[var][chosenLevel]) + if (gUnknown_085B2CDC[i] > gSaveBlock2Ptr->frontier.field_CE0[battleMode][lvlMode]) { gSpecialVar_0x8005 = 4; gSpecialVar_0x8006 = i + 5; @@ -2662,8 +2663,8 @@ static void sub_813A2DC(u8 taskId) } task->data[4] = convert_pixel_width_to_tile_width(unk1); - - if (task->data[2] + task->data[4] > 0x1D) + + if (task->data[2] + task->data[4] > 0x1D) { int unk2 = 0x1D - task->data[4]; if (unk2 < 0) @@ -3036,13 +3037,13 @@ void sub_813A878(u8 a0) { static const u16 gUnknown_085B3104[] = {0x0000, 0x0001, 0x0002, 0x0100, 0x0101, 0x0400, 0x0401, 0x0200, 0x0201, 0x0300, 0x0500, 0x0600}; - u16 var1 = VarGet(VAR_0x40CE); + u16 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); u16 var2 = VarGet(VAR_FRONTIER_GAMBLER_SET_FACILITY_F); - u16 var3 = VarGet(VAR_FRONTIER_FACILITY); + u16 frontierFacilityId = VarGet(VAR_FRONTIER_FACILITY); if (VarGet(VAR_FRONTIER_GAMBLER_PLACED_BET_F) == 1) { - if (gUnknown_085B3104[var2] == (var3 << 8) + var1) + if (gUnknown_085B3104[var2] == (frontierFacilityId << 8) + battleMode) { if (a0 != 0) { @@ -3363,7 +3364,7 @@ void sub_813ADD4(void) struct Task *task = &gTasks[taskId]; ListMenuGetScrollAndRow(task->data[14], &scrollOffset, &selectedRow); SetStandardWindowBorderStyle(task->data[13], 0); - + for (i = 0; i < 6; i++) { sub_8199F74(task->data[13], 1, gUnknown_085B2CF0[gSpecialVar_0x8004][scrollOffset + i], 10, i * 16, TEXT_SPEED_FF, NULL, 0, 0); @@ -3381,7 +3382,7 @@ void sub_813AEB4(void) u16 temp1 = 0; u16 temp2 = 0; gSpecialVar_0x8005 = 0; - + temp1 = VarGet(VAR_TEMP_E); temp2 = VarGet(VAR_TEMP_D); @@ -3509,7 +3510,7 @@ static void sub_813B0B4(u8 a0) u8 eventObjectId; LoadPalette(&gUnknown_085B3280[a0], 0x1A0, 8); TryGetEventObjectIdByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &eventObjectId); - + if (a0 == 0) { PlaySE(SE_W109); @@ -3656,7 +3657,7 @@ bool32 sub_813B374(void) u16 var = VarGet(VAR_0x4037); GetMapName(gStringVar1, gUnknown_085B3400[var - 1], 0); - + if (var < 9) { return FALSE; @@ -3697,7 +3698,7 @@ bool32 sub_813B3B0(void) break; } } - + if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(UNDERWATER3)) { switch (gSaveBlock1Ptr->location.mapNum) @@ -4159,7 +4160,7 @@ static u16 sub_813BC00(void) } } } - + if (((gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] >> gUnknown_085B347C[retVal]) & 1)) { gSaveBlock1Ptr->vars[VAR_FANCLUB_UNKNOWN_1 - VARS_START] ^= 1 << gUnknown_085B347C[retVal]; diff --git a/src/fieldmap.c b/src/fieldmap.c index f57c4b48f..019db9d0d 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -712,8 +712,8 @@ int GetPostCameraMoveMapBorderId(int x, int y) int CanCameraMoveInDirection(int direction) { int x, y; - x = gSaveBlock1Ptr->pos.x + 7 + gUnknown_08339D64[direction].x; - y = gSaveBlock1Ptr->pos.y + 7 + gUnknown_08339D64[direction].y; + x = gSaveBlock1Ptr->pos.x + 7 + gDirectionToVectors[direction].x; + y = gSaveBlock1Ptr->pos.y + 7 + gDirectionToVectors[direction].y; if (GetMapBorderIdAt(x, y) == -1) { return 0; @@ -951,7 +951,7 @@ void copy_tileset_patterns_to_vram2(struct Tileset const *tileset, u16 numTiles, if (!tileset->isCompressed) LoadBgTiles(2, tileset->tiles, numTiles * 32, offset); else - copy_decompressed_tile_data_to_vram_autofree(2, tileset->tiles, numTiles * 32, offset, 0); + DecompressAndLoadBgGfxUsingHeap(2, tileset->tiles, numTiles * 32, offset, 0); } } diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index f5c4ba491..33c85d448 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -5,6 +5,7 @@ #include "sprite.h" #include "pokemon.h" #include "text.h" +#include "text_window.h" #include "malloc.h" #include "gpu_regs.h" #include "main.h" @@ -26,6 +27,7 @@ #include "event_data.h" #include "overworld.h" #include "menu.h" +#include "trainer_pokemon_sprites.h" struct HallofFameMon { @@ -81,18 +83,10 @@ extern const u8 gText_MainMenuTime[]; extern const u8 gContestConfetti_Gfx[]; extern const u8 gContestConfetti_Pal[]; -extern void NewMenuHelpers_DrawDialogueFrame(u8, u8); extern void sub_8175620(void); extern u8 TrySavingData(u8); -extern u8 sub_818D3E4(u16 species, u32 trainerId, u32 personality, u8 flags, s16 x, s16 y, u8, u16); extern void sub_8197434(u8, u8); extern u16 sub_818D97C(u8 playerGender, u8); -extern u16 sub_818D8AC(u16, u8, s16, s16, u8, u16); -extern const void* stdpal_get(u8); -extern void LoadWindowGfx(u8, u8, u16, u8); -extern u16 sub_818D820(u16); -extern u16 sub_818D8F0(u16); -extern u16 sub_818D7D8(u16 species, u32 trainerId, u32 personality, u8 arg3, s16 sp0, s16 sp1, u8 sp2, u16 sp3); extern void sub_8198204(u8 *dst, const u8 *src, u8, u8, u8); extern bool8 sub_80F9C30(void); extern void sub_8198314(void); @@ -102,8 +96,6 @@ extern void sub_80F9BF4(u16, u16, u8); extern void sub_81980F0(u8, u8, u8, u8, u16); extern void sub_80F9BCC(u16, u16, u8); extern bool8 sub_80F9C1C(void); -extern u16 SpeciesToPokedexNum(u16 species); -extern void dp13_810BB8C(void); extern void sub_81971D0(void); extern void sub_8197200(void); extern void sub_8152254(void); @@ -611,7 +603,7 @@ static void Task_Hof_DisplayMon(u8 taskId) if (currMon->species == SPECIES_EGG) field6 += 10; - spriteId = sub_818D3E4(currMon->species, currMon->tid, currMon->personality, 1, xPos, yPos, currMonId, 0xFFFF); + spriteId = CreatePicSprite2(currMon->species, currMon->tid, currMon->personality, 1, xPos, yPos, currMonId, 0xFFFF); gSprites[spriteId].tDestinationX = field4; gSprites[spriteId].tDestinationY = field6; gSprites[spriteId].data[0] = 0; @@ -723,7 +715,7 @@ static void sub_8173EE4(u8 taskId) ShowBg(0); ShowBg(1); ShowBg(3); - gTasks[taskId].tPlayerSpriteID = sub_818D8AC(sub_818D97C(gSaveBlock2Ptr->playerGender, 1), 1, 120, 72, 6, 0xFFFF); + gTasks[taskId].tPlayerSpriteID = CreateTrainerPicSprite(PlayerGenderToFrontTrainerPicId_Debug(gSaveBlock2Ptr->playerGender, TRUE), 1, 120, 72, 6, 0xFFFF); AddWindow(&sHof_WindowTemplate); LoadWindowGfx(1, gSaveBlock2Ptr->optionsWindowFrameType, 0x21D, 0xD0); LoadPalette(stdpal_get(1), 0xE0, 0x20); @@ -780,11 +772,11 @@ static void Task_Hof_HandleExit(u8 taskId) if (spriteId != 0xFF) { FreeOamMatrix(gSprites[spriteId].oam.matrixNum); - sub_818D820(spriteId); + FreeAndDestroyMonPicSprite(spriteId); } } - sub_818D8F0(gTasks[taskId].tPlayerSpriteID); + FreeAndDestroyTrainerPicSprite(gTasks[taskId].tPlayerSpriteID); HideBg(0); HideBg(1); HideBg(3); @@ -956,7 +948,7 @@ static void Task_HofPC_DrawSpritesPrintText(u8 taskId) if (currMon->species == SPECIES_EGG) posY += 10; - spriteId = sub_818D7D8(currMon->species, currMon->tid, currMon->personality, 1, posX, posY, i, 0xFFFF); + spriteId = CreateMonPicSprite_HandleDeoxys(currMon->species, currMon->tid, currMon->personality, 1, posX, posY, i, 0xFFFF); gSprites[spriteId].oam.priority = 1; gTasks[taskId].tMonSpriteId(i) = spriteId; } @@ -1026,7 +1018,7 @@ static void Task_HofPC_HandleInput(u8 taskId) u8 spriteId = gTasks[taskId].tMonSpriteId(i); if (spriteId != 0xFF) { - sub_818D820(spriteId); + FreeAndDestroyMonPicSprite(spriteId); gTasks[taskId].tMonSpriteId(i) = 0xFF; } } @@ -1087,7 +1079,7 @@ static void Task_HofPC_HandleExit(u8 taskId) u16 spriteId = gTasks[taskId].tMonSpriteId(i); if (spriteId != 0xFF) { - sub_818D820(spriteId); + FreeAndDestroyMonPicSprite(spriteId); gTasks[taskId].tMonSpriteId(i) = 0xFF; } } @@ -1305,7 +1297,7 @@ static void sub_8174F70(void) ResetTasks(); ResetSpriteData(); reset_temp_tile_data_buffers(); - dp13_810BB8C(); + ResetAllPicSprites(); FreeAllSpritePalettes(); gReservedSpritePaletteCount = 8; LoadCompressedObjectPic(&sHallOfFame_ConfettiSpriteSheet); diff --git a/src/item.c b/src/item.c index c94f29910..b4a2fd6f0 100644 --- a/src/item.c +++ b/src/item.c @@ -10,6 +10,7 @@ #include "item_menu.h" #include "strings.h" #include "load_save.h" +#include "battle_pyramid_bag.h" extern bool8 InBattlePyramid(void); extern u16 gUnknown_0203CF30[]; @@ -752,9 +753,8 @@ u16 BagGetQuantityByPocketPosition(u8 pocketId, u16 pocketPos) static void SwapItemSlots(struct ItemSlot *a, struct ItemSlot *b) { - struct ItemSlot temp = *a; - *a = *b; - *b = temp; + struct ItemSlot temp; + SWAP(*a, *b, temp); } void CompactItemsInBagPocket(struct BagPocket *bagPocket) @@ -845,8 +845,8 @@ u16 CountTotalItemQuantityInBag(u16 itemId) static bool8 CheckPyramidBagHasItem(u16 itemId, u16 count) { u8 i; - u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.chosenLvl]; - u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.chosenLvl]; + u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode]; + u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode]; for (i = 0; i < PYRAMID_BAG_ITEMS_COUNT; i++) { @@ -867,8 +867,8 @@ static bool8 CheckPyramidBagHasItem(u16 itemId, u16 count) static bool8 CheckPyramidBagHasSpace(u16 itemId, u16 count) { u8 i; - u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.chosenLvl]; - u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.chosenLvl]; + u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode]; + u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode]; for (i = 0; i < PYRAMID_BAG_ITEMS_COUNT; i++) { @@ -890,8 +890,8 @@ bool8 AddPyramidBagItem(u16 itemId, u16 count) { u16 i; - u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.chosenLvl]; - u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.chosenLvl]; + u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode]; + u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode]; u16 *newItems = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(u16)); u8 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(u8)); @@ -963,10 +963,10 @@ bool8 RemovePyramidBagItem(u16 itemId, u16 count) { u16 i; - u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.chosenLvl]; - u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.chosenLvl]; + u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode]; + u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode]; - i = gUnknown_0203CF30[3] + gUnknown_0203CF30[4]; + i = gPyramidBagCursorData.cursorPosition + gPyramidBagCursorData.scrollPosition; if (items[i] == itemId && quantities[i] >= count) { quantities[i] -= count; diff --git a/src/item_menu.c b/src/item_menu.c index f58c2b8b3..082fe5558 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -149,14 +149,57 @@ void sub_81AD6FC(u8 taskId); // .rodata -const struct BgTemplate gUnknown_08613F90[3] = { - {0, 0, 31, 0, 0, 1, 0}, - {1, 0, 30, 0, 0, 0, 0}, - {2, 3, 29, 0, 0, 2, 0} +const struct BgTemplate gUnknown_08613F90[3] = +{ + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0, + }, + { + .bg = 1, + .charBaseIndex = 0, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0, + }, + { + .bg = 2, + .charBaseIndex = 3, + .mapBaseIndex = 29, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0, + }, }; -const struct ListMenuTemplate gUnknown_08613F9C = { - NULL, bag_menu_change_item_callback, sub_81AB520, 0, 0, 0, 0, 8, 0, 1, 1, 0, 3, 0, 0, 0, 7, 0 +const struct ListMenuTemplate gUnknown_08613F9C = +{ + .items = NULL, + .moveCursorFunc = bag_menu_change_item_callback, + .itemPrintFunc = sub_81AB520, + .totalItems = 0, + .maxShowed = 0, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 1, + .cursorPal = 1, + .fillValue = 0, + .cursorShadowPal = 3, + .lettersSpacing = 0, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 7, + .cursorKind = 0 }; const struct MenuAction gUnknown_08613FB4[] = { @@ -221,27 +264,157 @@ const u8 gUnknown_08614164[][3] = { {0, 14, 10} }; -const struct WindowTemplate gUnknown_08614174[] = { - {0, 14, 2, 15, 16, 1, 0x27}, - {0, 0, 13, 14, 6, 1, 0x117}, - {0, 4, 1, 8, 2, 1, 0x1A1}, - {0, 1, 13, 5, 6, 12, 0x16B}, - {0, 7, 13, 4, 6, 12, 0x189}, - {1, 2, 15, 27, 4, 15, 0x1B1}, - {0xFF, 0, 0, 0, 0, 0, 0} +const struct WindowTemplate gUnknown_08614174[] = +{ + { + .priority = 0, + .tilemapLeft = 14, + .tilemapTop = 2, + .width = 15, + .height = 16, + .paletteNum = 1, + .baseBlock = 0x27, + }, + { + .priority = 0, + .tilemapLeft = 0, + .tilemapTop = 13, + .width = 14, + .height = 6, + .paletteNum = 1, + .baseBlock = 0x117, + }, + { + .priority = 0, + .tilemapLeft = 4, + .tilemapTop = 1, + .width = 8, + .height = 2, + .paletteNum = 1, + .baseBlock = 0x1A1, + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 13, + .width = 5, + .height = 6, + .paletteNum = 12, + .baseBlock = 0x16B, + }, + { + .priority = 0, + .tilemapLeft = 7, + .tilemapTop = 13, + .width = 4, + .height = 6, + .paletteNum = 12, + .baseBlock = 0x189, + }, + { + .priority = 1, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 27, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x1B1, + }, + DUMMY_WIN_TEMPLATE, }; -const struct WindowTemplate gUnknown_086141AC[] = { - {1, 22, 17, 7, 2, 15, 0x21D}, - {1, 22, 15, 7, 4, 15, 0x21D}, - {1, 15, 15, 14, 4, 15, 0x21D}, - {1, 15, 13, 14, 6, 15, 0x21D}, - {1, 2, 15, 27, 4, 15, 0x1B1}, - {1, 24, 15, 5, 4, 15, 0x21D}, - {1, 21, 9, 5, 4, 15, 0x21D}, - {1, 24, 17, 5, 2, 15, 0x21D}, - {1, 18, 11, 10, 2, 15, 0x245}, - {1, 1, 1, 10, 2, 15, 0x231} +const struct WindowTemplate gUnknown_086141AC[] = +{ + { + .priority = 1, + .tilemapLeft = 22, + .tilemapTop = 17, + .width = 7, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x21D, + }, + { + .priority = 1, + .tilemapLeft = 22, + .tilemapTop = 15, + .width = 7, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x21D, + }, + { + .priority = 1, + .tilemapLeft = 15, + .tilemapTop = 15, + .width = 14, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x21D, + }, + { + .priority = 1, + .tilemapLeft = 15, + .tilemapTop = 13, + .width = 14, + .height = 6, + .paletteNum = 15, + .baseBlock = 0x21D, + }, + { + .priority = 1, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 27, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x1B1, + }, + { + .priority = 1, + .tilemapLeft = 24, + .tilemapTop = 15, + .width = 5, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x21D, + }, + { + .priority = 1, + .tilemapLeft = 21, + .tilemapTop = 9, + .width = 5, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x21D, + }, + { + .priority = 1, + .tilemapLeft = 24, + .tilemapTop = 17, + .width = 5, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x21D, + }, + { + .priority = 1, + .tilemapLeft = 18, + .tilemapTop = 11, + .width = 10, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x245, + }, + { + .priority = 1, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 10, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x231, + }, }; // .text @@ -675,7 +848,7 @@ void sub_81AB520(u8 rboxId, int item_index_in_pocket, u8 a) } itemId = BagGetItemIdByPocketPosition(gUnknown_0203CE58.pocket + 1, item_index_in_pocket); itemQuantity = BagGetQuantityByPocketPosition(gUnknown_0203CE58.pocket + 1, item_index_in_pocket); - if ((u16)(itemId - ITEM_HM01) <= 7) + if (itemId >= ITEM_HM01 && itemId <= ITEM_HM08) BlitBitmapToWindow(rboxId, gBagMenuHMIcon_Gfx, 8, a - 1, 16, 16); if (gUnknown_0203CE58.pocket == 3) { @@ -701,10 +874,10 @@ void sub_81AB520(u8 rboxId, int item_index_in_pocket, u8 a) void bag_menu_print_description_box_text(int a) { - u8* str; + const u8 *str; if (a != -2) { - str = (u8*)ItemId_GetDescription(BagGetItemIdByPocketPosition(gUnknown_0203CE58.pocket + 1, a)); + str = ItemId_GetDescription(BagGetItemIdByPocketPosition(gUnknown_0203CE58.pocket + 1, a)); } else { @@ -2103,9 +2276,9 @@ void setup_bag_menu_textboxes(void) InitWindows(gUnknown_08614174); DeactivateAllTextPrinters(); - LoadUserWindowBorderGfx(0, 1, -32); - LoadMessageBoxGfx(0, 10, -48); - sub_819A2BC(-64, 1); + LoadUserWindowBorderGfx(0, 1, 0xE0); + LoadMessageBoxGfx(0, 10, 0xD0); + sub_819A2BC(0xC0, 1); LoadPalette(&gUnknown_0860F074, 0xF0, 0x20); for (i = 0; i < 3; i++) { diff --git a/src/item_use.c b/src/item_use.c index 9031338dd..ea8206502 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -29,44 +29,26 @@ #include "string_util.h" #include "task.h" #include "text.h" +#include "strings.h" +#include "pokeblock.h" +#include "menu.h" +#include "item_menu.h" +#include "battle_pyramid_bag.h" -extern void(**gUnknown_0203CE54)(void); -extern void(**gUnknown_0203CF2C)(void); extern void(*gUnknown_0203A0F4)(u8 taskId); extern void(*gUnknown_085920D8[])(void); extern void (*gUnknown_03006328)(u8, u16, TaskFunc); extern void unknown_ItemMenu_Confirm(u8 taskId); extern void sub_81C5B14(u8 taskId); -extern u8 gText_DadsAdvice[]; -extern u8 gText_CantDismountBike[]; -extern void sub_8197434(u8 a, u8 b); extern void ScriptUnfreezeEventObjects(void); extern void ItemUseOutOfBattle_TMHM(u8 a); extern void ItemUseOutOfBattle_EvolutionStone(u8 b); -extern void bag_menu_mail_related(void); -extern void OpenPokeblockCase(u8 a, void(*b)(void)); -extern void overworld_free_bg_tilemaps(void); -extern bool32 Overworld_IsBikingAllowed(void); extern bool8 IsPlayerFacingSurfableFishableWater(void); extern bool8 sub_81221AC(void); -extern u8 gText_ItemFinderNothing[]; -extern u8 gText_ItemFinderNearby[]; -extern u8 gText_ItemFinderOnTop[]; -extern u8 gText_CoinCase[]; -extern u8 gText_PowderQty[]; extern u8 gUnknown_085920E4[]; extern u8 Route102_EventScript_274482[]; extern u8 Route102_EventScript_2744C0[]; extern u8 BattleFrontier_OutsideEast_EventScript_242CFC[]; -extern u8 gText_BootedUpHM[]; -extern u8 gText_BootedUpTM[]; -extern u8 gText_TMHMContainedVar1[]; -extern u8 gText_PlayerUsedVar2[]; -extern u8 gText_RepelEffectsLingered[]; -extern u8 gText_UsedVar2WildLured[]; -extern u8 gText_UsedVar2WildRepelled[]; -extern u8 gText_BoxFull[]; -extern u8 gText_WontHaveEffect[]; extern int sub_80247BC(void); extern struct MapHeader* mapconnection_get_mapheader(struct MapConnection *connection); extern void SetUpItemUseCallback(u8 taskId); @@ -86,7 +68,6 @@ extern void sub_81C59BC(void); extern void sub_81AB9A8(u8); extern void sub_81ABA88(u8); extern void sub_80B7CC8(void); -extern void Overworld_ResetStateAfterDigEscRope(void); extern u8* sub_806CF78(u16); extern void sub_81B89F0(void); extern u8 GetItemEffectType(u16); @@ -115,8 +96,7 @@ void sub_80FE124(u8 taskId); void sub_80FE164(u8 taskId); void DisplayItemMessage(u8 taskId, u8 a, const u8* str, void(*callback)(u8 taskId)); -void DisplayItemMessageInBattlePyramid(u8 taskId, u8* str, void(*callback)(u8 taskId)); -void DisplayItemMessageOnField(u8 taskId, u8* str, void(*callback)(u8 taskId)); +void DisplayItemMessageOnField(u8 taskId, const u8* str, void(*callback)(u8 taskId)); void sub_81C6714(u8 taskId); void CleanUpAfterFailingToUseRegisteredKeyItemOnField(u8 taskId); void StartFishing(u8 a); @@ -137,12 +117,12 @@ void SetUpItemUseCallback(u8 taskId) type = ItemId_GetType(gSpecialVar_ItemId) - 1; if (!InBattlePyramid()) { - *gUnknown_0203CE54 = gUnknown_085920D8[type]; + gUnknown_0203CE54->unk0 = gUnknown_085920D8[type]; unknown_ItemMenu_Confirm(taskId); } else { - *gUnknown_0203CF2C = gUnknown_085920D8[type]; + gPyramidBagResources->callback2 = gUnknown_085920D8[type]; sub_81C5B14(taskId); } } @@ -221,7 +201,7 @@ void sub_80FD254() void ItemUseOutOfBattle_Mail(u8 taskId) { - *gUnknown_0203CE54 = sub_80FD254; + gUnknown_0203CE54->unk0 = sub_80FD254; unknown_ItemMenu_Confirm(taskId); } @@ -617,7 +597,7 @@ void ItemUseOutOfBattle_PokeblockCase(u8 taskId) } else if (gTasks[taskId].data[3] != TRUE) { - *gUnknown_0203CE54 = sub_80FDBEC; + gUnknown_0203CE54->unk0 = sub_80FDBEC; unknown_ItemMenu_Confirm(taskId); } else @@ -679,7 +659,7 @@ void sub_80FDD10(u8 taskId) { gUnknown_0203A0F4 = sub_80FDD74; gFieldCallback = MapPostLoadHook_UseItem; - *gUnknown_0203CE54 = CB2_ReturnToField; + gUnknown_0203CE54->unk0 = CB2_ReturnToField; unknown_ItemMenu_Confirm(taskId); } else @@ -898,7 +878,7 @@ void ItemUseOutOfBattle_BlackWhiteFlute(u8 taskId) void task08_080A1C44(u8 taskId) { - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); sub_80B7CC8(); DestroyTask(taskId); } @@ -1002,12 +982,12 @@ void sub_80FE54C(u8 taskId) { if (!InBattlePyramid()) { - *gUnknown_0203CE54 = sub_81B89F0; + gUnknown_0203CE54->unk0 = sub_81B89F0; unknown_ItemMenu_Confirm(taskId); } else { - *gUnknown_0203CF2C = sub_81B89F0; + gPyramidBagResources->callback2 = sub_81B89F0; sub_81C5B14(taskId); } } diff --git a/src/link.c b/src/link.c index b729f86eb..457e44a01 100644 --- a/src/link.c +++ b/src/link.c @@ -1679,7 +1679,7 @@ void CB2_LinkError(void) static void sub_800B080(void) { LoadBgTiles(0, g2BlankTilesGfx, 0x20, 0); - copy_decompressed_tile_data_to_vram_autofree(1, gWirelessLinkDisplayGfx, FALSE, 0, 0); + DecompressAndLoadBgGfxUsingHeap(1, gWirelessLinkDisplayGfx, FALSE, 0, 0); CopyToBgTilemapBuffer(1, gWirelessLinkDisplayTilemap, 0, 0); CopyBgTilemapBufferToVram(1); LoadPalette(gWirelessLinkDisplayPal, 0, 0x20); diff --git a/src/mail_data.c b/src/mail_data.c index ebb49febf..809dcc2a8 100644 --- a/src/mail_data.c +++ b/src/mail_data.c @@ -22,7 +22,7 @@ void ClearMailStruct(struct MailStruct *mail) for (i = 0; i < MAIL_WORDS_COUNT; i++) mail->words[i] = 0xFFFF; - for (i = 0; i < PLAYER_NAME_LENGTH; i++) + for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++) mail->playerName[i] = EOS; for (i = 0; i < 4; i++) @@ -58,7 +58,7 @@ u8 GiveMailToMon(struct Pokemon *mon, u16 itemId) for (i = 0; i < MAIL_WORDS_COUNT; i++) gSaveBlock1Ptr->mail[id].words[i] = 0xFFFF; - for (i = 0; i < PLAYER_NAME_LENGTH - 1; i++) + for (i = 0; i < PLAYER_NAME_LENGTH + 1 - 1; i++) gSaveBlock1Ptr->mail[id].playerName[i] = gSaveBlock2Ptr->playerName[i]; gSaveBlock1Ptr->mail[id].playerName[i] = EOS; PadNameString(gSaveBlock1Ptr->mail[id].playerName, CHAR_SPACE); diff --git a/src/main_menu.c b/src/main_menu.c index 052035e34..3d8d5acc2 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -1,7 +1,5 @@ - -// Includes #include "global.h" -#include "battle_dome_cards.h" +#include "trainer_pokemon_sprites.h" #include "bg.h" #include "constants/flags.h" #include "constants/rgb.h" @@ -133,29 +131,121 @@ const u8 gUnknown_082FEEF0[] = INCBIN_U8("graphics/birch_speech/map.bin.lz"); const u16 gUnknown_082FF018[] = INCBIN_U16("graphics/birch_speech/bg2.gbapal"); const u16 gUnknown_082FF028[] = {0, 0, 0, 0, 0, 0, 0, 0}; -const struct WindowTemplate sWindowTemplates_NoSavedGame[] = { - {0, 2, 1, 26, 2, 15, 1}, - {0, 2, 5, 26, 2, 15, 0x35} +const struct WindowTemplate sWindowTemplates_NoSavedGame[] = +{ + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 1, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 1 + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 5, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x35 + } }; -const struct WindowTemplate sWindowTemplates_HasSavedGame[] = { - {0, 2, 1, 26, 6, 15, 1}, - {0, 2, 9, 26, 2, 15, 0x9D}, - {0, 2, 13, 26, 2, 15, 0xD1}, - {0, 2, 17, 26, 2, 15, 0x105}, - {0, 2, 21, 26, 2, 15, 0x139} +const struct WindowTemplate sWindowTemplates_HasSavedGame[] = +{ + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 1, + .width = 26, + .height = 6, + .paletteNum = 15, + .baseBlock = 1 + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 9, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x9D + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 13, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 0xD1 + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 17, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x105 + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 21, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x139 + } }; -const struct WindowTemplate sWindowTemplate_ErrorWindow[] = { - {0, 2, 15, 26, 4, 15, 0x16D}, - {0xFF, 0, 0, 0, 0, 0, 0} +const struct WindowTemplate sWindowTemplate_ErrorWindow[] = +{ + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 26, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x16D + }, + DUMMY_WIN_TEMPLATE }; -const struct WindowTemplate gUnknown_082FF080[] = { - {0, 2, 15, 27, 4, 15, 1}, - {0, 3, 5, 6, 4, 15, 0x6D}, - {0, 3, 2, 9, 10, 15, 0x85}, - {0xFF, 0, 0, 0, 0, 0, 0} +const struct WindowTemplate gUnknown_082FF080[] = +{ + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 27, + .height = 4, + .paletteNum = 15, + .baseBlock = 1 + }, + { + .priority = 0, + .tilemapLeft = 3, + .tilemapTop = 5, + .width = 6, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x6D + }, + { + .priority = 0, + .tilemapLeft = 3, + .tilemapTop = 2, + .width = 9, + .height = 10, + .paletteNum = 15, + .baseBlock = 0x85 + }, + DUMMY_WIN_TEMPLATE }; const u16 gMainMenuBgPal[] = INCBIN_U16("graphics/misc/main_menu_bg.gbapal"); @@ -1018,7 +1108,7 @@ void task_new_game_prof_birch_speech_1(u8 taskId) ScanlineEffect_Stop(); ResetSpriteData(); FreeAllSpritePalettes(); - dp13_810BB8C(); + ResetAllPicSprites(); AddBirchSpeechObjects(taskId); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); gTasks[taskId].data[4] = 0; @@ -1336,7 +1426,7 @@ void task_new_game_prof_birch_speech_17(u8 taskId) if (!gPaletteFade.active) { FreeAllWindowBuffers(); - sub_818D820(gTasks[taskId].data[9]); + FreeAndDestroyMonPicSprite(gTasks[taskId].data[9]); set_default_player_name(Random() % 20); DestroyTask(taskId); DoNamingScreen(0, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, new_game_prof_birch_speech_part2_start); @@ -1515,8 +1605,8 @@ void task_new_game_prof_birch_speech_part2_12(u8 taskId) if (!gPaletteFade.active) { FreeAllWindowBuffers(); - sub_818D820(gTasks[taskId].data[9]); - dp13_810BB8C(); + FreeAndDestroyMonPicSprite(gTasks[taskId].data[9]); + ResetAllPicSprites(); SetMainCallback2(CB2_NewGame); DestroyTask(taskId); } @@ -1558,7 +1648,7 @@ void new_game_prof_birch_speech_part2_start(void) ScanlineEffect_Stop(); ResetSpriteData(); FreeAllSpritePalettes(); - dp13_810BB8C(); + ResetAllPicSprites(); AddBirchSpeechObjects(taskId); if (gSaveBlock2Ptr->playerGender != MALE) { @@ -1613,7 +1703,7 @@ void sub_80318D8(struct Sprite *sprite) u8 sub_80318F4(u8 a, u8 b) { - return sub_818D3E4(SPECIES_LOTAD, 8, 0, 1, a, b, 14, -1); + return CreatePicSprite2(SPECIES_LOTAD, 8, 0, 1, a, b, 14, -1); } void AddBirchSpeechObjects(u8 taskId) diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 578636d40..0d22bd126 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -70,32 +70,110 @@ static const u16 gUnknown_0857F444[16] = INCBIN_U16("graphics/interface/map_popu static const u8 gRegionMapSectionId_To_PopUpThemeIdMapping[] = { - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_BRICK, - MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_BRICK, - MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_BRICK, MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_BRICK, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, - MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_UNDERWATER, - MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, - MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, - MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_UNDERWATER, MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE2, - MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_MARBLE, MAPPOPUP_THEME_STONE, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE2, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_MARBLE, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_WOOD, - MAPPOPUP_THEME_WOOD, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE2, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE2, MAPPOPUP_THEME_STONE2, - MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_STONE, MAPPOPUP_THEME_MARBLE + [MAPSEC_LITTLEROOT_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_OLDALE_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_DEWFORD_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_LAVARIDGE_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_FALLARBOR_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_VERDANTURF_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_PACIFIDLOG_TOWN] = MAPPOPUP_THEME_WOOD, + [MAPSEC_PETALBURG_CITY] = MAPPOPUP_THEME_BRICK, + [MAPSEC_SLATEPORT_CITY] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_MAUVILLE_CITY] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_RUSTBORO_CITY] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_FORTREE_CITY] = MAPPOPUP_THEME_BRICK, + [MAPSEC_LILYCOVE_CITY] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_MOSSDEEP_CITY] = MAPPOPUP_THEME_BRICK, + [MAPSEC_SOOTOPOLIS_CITY] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_EVER_GRANDE_CITY] = MAPPOPUP_THEME_BRICK, + [MAPSEC_ROUTE_101] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_102] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_103] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_104] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_105] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_106] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_107] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_108] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_109] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_110] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_111] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_112] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_113] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_114] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_115] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_116] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_117] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_118] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_119] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_120] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_121] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_122] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_123] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ROUTE_124] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_125] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_126] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_127] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_128] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_129] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_130] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_131] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_132] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_133] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_ROUTE_134] = MAPPOPUP_THEME_UNDERWATER, + [MAPSEC_UNDERWATER_124] = MAPPOPUP_THEME_STONE2, + [MAPSEC_UNDERWATER_125] = MAPPOPUP_THEME_STONE2, + [MAPSEC_UNDERWATER_126] = MAPPOPUP_THEME_STONE2, + [MAPSEC_UNDERWATER_127] = MAPPOPUP_THEME_STONE2, + [MAPSEC_UNDERWATER_SOOTOPOLIS] = MAPPOPUP_THEME_STONE2, + [MAPSEC_GRANITE_CAVE] = MAPPOPUP_THEME_STONE, + [MAPSEC_MT_CHIMNEY] = MAPPOPUP_THEME_STONE, + [MAPSEC_SAFARI_ZONE] = MAPPOPUP_THEME_WOOD, + [MAPSEC_BATTLE_FRONTIER] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_PETALBURG_WOODS] = MAPPOPUP_THEME_WOOD, + [MAPSEC_RUSTURF_TUNNEL] = MAPPOPUP_THEME_STONE, + [MAPSEC_ABANDONED_SHIP] = MAPPOPUP_THEME_WOOD, + [MAPSEC_NEW_MAUVILLE] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_METEOR_FALLS] = MAPPOPUP_THEME_STONE, + [MAPSEC_METEOR_FALLS2] = MAPPOPUP_THEME_STONE, + [MAPSEC_MT_PYRE] = MAPPOPUP_THEME_STONE, + [MAPSEC_AQUA_HIDEOUT_OLD] = MAPPOPUP_THEME_STONE, + [MAPSEC_SHOAL_CAVE] = MAPPOPUP_THEME_STONE, + [MAPSEC_SEAFLOOR_CAVERN] = MAPPOPUP_THEME_STONE, + [MAPSEC_UNDERWATER_128] = MAPPOPUP_THEME_STONE2, + [MAPSEC_VICTORY_ROAD] = MAPPOPUP_THEME_STONE, + [MAPSEC_MIRAGE_ISLAND] = MAPPOPUP_THEME_WOOD, + [MAPSEC_CAVE_OF_ORIGIN] = MAPPOPUP_THEME_STONE, + [MAPSEC_SOUTHERN_ISLAND] = MAPPOPUP_THEME_WOOD, + [MAPSEC_FIERY_PATH] = MAPPOPUP_THEME_STONE, + [MAPSEC_FIERY_PATH2] = MAPPOPUP_THEME_STONE, + [MAPSEC_JAGGED_PASS] = MAPPOPUP_THEME_WOOD, + [MAPSEC_JAGGED_PASS2] = MAPPOPUP_THEME_WOOD, + [MAPSEC_SEALED_CHAMBER] = MAPPOPUP_THEME_STONE, + [MAPSEC_UNDERWATER_SEALED_CHAMBER] = MAPPOPUP_THEME_STONE2, + [MAPSEC_SCORCHED_SLAB] = MAPPOPUP_THEME_STONE, + [MAPSEC_ISLAND_CAVE] = MAPPOPUP_THEME_STONE, + [MAPSEC_DESERT_RUINS] = MAPPOPUP_THEME_STONE, + [MAPSEC_ANCIENT_TOMB] = MAPPOPUP_THEME_STONE, + [MAPSEC_INSIDE_OF_TRUCK] = MAPPOPUP_THEME_WOOD, + [MAPSEC_SKY_PILLAR] = MAPPOPUP_THEME_STONE, + [MAPSEC_SECRET_BASE] = MAPPOPUP_THEME_STONE, + [MAPSEC_DYNAMIC] = MAPPOPUP_THEME_MARBLE, + [MAPSEC_AQUA_HIDEOUT - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_MAGMA_HIDEOUT - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_MIRAGE_TOWER - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_BIRTH_ISLAND_2 - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_WOOD, + [MAPSEC_FARAWAY_ISLAND - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_WOOD, + [MAPSEC_ARTISAN_CAVE - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_MARINE_CAVE - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_UNDERWATER_MARINE_CAVE - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE2, + [MAPSEC_TERRA_CAVE - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_UNDERWATER_TERRA_CAVE - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE2, + [MAPSEC_UNDERWATER_UNK1 - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE2, + [MAPSEC_UNDERWATER_129 - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE2, + [MAPSEC_DESERT_UNDERPASS - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_ALTERING_CAVE_2 - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_NAVEL_ROCK2 - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_STONE, + [MAPSEC_TRAINER_HILL - MAPSEC_SUBTRACT_KANTO] = MAPPOPUP_THEME_MARBLE }; static const u8 gText_PyramidFloor1[] = _("PYRAMID FLOOR 1"); diff --git a/src/match_call.c b/src/match_call.c index 99eb6d65a..2879881bf 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -5,9 +5,9 @@ #include "event_data.h" #include "string_util.h" #include "battle.h" -#include "battle_frontier_1.h" #include "gym_leader_rematch.h" +extern void sub_8197080(u8 *dest); extern const u8 gTrainerClassNames[][13]; // Static type declarations diff --git a/src/menu.c b/src/menu.c index eda9513ba..3acb44985 100644 --- a/src/menu.c +++ b/src/menu.c @@ -65,13 +65,27 @@ static const u8 gUnknown_0860F094[] = { 8, 4, 1 }; static const struct WindowTemplate gUnknown_0860F098[] = { - { 0x00, 0x02, 0x0F, 0x1B, 0x04, 0x0F, 0x194 }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 27, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x194 + }, DUMMY_WIN_TEMPLATE }; static const struct WindowTemplate gUnknown_0860F0A8 = { - 0x00, 0x15, 0x09, 0x05, 0x04, 0x0F, 0x125 + .priority = 0, + .tilemapLeft = 21, + .tilemapTop = 9, + .width = 5, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x125 }; const u16 gUnknown_0860F0B0[] = INCBIN_U16("graphics/interface/860F0B0.gbapal"); @@ -1801,7 +1815,7 @@ void *decompress_and_copy_tile_data_to_vram(u8 bgId, const void *src, int size, return NULL; } -void copy_decompressed_tile_data_to_vram_autofree(u8 bgId, const void *src, int size, u16 offset, u8 mode) +void DecompressAndLoadBgGfxUsingHeap(u8 bgId, const void *src, int size, u16 offset, u8 mode) { int sizeOut; void *ptr = malloc_and_decompress(src, &sizeOut); diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 68f31584b..7f031c704 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -42,8 +42,24 @@ static const struct BgTemplate sBgTemplates[] = static const struct WindowTemplate sWindowTemplates[] = { - {0, 4, 15, 22, 4, 14, 20}, - {0, 7, 6, 16, 4, 14, 0x6C}, + { + .priority = 0, + .tilemapLeft = 4, + .tilemapTop = 15, + .width = 22, + .height = 4, + .paletteNum = 14, + .baseBlock = 20 + }, + { + .priority = 0, + .tilemapLeft = 7, + .tilemapTop = 6, + .width = 16, + .height = 4, + .paletteNum = 14, + .baseBlock = 0x6C + }, DUMMY_WIN_TEMPLATE }; diff --git a/src/mystery_event_script.c b/src/mystery_event_script.c index 8822cd05a..921c8e97c 100644 --- a/src/mystery_event_script.c +++ b/src/mystery_event_script.c @@ -226,9 +226,9 @@ bool8 MEScrCmd_setenigmaberry(struct ScriptContext *ctx) const u8 *message; bool32 haveBerry = IsEnigmaBerryValid(); u8 *berry = (u8 *)(ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]); - StringCopyN(gStringVar1, gSaveBlock1Ptr->enigmaBerry.berry.name, BERRY_NAME_COUNT); + StringCopyN(gStringVar1, gSaveBlock1Ptr->enigmaBerry.berry.name, BERRY_NAME_LENGTH + 1); SetEnigmaBerry(berry); - StringCopyN(gStringVar2, gSaveBlock1Ptr->enigmaBerry.berry.name, BERRY_NAME_COUNT); + StringCopyN(gStringVar2, gSaveBlock1Ptr->enigmaBerry.berry.name, BERRY_NAME_LENGTH + 1); if (!haveBerry) { diff --git a/src/naming_screen.c b/src/naming_screen.c index f99d23bc3..42525380b 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -113,12 +113,53 @@ static const struct BgTemplate gUnknown_0858BE00[] = } }; -static const struct WindowTemplate gUnknown_0858BE10[] = { - { 0x01, 0x03, 0x0A, 0x13, 0x08, 0x0A, 0x030 }, - { 0x02, 0x03, 0x0A, 0x13, 0x08, 0x0A, 0x0C8 }, - { 0x03, 0x08, 0x06, 0x11, 0x02, 0x0A, 0x030 }, - { 0x03, 0x08, 0x04, 0x11, 0x02, 0x0A, 0x052 }, - { 0x00, 0x00, 0x00, 0x1E, 0x02, 0x0B, 0x074 }, +static const struct WindowTemplate gUnknown_0858BE10[] = +{ + { + .priority = 1, + .tilemapLeft = 3, + .tilemapTop = 10, + .width = 19, + .height = 8, + .paletteNum = 10, + .baseBlock = 0x030 + }, + { + .priority = 2, + .tilemapLeft = 3, + .tilemapTop = 10, + .width = 19, + .height = 8, + .paletteNum = 10, + .baseBlock = 0x0C8 + }, + { + .priority = 3, + .tilemapLeft = 8, + .tilemapTop = 6, + .width = 17, + .height = 2, + .paletteNum = 10, + .baseBlock = 0x030 + }, + { + .priority = 3, + .tilemapLeft = 8, + .tilemapTop = 4, + .width = 17, + .height = 2, + .paletteNum = 10, + .baseBlock = 0x052 + }, + { + .priority = 0, + .tilemapLeft = 0, + .tilemapTop = 0, + .width = 30, + .height = 2, + .paletteNum = 11, + .baseBlock = 0x074 + }, DUMMY_WIN_TEMPLATE }; diff --git a/src/new_game.c b/src/new_game.c index 8b8436d10..36c028ce8 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -23,6 +23,8 @@ #include "overworld.h" #include "mail.h" #include "battle_records.h" +#include "item.h" +#include "pokedex.h" extern u8 gDifferentSaveFile; extern u16 gSaveFileStatus; @@ -33,13 +35,11 @@ extern u16 GetGeneratedTrainerIdLower(void); extern void ClearContestWinnerPicsInContestHall(void); extern void sub_80BB358(void); extern void ResetBagScrollPositions(void); -extern void ResetPokedex(void); extern void ResetGabbyAndTy(void); extern void ResetSecretBases(void); extern void ResetLinkContestBoolean(void); extern void sub_8052DA8(void); extern void ResetPokemonStorageSystem(void); -extern void ClearBag(void); extern void NewGameInitPCItems(void); extern void ClearDecorationInventories(void); extern void ResetFanClub(void); @@ -133,7 +133,7 @@ static void ClearFrontierRecord(void) static void WarpToTruck(void) { Overworld_SetWarpDestination(25, 40, -1, -1, -1); // inside of truck - warp_in(); + WarpIntoMap(); } void Sav2_ClearSetDefault(void) diff --git a/src/option_menu.c b/src/option_menu.c index fc0c0c24e..d48a1e448 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -91,8 +91,24 @@ static const u8 *const sOptionMenuItemsNames[MENUITEM_COUNT] = static const struct WindowTemplate sOptionMenuWinTemplates[] = { - {1, 2, 1, 0x1A, 2, 1, 2}, - {0, 2, 5, 0x1A, 0xE, 1, 0x36}, + { + .priority = 1, + .tilemapLeft = 2, + .tilemapTop = 1, + .width = 26, + .height = 2, + .paletteNum = 1, + .baseBlock = 2 + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 5, + .width = 26, + .height = 14, + .paletteNum = 1, + .baseBlock = 0x36 + }, DUMMY_WIN_TEMPLATE }; diff --git a/src/overworld.c b/src/overworld.c index d85af9e4d..683679218 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1,8 +1,8 @@ #include "global.h" #include "overworld.h" -#include "main.h" #include "battle_setup.h" #include "berry.h" +#include "bg.h" // #include "cable_club.h" #include "clock.h" #include "event_data.h" @@ -20,15 +20,18 @@ #include "field_weather.h" #include "fieldmap.h" // #include "fldeff_flash.h" +#include "gpu_regs.h" #include "heal_location.h" #include "link.h" +#include "link_rfu.h" #include "load_save.h" #include "main.h" +#include "malloc.h" #include "m4a.h" -#include "constants/maps.h" #include "map_name_popup.h" #include "menu.h" #include "metatile_behavior.h" +#include "money.h" #include "new_game.h" #include "palette.h" #include "play_time.h" @@ -37,12 +40,11 @@ // #include "rotating_gate.h" #include "safari_zone.h" #include "save.h" +#include "save_location.h" #include "script.h" // #include "script_pokemon_80C4.h" #include "secret_base.h" -#include "constants/songs.h" #include "sound.h" -#include "constants/species.h" #include "start_menu.h" #include "task.h" // #include "tileset_anim.h" @@ -50,14 +52,11 @@ #include "tv.h" #include "scanline_effect.h" #include "wild_encounter.h" -#include "bg.h" -#include "money.h" -#include "save_location.h" #include "constants/abilities.h" -#include "malloc.h" -#include "gpu_regs.h" -#include "link_rfu.h" #include "constants/map_types.h" +#include "constants/maps.h" +#include "constants/songs.h" +#include "constants/species.h" // event scripts extern const u8 EventScript_WhiteOut[]; @@ -151,7 +150,7 @@ extern void TransferTilesetAnimsBuffer(void); extern bool32 sub_81D5F48(void); extern u8 GetCurrentTrainerHillMapId(void); extern bool8 warp0_in_pokecenter(void); -extern void dp13_810BB8C(void); +extern void ResetAllPicSprites(void); extern void FieldEffectActiveListClear(void); extern void SetUpFieldTasks(void); extern void sub_81BE6B8(void); @@ -159,7 +158,6 @@ extern void sub_80AAFA4(void); extern void ShowStartMenu(void); extern void sub_80AEE84(void); extern void mapldr_default(void); -extern void npc_paltag_set_load(u8); extern void sub_8088B3C(u16, u16); extern bool32 sub_800F0B8(void); extern bool32 sub_8009F3C(void); @@ -185,7 +183,7 @@ static bool32 sub_8086638(u8 *state); static bool32 load_map_stuff(u8 *state, u32); static bool32 map_loading_iteration_2_link(u8 *state); static void mli4_mapscripts_and_other(void); -static void map_loading_lcd_reset(void); +static void InitOverworldGraphicsRegisters(void); static u8 sub_8087858(u8); static u16 sub_80871C0(u32 a1); static void sub_80867C8(void); @@ -246,9 +244,9 @@ static void c1_link_related_func_set(u16 (*func)(u32)); static void SetFieldVBlankCallback(void); static void FieldClearVBlankHBlankCallbacks(void); static void sub_8085810(void); -static u8 sub_808532C(struct UnkPlayerStruct *playerStruct, u16 a2, u8 a3); -static u8 sub_808538C(struct UnkPlayerStruct *playerStruct, u8 a2, u16 a3, u8 a4); -static u16 cur_mapdata_block_role_at_screen_center_acc_to_sav1(void); +static u8 GetAdjustedInitialTransitionFlags(struct InitialPlayerAvatarState *playerStruct, u16 a2, u8 a3); +static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *playerStruct, u8 a2, u16 a3, u8 a4); +static u16 GetCenterScreenMetatileBehavior(void); // IWRAM bss vars IWRAM_DATA static void *sUnknown_03000E0C; @@ -260,12 +258,12 @@ IWRAM_DATA static u32 sUnusedVar; // EWRAM vars EWRAM_DATA static u8 sUnknown_020322D8 = 0; -EWRAM_DATA struct WarpData gUnknown_020322DC = {0}; +EWRAM_DATA struct WarpData gLastUsedWarp = {0}; EWRAM_DATA static struct WarpData sWarpDestination = {0}; // new warp position -EWRAM_DATA static struct WarpData sUnknown_020322EC = {0}; -EWRAM_DATA static struct WarpData sUnknown_020322F4 = {0}; +EWRAM_DATA static struct WarpData gFixedDiveWarp = {0}; +EWRAM_DATA static struct WarpData gFixedHoleWarp = {0}; EWRAM_DATA static u16 sLastMapSectionId = 0; -EWRAM_DATA static struct UnkPlayerStruct sUnknown_02032300 = {0}; +EWRAM_DATA static struct InitialPlayerAvatarState gInitialPlayerAvatarState = {0}; EWRAM_DATA static u16 sAmbientCrySpecies = 0; EWRAM_DATA static bool8 sIsAmbientCryWaterMon = FALSE; EWRAM_DATA struct LinkPlayerEventObject gLinkPlayerEventObjects[4] = {0}; @@ -292,17 +290,17 @@ static const u8 sUnusedData[] = 0x2C, 0x00, 0x00, 0x00, }; -const struct UCoords32 gUnknown_08339D64[] = -{ - { 0, 0}, - { 0, 1}, - { 0, -1}, - {-1, 0}, - { 1, 0}, - {-1, 1}, - { 1, 1}, - {-1, -1}, - { 1, -1}, +const struct UCoords32 gDirectionToVectors[] = +{ + { 0, 0}, // DIR_NONE + { 0, 1}, // DIR_SOUTH + { 0, -1}, // DIR_NORTH + {-1, 0}, // DIR_WEST + { 1, 0}, // DIR_EAST + {-1, 1}, // DIR_SOUTHWEST + { 1, 1}, // DIR_SOUTHEAST + {-1, -1}, // DIR_NORTHWEST + { 1, -1}, // DIR_NORTHEAST }; static const struct BgTemplate gUnknown_08339DAC[] = @@ -345,7 +343,7 @@ static const struct BgTemplate gUnknown_08339DAC[] = } }; -static const struct ScanlineEffectParams gUnknown_08339DBC = +static const struct ScanlineEffectParams sFlashEffectParams = { (void *)REG_ADDR_WIN0H, ((DMA_ENABLE | DMA_START_HBLANK | DMA_REPEAT | DMA_DEST_RELOAD) << 16) | 1, @@ -400,12 +398,12 @@ void DoWhiteOut(void) HealPlayerParty(); Overworld_ResetStateAfterWhiteOut(); Overworld_SetWarpDestToLastHealLoc(); - warp_in(); + WarpIntoMap(); } void Overworld_ResetStateAfterFly(void) { - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); FlagClear(FLAG_SYS_CYCLING_ROAD); FlagClear(FLAG_SYS_CRUISE_MODE); FlagClear(FLAG_SYS_SAFARI_MODE); @@ -415,7 +413,7 @@ void Overworld_ResetStateAfterFly(void) void Overworld_ResetStateAfterTeleport(void) { - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); FlagClear(FLAG_SYS_CYCLING_ROAD); FlagClear(FLAG_SYS_CRUISE_MODE); FlagClear(FLAG_SYS_SAFARI_MODE); @@ -426,7 +424,7 @@ void Overworld_ResetStateAfterTeleport(void) void Overworld_ResetStateAfterDigEscRope(void) { - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); FlagClear(FLAG_SYS_CYCLING_ROAD); FlagClear(FLAG_SYS_CRUISE_MODE); FlagClear(FLAG_SYS_SAFARI_MODE); @@ -436,7 +434,7 @@ void Overworld_ResetStateAfterDigEscRope(void) static void Overworld_ResetStateAfterWhiteOut(void) { - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); FlagClear(FLAG_SYS_CYCLING_ROAD); FlagClear(FLAG_SYS_CRUISE_MODE); FlagClear(FLAG_SYS_SAFARI_MODE); @@ -575,16 +573,16 @@ const struct MapLayout *GetMapLayout(void) void ApplyCurrentWarp(void) { - gUnknown_020322DC = gSaveBlock1Ptr->location; + gLastUsedWarp = gSaveBlock1Ptr->location; gSaveBlock1Ptr->location = sWarpDestination; - sUnknown_020322EC = sDummyWarpData; - sUnknown_020322F4 = sDummyWarpData; + gFixedDiveWarp = sDummyWarpData; + gFixedHoleWarp = sDummyWarpData; } void set_warp2_warp3_to_neg_1(void) { - sUnknown_020322EC = sDummyWarpData; - sUnknown_020322F4 = sDummyWarpData; + gFixedDiveWarp = sDummyWarpData; + gFixedHoleWarp = sDummyWarpData; } void SetWarpData(struct WarpData *warp, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y) @@ -596,7 +594,7 @@ void SetWarpData(struct WarpData *warp, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, warp->y = y; } -bool32 warp_data_is_not_neg_1(struct WarpData *warp) +bool32 IsDummyWarp(struct WarpData *warp) { if (warp->mapGroup != -1) return FALSE; @@ -617,12 +615,12 @@ struct MapHeader const *const Overworld_GetMapHeaderByGroupAndId(u16 mapGroup, u return gMapGroups[mapGroup][mapNum]; } -struct MapHeader const *const warp1_get_mapheader(void) +struct MapHeader const *const GetDestinationWarpMapHeader(void) { return Overworld_GetMapHeaderByGroupAndId(sWarpDestination.mapGroup, sWarpDestination.mapNum); } -void set_current_map_header_from_sav1_save_old_name(void) +void LoadCurrentMapData(void) { sLastMapSectionId = gMapHeader.regionMapSectionId; gMapHeader = *Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum); @@ -636,7 +634,7 @@ void LoadSaveblockMapHeader(void) gMapHeader.mapLayout = GetMapLayout(); } -void update_camera_pos_from_warpid(void) +void SetPlayerCoordsFromWarp(void) { if (gSaveBlock1Ptr->location.warpId >= 0 && gSaveBlock1Ptr->location.warpId < gMapHeader.events->warpCount) { @@ -655,11 +653,11 @@ void update_camera_pos_from_warpid(void) } } -void warp_in(void) +void WarpIntoMap(void) { ApplyCurrentWarp(); - set_current_map_header_from_sav1_save_old_name(); - update_camera_pos_from_warpid(); + LoadCurrentMapData(); + SetPlayerCoordsFromWarp(); } void Overworld_SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y) @@ -726,27 +724,27 @@ void sub_8084E14(void) sWarpDestination = gSaveBlock1Ptr->warp4; } -void sub_8084E2C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y) +void SetFixedDiveWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y) { - SetWarpData(&sUnknown_020322EC, mapGroup, mapNum, warpId, x, y); + SetWarpData(&gFixedDiveWarp, mapGroup, mapNum, warpId, x, y); } -void warp1_set_to_warp2(void) +void SetFixedDiveWarpAsDestination(void) { - sWarpDestination = sUnknown_020322EC; + sWarpDestination = gFixedDiveWarp; } -void sub_8084E80(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y) +void SetFixedHoleWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y) { - SetWarpData(&sUnknown_020322F4, mapGroup, mapNum, warpId, x, y); + SetWarpData(&gFixedHoleWarp, mapGroup, mapNum, warpId, x, y); } -void sub_8084EBC(s16 x, s16 y) +void SetFixedHoleWarpAsDestination(s16 x, s16 y) { - if (warp_data_is_not_neg_1(&sUnknown_020322F4) == TRUE) - sWarpDestination = gUnknown_020322DC; + if (IsDummyWarp(&gFixedHoleWarp) == TRUE) + sWarpDestination = gLastUsedWarp; else - Overworld_SetWarpDestination(sUnknown_020322F4.mapGroup, sUnknown_020322F4.mapNum, -1, x, y); + Overworld_SetWarpDestination(gFixedHoleWarp.mapGroup, gFixedHoleWarp.mapNum, -1, x, y); } void warp1_set_to_sav1w(void) @@ -787,7 +785,7 @@ const struct MapConnection *GetMapConnection(u8 dir) return NULL; } -bool8 sub_8084FF8(u8 dir, u16 x, u16 y) +bool8 SetDiveWarp(u8 dir, u16 x, u16 y) { const struct MapConnection *connection = GetMapConnection(dir); @@ -798,21 +796,21 @@ bool8 sub_8084FF8(u8 dir, u16 x, u16 y) else { mapheader_run_script_with_tag_x6(); - if (warp_data_is_not_neg_1(&sUnknown_020322EC)) + if (IsDummyWarp(&gFixedDiveWarp)) return FALSE; - warp1_set_to_warp2(); + SetFixedDiveWarpAsDestination(); } return TRUE; } -bool8 sub_8085058(u16 x, u16 y) +bool8 SetDiveWarpEmerge(u16 x, u16 y) { - return sub_8084FF8(CONNECTION_EMERGE, x, y); + return SetDiveWarp(CONNECTION_EMERGE, x, y); } -bool8 sub_8085078(u16 x, u16 y) +bool8 SetDiveWarpDive(u16 x, u16 y) { - return sub_8084FF8(CONNECTION_DIVE, x, y); + return SetDiveWarp(CONNECTION_DIVE, x, y); } void mliX_load_map(u8 mapGroup, u8 mapNum) @@ -824,7 +822,7 @@ void mliX_load_map(u8 mapGroup, u8 mapNum) sub_8085810(); ApplyCurrentWarp(); - set_current_map_header_from_sav1_save_old_name(); + LoadCurrentMapData(); LoadEventObjTemplatesFromHeader(); TrySetMapSaveWarpStatus(); ClearTempFieldEventData(); @@ -860,7 +858,7 @@ static void mli0_load_map(u32 a1) bool8 v2; bool8 indoors; - set_current_map_header_from_sav1_save_old_name(); + LoadCurrentMapData(); if (!(sUnknown_020322D8 & 1)) { if (gMapHeader.mapLayoutId == 0x169) @@ -905,84 +903,84 @@ static void mli0_load_map(u32 a1) } } -void player_avatar_init_params_reset(void) +void ResetInitialPlayerAvatarState(void) { - sUnknown_02032300.player_field_1 = 1; - sUnknown_02032300.player_field_0 = 1; + gInitialPlayerAvatarState.direction = 1; + gInitialPlayerAvatarState.transitionFlags = 1; } -void walkrun_find_lowest_active_bit_in_bitfield(void) +void StoreInitialPlayerAvatarState(void) { - sUnknown_02032300.player_field_1 = GetPlayerFacingDirection(); + gInitialPlayerAvatarState.direction = GetPlayerFacingDirection(); if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_MACH_BIKE)) - sUnknown_02032300.player_field_0 = 2; + gInitialPlayerAvatarState.transitionFlags = 2; else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_ACRO_BIKE)) - sUnknown_02032300.player_field_0 = 4; + gInitialPlayerAvatarState.transitionFlags = 4; else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING)) - sUnknown_02032300.player_field_0 = 8; + gInitialPlayerAvatarState.transitionFlags = 8; else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_4)) - sUnknown_02032300.player_field_0 = 16; + gInitialPlayerAvatarState.transitionFlags = 16; else - sUnknown_02032300.player_field_0 = 1; + gInitialPlayerAvatarState.transitionFlags = 1; } -static struct UnkPlayerStruct *sub_80852D4(void) +static struct InitialPlayerAvatarState *GetInitialPlayerAvatarState(void) { - struct UnkPlayerStruct playerStruct; + struct InitialPlayerAvatarState playerStruct; u8 mapType = Overworld_GetMapTypeOfSaveblockLocation(); - u16 v2 = cur_mapdata_block_role_at_screen_center_acc_to_sav1(); - u8 v4 = sub_808532C(&sUnknown_02032300, v2, mapType); - playerStruct.player_field_0 = v4; - playerStruct.player_field_1 = sub_808538C(&sUnknown_02032300, v4, v2, mapType); - sUnknown_02032300 = playerStruct; - return &sUnknown_02032300; + u16 metatileBehavior = GetCenterScreenMetatileBehavior(); + u8 transitionFlags = GetAdjustedInitialTransitionFlags(&gInitialPlayerAvatarState, metatileBehavior, mapType); + playerStruct.transitionFlags = transitionFlags; + playerStruct.direction = GetAdjustedInitialDirection(&gInitialPlayerAvatarState, transitionFlags, metatileBehavior, mapType); + gInitialPlayerAvatarState = playerStruct; + return &gInitialPlayerAvatarState; } -static u8 sub_808532C(struct UnkPlayerStruct *playerStruct, u16 a2, u8 a3) +static u8 GetAdjustedInitialTransitionFlags(struct InitialPlayerAvatarState *playerStruct, u16 metatileBehavior, u8 mapType) { - if (a3 != 8 && FlagGet(FLAG_SYS_CRUISE_MODE)) + if (mapType != MAP_TYPE_INDOOR && FlagGet(FLAG_SYS_CRUISE_MODE)) return 1; - else if (a3 == 5) + else if (mapType == MAP_TYPE_UNDERWATER) return 16; - else if (MetatileBehavior_IsSurfableWaterOrUnderwater(a2) == 1) + else if (MetatileBehavior_IsSurfableWaterOrUnderwater(metatileBehavior) == TRUE) return 8; else if (Overworld_IsBikingAllowed() != TRUE) return 1; - else if (playerStruct->player_field_0 == 2) + else if (playerStruct->transitionFlags == 2) return 2; - else if (playerStruct->player_field_0 != 4) + else if (playerStruct->transitionFlags != 4) return 1; else return 4; } -static u8 sub_808538C(struct UnkPlayerStruct *playerStruct, u8 a2, u16 a3, u8 a4) +static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *playerStruct, u8 transitionFlags, u16 metatileBehavior, u8 mapType) { - if (FlagGet(FLAG_SYS_CRUISE_MODE) && a4 == 6) + if (FlagGet(FLAG_SYS_CRUISE_MODE) && mapType == MAP_TYPE_6) return 4; - else if (MetatileBehavior_IsDeepSouthWarp(a3) == TRUE) + else if (MetatileBehavior_IsDeepSouthWarp(metatileBehavior) == TRUE) return 2; - else if (MetatileBehavior_IsNonAnimDoor(a3) == TRUE || MetatileBehavior_IsDoor(a3) == TRUE) + else if (MetatileBehavior_IsNonAnimDoor(metatileBehavior) == TRUE || MetatileBehavior_IsDoor(metatileBehavior) == TRUE) return 1; - else if (MetatileBehavior_IsSouthArrowWarp(a3) == TRUE) + else if (MetatileBehavior_IsSouthArrowWarp(metatileBehavior) == TRUE) return 2; - else if (MetatileBehavior_IsNorthArrowWarp(a3) == TRUE) + else if (MetatileBehavior_IsNorthArrowWarp(metatileBehavior) == TRUE) return 1; - else if (MetatileBehavior_IsWestArrowWarp(a3) == TRUE) + else if (MetatileBehavior_IsWestArrowWarp(metatileBehavior) == TRUE) return 4; - else if (MetatileBehavior_IsEastArrowWarp(a3) == TRUE) + else if (MetatileBehavior_IsEastArrowWarp(metatileBehavior) == TRUE) return 3; - else if ((playerStruct->player_field_0 == 16 && a2 == 8) - || (playerStruct->player_field_0 == 8 && a2 == 16)) - return playerStruct->player_field_1; - else if (MetatileBehavior_IsLadder(a3) == TRUE) - return playerStruct->player_field_1; + else if ((playerStruct->transitionFlags == 16 && transitionFlags == 8) + || (playerStruct->transitionFlags == 8 && transitionFlags == 16)) + return playerStruct->direction; + else if (MetatileBehavior_IsLadder(metatileBehavior) == TRUE) + return playerStruct->direction; else return 1; } -static u16 cur_mapdata_block_role_at_screen_center_acc_to_sav1(void) +static u16 GetCenterScreenMetatileBehavior(void) { return MapGridGetMetatileBehaviorAt(gSaveBlock1Ptr->pos.x + 7, gSaveBlock1Ptr->pos.y + 7); } @@ -1232,7 +1230,7 @@ void Overworld_ChangeMusicTo(u16 newMusic) u8 GetMapMusicFadeoutSpeed(void) { - const struct MapHeader *mapHeader = warp1_get_mapheader(); + const struct MapHeader *mapHeader = GetDestinationWarpMapHeader(); if (Overworld_MapTypeIsIndoors(mapHeader->mapType) == TRUE) return 2; else @@ -1258,7 +1256,7 @@ void music_something(void) } } -bool8 sub_80859A0(void) +bool8 BGMusicStopped(void) { return IsNotWaitingForBGMStop(); } @@ -1361,7 +1359,7 @@ u8 Overworld_GetMapTypeOfSaveblockLocation(void) u8 get_map_light_from_warp0(void) { - return GetMapTypeByWarpData(&gUnknown_020322DC); + return GetMapTypeByWarpData(&gLastUsedWarp); } bool8 is_map_type_1_2_3_5_or_6(u8 mapType) @@ -1550,7 +1548,7 @@ void CB2_NewGame(void) StopMapMusic(); ResetSafariZoneFlag_(); NewGameInitData(); - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); PlayTimeCounter_Start(); ScriptContext1_Init(); ScriptContext2_Disable(); @@ -1572,7 +1570,7 @@ void CB2_WhiteOut(void) StopMapMusic(); ResetSafariZoneFlag_(); DoWhiteOut(); - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); ScriptContext1_Init(); ScriptContext2_Disable(); gFieldCallback = sub_80AF3C8; @@ -1755,7 +1753,7 @@ void CB2_ContinueSavedGame(void) { ClearSecretBase2Field_9(); warp1_set_to_sav1w(); - warp_in(); + WarpIntoMap(); sub_80EDB44(); SetMainCallback2(CB2_LoadMap); } @@ -1806,19 +1804,19 @@ static void VBlankCB_Field(void) TransferTilesetAnimsBuffer(); } -static void sub_80863B0(void) +static void InitCurrentFlashLevelScanlineEffect(void) { - u8 val; + u8 flashLevel; if (sub_81A9E6C()) { door_upload_tiles(); - ScanlineEffect_SetParams(gUnknown_08339DBC); + ScanlineEffect_SetParams(sFlashEffectParams); } - else if ((val = Overworld_GetFlashLevel())) + else if ((flashLevel = Overworld_GetFlashLevel())) { - sub_80B00E8(val); - ScanlineEffect_SetParams(gUnknown_08339DBC); + sub_80B00E8(flashLevel); + ScanlineEffect_SetParams(sFlashEffectParams); } } @@ -1850,8 +1848,8 @@ static bool32 map_loading_iteration_3(u8 *state) (*state)++; break; case 4: - sub_80863B0(); - map_loading_lcd_reset(); + InitCurrentFlashLevelScanlineEffect(); + InitOverworldGraphicsRegisters(); sub_8197200(); (*state)++; break; @@ -1925,8 +1923,8 @@ static bool32 load_map_stuff(u8 *state, u32 a2) (*state)++; break; case 4: - sub_80863B0(); - map_loading_lcd_reset(); + InitCurrentFlashLevelScanlineEffect(); + InitOverworldGraphicsRegisters(); sub_8197200(); (*state)++; break; @@ -2022,8 +2020,8 @@ static bool32 map_loading_iteration_2_link(u8 *state) (*state)++; break; case 3: - sub_80863B0(); - map_loading_lcd_reset(); + InitCurrentFlashLevelScanlineEffect(); + InitOverworldGraphicsRegisters(); sub_8197200(); (*state)++; break; @@ -2102,13 +2100,13 @@ static void sub_80867D8(void) static void sub_8086860(void) { - sub_80863B0(); - map_loading_lcd_reset(); + InitCurrentFlashLevelScanlineEffect(); + InitOverworldGraphicsRegisters(); sub_8197200(); mapdata_load_assets_to_gpu_and_full_redraw(); } -static void map_loading_lcd_reset(void) +static void InitOverworldGraphicsRegisters(void) { clear_scheduled_bg_copies_to_vram(); reset_temp_tile_data_buffers(); @@ -2149,13 +2147,13 @@ static void sub_8086988(u32 a1) ResetSpriteData(); ResetPaletteFade(); ScanlineEffect_Clear(); - dp13_810BB8C(); + ResetAllPicSprites(); ResetCameraUpdateInfo(); InstallCameraPanAheadCallback(); if (!a1) - npc_paltag_set_load(0); + InitEventObjectPalettes(0); else - npc_paltag_set_load(1); + InitEventObjectPalettes(1); FieldEffectActiveListClear(); sub_80AAFA4(); @@ -2178,16 +2176,16 @@ static void sub_80869DC(void) static void mli4_mapscripts_and_other(void) { s16 x, y; - struct UnkPlayerStruct *player; + struct InitialPlayerAvatarState *player; gUnknown_03005DEC = 0; gUnknown_03005DE8 = 0; sub_808D438(); sav1_camera_get_focus_coords(&x, &y); - player = sub_80852D4(); - InitPlayerAvatar(x, y, player->player_field_1, gSaveBlock2Ptr->playerGender); - SetPlayerAvatarTransitionFlags(player->player_field_0); - player_avatar_init_params_reset(); + player = GetInitialPlayerAvatarState(); + InitPlayerAvatar(x, y, player->direction, gSaveBlock2Ptr->playerGender); + SetPlayerAvatarTransitionFlags(player->transitionFlags); + ResetInitialPlayerAvatarState(); TrySpawnEventObjects(0, 0); mapheader_run_first_tag4_script_list_match(); } @@ -2732,8 +2730,8 @@ static const u8 *sub_80873B4(struct UnkStruct_8054FF8 *a1) return 0; unkStruct = a1->sub; - unkStruct.x += gUnknown_08339D64[a1->d].x; - unkStruct.y += gUnknown_08339D64[a1->d].y; + unkStruct.x += gDirectionToVectors[a1->d].x; + unkStruct.y += gDirectionToVectors[a1->d].y; unkStruct.height = 0; linkPlayerId = GetLinkPlayerIdAt(unkStruct.x, unkStruct.y); @@ -3166,12 +3164,12 @@ static void SpriteCB_LinkPlayer(struct Sprite *sprite) SetObjectSubpriorityByZCoord(eventObj->previousElevation, sprite, 1); sprite->oam.priority = ZCoordToPriority(eventObj->previousElevation); - if (!linkPlayerEventObj->mode) + if (!linkPlayerEventObj->mode) StartSpriteAnim(sprite, GetFaceDirectionAnimNum(eventObj->range.as_byte)); else StartSpriteAnimIfDifferent(sprite, GetMoveDirectionAnimNum(eventObj->range.as_byte)); - UpdateEventObjectSpriteVisibility(sprite, 0); + UpdateEventObjectSpriteVisibility(sprite, 0); if (eventObj->triggerGroundEffectsOnMove) { sprite->invisible = ((sprite->data[7] & 4) >> 2); diff --git a/src/player_pc.c b/src/player_pc.c index ef00e2e06..7ac8e78d5 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -184,9 +184,33 @@ const struct MenuAction gMailboxMailOptions[] = static const struct WindowTemplate gUnknown_085DFF24[3] = { - {0x00, 0x01, 0x01, 0x09, 0x06, 0x0F, 0x0001}, - {0x00, 0x01, 0x01, 0x09, 0x08, 0x0F, 0x0001}, - {0x00, 0x01, 0x01, 0x0A, 0x08, 0x0F, 0x0001} + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 9, + .height = 6, + .paletteNum = 15, + .baseBlock = 1 + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 9, + .height = 8, + .paletteNum = 15, + .baseBlock = 1 + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 10, + .height = 8, + .paletteNum = 15, + .baseBlock = 1 + } }; static const struct YesNoFuncTable ResumeFromWithdrawYesNoFuncList = // ResumeFromWithdrawYesNoFuncList @@ -195,27 +219,85 @@ static const struct YesNoFuncTable ResumeFromWithdrawYesNoFuncList = // ResumeFr ItemStorage_ResumeInputFromNoToss }; -static const struct ListMenuTemplate gUnknown_085DFF44 = { - NULL, - ItemStorage_MoveCursor, - fish4_goto_x5_or_x6, - 0, 0, - 0, 0, 8, 0, - 9, 2, 1, 3, FALSE, 0, FALSE, 7 +static const struct ListMenuTemplate gUnknown_085DFF44 = +{ + .items = NULL, + .moveCursorFunc = ItemStorage_MoveCursor, + .itemPrintFunc = fish4_goto_x5_or_x6, + .totalItems = 0, + .maxShowed = 0, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 9, + .cursorPal = 2, + .fillValue = 1, + .cursorShadowPal = 3, + .lettersSpacing = FALSE, + .itemVerticalPadding = 0, + .scrollMultiple = FALSE, + .fontId = 7 }; static const struct WindowTemplate gUnknown_085DFF5C[5] = { - {0x00, 0x10, 0x01, 0x0D, 0x12, 0x0F, 0x0001}, - {0x00, 0x01, 0x0D, 0x0D, 0x06, 0x0F, 0x00EB}, - {0x00, 0x01, 0x08, 0x03, 0x03, 0x0F, 0x0153}, - {0x00, 0x01, 0x01, 0x0D, 0x02, 0x0F, 0x0139}, - {0x00, 0x08, 0x09, 0x06, 0x02, 0x0F, 0x015C} + { + .priority = 0, + .tilemapLeft = 16, + .tilemapTop = 1, + .width = 13, + .height = 18, + .paletteNum = 15, + .baseBlock = 0x0001 + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 13, + .width = 13, + .height = 6, + .paletteNum = 15, + .baseBlock = 0x00EB + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 8, + .width = 3, + .height = 3, + .paletteNum = 15, + .baseBlock = 0x0153 + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 13, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x0139 + }, + { + .priority = 0, + .tilemapLeft = 8, + .tilemapTop = 9, + .width = 6, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x015C + } }; static const struct WindowTemplate gUnknown_085DFF84 = { - 0x00, 0x09, 0x07, 0x05, 0x04, 0x0F, 0x0168 + .priority = 0, + .tilemapLeft = 9, + .tilemapTop = 7, + .width = 5, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x0168 }; static const u8 gUnknown_085DFF8C[] = {0x01, 0x03, 0x02, 0x00}; @@ -476,7 +558,7 @@ static void ItemStorage_WithdrawToss_Helper(u8 taskId, bool8 toss) playerPCItemPageInfo.scrollIndicatorId = 0xFF; ItemStorage_SetItemAndMailCount(taskId); sub_816BC14(); - gpu_pal_allocator_reset__manage_upper_four(); + FreeAndReserveObjectSpritePalettes(); LoadListMenuArrowsGfx(); sub_8122344(gUnknown_0203BCC4->spriteIds, 7); sub_8197434(0,0); diff --git a/src/pokeblock.c b/src/pokeblock.c index e615693b9..0fa2cde04 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -294,21 +294,118 @@ static const struct Pokeblock sFavoritePokeblocksTable[] = static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = { - {0, 2, 1, 9, 2, 0xF, 0x1E}, - {0, 0xF, 1, 0xE, 0x12, 0xF, 0x30}, - {0, 2, 0xD, 5, 2, 0xF, 0x12C}, - {0, 2, 0xF, 5, 2, 0xF, 0x136}, - {0, 2, 0x11, 5, 2, 0xF, 0x140}, - {0, 8, 0xD, 5, 2, 0xF, 0x14A}, - {0, 8, 0xF, 5, 2, 0xF, 0x154}, - {0, 0xB, 0x11, 2, 2, 0xF, 0x15E}, - {1, 7, 5, 6, 6, 0xF, 0x162}, - {1, 7, 7, 6, 4, 0xF, 0x186}, - {1, 2, 0xF, 0x1B, 4, 0xF, 0x19E}, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 1, + .width = 9, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x1E + }, + { + .priority = 0, + .tilemapLeft = 15, + .tilemapTop = 1, + .width = 14, + .height = 18, + .paletteNum = 15, + .baseBlock = 0x30 + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 13, + .width = 5, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x12C + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 5, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x136 + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 17, + .width = 5, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x140 + }, + { + .priority = 0, + .tilemapLeft = 8, + .tilemapTop = 13, + .width = 5, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x14A + }, + { + .priority = 0, + .tilemapLeft = 8, + .tilemapTop = 15, + .width = 5, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x154 + }, + { + .priority = 0, + .tilemapLeft = 11, + .tilemapTop = 17, + .width = 2, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x15E + }, + { + .priority = 1, + .tilemapLeft = 7, + .tilemapTop = 5, + .width = 6, + .height = 6, + .paletteNum = 15, + .baseBlock = 0x162 + }, + { + .priority = 1, + .tilemapLeft = 7, + .tilemapTop = 7, + .width = 6, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x186 + }, + { + .priority = 1, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 27, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x19E + }, DUMMY_WIN_TEMPLATE }; -static const struct WindowTemplate sTossPkblockWindowTemplate = {1, 0x15, 9, 5, 4, 0xF, 0x20A}; +static const struct WindowTemplate sTossPkblockWindowTemplate = +{ + .priority = 1, + .tilemapLeft = 21, + .tilemapTop = 9, + .width = 5, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x20A +}; static const struct ListMenuTemplate sPokeblockListMenuTemplate = { diff --git a/src/pokedex.c b/src/pokedex.c index 0d73a9fe1..2cb3c153f 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -11,7 +11,7 @@ #include "main.h" #include "sound.h" #include "task.h" -#include "battle_dome_cards.h" +#include "trainer_pokemon_sprites.h" #include "scanline_effect.h" #include "malloc.h" #include "gpu_regs.h" @@ -821,7 +821,7 @@ const u8 sText_TenDashes[] = _("----------"); void ResetPokedex(void) { u16 i; - + gUnknown_02039B50 = 0; gUnknown_02039B52 = 64; gUnknown_030060B0 = 0; @@ -910,7 +910,7 @@ void sub_80BB534(void) { u8 *addr; u32 size; - + switch (gMain.state) { case 0: @@ -929,7 +929,7 @@ void sub_80BB534(void) ResetPaletteFade(); FreeAllSpritePalettes(); gReservedSpritePaletteCount = 8; - dp13_810BB8C(); + ResetAllPicSprites(); gMain.state++; break; case 2: @@ -984,7 +984,7 @@ void sub_80BB78C(u8 taskId) void sub_80BB7D4(u8 taskId) { SetGpuReg(REG_OFFSET_BG0VOFS, gUnknown_02039B4C->menuY); - + if (gUnknown_02039B4C->menuY) { gUnknown_02039B4C->menuY -= 8; @@ -1377,7 +1377,7 @@ bool8 sub_80BC514(u8 a) SetBgTilemapBuffer(2, AllocZeroed(0x800)); SetBgTilemapBuffer(1, AllocZeroed(0x800)); SetBgTilemapBuffer(0, AllocZeroed(0x800)); - copy_decompressed_tile_data_to_vram_autofree(3, gPokedexMenu_Gfx, 0x2000, 0, 0); + DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(1, gUnknown_08DC2C5C, 0, 0); CopyToBgTilemapBuffer(3, gUnknown_08DC2DAC, 0, 0); if (a == 0) @@ -1467,7 +1467,7 @@ void sub_80BC844(u8 a) void sub_80BC890(void) { void* tilemapBuffer; - + FreeAllWindowBuffers(); tilemapBuffer = GetBgTilemapBuffer(0); if (tilemapBuffer) @@ -1487,7 +1487,7 @@ void sub_80BC8D4(u8 dexMode, u8 sortMode) { u16 vars[3]; //I have no idea why three regular variables are stored in an array, but whatever. s16 i; - + gUnknown_02039B4C->pokemonListCount = 0; switch (dexMode) @@ -1633,7 +1633,7 @@ void sub_80BC8D4(u8 dexMode, u8 sortMode) void sub_80BCE2C(u8 windowId, u8 fontId, const u8* str, u8 left, u8 top) { u8 color[3]; - + color[0] = 0; color[1] = 15; color[2] = 3; @@ -1731,7 +1731,7 @@ void sub_80BD154(u16 a, u8 left, u8 top, u16 unused) { u8 text[6]; u16 r6; - + memcpy(text, gUnknown_0855D2B8, 6); r6 = gUnknown_02039B4C->unk0[a].dexNum; if (gUnknown_02039B4C->dexMode == DEX_MODE_HOENN) @@ -1753,7 +1753,7 @@ void sub_80BD1F4(u16 a, u8 x, u8 y, u16 unused) u8 sub_80BD23C(u16 num, u8 left, u8 top) { const u8* str; - + num = NationalPokedexNumToSpecies(num); if (num) str = gSpeciesNames[num]; @@ -1773,7 +1773,7 @@ void sub_80BD2B4(u16 a, u16 b) u8 i; u16 unk; u8 spriteId; - + gPaletteFade.bufferTransferDisabled = TRUE; for (i = 0; i < 4; i++) @@ -1803,13 +1803,13 @@ void sub_80BD2B4(u16 a, u16 b) gSprites[spriteId].callback = sub_80BE4E0; gSprites[spriteId].data[5] = 32; } - + sub_80BCE84(0, a, b); SetGpuReg(REG_OFFSET_BG2VOFS, gUnknown_02039B4C->unk62D); gUnknown_02039B4C->unk630 = 0; gUnknown_02039B4C->unk632 = 0; - + gPaletteFade.bufferTransferDisabled = FALSE; } @@ -1897,7 +1897,7 @@ u16 sub_80BD69C(u16 a, u16 b) u8 i; u16 r6; u8 r10 = 0; - + if ((gMain.heldKeys & DPAD_UP) && (a > 0)) { r10 = 1; @@ -1917,7 +1917,7 @@ u16 sub_80BD69C(u16 a, u16 b) else if ((gMain.newKeys & DPAD_LEFT) && (a > 0)) { r6 = a; - + for (i = 0; i < 7; i++) a = sub_80C0E0C(1, a, 0, gUnknown_02039B4C->pokemonListCount - 1); gUnknown_02039B4C->unk62C += 16 * (a - r6); @@ -1935,13 +1935,13 @@ u16 sub_80BD69C(u16 a, u16 b) sub_80BD2B4(a, 0xE); PlaySE(SE_Z_PAGE); } - + if (r10 == 0) { gUnknown_02039B4C->unk638 = 0; return a; } - + r5 = gUnknown_0855D28C[gUnknown_02039B4C->unk638 / 4]; r3 = gUnknown_0855D291[gUnknown_02039B4C->unk638 / 4]; gUnknown_02039B4C->unk62E = r3; @@ -2030,7 +2030,7 @@ u8 sub_80BDA40(void) { if (gUnknown_02039B4C->unk61E[i] != 0xFFFF) { - sub_818D820(gUnknown_02039B4C->unk61E[i]); + FreeAndDestroyMonPicSprite(gUnknown_02039B4C->unk61E[i]); gUnknown_02039B4C->unk61E[i] |= 0xFFFF; } } @@ -2109,7 +2109,7 @@ void sub_80BDB7C(u8 a) if (a == 0) { u32 _a; - + if (!IsNationalPokedexEnabled()) { CreateSprite(&gUnknown_0855D1F4, 32, 40, 1); @@ -2160,22 +2160,22 @@ void sub_80BDB7C(u8 a) else { u16 r6; - + CreateSprite(&gUnknown_0855D1F4, 32, 40, 1); spriteId = CreateSprite(&gUnknown_0855D1F4, 32, 76, 1); StartSpriteAnim(&gSprites[spriteId], 1); CreateSprite(&gUnknown_0855D20C, 17, 45, 1); - + spriteId = CreateSprite(&gUnknown_0855D20C, 17, 55, 1); StartSpriteAnim(&gSprites[spriteId], 1); CreateSprite(&gUnknown_0855D20C, 17, 81, 1); - + spriteId = CreateSprite(&gUnknown_0855D20C, 17, 91, 1); StartSpriteAnim(&gSprites[spriteId], 1); - + r6 = GetHoennPokedexCount(0); _a = 0; @@ -2197,9 +2197,9 @@ void sub_80BDB7C(u8 a) spriteId = CreateSprite(&gUnknown_0855D23C, 56, 45, 1); r5 = (r6 % 100) % 10; StartSpriteAnim(&gSprites[spriteId], r5); - + _a = 0; - + spriteId = CreateSprite(&gUnknown_0855D23C, 40, 55, 1); r5 = gUnknown_02039B4C->unk61A / 100; StartSpriteAnim(&gSprites[spriteId], r5); @@ -2207,21 +2207,21 @@ void sub_80BDB7C(u8 a) _a = 1; else gSprites[spriteId].invisible = TRUE; - + spriteId = CreateSprite(&gUnknown_0855D23C, 48, 55, 1); r5 = (gUnknown_02039B4C->unk61A % 100) / 10; if (r5 != 0 || _a != 0) StartSpriteAnim(&gSprites[spriteId], r5); else gSprites[spriteId].invisible = TRUE; - + spriteId = CreateSprite(&gUnknown_0855D23C, 56, 55, 1); r5 = (gUnknown_02039B4C->unk61A % 100) % 10; StartSpriteAnim(&gSprites[spriteId], r5); - + r6 = GetHoennPokedexCount(1); _a = 0; - + spriteId = CreateSprite(&gUnknown_0855D23C, 40, 81, 1); r5 = r6 / 100; StartSpriteAnim(&gSprites[spriteId], r5); @@ -2229,20 +2229,20 @@ void sub_80BDB7C(u8 a) _a = 1; else gSprites[spriteId].invisible = TRUE; - + spriteId = CreateSprite(&gUnknown_0855D23C, 48, 81, 1); r5 = (r6 % 100) / 10; if (r5 != 0 || _a != 0) StartSpriteAnim(&gSprites[spriteId], r5); else gSprites[spriteId].invisible = TRUE; - + spriteId = CreateSprite(&gUnknown_0855D23C, 56, 81, 1); r5 = (r6 % 100) % 10; StartSpriteAnim(&gSprites[spriteId], r5); - + _a = 0; - + spriteId = CreateSprite(&gUnknown_0855D23C, 40, 91, 1); r5 = gUnknown_02039B4C->unk61C / 100; StartSpriteAnim(&gSprites[spriteId], r5); @@ -2250,14 +2250,14 @@ void sub_80BDB7C(u8 a) _a = 1; else gSprites[spriteId].invisible = TRUE; - + spriteId = CreateSprite(&gUnknown_0855D23C, 48, 91, 1); r5 = (gUnknown_02039B4C->unk61C % 100) / 10; if (r5 != 0 || _a != 0) StartSpriteAnim(&gSprites[spriteId], r5); else gSprites[spriteId].invisible = TRUE; - + spriteId = CreateSprite(&gUnknown_0855D23C, 56, 91, 1); r5 = (gUnknown_02039B4C->unk61C % 100) % 10; StartSpriteAnim(&gSprites[spriteId], r5); @@ -2313,7 +2313,7 @@ void sub_80BE4E0(struct Sprite *sprite) if (gUnknown_02039B4C->unk64A != 0 && gUnknown_02039B4C->unk64A != 3) { - sub_818D820(gUnknown_02039B4C->unk61E[data1]); + FreeAndDestroyMonPicSprite(gUnknown_02039B4C->unk61E[data1]); gUnknown_02039B4C->unk61E[data1] = 0xFFFF; } else @@ -2339,7 +2339,7 @@ void sub_80BE4E0(struct Sprite *sprite) if ((sprite->data[5] <= -64 || sprite->data[5] >= 64) && sprite->data[0] != 0) { - sub_818D820(gUnknown_02039B4C->unk61E[data1]); + FreeAndDestroyMonPicSprite(gUnknown_02039B4C->unk61E[data1]); gUnknown_02039B4C->unk61E[data1] = 0xFFFF; } } @@ -2449,14 +2449,14 @@ void sub_80BE8DC(const u8* str, u8 left, u8 top) color[0] = 0; color[1] = 15; color[2] = 3; - + AddTextPrinterParameterized2(0, 1, left, top, 0, 0, color, -1, str); } u8 sub_80BE91C(struct PokedexListItem* item, u8 b) { u8 taskId; - + gUnknown_02039B54 = item; taskId = CreateTask(sub_80BEA24, 0); gTasks[taskId].data[0] = 0; @@ -2473,7 +2473,7 @@ u8 sub_80BE91C(struct PokedexListItem* item, u8 b) SetBgTilemapBuffer(0, AllocZeroed(0x800)); InitWindows(gUnknown_0856E640); DeactivateAllTextPrinters(); - + return taskId; } @@ -2518,7 +2518,7 @@ void sub_80BEA24(u8 taskId) } break; case 1: - copy_decompressed_tile_data_to_vram_autofree(3, gPokedexMenu_Gfx, 0x2000, 0, 0); + DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, gUnknown_08DC3080, 0, 0); FillWindowPixelBuffer(0, 0); PutWindowTilemap(0); @@ -2703,7 +2703,7 @@ void sub_80BEFD0(u8 taskId) { if (!gPaletteFade.active) { - sub_818D820(gTasks[taskId].data[4]); + FreeAndDestroyMonPicSprite(gTasks[taskId].data[4]); switch (gUnknown_02039B4C->unk64E) { case 1: @@ -2724,7 +2724,7 @@ void sub_80BF038(u8 taskId) { if (!gPaletteFade.active) { - sub_818D820(gTasks[taskId].data[4]); + FreeAndDestroyMonPicSprite(gTasks[taskId].data[4]); gTasks[taskId].func = sub_80BEA24; } } @@ -2733,7 +2733,7 @@ void sub_80BF070(u8 taskId) { if (!gPaletteFade.active) { - sub_818D820(gTasks[taskId].data[4]); + FreeAndDestroyMonPicSprite(gTasks[taskId].data[4]); sub_80BEDB0(); DestroyTask(taskId); } @@ -2813,7 +2813,7 @@ void sub_80BF250(u8 taskId) } break; case 1: - copy_decompressed_tile_data_to_vram_autofree(3, &gPokedexMenu_Gfx, 0x2000, 0, 0); + DecompressAndLoadBgGfxUsingHeap(3, &gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, &gUnknown_08DC3198, 0, 0); FillWindowPixelBuffer(0, 0); PutWindowTilemap(0); @@ -2960,7 +2960,7 @@ void sub_80BF790(u8 taskId) if (!gPaletteFade.active) { sub_8145914(); - sub_818D820(gTasks[taskId].data[4]); + FreeAndDestroyMonPicSprite(gTasks[taskId].data[4]); switch (gUnknown_02039B4C->unk64E) { default: @@ -3007,7 +3007,7 @@ void sub_80BF82C(u8 taskId) } break; case 1: - copy_decompressed_tile_data_to_vram_autofree(3, gPokedexMenu_Gfx, 0x2000, 0, 0); + DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, gUnknown_08DC2E6C, 0, 0); FillWindowPixelBuffer(0, 0); PutWindowTilemap(0); @@ -3109,8 +3109,8 @@ void sub_80BFC78(u8 taskId) { if (!gPaletteFade.active) { - sub_818D820(gTasks[taskId].data[4]); - sub_818D8F0(gTasks[taskId].data[5]); + FreeAndDestroyMonPicSprite(gTasks[taskId].data[4]); + FreeAndDestroyTrainerPicSprite(gTasks[taskId].data[5]); switch (gUnknown_02039B4C->unk64E) { default: @@ -3334,7 +3334,7 @@ void sub_80BFE38(u8 taskId) { u8 spriteId; u16 dexNum = gTasks[taskId].data[1]; - + switch (gTasks[taskId].data[0]) { case 0: @@ -3354,7 +3354,7 @@ void sub_80BFE38(u8 taskId) } break; case 1: - copy_decompressed_tile_data_to_vram_autofree(3, gPokedexMenu_Gfx, 0x2000, 0, 0); + DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, gUnknown_08DC3080, 0, 0); FillWindowPixelBuffer(0, 0); PutWindowTilemap(0); @@ -3440,7 +3440,7 @@ void blockset_load_palette_to_gpu(u8 taskId) buffer = GetBgTilemapBuffer(3); if (buffer) Free(buffer); - + species = NationalPokedexNumToSpecies(gTasks[taskId].data[1]); otId = ((u16)gTasks[taskId].data[13] << 16) | (u16)gTasks[taskId].data[12]; personality = ((u16)gTasks[taskId].data[15] << 16) | (u16)gTasks[taskId].data[14]; @@ -3472,7 +3472,7 @@ void sub_80C020C(u32 num, u32 value, u32 c, u32 d) const u8 *text; const u8 *text2; const u8 *text3; - + if (d) sub_80BE8DC(gText_PokedexRegistration, GetStringCenterAlignXOffset(1, gText_PokedexRegistration, 0xF0), 0); if (value == 0) @@ -4064,7 +4064,7 @@ void sub_80C0A88(u8 windowId, const u8 *str, u8 left, u8 top) color[0] = 0; color[1] = 15; color[2] = 3; - + AddTextPrinterParameterized2(windowId, 1, left, top, 0, 0, color, -1, str); } @@ -4107,7 +4107,7 @@ void sub_80C0BF0(u8 windowId, const u8* str, u8 left, u8 top) u8 str2[11]; u8 i; u8 count; - + for (i = 0; i < 11; i++) str2[i] = CHAR_SPACE; for (count = 0; str[count] != CHAR_SPACE && count < 11; count++) @@ -4232,12 +4232,12 @@ u32 sub_80C0E68(u16 a) u16 sub_80C0E9C(u16 num, s16 x, s16 y, u16 paletteSlot) { num = NationalPokedexNumToSpecies(num); - return sub_818D7D8(num, 8, sub_80C0E68(num), TRUE, x, y, paletteSlot, 0xFFFF); + return CreateMonPicSprite_HandleDeoxys(num, 8, sub_80C0E68(num), TRUE, x, y, paletteSlot, 0xFFFF); } u16 sub_80C0EF8(u16 species, s16 x, s16 y, s8 paletteSlot) { - return sub_818D8AC(species, TRUE, x, y, paletteSlot, 0xFFFF); + return CreateTrainerPicSprite(species, TRUE, x, y, paletteSlot, 0xFFFF); } int sub_80C0F30(u8 dexMode, u8 sortMode, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2) @@ -4364,7 +4364,7 @@ u8 sub_80C1258(void) void sub_80C1270(const u8 *str, u32 left, u32 top) { u8 color[3]; - + color[0] = 0; color[1] = 15; color[2] = 2; @@ -4397,8 +4397,8 @@ void sub_80C12E0(u8 taskId) InitWindows(gUnknown_0856F008); DeactivateAllTextPrinters(); PutWindowTilemap(0); - copy_decompressed_tile_data_to_vram_autofree(3, gPokedexSearchMenu_Gfx, 0x2000, 0, 0); - + DecompressAndLoadBgGfxUsingHeap(3, gPokedexSearchMenu_Gfx, 0x2000, 0, 0); + if (!IsNationalPokedexEnabled()) CopyToBgTilemapBuffer(3, gPokedexSearch2_Tilemap, 0, 0); else @@ -4450,7 +4450,7 @@ void sub_80C12E0(u8 taskId) void sub_80C152C(void) { void* tilemapBuffer; - + FreeAllWindowBuffers(); tilemapBuffer = GetBgTilemapBuffer(0); if (tilemapBuffer) @@ -4992,12 +4992,12 @@ void sub_80C2064(u8 a, u8 b) void sub_80C20F8(u8 taskId) { u16 var; - + sub_80C12B0(0x28, 0x10, 0x60, 0x50); var = gTasks[taskId].data[6] + gTasks[taskId].data[7]; sub_80C1270(gUnknown_0856EE5C[var].text2, 0x2D, 0x11); - + var = gTasks[taskId].data[8] + gTasks[taskId].data[9]; sub_80C1270(gUnknown_0856EEB4[var].text2, 0x2D, 0x21); diff --git a/src/pokemon.c b/src/pokemon.c index 3aa88e991..292254985 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -13,6 +13,7 @@ #include "constants/hold_effects.h" #include "constants/battle_move_effects.h" #include "constants/songs.h" +#include "constants/battle_frontier.h" #include "string_util.h" #include "text.h" #include "link.h" @@ -80,8 +81,7 @@ extern void set_unknown_box_id(u8); extern void sub_803FA70(u8 battlerId); extern u8 sav1_map_get_name(void); extern const u8 *sub_81A1650(u8, u8 language); -extern u8 BattleFrontierGetOpponentLvl(u8); -extern u16 FacilityClassToPicIndex(u16); +extern u8 GetFrontierEnemyMonLevel(u8); extern bool8 InBattlePyramid(void); extern bool8 InBattlePike(void); extern bool8 sub_806F104(void); @@ -955,7 +955,7 @@ const u16 gHoennToNationalOrder[] = // Assigns Hoenn Dex Pokémon (Using Nationa NATIONAL_DEX_BLAZIKEN, // HOENN_DEX_BLAZIKEN NATIONAL_DEX_MUDKIP, // HOENN_DEX_MUDKIP NATIONAL_DEX_MARSHTOMP, // HOENN_DEX_MARSHTOMP - NATIONAL_DEX_SWAMPERT, // HOENN_DEX_SWAMPERT + NATIONAL_DEX_SWAMPERT, // HOENN_DEX_SWAMPERT NATIONAL_DEX_POOCHYENA, // HOENN_DEX_POOCHYENA NATIONAL_DEX_MIGHTYENA, // HOENN_DEX_MIGHTYENA NATIONAL_DEX_ZIGZAGOON, // HOENN_DEX_ZIGZAGOON @@ -2819,8 +2819,8 @@ void sub_8068338(struct Pokemon *mon, struct UnknownPokemonStruct *src, bool8 lv u8 language; u8 value; - if (gSaveBlock2Ptr->frontier.chosenLvl != 0) - level = BattleFrontierGetOpponentLvl(gSaveBlock2Ptr->frontier.chosenLvl); + if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) + level = GetFrontierEnemyMonLevel(gSaveBlock2Ptr->frontier.lvlMode); else if (lvl50) level = 50; else @@ -2884,7 +2884,7 @@ void sub_8068528(struct Pokemon *mon, const struct UnknownPokemonStruct2 *src, u CreateMon(mon, src->mons[monId].species, - BattleFrontierGetOpponentLvl(src->field_0_1 - 1), + GetFrontierEnemyMonLevel(src->field_0_1 - 1), 0x1F, TRUE, personality, @@ -4112,7 +4112,7 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) { retVal = 0; - while (retVal < OT_NAME_LENGTH) + while (retVal < PLAYER_NAME_LENGTH) { data[retVal] = boxMon->otName[retVal]; retVal++; @@ -4480,7 +4480,7 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg) case MON_DATA_OT_NAME: { s32 i; - for (i = 0; i < OT_NAME_LENGTH; i++) + for (i = 0; i < PLAYER_NAME_LENGTH; i++) boxMon->otName[i] = data[i]; break; } @@ -6778,7 +6778,7 @@ s8 GetFlavorRelationByPersonality(u32 personality, u8 flavor) bool8 IsTradedMon(struct Pokemon *mon) { - u8 otName[OT_NAME_LENGTH + 1]; + u8 otName[PLAYER_NAME_LENGTH + 1]; u32 otId; GetMonData(mon, MON_DATA_OT_NAME, otName); otId = GetMonData(mon, MON_DATA_OT_ID, 0); @@ -7118,9 +7118,9 @@ u16 FacilityClassToPicIndex(u16 facilityClass) u16 PlayerGenderToFrontTrainerPicId(u8 playerGender) { if (playerGender != MALE) - return FacilityClassToPicIndex(FACILITY_CLASS_PKMN_TRAINER_BRENDAN); - else return FacilityClassToPicIndex(FACILITY_CLASS_PKMN_TRAINER_MAY); + else + return FacilityClassToPicIndex(FACILITY_CLASS_PKMN_TRAINER_BRENDAN); } void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality) diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index c50aa4a75..9c307f7f8 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -938,14 +938,14 @@ void StartMonSummaryAnimation(struct Sprite *sprite, u8 frontAnimId) void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet) { - u8 nature, taskId, animId, bank; + u8 nature, taskId, animId, battlerId; taskId = CreateTask(Task_HandleMonAnimation, 128); gTasks[taskId].tPtrLO = (u32)(sprite) >> 0x10; gTasks[taskId].tPtrHI = (u32)(sprite); - bank = sprite->data[0]; - nature = GetNature(&gPlayerParty[gBattlerPartyIndexes[bank]]); + battlerId = sprite->data[0]; + nature = GetNature(&gPlayerParty[gBattlerPartyIndexes[battlerId]]); animId = 3 * backAnimSet + sBackAnimNatureModTable[nature]; gTasks[taskId].tAnimId = sBackAnimationIds[animId]; diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 1afbaab7a..6b51c6e07 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -172,7 +172,7 @@ static void sub_81C2074(u16 a, s16 b); static void sub_81C20F0(u8 taskId); static void sub_81C2194(u16 *a, u16 b, u8 c); static void sub_81C2228(struct Pokemon* mon); -static void sub_81C22CC(struct Pokemon* mon); +static void DrawExperienceProgressBar(struct Pokemon* mon); static void sub_81C240C(u16 a); static void sub_81C2524(void); static void sub_81C2554(void); @@ -313,48 +313,304 @@ static const struct UnkStruct_61CC04 gUnknown_0861CC10 = static const s8 gUnknown_0861CC1C[] = {0, 2, 3, 1, 4, 5}; static const struct WindowTemplate gUnknown_0861CC24[] = { - { 0x00, 0x00, 0x00, 0x0b, 0x02, 0x06, 0x0001 }, - { 0x00, 0x00, 0x00, 0x0b, 0x02, 0x06, 0x0017 }, - { 0x00, 0x00, 0x00, 0x0b, 0x02, 0x06, 0x002d }, - { 0x00, 0x00, 0x00, 0x0b, 0x02, 0x06, 0x0043 }, - { 0x00, 0x16, 0x00, 0x08, 0x02, 0x07, 0x0059 }, - { 0x00, 0x16, 0x00, 0x08, 0x02, 0x07, 0x0069 }, - { 0x00, 0x16, 0x00, 0x08, 0x02, 0x07, 0x0079 }, - { 0x00, 0x0b, 0x04, 0x00, 0x02, 0x06, 0x0089 }, - { 0x00, 0x0b, 0x04, 0x12, 0x02, 0x06, 0x0089 }, - { 0x00, 0x0b, 0x06, 0x12, 0x02, 0x06, 0x00ad }, - { 0x00, 0x0a, 0x07, 0x06, 0x06, 0x06, 0x00d1 }, - { 0x00, 0x16, 0x07, 0x05, 0x06, 0x06, 0x00f5 }, - { 0x00, 0x0a, 0x0e, 0x0b, 0x04, 0x06, 0x0113 }, - { 0x00, 0x00, 0x12, 0x06, 0x02, 0x06, 0x013f }, - { 0x00, 0x01, 0x0f, 0x09, 0x04, 0x06, 0x014b }, - { 0x00, 0x01, 0x0f, 0x05, 0x04, 0x06, 0x016f }, - { 0x00, 0x16, 0x04, 0x00, 0x02, 0x06, 0x0183 }, - { 0x00, 0x01, 0x02, 0x04, 0x02, 0x07, 0x0183 }, - { 0x00, 0x01, 0x0c, 0x09, 0x02, 0x06, 0x018b }, - { 0x00, 0x01, 0x0e, 0x09, 0x04, 0x06, 0x019d }, + { + .priority = 0, + .tilemapLeft = 0, + .tilemapTop = 0, + .width = 11, + .height = 2, + .paletteNum = 6, + .baseBlock = 1, + }, + { + .priority = 0, + .tilemapLeft = 0, + .tilemapTop = 0, + .width = 11, + .height = 2, + .paletteNum = 6, + .baseBlock = 23, + }, + { + .priority = 0, + .tilemapLeft = 0, + .tilemapTop = 0, + .width = 11, + .height = 2, + .paletteNum = 6, + .baseBlock = 45, + }, + { + .priority = 0, + .tilemapLeft = 0, + .tilemapTop = 0, + .width = 11, + .height = 2, + .paletteNum = 6, + .baseBlock = 67, + }, + { + .priority = 0, + .tilemapLeft = 22, + .tilemapTop = 0, + .width = 8, + .height = 2, + .paletteNum = 7, + .baseBlock = 89, + }, + { + .priority = 0, + .tilemapLeft = 22, + .tilemapTop = 0, + .width = 8, + .height = 2, + .paletteNum = 7, + .baseBlock = 105, + }, + { + .priority = 0, + .tilemapLeft = 22, + .tilemapTop = 0, + .width = 8, + .height = 2, + .paletteNum = 7, + .baseBlock = 121, + }, + { + .priority = 0, + .tilemapLeft = 11, + .tilemapTop = 4, + .width = 0, + .height = 2, + .paletteNum = 6, + .baseBlock = 137, + }, + { + .priority = 0, + .tilemapLeft = 11, + .tilemapTop = 4, + .width = 18, + .height = 2, + .paletteNum = 6, + .baseBlock = 137, + }, + { + .priority = 0, + .tilemapLeft = 11, + .tilemapTop = 6, + .width = 18, + .height = 2, + .paletteNum = 6, + .baseBlock = 173, + }, + { + .priority = 0, + .tilemapLeft = 10, + .tilemapTop = 7, + .width = 6, + .height = 6, + .paletteNum = 6, + .baseBlock = 209, + }, + { + .priority = 0, + .tilemapLeft = 22, + .tilemapTop = 7, + .width = 5, + .height = 6, + .paletteNum = 6, + .baseBlock = 245, + }, + { + .priority = 0, + .tilemapLeft = 10, + .tilemapTop = 14, + .width = 11, + .height = 4, + .paletteNum = 6, + .baseBlock = 275, + }, + { + .priority = 0, + .tilemapLeft = 0, + .tilemapTop = 18, + .width = 6, + .height = 2, + .paletteNum = 6, + .baseBlock = 319, + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 15, + .width = 9, + .height = 4, + .paletteNum = 6, + .baseBlock = 331, + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 15, + .width = 5, + .height = 4, + .paletteNum = 6, + .baseBlock = 367, + }, + { + .priority = 0, + .tilemapLeft = 22, + .tilemapTop = 4, + .width = 0, + .height = 2, + .paletteNum = 6, + .baseBlock = 387, + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 2, + .width = 4, + .height = 2, + .paletteNum = 7, + .baseBlock = 387, + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 12, + .width = 9, + .height = 2, + .paletteNum = 6, + .baseBlock = 395, + }, + { + .priority = 0, + .tilemapLeft = 1, + .tilemapTop = 14, + .width = 9, + .height = 4, + .paletteNum = 6, + .baseBlock = 413, + }, DUMMY_WIN_TEMPLATE }; static const struct WindowTemplate gUnknown_0861CCCC[] = { - { 0x00, 0x0b, 0x04, 0x0b, 0x02, 0x06, 0x01c1 }, - { 0x00, 0x16, 0x04, 0x07, 0x02, 0x06, 0x01d7 }, - { 0x00, 0x0b, 0x09, 0x12, 0x04, 0x06, 0x01e5 }, - { 0x00, 0x0b, 0x0e, 0x12, 0x06, 0x06, 0x022d }, + { + .priority = 0, + .tilemapLeft = 11, + .tilemapTop = 4, + .width = 11, + .height = 2, + .paletteNum = 6, + .baseBlock = 449, + }, + { + .priority = 0, + .tilemapLeft = 22, + .tilemapTop = 4, + .width = 7, + .height = 2, + .paletteNum = 6, + .baseBlock = 471, + }, + { + .priority = 0, + .tilemapLeft = 11, + .tilemapTop = 9, + .width = 18, + .height = 4, + .paletteNum = 6, + .baseBlock = 485, + }, + { + .priority = 0, + .tilemapLeft = 11, + .tilemapTop = 14, + .width = 18, + .height = 6, + .paletteNum = 6, + .baseBlock = 557, + }, }; static const struct WindowTemplate gUnknown_0861CCEC[] = { - { 0x00, 0x0a, 0x04, 0x0a, 0x02, 0x06, 0x01c1 }, - { 0x00, 0x14, 0x04, 0x0a, 0x02, 0x06, 0x01d5 }, - { 0x00, 0x10, 0x07, 0x06, 0x06, 0x06, 0x01e9 }, - { 0x00, 0x1b, 0x07, 0x03, 0x06, 0x06, 0x020d }, - { 0x00, 0x18, 0x0e, 0x06, 0x04, 0x06, 0x021f }, + { + .priority = 0, + .tilemapLeft = 10, + .tilemapTop = 4, + .width = 10, + .height = 2, + .paletteNum = 6, + .baseBlock = 449, + }, + { + .priority = 0, + .tilemapLeft = 20, + .tilemapTop = 4, + .width = 10, + .height = 2, + .paletteNum = 6, + .baseBlock = 469, + }, + { + .priority = 0, + .tilemapLeft = 16, + .tilemapTop = 7, + .width = 6, + .height = 6, + .paletteNum = 6, + .baseBlock = 489, + }, + { + .priority = 0, + .tilemapLeft = 27, + .tilemapTop = 7, + .width = 3, + .height = 6, + .paletteNum = 6, + .baseBlock = 525, + }, + { + .priority = 0, + .tilemapLeft = 24, + .tilemapTop = 14, + .width = 6, + .height = 4, + .paletteNum = 6, + .baseBlock = 543, + }, }; static const struct WindowTemplate gUnknown_0861CD14[] = { - { 0x00, 0x0f, 0x04, 0x09, 0x0a, 0x06, 0x01c1 }, - { 0x00, 0x18, 0x04, 0x06, 0x0a, 0x08, 0x021b }, - { 0x00, 0x0a, 0x0f, 0x14, 0x04, 0x06, 0x0257 }, + { + .priority = 0, + .tilemapLeft = 15, + .tilemapTop = 4, + .width = 9, + .height = 10, + .paletteNum = 6, + .baseBlock = 449, + }, + { + .priority = 0, + .tilemapLeft = 24, + .tilemapTop = 4, + .width = 6, + .height = 10, + .paletteNum = 8, + .baseBlock = 539, + }, + { + .priority = 0, + .tilemapLeft = 10, + .tilemapTop = 15, + .width = 20, + .height = 4, + .paletteNum = 6, + .baseBlock = 599, + }, }; static const u8 sTextColors_861CD2C[][3] = { @@ -393,7 +649,10 @@ static const u8 gUnknown_0861CE7B[] = _("{COLOR WHITE}{SHADOW DARK_GREY}"); static const u8 gUnknown_0861CE82[] = _("{SPECIAL_F7 0x00}/{SPECIAL_F7 0x01}\n{SPECIAL_F7 0x02}\n{SPECIAL_F7 0x03}"); static const u8 gUnknown_0861CE8E[] = _("{SPECIAL_F7 0x00}\n{SPECIAL_F7 0x01}\n{SPECIAL_F7 0x02}"); static const u8 gUnknown_0861CE97[] = _("{PP}{SPECIAL_F7 0x00}/{SPECIAL_F7 0x01}"); -static const struct OamData gOamData_861CEA0 = + +#define TAG_MOVE_TYPES 30002 + +static const struct OamData sOamData_MoveTypes = { .y = 0, .affineMode = 0, @@ -409,140 +668,166 @@ static const struct OamData gOamData_861CEA0 = .paletteNum = 0, .affineParam = 0, }; -static const union AnimCmd gSpriteAnim_861CEA8[] = { - ANIMCMD_FRAME(0, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeNormal[] = { + ANIMCMD_FRAME(TYPE_NORMAL * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CEB0[] = { - ANIMCMD_FRAME(8, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeFighting[] = { + ANIMCMD_FRAME(TYPE_FIGHTING * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CEB8[] = { - ANIMCMD_FRAME(16, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeFlying[] = { + ANIMCMD_FRAME(TYPE_FLYING * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CEC0[] = { - ANIMCMD_FRAME(24, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypePoison[] = { + ANIMCMD_FRAME(TYPE_POISON * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CEC8[] = { - ANIMCMD_FRAME(32, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeGround[] = { + ANIMCMD_FRAME(TYPE_GROUND * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CED0[] = { - ANIMCMD_FRAME(40, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeRock[] = { + ANIMCMD_FRAME(TYPE_ROCK * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CED8[] = { - ANIMCMD_FRAME(48, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeBug[] = { + ANIMCMD_FRAME(TYPE_BUG * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CEE0[] = { - ANIMCMD_FRAME(56, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeGhost[] = { + ANIMCMD_FRAME(TYPE_GHOST * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CEE8[] = { - ANIMCMD_FRAME(64, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeSteel[] = { + ANIMCMD_FRAME(TYPE_STEEL * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CEF0[] = { - ANIMCMD_FRAME(72, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeMystery[] = { + ANIMCMD_FRAME(TYPE_MYSTERY * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CEF8[] = { - ANIMCMD_FRAME(80, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeFire[] = { + ANIMCMD_FRAME(TYPE_FIRE * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CF00[] = { - ANIMCMD_FRAME(88, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeWater[] = { + ANIMCMD_FRAME(TYPE_WATER * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CF08[] = { - ANIMCMD_FRAME(96, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeGrass[] = { + ANIMCMD_FRAME(TYPE_GRASS * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CF10[] = { - ANIMCMD_FRAME(104, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeElectric[] = { + ANIMCMD_FRAME(TYPE_ELECTRIC * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CF18[] = { - ANIMCMD_FRAME(112, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypePsychic[] = { + ANIMCMD_FRAME(TYPE_PSYCHIC * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CF20[] = { - ANIMCMD_FRAME(120, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeIce[] = { + ANIMCMD_FRAME(TYPE_ICE * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CF28[] = { - ANIMCMD_FRAME(128, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeDragon[] = { + ANIMCMD_FRAME(TYPE_DRAGON * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CF30[] = { - ANIMCMD_FRAME(136, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_TypeDark[] = { + ANIMCMD_FRAME(TYPE_DARK * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CF38[] = { - ANIMCMD_FRAME(144, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_CategoryCool[] = { + ANIMCMD_FRAME((CONTEST_CATEGORY_COOL + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CF40[] = { - ANIMCMD_FRAME(152, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_CategoryBeauty[] = { + ANIMCMD_FRAME((CONTEST_CATEGORY_BEAUTY + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CF48[] = { - ANIMCMD_FRAME(160, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_CategoryCute[] = { + ANIMCMD_FRAME((CONTEST_CATEGORY_CUTE + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CF50[] = { - ANIMCMD_FRAME(168, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_CategorySmart[] = { + ANIMCMD_FRAME((CONTEST_CATEGORY_SMART + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861CF58[] = { - ANIMCMD_FRAME(176, 0, FALSE, FALSE), +static const union AnimCmd sSpriteAnim_CategoryTough[] = { + ANIMCMD_FRAME((CONTEST_CATEGORY_TOUGH + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd *const gSpriteAnimTable_861CF60[] = { - gSpriteAnim_861CEA8, - gSpriteAnim_861CEB0, - gSpriteAnim_861CEB8, - gSpriteAnim_861CEC0, - gSpriteAnim_861CEC8, - gSpriteAnim_861CED0, - gSpriteAnim_861CED8, - gSpriteAnim_861CEE0, - gSpriteAnim_861CEE8, - gSpriteAnim_861CEF0, - gSpriteAnim_861CEF8, - gSpriteAnim_861CF00, - gSpriteAnim_861CF08, - gSpriteAnim_861CF10, - gSpriteAnim_861CF18, - gSpriteAnim_861CF20, - gSpriteAnim_861CF28, - gSpriteAnim_861CF30, - gSpriteAnim_861CF38, - gSpriteAnim_861CF40, - gSpriteAnim_861CF48, - gSpriteAnim_861CF50, - gSpriteAnim_861CF58, -}; -static const struct CompressedSpriteSheet gUnknown_0861CFBC = +static const union AnimCmd *const sSpriteAnimTable_MoveTypes[NUMBER_OF_MON_TYPES + CONTEST_CATEGORIES_COUNT] = { + sSpriteAnim_TypeNormal, + sSpriteAnim_TypeFighting, + sSpriteAnim_TypeFlying, + sSpriteAnim_TypePoison, + sSpriteAnim_TypeGround, + sSpriteAnim_TypeRock, + sSpriteAnim_TypeBug, + sSpriteAnim_TypeGhost, + sSpriteAnim_TypeSteel, + sSpriteAnim_TypeMystery, + sSpriteAnim_TypeFire, + sSpriteAnim_TypeWater, + sSpriteAnim_TypeGrass, + sSpriteAnim_TypeElectric, + sSpriteAnim_TypePsychic, + sSpriteAnim_TypeIce, + sSpriteAnim_TypeDragon, + sSpriteAnim_TypeDark, + sSpriteAnim_CategoryCool, + sSpriteAnim_CategoryBeauty, + sSpriteAnim_CategoryCute, + sSpriteAnim_CategorySmart, + sSpriteAnim_CategoryTough, +}; + +static const struct CompressedSpriteSheet sSpriteSheet_MoveTypes = { .data = gMoveTypes_Gfx, - .size = 0x1700, - .tag = 30002 + .size = (NUMBER_OF_MON_TYPES + CONTEST_CATEGORIES_COUNT) * 0x100, + .tag = TAG_MOVE_TYPES }; -static const struct SpriteTemplate gUnknown_0861CFC4 = +static const struct SpriteTemplate sSpriteTemplate_MoveTypes = { - .tileTag = 30002, - .paletteTag = 30002, - .oam = &gOamData_861CEA0, - .anims = gSpriteAnimTable_861CF60, + .tileTag = TAG_MOVE_TYPES, + .paletteTag = TAG_MOVE_TYPES, + .oam = &sOamData_MoveTypes, + .anims = sSpriteAnimTable_MoveTypes, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy }; -static const u8 gUnknown_0861CFDC[] = {13, 13, 14, 14, 13, 13, 15, 14, 13, 15, 13, 14, 15, 13, 14, 14, 15, 13, 13, 14, 14, 15, 13}; +static const u8 sMoveTypeToOamPaletteNum[NUMBER_OF_MON_TYPES + CONTEST_CATEGORIES_COUNT] = +{ + [TYPE_NORMAL] = 13, + [TYPE_FIGHTING] = 13, + [TYPE_FLYING] = 14, + [TYPE_POISON] = 14, + [TYPE_GROUND] = 13, + [TYPE_ROCK] = 13, + [TYPE_BUG] = 15, + [TYPE_GHOST] = 14, + [TYPE_STEEL] = 13, + [TYPE_MYSTERY] = 15, + [TYPE_FIRE] = 13, + [TYPE_WATER] = 14, + [TYPE_GRASS] = 15, + [TYPE_ELECTRIC] = 13, + [TYPE_PSYCHIC] = 14, + [TYPE_ICE] = 14, + [TYPE_DRAGON] = 15, + [TYPE_DARK] = 13, + [NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_COOL] = 13, + [NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_BEAUTY] = 14, + [NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_CUTE] = 14, + [NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_SMART] = 15, + [NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_TOUGH] = 13, +}; static const struct OamData gOamData_861CFF4 = { .y = 0, @@ -632,7 +917,7 @@ static const struct SpriteTemplate gUnknown_0861D084 = .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy }; -static const struct OamData gOamData_861D09C = +static const struct OamData sOamData_StatusCondition = { .y = 0, .affineMode = 0, @@ -648,42 +933,42 @@ static const struct OamData gOamData_861D09C = .paletteNum = 0, .affineParam = 0, }; -static const union AnimCmd gSpriteAnim_861D0A4[] = { +static const union AnimCmd sSpriteAnim_StatusPoison[] = { ANIMCMD_FRAME(0, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861D0AC[] = { +static const union AnimCmd sSpriteAnim_StatusParalyzed[] = { ANIMCMD_FRAME(4, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861D0B4[] = { +static const union AnimCmd sSpriteAnim_StatusSleep[] = { ANIMCMD_FRAME(8, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861D0BC[] = { +static const union AnimCmd sSpriteAnim_StatusFrozen[] = { ANIMCMD_FRAME(12, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861D0C4[] = { +static const union AnimCmd sSpriteAnim_StatusBurn[] = { ANIMCMD_FRAME(16, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861D0CC[] = { +static const union AnimCmd sSpriteAnim_StatusPokerus[] = { ANIMCMD_FRAME(20, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_861D0D4[] = { +static const union AnimCmd sSpriteAnim_StatusFaint[] = { ANIMCMD_FRAME(24, 0, FALSE, FALSE), ANIMCMD_END }; -static const union AnimCmd *const gSpriteAnimTable_861D0DC[] = { - gSpriteAnim_861D0A4, - gSpriteAnim_861D0AC, - gSpriteAnim_861D0B4, - gSpriteAnim_861D0BC, - gSpriteAnim_861D0C4, - gSpriteAnim_861D0CC, - gSpriteAnim_861D0D4, +static const union AnimCmd *const sSpriteAnimTable_StatusCondition[] = { + sSpriteAnim_StatusPoison, + sSpriteAnim_StatusParalyzed, + sSpriteAnim_StatusSleep, + sSpriteAnim_StatusFrozen, + sSpriteAnim_StatusBurn, + sSpriteAnim_StatusPokerus, + sSpriteAnim_StatusFaint, }; static const struct CompressedSpriteSheet gUnknown_0861D0F8 = { @@ -696,12 +981,12 @@ static const struct CompressedSpritePalette gUnknown_0861D100 = .data = gStatusPal_Icons, .tag = 30001 }; -static const struct SpriteTemplate gUnknown_0861D108 = +static const struct SpriteTemplate sSpriteTemplate_StatusCondition = { .tileTag = 30001, .paletteTag = 30001, - .oam = &gOamData_861D09C, - .anims = gSpriteAnimTable_861D0DC, + .oam = &sOamData_StatusCondition, + .anims = sSpriteAnimTable_StatusCondition, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy @@ -968,7 +1253,7 @@ static bool8 SummaryScreen_DecompressGraphics(void) pssData->unk40F0++; break; case 7: - LoadCompressedObjectPic(&gUnknown_0861CFBC); + LoadCompressedObjectPic(&sSpriteSheet_MoveTypes); pssData->unk40F0++; break; case 8: @@ -1492,7 +1777,7 @@ static void sub_81C0D44(u8 taskId) static void sub_81C0E24(void) { if (pssData->currPageIndex == 1) - sub_81C22CC(&pssData->currentMon); + DrawExperienceProgressBar(&pssData->currentMon); } static void sub_81C0E48(u8 taskId) @@ -2241,37 +2526,40 @@ static void sub_81C228C(bool8 isMonShiny) schedule_bg_copy_tilemap_to_vram(3); } -static void sub_81C22CC(struct Pokemon *unused) +static void DrawExperienceProgressBar(struct Pokemon *unused) { - s64 r6r7; + s64 numExpProgressBarTicks; struct PokeSummary *summary = &pssData->summary; u16 *r9; u8 i; if (summary->level < MAX_MON_LEVEL) { - u32 r1 = gExperienceTables[gBaseStats[summary->species].growthRate][summary->level + 1] - gExperienceTables[gBaseStats[summary->species].growthRate][summary->level]; - u32 r4 = summary->exp - gExperienceTables[gBaseStats[summary->species].growthRate][summary->level]; + u32 expBetweenLevels = gExperienceTables[gBaseStats[summary->species].growthRate][summary->level + 1] - gExperienceTables[gBaseStats[summary->species].growthRate][summary->level]; + u32 expSinceLastLevel = summary->exp - gExperienceTables[gBaseStats[summary->species].growthRate][summary->level]; - r6r7 = r4 * 64 / r1; - if (r6r7 == 0 && r4 != 0) - r6r7 = 1; + // Calculate the number of 1-pixel "ticks" to illuminate in the experience progress bar. + // There are 8 tiles that make up the bar, and each tile has 8 "ticks". Hence, the numerator + // is multiplied by 64. + numExpProgressBarTicks = expSinceLastLevel * 64 / expBetweenLevels; + if (numExpProgressBarTicks == 0 && expSinceLastLevel != 0) + numExpProgressBarTicks = 1; } else { - r6r7 = 0; + numExpProgressBarTicks = 0; } r9 = &pssData->bgTilemapBuffers[PSS_PAGE_SKILLS][1][0x255]; for (i = 0; i < 8; i++) { - if (r6r7 > 7) + if (numExpProgressBarTicks > 7) r9[i] = 0x206A; else - r9[i] = 0x2062 + (r6r7 % 8); - r6r7 -= 8; - if (r6r7 < 0) - r6r7 = 0; + r9[i] = 0x2062 + (numExpProgressBarTicks % 8); + numExpProgressBarTicks -= 8; + if (numExpProgressBarTicks < 0) + numExpProgressBarTicks = 0; } if (GetBgTilemapBuffer(1) == pssData->bgTilemapBuffers[PSS_PAGE_SKILLS][0]) @@ -3415,7 +3703,7 @@ static void sub_81C42C8(void) for (i = 3; i < 8; i++) { if (pssData->spriteIds[i] == 0xFF) - pssData->spriteIds[i] = CreateSprite(&gUnknown_0861CFC4, 0, 0, 2); + pssData->spriteIds[i] = CreateSprite(&sSpriteTemplate_MoveTypes, 0, 0, 2); sub_81C4204(i, TRUE); } @@ -3425,7 +3713,7 @@ static void SetMoveTypeSpritePosAndType(u8 typeId, u8 x, u8 y, u8 spriteArrayId) { struct Sprite *sprite = &gSprites[pssData->spriteIds[spriteArrayId]]; StartSpriteAnim(sprite, typeId); - sprite->oam.paletteNum = gUnknown_0861CFDC[typeId]; + sprite->oam.paletteNum = sMoveTypeToOamPaletteNum[typeId]; sprite->pos1.x = x + 16; sprite->pos1.y = y + 8; sub_81C4204(spriteArrayId, FALSE); @@ -3706,7 +3994,7 @@ static void CreateSetStatusSprite(void) if (*spriteId == 0xFF) { - *spriteId = CreateSprite(&gUnknown_0861D108, 64, 152, 0); + *spriteId = CreateSprite(&sSpriteTemplate_StatusCondition, 64, 152, 0); } anim = sub_81B205C(&pssData->currentMon); diff --git a/src/record_mixing.c b/src/record_mixing.c index 8b21e214f..552c32d38 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -1635,8 +1635,8 @@ void sub_80E8260(struct UnkRecordMixingStruct2 *dst) dst->field_0[0][i].field_4 = gSaveBlock2Ptr->frontier.field_CF0[i]; dst->field_0[1][i].field_4 = gSaveBlock2Ptr->frontier.field_CF4[i]; dst->field_0[2][i].field_4 = gSaveBlock2Ptr->frontier.field_CF8[i]; - dst->field_0[3][i].field_4 = gSaveBlock2Ptr->frontier.field_D14[i]; - dst->field_0[4][i].field_4 = gSaveBlock2Ptr->frontier.field_DD0[i]; + dst->field_0[3][i].field_4 = gSaveBlock2Ptr->frontier.field_D14[0][i]; + dst->field_0[4][i].field_4 = gSaveBlock2Ptr->frontier.field_DD0[0][i]; dst->field_0[5][i].field_4 = gSaveBlock2Ptr->frontier.field_DDE[i]; dst->field_0[6][i].field_4 = gSaveBlock2Ptr->frontier.field_DEA[i]; dst->field_0[7][i].field_4 = gSaveBlock2Ptr->frontier.field_E08[i]; diff --git a/src/recorded_battle.c b/src/recorded_battle.c index 45b07ca7a..fc3b8b94a 100644 --- a/src/recorded_battle.c +++ b/src/recorded_battle.c @@ -28,7 +28,7 @@ extern u8 gUnknown_03001279; struct PlayerInfo { u32 trainerId; - u8 name[PLAYER_NAME_LENGTH]; + u8 name[PLAYER_NAME_LENGTH + 1]; u8 gender; u16 battlerId; u16 language; @@ -44,7 +44,7 @@ struct RecordedBattleSave { struct Pokemon playerParty[PARTY_SIZE]; struct Pokemon opponentParty[PARTY_SIZE]; - u8 playersName[MAX_BATTLERS_COUNT][PLAYER_NAME_LENGTH]; + u8 playersName[MAX_BATTLERS_COUNT][PLAYER_NAME_LENGTH + 1]; u8 playersGender[MAX_BATTLERS_COUNT]; u32 playersTrainerId[MAX_BATTLERS_COUNT]; u8 playersLanguage[MAX_BATTLERS_COUNT]; @@ -170,7 +170,7 @@ void sub_8184E58(void) } else { - for (j = 0; j < PLAYER_NAME_LENGTH; j++) + for (j = 0; j < PLAYER_NAME_LENGTH + 1; j++) sPlayers[i].name[j] = gLinkPlayers[i].name[j]; } } @@ -186,7 +186,7 @@ void sub_8184E58(void) sPlayers[0].battlerId = 0; sPlayers[0].language = gGameLanguage; - for (i = 0; i < PLAYER_NAME_LENGTH; i++) + for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++) sPlayers[0].name[i] = gSaveBlock2Ptr->playerName[i]; } } @@ -343,7 +343,7 @@ u32 MoveRecordedBattleToSaveData(void) for (i = 0; i < MAX_BATTLERS_COUNT; i++) { - for (j = 0; j < PLAYER_NAME_LENGTH; j++) + for (j = 0; j < PLAYER_NAME_LENGTH + 1; j++) { battleSave->playersName[i][j] = sPlayers[i].name[j]; } @@ -1293,7 +1293,7 @@ static bool32 AllocTryCopyRecordedBattleSaveData(struct RecordedBattleSave *dst) static void CB2_RecordedBattleEnd(void) { - gSaveBlock2Ptr->frontier.chosenLvl = sUnknown_0203C7AD; + gSaveBlock2Ptr->frontier.lvlMode = sUnknown_0203C7AD; gBattleOutcome = 0; gBattleTypeFlags = 0; gTrainerBattleOpponent_A = 0; @@ -1332,7 +1332,7 @@ static void SetRecordedBattleVarsFromSave(struct RecordedBattleSave *src) for (i = 0; i < MAX_BATTLERS_COUNT; i++) { - for (var = FALSE, j = 0; j < PLAYER_NAME_LENGTH; j++) + for (var = FALSE, j = 0; j < PLAYER_NAME_LENGTH + 1; j++) { gLinkPlayers[i].name[j] = src->playersName[i][j]; if (src->playersName[i][j] == EOS) @@ -1353,7 +1353,7 @@ static void SetRecordedBattleVarsFromSave(struct RecordedBattleSave *src) gTrainerBattleOpponent_B = src->opponentB; gPartnerTrainerId = src->partnerId; gUnknown_0203C7B4 = src->field_4FA; - sUnknown_0203C7AD = gSaveBlock2Ptr->frontier.chosenLvl; + sUnknown_0203C7AD = gSaveBlock2Ptr->frontier.lvlMode; sFrontierFacility = src->field_4FD; sUnknown_0203C7AF = src->field_4FE; sBattleStyle = src->battleStyle; @@ -1375,7 +1375,7 @@ static void SetRecordedBattleVarsFromSave(struct RecordedBattleSave *src) sUnknown_0203CCDC[i] = src->field_50E[i]; } - gSaveBlock2Ptr->frontier.chosenLvl = src->field_4FC; + gSaveBlock2Ptr->frontier.lvlMode = src->field_4FC; for (i = 0; i < MAX_BATTLERS_COUNT; i++) { diff --git a/src/rom_8011DC0.c b/src/rom_8011DC0.c index 55e3fe32b..56c31f89f 100644 --- a/src/rom_8011DC0.c +++ b/src/rom_8011DC0.c @@ -18,6 +18,7 @@ #include "constants/maps.h" #include "constants/species.h" #include "constants/rgb.h" +#include "constants/battle_frontier.h" #include "trade.h" #include "trainer_card.h" #include "overworld.h" @@ -39,7 +40,7 @@ struct UnkStruct_Shared { struct UnkLinkRfuStruct_02022B14 field_0; u8 needingPadding[3]; - u8 playerName[PLAYER_NAME_LENGTH]; + u8 playerName[PLAYER_NAME_LENGTH + 1]; }; struct UnkStruct_x1C @@ -468,7 +469,7 @@ void sub_8012780(u8 taskId) switch (data->state) { case 0: - if (gSpecialVar_0x8004 == 20 && gSaveBlock2Ptr->frontier.chosenLvl == 1) + if (gSpecialVar_0x8004 == 20 && gSaveBlock2Ptr->frontier.lvlMode == FRONTIER_LVL_OPEN) gSpecialVar_0x8004++; gUnknown_02022C2C = gUnknown_082F00C4[gSpecialVar_0x8004]; gUnknown_02022C2D = gUnknown_082F00C4[gSpecialVar_0x8004] >> 8; @@ -1050,7 +1051,7 @@ void sub_80134E8(u8 taskId) switch (data->state) { case 0: - if (gSpecialVar_0x8004 == 20 && gSaveBlock2Ptr->frontier.chosenLvl == 1) + if (gSpecialVar_0x8004 == 20 && gSaveBlock2Ptr->frontier.lvlMode == FRONTIER_LVL_OPEN) gSpecialVar_0x8004++; gUnknown_02022C2C = gUnknown_082F0530[gSpecialVar_0x8004]; sub_8010F84(gUnknown_02022C2C, 0, 0); @@ -1636,7 +1637,7 @@ void sub_8014290(u16 arg0, u16 x, u16 y) VarSet(VAR_0x4087, arg0); Overworld_SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, x, y); saved_warp2_set_2(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, x, y); - warp_in(); + WarpIntoMap(); } void sub_8014304(s8 mapGroup, s8 mapNum, s32 x, s32 y, u16 arg4) @@ -1647,7 +1648,7 @@ void sub_8014304(s8 mapGroup, s8 mapNum, s32 x, s32 y, u16 arg4) gUnknown_03005DB4 = GetMultiplayerId(); sub_809D2BC(); Overworld_SetWarpDestination(mapGroup, mapNum, -1, x, y); - warp_in(); + WarpIntoMap(); } void sub_8014384(void) diff --git a/src/safari_zone.c b/src/safari_zone.c index 01d72fa13..427a5ceb8 100644 --- a/src/safari_zone.c +++ b/src/safari_zone.c @@ -35,7 +35,7 @@ extern void CB2_ReturnToFieldContinueScriptPlayMapMusic(void); extern void CB2_LoadMap(void); extern void sub_80AF6F0(void); extern void ScriptContext1_Stop(void); -extern void warp_in(void); +extern void WarpIntoMap(void); extern void GetXYCoordsOneStepInFrontOfPlayer(s16* x, s16* y); extern void PlayerGetDestCoords(s16* x, s16* y); @@ -117,7 +117,7 @@ void CB2_EndSafariBattle(void) else if (gBattleOutcome == B_OUTCOME_NO_SAFARI_BALLS) { ScriptContext2_RunNewScript(EventScript_2A4B4C); - warp_in(); + WarpIntoMap(); gFieldCallback = sub_80AF6F0; SetMainCallback2(CB2_LoadMap); } diff --git a/src/scrcmd.c b/src/scrcmd.c index 01d04704a..31a4ed35a 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -750,7 +750,7 @@ bool8 ScrCmd_warp(struct ScriptContext *ctx) Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y); sub_80AF734(); - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); return TRUE; } @@ -764,7 +764,7 @@ bool8 ScrCmd_warpsilent(struct ScriptContext *ctx) Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y); sp13E_warp_to_last_warp(); - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); return TRUE; } @@ -778,7 +778,7 @@ bool8 ScrCmd_warpdoor(struct ScriptContext *ctx) Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y); sub_80AF7D0(); - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); return TRUE; } @@ -791,11 +791,11 @@ bool8 ScrCmd_warphole(struct ScriptContext *ctx) PlayerGetDestCoords(&x, &y); if (mapGroup == 0xFF && mapNum == 0xFF) - sub_8084EBC(x - 7, y - 7); + SetFixedHoleWarpAsDestination(x - 7, y - 7); else Overworld_SetWarpDestination(mapGroup, mapNum, -1, x - 7, y - 7); sp13F_fall_to_last_warp(); - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); return TRUE; } @@ -809,7 +809,7 @@ bool8 ScrCmd_warpteleport(struct ScriptContext *ctx) Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y); sub_80AF848(); - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); return TRUE; } @@ -823,7 +823,7 @@ bool8 ScrCmd_warpD7(struct ScriptContext *ctx) Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y); sub_80AF87C(); - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); return TRUE; } @@ -859,7 +859,7 @@ bool8 ScrCmd_setdivewarp(struct ScriptContext *ctx) u16 x = VarGet(ScriptReadHalfword(ctx)); u16 y = VarGet(ScriptReadHalfword(ctx)); - sub_8084E2C(mapGroup, mapNum, warpId, x, y); + SetFixedDiveWarp(mapGroup, mapNum, warpId, x, y); return FALSE; } @@ -871,7 +871,7 @@ bool8 ScrCmd_setholewarp(struct ScriptContext *ctx) u16 x = VarGet(ScriptReadHalfword(ctx)); u16 y = VarGet(ScriptReadHalfword(ctx)); - sub_8084E80(mapGroup, mapNum, warpId, x, y); + SetFixedHoleWarp(mapGroup, mapNum, warpId, x, y); return FALSE; } @@ -2240,7 +2240,7 @@ bool8 ScrCmd_warpD1(struct ScriptContext *ctx) Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y); sub_808D074(GetPlayerFacingDirection()); sub_80B0244(); - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); return TRUE; } @@ -2293,6 +2293,6 @@ bool8 ScrCmd_warpE0(struct ScriptContext *ctx) Overworld_SetWarpDestination(mapGroup, mapNum, warpId, x, y); sub_80AF79C(); - player_avatar_init_params_reset(); + ResetInitialPlayerAvatarState(); return TRUE; } diff --git a/src/secret_base.c b/src/secret_base.c index b75163200..7fae50a81 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -388,7 +388,7 @@ void sub_80E8FD0(u8 taskId) gSaveBlock1Ptr->secretBases[secretBaseRecordId].sbr_field_10 ++; } sub_80E8F9C(); - warp_in(); + WarpIntoMap(); gFieldCallback = sub_80AF168; SetMainCallback2(CB2_LoadMap); DestroyTask(taskId); @@ -446,7 +446,7 @@ void sub_80E916C(u8 taskId) { idx = sCurSecretBaseId / 10 * 4; Overworld_SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, gUnknown_0858CFE8[idx + 2], gUnknown_0858CFE8[idx + 3]); - warp_in(); + WarpIntoMap(); gFieldCallback = sub_80E9108; SetMainCallback2(CB2_LoadMap); DestroyTask(taskId); @@ -644,7 +644,7 @@ void sub_80E96A4(u8 taskId) break; case 2: copy_saved_warp2_bank_and_enter_x_to_warp1(0x7e); - warp_in(); + WarpIntoMap(); gFieldCallback = mapldr_default; SetMainCallback2(CB2_LoadMap); ScriptContext2_Disable(); @@ -1354,7 +1354,7 @@ bool8 sub_80EA904(struct SecretBaseRecord *sbr1, struct SecretBaseRecord *sbr2) { u8 i; - for (i = 0; i < OT_NAME_LENGTH && (sbr1->trainerName[i] != EOS || sbr2->trainerName[i] != EOS); i++) + for (i = 0; i < PLAYER_NAME_LENGTH && (sbr1->trainerName[i] != EOS || sbr2->trainerName[i] != EOS); i++) { if (sbr1->trainerName[i] != sbr2->trainerName[i]) { @@ -1509,7 +1509,7 @@ bool8 DoesSecretBaseBelongToPlayer(struct SecretBaseRecord *secretBase) return FALSE; } - for (i = 0; i < OT_NAME_LENGTH && (secretBase->trainerName[i] != EOS || gSaveBlock2Ptr->playerName[i] != EOS); i ++) + for (i = 0; i < PLAYER_NAME_LENGTH && (secretBase->trainerName[i] != EOS || gSaveBlock2Ptr->playerName[i] != EOS); i ++) { if (secretBase->trainerName[i] != gSaveBlock2Ptr->playerName[i]) return FALSE; diff --git a/src/start_menu.c b/src/start_menu.c index 60271317a..4a58c146e 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -33,6 +33,7 @@ #include "international_string_util.h" #include "constants/songs.h" #include "field_player_avatar.h" +#include "battle_pyramid_bag.h" // Menu actions enum @@ -73,12 +74,11 @@ EWRAM_DATA static u8 sSaveDialogTimer = 0; EWRAM_DATA static bool8 sSavingComplete = FALSE; EWRAM_DATA static u8 sSaveInfoWindowId = 0; -// Extern variables +// Extern variables. extern u8 gDifferentSaveFile; -extern u16 gSaveFileStatus; extern u8 gUnknown_03005DB4; -// Extern functions in uncompiled files +// Extern functions in not decompiled files. extern void sub_80AF688(void); extern void var_800D_set_xB(void); extern void sub_808B864(void); @@ -89,7 +89,6 @@ extern void CB2_PokeNav(void); extern void sub_80C4DDC(void (*)(void)); extern void sub_80C51C4(void (*)(void)); extern void sub_80C4E74(u8, void (*)(void)); -extern void sub_81C4EFC(void); extern void ScriptUnfreezeEventObjects(void); extern void sub_81A9EC8(void); extern void save_serialize_map(void); @@ -781,7 +780,7 @@ static bool8 StartMenuBattlePyramidBagCallback(void) play_some_sound(); RemoveExtraStartMenuWindows(); overworld_free_bg_tilemaps(); - SetMainCallback2(sub_81C4EFC); // Display battle pyramid bag + SetMainCallback2(CB2_PyramidBagMenuFromStartMenu); return TRUE; } diff --git a/src/starter_choose.c b/src/starter_choose.c index 36e2b121a..c1e7eea40 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -20,6 +20,7 @@ #include "international_string_util.h" #include "trig.h" #include "scanline_effect.h" +#include "trainer_pokemon_sprites.h" #define STARTER_MON_COUNT 3 @@ -48,12 +49,6 @@ extern const u8 gStarterChoose_LabelCoords[][2]; extern const u8 gUnknown_085B1E0C[]; extern const u8 gUnknown_085B1E28[][2]; -extern void clear_scheduled_bg_copies_to_vram(void); -extern void dp13_810BB8C(void); -extern void do_scheduled_bg_tilemap_copies_to_vram(void); -extern u16 sub_818D820(u16); -extern u8 sub_818D3E4(u16 species, u32 trainerId, u32 personality, u8 flags, s16 x, s16 y, u8, u16); - // this file's functions static void MainCallback2_StarterChoose(void); static void sub_8134604(void); @@ -132,7 +127,7 @@ void CB2_ChooseStarter(void) ResetSpriteData(); ResetPaletteFade(); FreeAllSpritePalettes(); - dp13_810BB8C(); + ResetAllPicSprites(); LoadPalette(GetOverworldTextboxPalettePtr(), 0xE0, 0x20); LoadPalette(gBirchBagGrassPal, 0, 0x40); @@ -263,7 +258,7 @@ static void Task_StarterChoose5(u8 taskId) case 0: // YES // Return the starter choice and exit. gSpecialVar_Result = gTasks[taskId].tStarterSelection; - dp13_810BB8C(); + ResetAllPicSprites(); SetMainCallback2(gMain.savedCallback); break; case 1: // NO @@ -271,7 +266,7 @@ static void Task_StarterChoose5(u8 taskId) PlaySE(SE_SELECT); spriteId = gTasks[taskId].tPkmnSpriteId; FreeOamMatrix(gSprites[spriteId].oam.matrixNum); - sub_818D820(spriteId); + FreeAndDestroyMonPicSprite(spriteId); spriteId = gTasks[taskId].tCircleSpriteId; FreeOamMatrix(gSprites[spriteId].oam.matrixNum); @@ -349,7 +344,7 @@ static u8 CreatePokemonFrontSprite(u16 species, u8 x, u8 y) { u8 spriteId; - spriteId = sub_818D3E4(species, 8, 0, 1, x, y, 0xE, 0xFFFF); + spriteId = CreatePicSprite2(species, 8, 0, 1, x, y, 0xE, 0xFFFF); gSprites[spriteId].oam.priority = 0; return spriteId; } diff --git a/src/battle_dome_cards.c b/src/trainer_pokemon_sprites.c index 5e659a2e8..085e66214 100644 --- a/src/battle_dome_cards.c +++ b/src/trainer_pokemon_sprites.c @@ -1,5 +1,3 @@ - -// Includes #include "global.h" #include "sprite.h" #include "window.h" @@ -7,7 +5,10 @@ #include "constants/species.h" #include "palette.h" #include "decompress.h" -#include "battle_dome_cards.h" +#include "trainer_pokemon_sprites.h" +#include "data2.h" +#include "pokemon.h" +#include "constants/trainers.h" extern const struct CompressedSpriteSheet gMonFrontPicTable[NUM_SPECIES]; extern const struct CompressedSpriteSheet gMonBackPicTable[NUM_SPECIES]; @@ -19,11 +20,10 @@ extern const union AffineAnimCmd *const gUnknown_082FF694[]; extern const union AnimCmd *const gPlayerMonSpriteAnimsTable[]; extern const union AnimCmd *const *const gMonAnimationsSpriteAnimsPtrTable[NUM_SPECIES]; extern const union AnimCmd *const *const gUnknown_0830536C[]; -extern const u8 gFacilityClassToPicIndex[]; // Static type declarations -struct BattleDomeCard +struct PicData { u8 *frames; struct SpriteFrameImage *images; @@ -33,15 +33,16 @@ struct BattleDomeCard }; // Static RAM declarations +#define PICS_COUNT 8 -static EWRAM_DATA struct SpriteTemplate gUnknown_0203CCEC = {}; -static EWRAM_DATA struct BattleDomeCard gUnknown_0203CD04[8] = {}; +static EWRAM_DATA struct SpriteTemplate sCreatingSpriteTemplate = {}; +static EWRAM_DATA struct PicData sSpritePics[PICS_COUNT] = {}; // Static ROM declarations // .rodata -static const struct BattleDomeCard gUnknown_0860B058 = {}; +static const struct PicData sDummyPicData = {}; static const struct OamData gUnknown_0860B064 = { .size = 3 @@ -53,80 +54,67 @@ static const struct OamData gUnknown_0860B06C = // .text -static void nullsub_122(struct Sprite *sprite) +static void DummyPicSpriteCallback(struct Sprite *sprite) { } -bool16 dp13_810BB8C(void) +bool16 ResetAllPicSprites(void) { int i; - for (i = 0; i < 8; i ++) - { - gUnknown_0203CD04[i] = gUnknown_0860B058; - } + for (i = 0; i < PICS_COUNT; i ++) + sSpritePics[i] = sDummyPicData; + return FALSE; } -static bool16 load_pokemon_image_TODO(u16 species, u32 personality, bool8 isFrontPic, u8 *dest, bool8 isTrainer, bool8 ignoreDeoxys) +static bool16 DecompressPic(u16 species, u32 personality, bool8 isFrontPic, u8 *dest, bool8 isTrainer, bool8 ignoreDeoxys) { if (!isTrainer) { if (isFrontPic) { if (!ignoreDeoxys) - { LoadSpecialPokePic(&gMonFrontPicTable[species], dest, species, personality, isFrontPic); - } else - { LoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], dest, species, personality, isFrontPic); - } } else { if (!ignoreDeoxys) - { LoadSpecialPokePic(&gMonBackPicTable[species], dest, species, personality, isFrontPic); - } else - { LoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], dest, species, personality, isFrontPic); - } } } else { if (isFrontPic) - { DecompressPicFromTable(&gTrainerFrontPicTable[species], dest, species); - } else - { DecompressPicFromTable(&gTrainerBackPicTable[species], dest, species); - } } return FALSE; } -static bool16 sub_818D09C(u16 species, u32 personality, bool8 isFrontPic, u8 *dest, bool8 isTrainer) +static bool16 DecompressPic_HandleDeoxys(u16 species, u32 personality, bool8 isFrontPic, u8 *dest, bool8 isTrainer) { - return load_pokemon_image_TODO(species, personality, isFrontPic, dest, isTrainer, FALSE); + return DecompressPic(species, personality, isFrontPic, dest, isTrainer, FALSE); } -static void sub_818D0C4(u16 species, u32 otId, u32 personality, u8 paletteSlot, u16 paletteTag, bool8 isTrainer) +static void LoadPicPaletteByTagOrSlot(u16 species, u32 otId, u32 personality, u8 paletteSlot, u16 paletteTag, bool8 isTrainer) { if (!isTrainer) { if (paletteTag == 0xFFFF) { - gUnknown_0203CCEC.paletteTag |= 0xFFFF; + sCreatingSpriteTemplate.paletteTag |= 0xFFFF; LoadCompressedPalette(GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality), 0x100 + paletteSlot * 0x10, 0x20); } else { - gUnknown_0203CCEC.paletteTag = paletteTag; + sCreatingSpriteTemplate.paletteTag = paletteTag; LoadCompressedObjectPalette(GetMonSpritePalStructFromOtIdPersonality(species, otId, personality)); } } @@ -134,42 +122,34 @@ static void sub_818D0C4(u16 species, u32 otId, u32 personality, u8 paletteSlot, { if (paletteTag == 0xFFFF) { - gUnknown_0203CCEC.paletteTag |= 0xFFFF; + sCreatingSpriteTemplate.paletteTag |= 0xFFFF; LoadCompressedPalette(gTrainerFrontPicPaletteTable[species].data, 0x100 + paletteSlot * 0x10, 0x20); } else { - gUnknown_0203CCEC.paletteTag = paletteTag; + sCreatingSpriteTemplate.paletteTag = paletteTag; LoadCompressedObjectPalette(&gTrainerFrontPicPaletteTable[species]); } } } -static void sub_818D180(u16 species, u32 otId, u32 personality, u8 paletteSlot, bool8 isTrainer) +static void LoadPicPaletteBySlot(u16 species, u32 otId, u32 personality, u8 paletteSlot, bool8 isTrainer) { if (!isTrainer) - { LoadCompressedPalette(GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality), paletteSlot * 0x10, 0x20); - } else - { LoadCompressedPalette(gTrainerFrontPicPaletteTable[species].data, paletteSlot * 0x10, 0x20); - } } -static void uns_builder_assign_animtable1(bool8 isTrainer) +static void AssignSpriteAnimsTable(bool8 isTrainer) { if (!isTrainer) - { - gUnknown_0203CCEC.anims = gPlayerMonSpriteAnimsTable; - } + sCreatingSpriteTemplate.anims = gPlayerMonSpriteAnimsTable; else - { - gUnknown_0203CCEC.anims = gUnknown_0830536C[0]; - } + sCreatingSpriteTemplate.anims = gUnknown_0830536C[0]; } -static u16 oamt_spawn_poke_or_trainer_picture(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 isTrainer, bool8 ignoreDeoxys) +static u16 CreatePicSprite(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 isTrainer, bool8 ignoreDeoxys) { u8 i; u8 *framePics; @@ -177,14 +157,14 @@ static u16 oamt_spawn_poke_or_trainer_picture(u16 species, u32 otId, u32 persona int j; u8 spriteId; - for (i = 0; i < 8; i ++) + for (i = 0; i < PICS_COUNT; i ++) { - if (!gUnknown_0203CD04[i].active) + if (!sSpritePics[i].active) { break; } } - if (i == 8) + if (i == PICS_COUNT) { return 0xFFFF; } @@ -199,7 +179,7 @@ static u16 oamt_spawn_poke_or_trainer_picture(u16 species, u32 otId, u32 persona Free(framePics); return 0xFFFF; } - if (load_pokemon_image_TODO(species, personality, isFrontPic, framePics, isTrainer, ignoreDeoxys)) + if (DecompressPic(species, personality, isFrontPic, framePics, isTrainer, ignoreDeoxys)) { // debug trap? return 0xFFFF; @@ -209,32 +189,32 @@ static u16 oamt_spawn_poke_or_trainer_picture(u16 species, u32 otId, u32 persona images[j].data = framePics + 0x800 * j; images[j].size = 0x800; } - gUnknown_0203CCEC.tileTag = 0xFFFF; - gUnknown_0203CCEC.oam = &gUnknown_0860B064; - uns_builder_assign_animtable1(isTrainer); - gUnknown_0203CCEC.images = images; - gUnknown_0203CCEC.affineAnims = gDummySpriteAffineAnimTable; - gUnknown_0203CCEC.callback = nullsub_122; - sub_818D0C4(species, otId, personality, paletteSlot, paletteTag, isTrainer); - spriteId = CreateSprite(&gUnknown_0203CCEC, x, y, 0); + sCreatingSpriteTemplate.tileTag = 0xFFFF; + sCreatingSpriteTemplate.oam = &gUnknown_0860B064; + AssignSpriteAnimsTable(isTrainer); + sCreatingSpriteTemplate.images = images; + sCreatingSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable; + sCreatingSpriteTemplate.callback = DummyPicSpriteCallback; + LoadPicPaletteByTagOrSlot(species, otId, personality, paletteSlot, paletteTag, isTrainer); + spriteId = CreateSprite(&sCreatingSpriteTemplate, x, y, 0); if (paletteTag == 0xFFFF) { gSprites[spriteId].oam.paletteNum = paletteSlot; } - gUnknown_0203CD04[i].frames = framePics; - gUnknown_0203CD04[i].images = images; - gUnknown_0203CD04[i].paletteTag = paletteTag; - gUnknown_0203CD04[i].spriteId = spriteId; - gUnknown_0203CD04[i].active = TRUE; + sSpritePics[i].frames = framePics; + sSpritePics[i].images = images; + sSpritePics[i].paletteTag = paletteTag; + sSpritePics[i].spriteId = spriteId; + sSpritePics[i].active = TRUE; return spriteId; } -static u16 sub_818D384(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 isTrainer) +static u16 CreatePicSprite_HandleDeoxys(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 isTrainer) { - return oamt_spawn_poke_or_trainer_picture(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, isTrainer, FALSE); + return CreatePicSprite(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, isTrainer, FALSE); } -u16 sub_818D3E4(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, u8 paletteSlot, u16 paletteTag) +u16 CreatePicSprite2(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, u8 paletteSlot, u16 paletteTag) { u8 *framePics; struct SpriteFrameImage *images; @@ -243,14 +223,14 @@ u16 sub_818D3E4(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, u8 spriteId; u8 flags2; - for (i = 0; i < 8; i ++) + for (i = 0; i < PICS_COUNT; i ++) { - if (!gUnknown_0203CD04[i].active) + if (!sSpritePics[i].active) { break; } } - if (i == 8) + if (i == PICS_COUNT) { return 0xFFFF; } @@ -274,7 +254,7 @@ u16 sub_818D3E4(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, Free(framePics); return 0xFFFF; } - if (load_pokemon_image_TODO(species, personality, flags, framePics, FALSE, FALSE)) + if (DecompressPic(species, personality, flags, framePics, FALSE, FALSE)) { // debug trap? return 0xFFFF; @@ -284,76 +264,76 @@ u16 sub_818D3E4(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y, images[j].data = framePics + 0x800 * j; images[j].size = 0x800; } - gUnknown_0203CCEC.tileTag = 0xFFFF; - gUnknown_0203CCEC.anims = gMonAnimationsSpriteAnimsPtrTable[species]; - gUnknown_0203CCEC.images = images; + sCreatingSpriteTemplate.tileTag = 0xFFFF; + sCreatingSpriteTemplate.anims = gMonAnimationsSpriteAnimsPtrTable[species]; + sCreatingSpriteTemplate.images = images; if (flags2 == 0x01) { - gUnknown_0203CCEC.affineAnims = gUnknown_082FF694; - gUnknown_0203CCEC.oam = &gUnknown_0860B06C; + sCreatingSpriteTemplate.affineAnims = gUnknown_082FF694; + sCreatingSpriteTemplate.oam = &gUnknown_0860B06C; } else if (flags2 == 0x00) { - gUnknown_0203CCEC.affineAnims = gUnknown_082FF618; - gUnknown_0203CCEC.oam = &gUnknown_0860B06C; + sCreatingSpriteTemplate.affineAnims = gUnknown_082FF618; + sCreatingSpriteTemplate.oam = &gUnknown_0860B06C; } else { - gUnknown_0203CCEC.oam = &gUnknown_0860B064; - gUnknown_0203CCEC.affineAnims = gDummySpriteAffineAnimTable; + sCreatingSpriteTemplate.oam = &gUnknown_0860B064; + sCreatingSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable; } - gUnknown_0203CCEC.callback = nullsub_122; - sub_818D0C4(species, otId, personality, paletteSlot, paletteTag, FALSE); - spriteId = CreateSprite(&gUnknown_0203CCEC, x, y, 0); + sCreatingSpriteTemplate.callback = DummyPicSpriteCallback; + LoadPicPaletteByTagOrSlot(species, otId, personality, paletteSlot, paletteTag, FALSE); + spriteId = CreateSprite(&sCreatingSpriteTemplate, x, y, 0); if (paletteTag == 0xFFFF) { gSprites[spriteId].oam.paletteNum = paletteSlot; } - gUnknown_0203CD04[i].frames = framePics; - gUnknown_0203CD04[i].images = images; - gUnknown_0203CD04[i].paletteTag = paletteTag; - gUnknown_0203CD04[i].spriteId = spriteId; - gUnknown_0203CD04[i].active = TRUE; + sSpritePics[i].frames = framePics; + sSpritePics[i].images = images; + sSpritePics[i].paletteTag = paletteTag; + sSpritePics[i].spriteId = spriteId; + sSpritePics[i].active = TRUE; return spriteId; } -static u16 sub_818D5B0(u16 spriteId) +static u16 FreeAndDestroyPicSpriteInternal(u16 spriteId) { u8 i; u8 *framePics; struct SpriteFrameImage *images; - for (i = 0; i < 8; i ++) + for (i = 0; i < PICS_COUNT; i ++) { - if (gUnknown_0203CD04[i].spriteId == spriteId) + if (sSpritePics[i].spriteId == spriteId) { break; } } - if (i == 8) + if (i == PICS_COUNT) { return 0xFFFF; } - framePics = gUnknown_0203CD04[i].frames; - images = gUnknown_0203CD04[i].images; - if (gUnknown_0203CD04[i].paletteTag != 0xFFFF) + framePics = sSpritePics[i].frames; + images = sSpritePics[i].images; + if (sSpritePics[i].paletteTag != 0xFFFF) { FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(gSprites[spriteId].oam.paletteNum)); } DestroySprite(&gSprites[spriteId]); Free(framePics); Free(images); - gUnknown_0203CD04[i] = gUnknown_0860B058; + sSpritePics[i] = sDummyPicData; return 0; } static u16 sub_818D65C(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u8 paletteSlot, u8 windowId, bool8 isTrainer) { - if (sub_818D09C(species, personality, isFrontPic, (u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA), FALSE)) + if (DecompressPic_HandleDeoxys(species, personality, isFrontPic, (u8 *)GetWindowAttribute(windowId, WINDOW_TILE_DATA), FALSE)) { return 0xFFFF; } - sub_818D180(species, otId, personality, paletteSlot, isTrainer); + LoadPicPaletteBySlot(species, otId, personality, paletteSlot, isTrainer); return 0; } @@ -362,29 +342,29 @@ static u16 sub_818D6CC(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u8 *framePics; framePics = Alloc(4 * 0x800); - if (framePics && !sub_818D09C(species, personality, isFrontPic, framePics, isTrainer)) + if (framePics && !DecompressPic_HandleDeoxys(species, personality, isFrontPic, framePics, isTrainer)) { BlitBitmapRectToWindow(windowId, framePics, 0, 0, 0x40, 0x40, destX, destY, 0x40, 0x40); - sub_818D180(species, otId, personality, paletteSlot, isTrainer); + LoadPicPaletteBySlot(species, otId, personality, paletteSlot, isTrainer); Free(framePics); return 0; } return 0xFFFF; } -static u16 sub_818D778(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 ignoreDeoxys) +static u16 CreateMonPicSprite(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag, bool8 ignoreDeoxys) { - return oamt_spawn_poke_or_trainer_picture(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, FALSE, ignoreDeoxys); + return CreatePicSprite(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, FALSE, ignoreDeoxys); } -u16 sub_818D7D8(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag) +u16 CreateMonPicSprite_HandleDeoxys(u16 species, u32 otId, u32 personality, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag) { - return sub_818D778(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, FALSE); + return CreateMonPicSprite(species, otId, personality, isFrontPic, x, y, paletteSlot, paletteTag, FALSE); } -u16 sub_818D820(u16 spriteId) +u16 FreeAndDestroyMonPicSprite(u16 spriteId) { - return sub_818D5B0(spriteId); + return FreeAndDestroyPicSpriteInternal(spriteId); } u16 sub_818D834(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u8 paletteSlot, u8 windowId) @@ -397,14 +377,14 @@ u16 sub_818D864(u16 species, u32 otId, u32 personality, bool8 isFrontPic, u16 de return sub_818D6CC(species, otId, personality, isFrontPic, destX, destY, paletteSlot, windowId, FALSE); } -u16 sub_818D8AC(u16 species, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag) +u16 CreateTrainerPicSprite(u16 species, bool8 isFrontPic, s16 x, s16 y, u8 paletteSlot, u16 paletteTag) { - return sub_818D384(species, 0, 0, isFrontPic, x, y, paletteSlot, paletteTag, TRUE); + return CreatePicSprite_HandleDeoxys(species, 0, 0, isFrontPic, x, y, paletteSlot, paletteTag, TRUE); } -u16 sub_818D8F0(u16 spriteId) +u16 FreeAndDestroyTrainerPicSprite(u16 spriteId) { - return sub_818D5B0(spriteId); + return FreeAndDestroyPicSpriteInternal(spriteId); } u16 sub_818D904(u16 species, bool8 isFrontPic, u8 paletteSlot, u8 windowId) @@ -417,17 +397,17 @@ u16 sub_818D938(u16 species, bool8 isFrontPic, u16 destX, u16 destY, u8 paletteS return sub_818D6CC(species, 0, 0, isFrontPic, destX, destY, paletteSlot, windowId, TRUE); } -u8 sub_818D97C(u8 a0, u8 a1) +u16 PlayerGenderToFrontTrainerPicId_Debug(u8 gender, bool8 getClass) { - if (a1 == 1) + if (getClass == TRUE) { - switch (a0) + switch (gender) { - default: - return gFacilityClassToPicIndex[0x3F]; - case 0: - return gFacilityClassToPicIndex[0x3C]; + default: + return gFacilityClassToPicIndex[FACILITY_CLASS_PKMN_TRAINER_MAY]; + case MALE: + return gFacilityClassToPicIndex[FACILITY_CLASS_PKMN_TRAINER_BRENDAN]; } } - return a0; + return gender; } diff --git a/src/unk_text_util_2.c b/src/unk_text_util_2.c index ca8246128..4821ed776 100644 --- a/src/unk_text_util_2.c +++ b/src/unk_text_util_2.c @@ -4,6 +4,7 @@ #include "text.h" #include "sound.h" +ALIGNED(4) static const u8 sUnknown_08616124[] = {1, 2, 4}; static const u16 sFont6BrailleGlyphs[] = INCBIN_U16("data/graphics/fonts/font6.fwjpnfont"); diff --git a/src/util.c b/src/util.c index 88be4e4a1..9c8766a97 100644 --- a/src/util.c +++ b/src/util.c @@ -152,10 +152,6 @@ void DoBgAffineSet(struct BgAffineDstData *dest, u32 texX, u32 texY, s16 scrX, s BgAffineSet(&src, dest, 1); } -#ifdef NONMATCHING - -// Functionally equivalent. -// Only the two yflip loops don't match. void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output) { u8 x, y; @@ -166,32 +162,18 @@ void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output) for (y = 0; y < h; y++) { - int filler = 32 - w; - for (x = 0; x < w; x++) { int tile = (*tilemap & 0x3ff) * 32; - int attr = *tilemap & 0xc00; - if (attr == 0) + if ((*tilemap & 0xc00) == 0) { - void *src = tiles + tile; - void *dest = output; - int length = 32; - DmaCopy32(3, src, dest, length); + CpuCopy32(tiles + tile, output, 32); } - else if (attr == 0x800) // yflip + else if ((*tilemap & 0xc00) == 0x800) // yflip { for (i = 0; i < 8; i++) - { - void *src = tiles; - void *dest = output; - int length = 4; - // this is likely wrong, but makes it closer to matching - src += tile + (7 - i) * 4; - dest += i * 4; - DmaCopy32(3, src, dest, length); - } + CpuCopy32(tiles + (tile + (7 - i) * 4), output + i * 4, 4); } else // xflip { @@ -207,245 +189,20 @@ void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output) if (*tilemap & 0x800) // yflip { for (i = 0; i < 8; i++) - { - void *src = xflip + (7-i) * 4; - void *dest = output + i*4; - int length = 4; - DmaCopy32(3, src, dest, length); - } + CpuCopy32(xflip + (7 - i) * 4, output + i * 4, 4); } else { - void *src = xflip; - void *dest = output; - int length = 32; - DmaCopy32(3, src, dest, length); + CpuCopy32(xflip, output, 32); } } tilemap++; output += 32; } - tilemap += filler; + tilemap += (32 - w); } } -#else -NAKED void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output) -{ - asm("\n\ - .syntax unified\n\ - push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, 0x38\n\ - str r2, [sp, 0x20]\n\ - adds r4, r3, 0\n\ - ldr r7, [sp, 0x58]\n\ - lsls r0, 24\n\ - lsls r1, 24\n\ - ldr r2, =sSpriteDimensions\n\ - lsrs r1, 23\n\ - lsrs r0, 21\n\ - adds r1, r0\n\ - adds r0, r2, 0x1\n\ - adds r0, r1, r0\n\ - ldrb r0, [r0]\n\ - str r0, [sp, 0x24]\n\ - adds r1, r2\n\ - ldrb r1, [r1]\n\ - str r1, [sp, 0x28]\n\ - movs r0, 0\n\ - b _0806F88C\n\ - .pool\n\ - _0806F740:\n\ - movs r5, 0\n\ - adds r0, 0x1\n\ - str r0, [sp, 0x30]\n\ - b _0806F874\n\ - _0806F748:\n\ - ldrh r0, [r4]\n\ - ldr r2, =0x000003ff\n\ - adds r1, r2, 0\n\ - ands r1, r0\n\ - lsls r1, 5\n\ - mov r8, r1\n\ - movs r2, 0xC0\n\ - lsls r2, 4\n\ - adds r1, r2, 0\n\ - ands r1, r0\n\ - mov r2, sp\n\ - strh r0, [r2, 0x34]\n\ - cmp r1, 0\n\ - bne _0806F788\n\ - ldr r0, [sp, 0x20]\n\ - add r0, r8\n\ - adds r1, r7, 0\n\ - ldr r2, =0x04000008\n\ - bl CpuSet\n\ - adds r4, 0x2\n\ - str r4, [sp, 0x2C]\n\ - adds r7, 0x20\n\ - mov r10, r7\n\ - adds r5, 0x1\n\ - mov r9, r5\n\ - b _0806F86A\n\ - .pool\n\ - _0806F788:\n\ - movs r0, 0x80\n\ - lsls r0, 4\n\ - cmp r1, r0\n\ - bne _0806F7CC\n\ - movs r1, 0\n\ - adds r4, 0x2\n\ - str r4, [sp, 0x2C]\n\ - movs r2, 0x20\n\ - adds r2, r7\n\ - mov r10, r2\n\ - adds r5, 0x1\n\ - mov r9, r5\n\ - _0806F7A0:\n\ - lsls r4, r1, 24\n\ - asrs r4, 24\n\ - movs r0, 0x7\n\ - subs r0, r4\n\ - lsls r0, 2\n\ - add r0, r8\n\ - ldr r1, [sp, 0x20]\n\ - adds r0, r1, r0\n\ - lsls r1, r4, 2\n\ - adds r1, r7, r1\n\ - ldr r2, =0x04000001\n\ - bl CpuSet\n\ - adds r4, 0x1\n\ - lsls r4, 24\n\ - lsrs r1, r4, 24\n\ - asrs r4, 24\n\ - cmp r4, 0x7\n\ - ble _0806F7A0\n\ - b _0806F86A\n\ - .pool\n\ - _0806F7CC:\n\ - movs r1, 0\n\ - adds r4, 0x2\n\ - str r4, [sp, 0x2C]\n\ - movs r2, 0x20\n\ - adds r2, r7\n\ - mov r10, r2\n\ - adds r5, 0x1\n\ - mov r9, r5\n\ - movs r0, 0xF\n\ - mov r12, r0\n\ - _0806F7E0:\n\ - movs r2, 0\n\ - lsls r4, r1, 24\n\ - lsls r0, r4, 2\n\ - lsrs r0, 24\n\ - adds r6, r0, 0x3\n\ - mov r1, r8\n\ - adds r5, r1, r0\n\ - _0806F7EE:\n\ - lsls r1, r2, 24\n\ - asrs r1, 24\n\ - subs r0, r6, r1\n\ - mov r2, sp\n\ - adds r3, r2, r0\n\ - adds r0, r5, r1\n\ - ldr r2, [sp, 0x20]\n\ - adds r0, r2, r0\n\ - ldrb r2, [r0]\n\ - mov r0, r12\n\ - ands r0, r2\n\ - lsls r0, 4\n\ - lsrs r2, 4\n\ - orrs r0, r2\n\ - strb r0, [r3]\n\ - adds r1, 0x1\n\ - lsls r1, 24\n\ - lsrs r2, r1, 24\n\ - asrs r1, 24\n\ - cmp r1, 0x3\n\ - ble _0806F7EE\n\ - movs r1, 0x80\n\ - lsls r1, 17\n\ - adds r0, r4, r1\n\ - lsrs r1, r0, 24\n\ - asrs r0, 24\n\ - cmp r0, 0x7\n\ - ble _0806F7E0\n\ - mov r2, sp\n\ - ldrh r0, [r2, 0x34]\n\ - movs r2, 0x80\n\ - lsls r2, 4\n\ - ands r0, r2\n\ - cmp r0, 0\n\ - beq _0806F860\n\ - movs r1, 0\n\ - _0806F836:\n\ - lsls r4, r1, 24\n\ - asrs r4, 24\n\ - movs r0, 0x7\n\ - subs r0, r4\n\ - lsls r0, 2\n\ - add r0, sp\n\ - lsls r1, r4, 2\n\ - adds r1, r7, r1\n\ - ldr r2, =0x04000001\n\ - bl CpuSet\n\ - adds r4, 0x1\n\ - lsls r4, 24\n\ - lsrs r1, r4, 24\n\ - asrs r4, 24\n\ - cmp r4, 0x7\n\ - ble _0806F836\n\ - b _0806F86A\n\ - .pool\n\ - _0806F860:\n\ - mov r0, sp\n\ - adds r1, r7, 0\n\ - ldr r2, =0x04000008\n\ - bl CpuSet\n\ - _0806F86A:\n\ - ldr r4, [sp, 0x2C]\n\ - mov r7, r10\n\ - mov r1, r9\n\ - lsls r0, r1, 24\n\ - lsrs r5, r0, 24\n\ - _0806F874:\n\ - ldr r2, [sp, 0x28]\n\ - cmp r5, r2\n\ - bcs _0806F87C\n\ - b _0806F748\n\ - _0806F87C:\n\ - movs r0, 0x20\n\ - ldr r1, [sp, 0x28]\n\ - subs r0, r1\n\ - lsls r0, 1\n\ - adds r4, r0\n\ - ldr r2, [sp, 0x30]\n\ - lsls r0, r2, 24\n\ - lsrs r0, 24\n\ - _0806F88C:\n\ - ldr r1, [sp, 0x24]\n\ - cmp r0, r1\n\ - bcs _0806F894\n\ - b _0806F740\n\ - _0806F894:\n\ - add sp, 0x38\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .pool\n\ - .syntax divided"); -} - -#endif // NONMATCHING - int CountTrailingZeroBits(u32 value) { u8 i; diff --git a/src/wallclock.c b/src/wallclock.c index 5be20d5c9..f3feab1d4 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -59,13 +59,38 @@ static void SpriteCB_PMIndicator(struct Sprite *sprite); static const u8 sUnknown_085B1F58[] = INCBIN_U8("graphics/wallclock/graphics_85b1f58.4bpp.lz"); static const u16 sUnknown_085B21D4[] = INCBIN_U16("graphics/wallclock/palette_85b21d4.gbapal"); -static const struct WindowTemplate gUnknown_085B21DC[] = { - { 0x00, 0x03, 0x11, 0x18, 0x02, 0x0e, 0x200 }, - { 0x02, 0x18, 0x10, 0x06, 0x02, 0x0c, 0x230 }, + +static const struct WindowTemplate gUnknown_085B21DC[] = +{ + { + .priority = 0, + .tilemapLeft = 3, + .tilemapTop = 17, + .width = 24, + .height = 2, + .paletteNum = 14, + .baseBlock = 512 + }, + { + .priority = 2, + .tilemapLeft = 24, + .tilemapTop = 16, + .width = 6, + .height = 2, + .paletteNum = 12, + .baseBlock = 560 + }, DUMMY_WIN_TEMPLATE }; -static const struct WindowTemplate gUnknown_085B21F4 = { - 0x00, 0x18, 0x09, 0x05, 0x04, 0x0e, 0x23c +static const struct WindowTemplate gUnknown_085B21F4 = +{ + .priority = 0, + .tilemapLeft = 24, + .tilemapTop = 9, + .width = 5, + .height = 4, + .paletteNum = 14, + .baseBlock = 572 }; static const struct BgTemplate gUnknown_085B21FC[] = { { @@ -115,23 +140,25 @@ static const union AnimCmd *const gUnknown_085B2248[] = { static const union AnimCmd *const gUnknown_085B224C[] = { Unknown_085B2240 }; -static const struct SpriteTemplate gUnknown_085B2250 = { - TAG_GFX_WALL_CLOCK_HAND, - TAG_PAL_WALL_CLOCK_HAND, - &Unknown_085B2230, - gUnknown_085B2248, - NULL, - gDummySpriteAffineAnimTable, - SpriteCB_MinuteHand +static const struct SpriteTemplate gUnknown_085B2250 = +{ + .tileTag = TAG_GFX_WALL_CLOCK_HAND, + .paletteTag = TAG_PAL_WALL_CLOCK_HAND, + .oam = &Unknown_085B2230, + .anims = gUnknown_085B2248, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_MinuteHand }; -static const struct SpriteTemplate gUnknown_085B2268 = { - TAG_GFX_WALL_CLOCK_HAND, - TAG_PAL_WALL_CLOCK_HAND, - &Unknown_085B2230, - gUnknown_085B224C, - NULL, - gDummySpriteAffineAnimTable, - SpriteCB_HourHand +static const struct SpriteTemplate gUnknown_085B2268 = +{ + .tileTag = TAG_GFX_WALL_CLOCK_HAND, + .paletteTag = TAG_PAL_WALL_CLOCK_HAND, + .oam = &Unknown_085B2230, + .anims = gUnknown_085B224C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_HourHand }; static const struct OamData Unknown_085B2280 = { .y = 0xa0, @@ -152,23 +179,25 @@ static const union AnimCmd *const gUnknown_085B2298[] = { static const union AnimCmd *const gUnknown_085B229C[] = { Unknown_085B2290 }; -static const struct SpriteTemplate gUnknown_085B22A0 = { - TAG_GFX_WALL_CLOCK_HAND, - TAG_PAL_WALL_CLOCK_HAND, - &Unknown_085B2280, - gUnknown_085B2298, - NULL, - gDummySpriteAffineAnimTable, - SpriteCB_AMIndicator +static const struct SpriteTemplate gUnknown_085B22A0 = +{ + .tileTag = TAG_GFX_WALL_CLOCK_HAND, + .paletteTag = TAG_PAL_WALL_CLOCK_HAND, + .oam = &Unknown_085B2280, + .anims = gUnknown_085B2298, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_AMIndicator }; -static const struct SpriteTemplate gUnknown_085B22B8 = { - TAG_GFX_WALL_CLOCK_HAND, - TAG_PAL_WALL_CLOCK_HAND, - &Unknown_085B2280, - gUnknown_085B229C, - NULL, - gDummySpriteAffineAnimTable, - SpriteCB_PMIndicator +static const struct SpriteTemplate gUnknown_085B22B8 = +{ + .tileTag = TAG_GFX_WALL_CLOCK_HAND, + .paletteTag = TAG_PAL_WALL_CLOCK_HAND, + .oam = &Unknown_085B2280, + .anims = gUnknown_085B229C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_PMIndicator }; static const s8 sClockHandCoords[][2] = { { 0x00, -0x18}, |