From 8be2c5d60b54347c9df22410d97255d836d9fc9d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 01:49:38 -0400 Subject: [PATCH 01/63] Document Contest Lady TV Show --- data/text/tv.inc | 8 +-- include/constants/lilycove_lady.h | 10 +++- include/constants/tv.h | 8 ++- include/event_scripts.h | 8 +-- include/global.tv.h | 4 +- include/lilycove_lady.h | 2 +- src/lilycove_lady.c | 19 ++----- src/tv.c | 90 +++++++++++++++---------------- 8 files changed, 76 insertions(+), 73 deletions(-) diff --git a/data/text/tv.inc b/data/text/tv.inc index 72d391034..287ce7f00 100644 --- a/data/text/tv.inc +++ b/data/text/tv.inc @@ -2925,7 +2925,7 @@ gTVInSearchOfTrainersText08:: @ 0828C011 .string "That's all for today!\n" .string "See you again on our next broadcast!$" -gTVPokemonContestLiveUpdates2Text00:: @ 0828C137 +ContestLadyShow_Text_Intro:: @ 0828C137 .string "“POKéMON CONTEST LIVE UPDATES!”\p" .string "MC: Sorry to interrupt the regular\n" .string "programming, and thanks for joining us!\p" @@ -2940,7 +2940,7 @@ gTVPokemonContestLiveUpdates2Text00:: @ 0828C137 .string "Spectators: ?!!!!\n" .string "?!!!!$" -gTVPokemonContestLiveUpdates2Text01:: @ 0828C28C +ContestLadyShow_Text_Won:: @ 0828C28C .string "MC: Excuse me!\n" .string "Thanks for joining us on live TV!\p" .string "May I congratulate you on your win?\p" @@ -2959,7 +2959,7 @@ gTVPokemonContestLiveUpdates2Text01:: @ 0828C28C .string "We did it!\l" .string "Thank you!$" -gTVPokemonContestLiveUpdates2Text02:: @ 0828C45B +ContestLadyShow_Text_Lost:: @ 0828C45B .string "MC: Excuse me!\n" .string "Thanks for joining us on live TV!\p" .string "You must be disappointed by that turn\n" @@ -2979,7 +2979,7 @@ gTVPokemonContestLiveUpdates2Text02:: @ 0828C45B .string "Uh… That's all the time we have today!\n" .string "Thanks for tuning in!$" -gTVPokemonContestLiveUpdates2Text03:: @ 0828C662 +ContestLadyShow_Text_LostBadly:: @ 0828C662 .string "MC: Excuse me!\n" .string "Thanks for joining us on live TV!\p" .string "How did your CONTEST appearance go?\p" diff --git a/include/constants/lilycove_lady.h b/include/constants/lilycove_lady.h index 01f60ccf4..11b9b31e9 100644 --- a/include/constants/lilycove_lady.h +++ b/include/constants/lilycove_lady.h @@ -21,6 +21,12 @@ #define QUIZ_AUTHOR_NAME_PLAYER 1 #define QUIZ_AUTHOR_NAME_OTHER_PLAYER 2 -#define QUIZ_QUESTION_LEN 9 +#define QUIZ_QUESTION_LEN 9 -#endif +// Constants for how many good Pokéblocks the Contest Lady was given +// This determines how her performance is described when her TV show comes on +#define CONTEST_LADY_NORMAL 0 +#define CONTEST_LADY_GOOD 1 +#define CONTEST_LADY_BAD 2 + +#endif // GUARD_LILYCOVE_LADY_CONSTANTS_H diff --git a/include/constants/tv.h b/include/constants/tv.h index 57da9837b..f7b091f49 100644 --- a/include/constants/tv.h +++ b/include/constants/tv.h @@ -19,7 +19,7 @@ #define TVSHOW_3_CHEERS_FOR_POKEBLOCKS 9 #define TVSHOW_BATTLE_UPDATE 10 #define TVSHOW_FAN_CLUB_SPECIAL 11 -#define TVSHOW_CONTEST_LIVE_UPDATES_2 12 +#define TVSHOW_LILYCOVE_CONTEST_LADY 12 // // #define TVSHOW_POKEMON_TODAY_CAUGHT 21 #define TVSHOW_SMART_SHOPPER 22 @@ -215,4 +215,10 @@ #define TRENDWATCHER_STATE_BIGGER_FEMALE 5 #define TRENDWATCHER_STATE_OUTRO 6 +// TV Show states for the Contest Lady's Live Updates show +#define CONTESTLADYLIVE_STATE_INTRO 0 +#define CONTESTLADYLIVE_STATE_WON 1 +#define CONTESTLADYLIVE_STATE_LOST 2 +#define CONTESTLADYLIVE_STATE_LOST_BADLY 3 + #endif //GUARD_CONSTANTS_TV_H diff --git a/include/event_scripts.h b/include/event_scripts.h index ecb40c266..122af54cc 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -344,10 +344,10 @@ extern const u8 gTVInSearchOfTrainersText05[]; extern const u8 gTVInSearchOfTrainersText06[]; extern const u8 gTVInSearchOfTrainersText07[]; extern const u8 gTVInSearchOfTrainersText08[]; -extern const u8 gTVPokemonContestLiveUpdates2Text00[]; -extern const u8 gTVPokemonContestLiveUpdates2Text01[]; -extern const u8 gTVPokemonContestLiveUpdates2Text02[]; -extern const u8 gTVPokemonContestLiveUpdates2Text03[]; +extern const u8 ContestLadyShow_Text_Intro[]; +extern const u8 ContestLadyShow_Text_Won[]; +extern const u8 ContestLadyShow_Text_Lost[]; +extern const u8 ContestLadyShow_Text_LostBadly[]; extern const u8 gPokeNewsTextSlateport_Upcoming[]; extern const u8 gPokeNewsTextSlateport_Ongoing[]; extern const u8 gPokeNewsTextSlateport_Ending[]; diff --git a/include/global.tv.h b/include/global.tv.h index 8e1a898b6..64e6a984e 100644 --- a/include/global.tv.h +++ b/include/global.tv.h @@ -179,7 +179,7 @@ typedef union // size = 0x24 /*0x18*/ u8 idolNameLanguage; } fanClubSpecial; - // TVSHOW_CONTEST_LIVE_UPDATES_2 + // TVSHOW_LILYCOVE_CONTEST_LADY struct { /*0x00*/ u8 kind; /*0x01*/ bool8 active; @@ -189,7 +189,7 @@ typedef union // size = 0x24 /*0x16*/ u8 pokeblockState; /*0x17*/ u8 language; /*0x18*/ u8 pokemonNameLanguage; - } contestLiveUpdates2; + } contestLady; // Record Mixing Shows // TVSHOW_POKEMON_TODAY_CAUGHT diff --git a/include/lilycove_lady.h b/include/lilycove_lady.h index 1ec327be9..d3cce4ca8 100644 --- a/include/lilycove_lady.h +++ b/include/lilycove_lady.h @@ -12,6 +12,6 @@ void BufferContestLadyMonName(u8 *dest1, u8 *dest2); void BufferContestLadyPlayerName(u8 *dest); void BufferContestLadyLanguage(u8 *dest); void BufferContestName(u8 *dest, u8 category); -u8 sub_818E880(void); +u8 GetContestLadyPokeblockState(void); #endif //GUARD_LILYCOVE_LADY_H diff --git a/src/lilycove_lady.c b/src/lilycove_lady.c index 5bad07420..22155ffd5 100644 --- a/src/lilycove_lady.c +++ b/src/lilycove_lady.c @@ -762,25 +762,16 @@ void BufferContestName(u8 *dest, u8 category) StringCopy(dest, sContestNames[category]); } -// used in tv.c to determine sTVShowState for Contest Lady show -// if return val is 1, sTVShowState is 1 -// if return val is 2, sTVShowState is 3 -// if return val is 0, sTVShowState is 2 -u8 sub_818E880(void) +// Used by the Contest Lady's TV show to determine how well she performed +u8 GetContestLadyPokeblockState(void) { sContestLadyPtr = &gSaveBlock1Ptr->lilycoveLady.contest; if (sContestLadyPtr->numGoodPokeblocksGiven >= LILYCOVE_LADY_GIFT_THRESHOLD) - { - return 1; - } + return CONTEST_LADY_GOOD; else if (sContestLadyPtr->numGoodPokeblocksGiven == 0) - { - return 2; - } + return CONTEST_LADY_BAD; else - { - return 0; - } + return CONTEST_LADY_NORMAL; } diff --git a/src/tv.c b/src/tv.c index 691b343d8..0466ee713 100644 --- a/src/tv.c +++ b/src/tv.c @@ -38,6 +38,7 @@ #include "constants/contest.h" #include "constants/items.h" #include "constants/layouts.h" +#include "constants/lilycove_lady.h" #include "constants/maps.h" #include "constants/metatile_behaviors.h" #include "constants/moves.h" @@ -179,7 +180,7 @@ static void DoTVShowPokemonNewsBattleFrontier(void); static void DoTVShowWhatsNo1InHoennToday(void); static void DoTVShowSecretBaseSecrets(void); static void DoTVShowSafariFanClub(void); -static void DoTVShowPokemonContestLiveUpdates2(void); +static void DoTVShowLilycoveContestLady(void); // .rodata @@ -461,11 +462,11 @@ static const u8 *const sTVNameRaterTextGroup[] = { gTVNameRaterText18 }; -static const u8 *const sTVPokemonContestLiveUpdates2TextGroup[] = { - gTVPokemonContestLiveUpdates2Text00, - gTVPokemonContestLiveUpdates2Text01, - gTVPokemonContestLiveUpdates2Text02, - gTVPokemonContestLiveUpdates2Text03 +static const u8 *const sTVLilycoveContestLadyTextGroup[] = { + [CONTESTLADYLIVE_STATE_INTRO] = ContestLadyShow_Text_Intro, + [CONTESTLADYLIVE_STATE_WON] = ContestLadyShow_Text_Won, + [CONTESTLADYLIVE_STATE_LOST] = ContestLadyShow_Text_Lost, + [CONTESTLADYLIVE_STATE_LOST_BADLY] = ContestLadyShow_Text_LostBadly }; static const u8 *const sTVPokemonTodayFailedTextGroup[] = { @@ -1661,13 +1662,13 @@ void PutLilycoveContestLadyShowOnTheAir(void) if (gSpecialVar_Result != TRUE) { show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; - BufferContestLadyLanguage(&show->contestLiveUpdates2.language); - show->contestLiveUpdates2.pokemonNameLanguage = GAME_LANGUAGE; - show->contestLiveUpdates2.kind = TVSHOW_CONTEST_LIVE_UPDATES_2; - show->contestLiveUpdates2.active = TRUE; - BufferContestLadyPlayerName(show->contestLiveUpdates2.playerName); - BufferContestLadyMonName(&show->contestLiveUpdates2.contestCategory, show->contestLiveUpdates2.nickname); - show->contestLiveUpdates2.pokeblockState = sub_818E880(); + BufferContestLadyLanguage(&show->contestLady.language); + show->contestLady.pokemonNameLanguage = GAME_LANGUAGE; + show->contestLady.kind = TVSHOW_LILYCOVE_CONTEST_LADY; + show->contestLady.active = TRUE; + BufferContestLadyPlayerName(show->contestLady.playerName); + BufferContestLadyMonName(&show->contestLady.contestCategory, show->contestLady.nickname); + show->contestLady.pokeblockState = GetContestLadyPokeblockState(); tv_store_id_2x(show); } } @@ -3812,9 +3813,8 @@ static void sub_80F0708(void) // FIXME: register allocation shenanigans break; case TVSHOW_FAN_CLUB_SPECIAL: break; - case TVSHOW_CONTEST_LIVE_UPDATES_2: + case TVSHOW_LILYCOVE_CONTEST_LADY: break; - case TVSHOW_OFF_AIR: break; case TVSHOW_FAN_CLUB_LETTER: @@ -4308,11 +4308,10 @@ static void sub_80F12A4(TVShow *shows) curShow->fanClubSpecial.language = TV_GetStringLanguage(curShow->fanClubSpecial.playerName); curShow->fanClubSpecial.idolNameLanguage = TV_GetStringLanguage(curShow->fanClubSpecial.idolName); break; - case TVSHOW_CONTEST_LIVE_UPDATES_2: - curShow->contestLiveUpdates2.language = TV_GetStringLanguage(curShow->contestLiveUpdates2.playerName); - curShow->contestLiveUpdates2.pokemonNameLanguage = TV_GetStringLanguage(curShow->contestLiveUpdates2.nickname); + case TVSHOW_LILYCOVE_CONTEST_LADY: + curShow->contestLady.language = TV_GetStringLanguage(curShow->contestLady.playerName); + curShow->contestLady.pokemonNameLanguage = TV_GetStringLanguage(curShow->contestLady.nickname); break; - case TVSHOW_POKEMON_TODAY_CAUGHT: curShow->pokemonToday.language = TV_GetStringLanguage(curShow->pokemonToday.playerName); curShow->pokemonToday.language2 = TV_GetStringLanguage(curShow->pokemonToday.nickname); @@ -4492,8 +4491,8 @@ void DoTVShow(void) case TVSHOW_SAFARI_FAN_CLUB: DoTVShowSafariFanClub(); break; - case TVSHOW_CONTEST_LIVE_UPDATES_2: - DoTVShowPokemonContestLiveUpdates2(); + case TVSHOW_LILYCOVE_CONTEST_LADY: + DoTVShowLilycoveContestLady(); break; } } @@ -7174,7 +7173,8 @@ static void DoTVShowSafariFanClub(void) ShowFieldMessage(sTVSafariFanClubTextGroup[state]); } -static void DoTVShowPokemonContestLiveUpdates2(void) +// This show is a version of Contest Live Updates for the Lilycove Contest Lady +static void DoTVShowLilycoveContestLady(void) { TVShow *show; u8 state; @@ -7184,30 +7184,30 @@ static void DoTVShowPokemonContestLiveUpdates2(void) state = sTVShowState; switch (state) { - case 0: - BufferContestName(gStringVar1, show->contestLiveUpdates2.contestCategory); - if (show->contestLiveUpdates2.pokeblockState == 1) - { - sTVShowState = 1; - } - else if (show->contestLiveUpdates2.pokeblockState == 0) - { - sTVShowState = 2; - } - else - { - sTVShowState = 3; - } - break; - case 1: - case 2: - TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates2.playerName, show->contestLiveUpdates2.language); - case 3: - TVShowConvertInternationalString(gStringVar2, show->contestLiveUpdates2.nickname, show->contestLiveUpdates2.pokemonNameLanguage); - TVShowDone(); - break; + case CONTESTLADYLIVE_STATE_INTRO: + BufferContestName(gStringVar1, show->contestLady.contestCategory); + if (show->contestLady.pokeblockState == CONTEST_LADY_GOOD) + { + sTVShowState = CONTESTLADYLIVE_STATE_WON; + } + else if (show->contestLady.pokeblockState == CONTEST_LADY_NORMAL) + { + sTVShowState = CONTESTLADYLIVE_STATE_LOST; + } + else // CONTEST_LADY_BAD + { + sTVShowState = CONTESTLADYLIVE_STATE_LOST_BADLY; + } + break; + case CONTESTLADYLIVE_STATE_WON: + case CONTESTLADYLIVE_STATE_LOST: + TVShowConvertInternationalString(gStringVar3, show->contestLady.playerName, show->contestLady.language); + case CONTESTLADYLIVE_STATE_LOST_BADLY: + TVShowConvertInternationalString(gStringVar2, show->contestLady.nickname, show->contestLady.pokemonNameLanguage); + TVShowDone(); + break; } - ShowFieldMessage(sTVPokemonContestLiveUpdates2TextGroup[state]); + ShowFieldMessage(sTVLilycoveContestLadyTextGroup[state]); } void TVShowDone(void) From c9d3b26ff7de11b39ceeb0c713cb7b821f2b03d3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 02:12:46 -0400 Subject: [PATCH 02/63] Label miss string indexes --- data/battle_scripts_1.s | 12 +++++----- include/constants/battle_script_commands.h | 1 + include/constants/battle_string_ids.h | 7 ++++++ src/battle_message.c | 8 ++++--- src/battle_script_commands.c | 28 +++++++++++----------- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index ad9576a62..99b9be8dc 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2113,7 +2113,7 @@ BattleScript_EffectStockpile:: BattleScript_EffectSpitUp:: attackcanceler - jumpifbyte CMP_EQUAL, gBattleCommunication + 6, 0x1, BattleScript_82D9FA2 + jumpifbyte CMP_EQUAL, cMISS_TYPE, B_MSG_PROTECTED, BattleScript_SpitUpFailProtect attackstring ppreduce accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE @@ -2127,7 +2127,7 @@ BattleScript_SpitUpFail:: waitmessage 0x40 goto BattleScript_MoveEnd -BattleScript_82D9FA2:: +BattleScript_SpitUpFailProtect:: attackstring ppreduce pause 0x40 @@ -2223,7 +2223,7 @@ BattleScript_AlreadyBurned:: BattleScript_EffectMemento:: attackcanceler - jumpifbyte CMP_EQUAL, gBattleCommunication + 6, 0x1, BattleScript_82DA153 + jumpifbyte CMP_EQUAL, cMISS_TYPE, B_MSG_PROTECTED, BattleScript_MementoFailProtect attackstring ppreduce jumpifattackandspecialattackcannotfall BattleScript_ButItFailed @@ -2253,11 +2253,11 @@ BattleScript_EffectMementoPrintNoEffect: printstring STRINGID_BUTNOEFFECT waitmessage 0x40 goto BattleScript_EffectMementoTryFaint -BattleScript_82DA153: +BattleScript_MementoFailProtect: attackstring ppreduce - jumpifattackandspecialattackcannotfall BattleScript_82DA15A -BattleScript_82DA15A: + jumpifattackandspecialattackcannotfall BattleScript_MementoFailEnd +BattleScript_MementoFailEnd: setatkhptozero pause 0x40 effectivenesssound diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 9372377c4..cef0b184d 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -32,6 +32,7 @@ #define cEFFECT_CHOOSER gBattleCommunication + 3 #define cMULTISTRING_CHOOSER gBattleCommunication + 5 +#define cMISS_TYPE gBattleCommunication + 6 // Battle Script defines for getting the wanted battler #define BS_TARGET 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 1886043f1..f5b036b5d 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -383,4 +383,11 @@ #define STRINGID_TRAINER1WINTEXT 379 #define STRINGID_TRAINER2WINTEXT 380 +// Indexes into gMissStringIds +#define B_MSG_MISSED 0 +#define B_MSG_PROTECTED 1 +#define B_MSG_AVOIDED_ATK 2 +#define B_MSG_AVOIDED_DMG 3 +#define B_MSG_GROUND_MISS 4 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H diff --git a/src/battle_message.c b/src/battle_message.c index 46444a8fa..5f088dded 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -893,9 +893,11 @@ const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] = const u16 gMissStringIds[] = { - STRINGID_ATTACKMISSED, STRINGID_PKMNPROTECTEDITSELF, - STRINGID_PKMNAVOIDEDATTACK, STRINGID_AVOIDEDDAMAGE, - STRINGID_PKMNMAKESGROUNDMISS + [B_MSG_MISSED] = STRINGID_ATTACKMISSED, + [B_MSG_PROTECTED] = STRINGID_PKMNPROTECTEDITSELF, + [B_MSG_AVOIDED_ATK] = STRINGID_PKMNAVOIDEDATTACK, + [B_MSG_AVOIDED_DMG] = STRINGID_AVOIDEDDAMAGE, + [B_MSG_GROUND_MISS] = STRINGID_PKMNMAKESGROUNDMISS }; const u16 gNoEscapeStringIds[] = diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 84f8efaa8..e0a3693eb 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -991,7 +991,7 @@ static void Cmd_attackcanceler(void) gMoveResultFlags |= MOVE_RESULT_MISSED; gLastLandedMoves[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0; - gBattleCommunication[6] = 1; + gBattleCommunication[6] = B_MSG_PROTECTED; gBattlescriptCurrInstr++; } else @@ -1024,7 +1024,7 @@ static void Cmd_jumpifaffectedbyprotect(void) { gMoveResultFlags |= MOVE_RESULT_MISSED; JumpIfMoveFailed(5, 0); - gBattleCommunication[6] = 1; + gBattleCommunication[6] = B_MSG_PROTECTED; } else { @@ -1039,7 +1039,7 @@ bool8 JumpIfMoveAffectedByProtect(u16 move) { gMoveResultFlags |= MOVE_RESULT_MISSED; JumpIfMoveFailed(7, move); - gBattleCommunication[6] = 1; + gBattleCommunication[6] = B_MSG_PROTECTED; affected = TRUE; } return affected; @@ -1172,9 +1172,9 @@ static void Cmd_accuracycheck(void) gMoveResultFlags |= MOVE_RESULT_MISSED; if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && (gBattleMoves[move].target == MOVE_TARGET_BOTH || gBattleMoves[move].target == MOVE_TARGET_FOES_AND_ALLY)) - gBattleCommunication[6] = 2; + gBattleCommunication[6] = B_MSG_AVOIDED_ATK; else - gBattleCommunication[6] = 0; + gBattleCommunication[6] = B_MSG_MISSED; CheckWonderGuardAndLevitate(); } @@ -1370,7 +1370,7 @@ static void Cmd_typecalc(void) gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE); gLastLandedMoves[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0; - gBattleCommunication[6] = moveType; + gBattleCommunication[6] = B_MSG_GROUND_MISS; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } else @@ -1406,7 +1406,7 @@ static void Cmd_typecalc(void) gMoveResultFlags |= MOVE_RESULT_MISSED; gLastLandedMoves[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0; - gBattleCommunication[6] = 3; + gBattleCommunication[6] = B_MSG_AVOIDED_DMG; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } if (gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) @@ -1429,7 +1429,7 @@ static void CheckWonderGuardAndLevitate(void) if (gBattleMons[gBattlerTarget].ability == ABILITY_LEVITATE && moveType == TYPE_GROUND) { gLastUsedAbility = ABILITY_LEVITATE; - gBattleCommunication[6] = moveType; + gBattleCommunication[6] = B_MSG_GROUND_MISS; RecordAbilityBattle(gBattlerTarget, ABILITY_LEVITATE); return; } @@ -1484,7 +1484,7 @@ static void CheckWonderGuardAndLevitate(void) if (((flags & 2) || !(flags & 1)) && gBattleMoves[gCurrentMove].power) { gLastUsedAbility = ABILITY_WONDER_GUARD; - gBattleCommunication[6] = 3; + gBattleCommunication[6] = B_MSG_AVOIDED_DMG; RecordAbilityBattle(gBattlerTarget, ABILITY_WONDER_GUARD); } } @@ -2019,7 +2019,7 @@ static void Cmd_resultmessage(void) if (gBattleControllerExecFlags) return; - if (gMoveResultFlags & MOVE_RESULT_MISSED && (!(gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) || gBattleCommunication[6] > 2)) + if (gMoveResultFlags & MOVE_RESULT_MISSED && (!(gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) || gBattleCommunication[6] > B_MSG_AVOIDED_ATK)) { stringId = gMissStringIds[gBattleCommunication[6]]; gBattleCommunication[MSG_DISPLAY] = 1; @@ -4459,7 +4459,7 @@ static void Cmd_typecalc2(void) gLastUsedAbility = gBattleMons[gBattlerTarget].ability; gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE); gLastLandedMoves[gBattlerTarget] = 0; - gBattleCommunication[6] = moveType; + gBattleCommunication[6] = B_MSG_GROUND_MISS; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } else @@ -4534,7 +4534,7 @@ static void Cmd_typecalc2(void) gLastUsedAbility = ABILITY_WONDER_GUARD; gMoveResultFlags |= MOVE_RESULT_MISSED; gLastLandedMoves[gBattlerTarget] = 0; - gBattleCommunication[6] = 3; + gBattleCommunication[6] = B_MSG_AVOIDED_DMG; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } if (gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) @@ -6802,7 +6802,7 @@ static void Cmd_stockpiletobasedamage(void) } else { - if (gBattleCommunication[6] != 1) + if (gBattleCommunication[6] != B_MSG_PROTECTED) { gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerTarget], gCurrentMove, gSideStatuses[GET_BATTLER_SIDE(gBattlerTarget)], 0, @@ -8928,7 +8928,7 @@ static void Cmd_jumpifattackandspecialattackcannotfall(void) // memento { if (gBattleMons[gBattlerTarget].statStages[STAT_ATK] == MIN_STAT_STAGE && gBattleMons[gBattlerTarget].statStages[STAT_SPATK] == MIN_STAT_STAGE - && gBattleCommunication[6] != 1) + && gBattleCommunication[6] != B_MSG_PROTECTED) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } From 87430a1ebcee5570613127ab674269e4e62400d0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 02:16:01 -0400 Subject: [PATCH 03/63] Add WAIT_TIME battle script constants --- data/battle_scripts_1.s | 827 ++++++++++++++++++++-------------------- 1 file changed, 415 insertions(+), 412 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 99b9be8dc..92ef199cc 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -12,6 +12,9 @@ .include "constants/constants.inc" .section script_data, "aw", %progbits + +.set WAIT_TIME_LONG, 64 +.set WAIT_TIME_SHORT, 32 .align 2 gBattleScriptsForMoveEffects:: @ 82D86A8 @@ -256,7 +259,7 @@ BattleScript_EffectHit:: jumpifnotmove MOVE_SURF, BattleScript_HitFromAtkCanceler jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_HitFromAtkCanceler orword gHitMarker, HITMARKER_IGNORE_UNDERWATER - setbyte sDMG_MULTIPLIER, 0x2 + setbyte sDMG_MULTIPLIER, 2 BattleScript_HitFromAtkCanceler:: attackcanceler BattleScript_HitFromAccCheck:: @@ -278,9 +281,9 @@ BattleScript_HitFromAtkAnimation:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL BattleScript_MoveEnd:: @@ -293,11 +296,11 @@ BattleScript_PrintMoveMissed:: attackstring ppreduce BattleScript_MoveMissedPause:: - pause 0x20 + pause WAIT_TIME_SHORT BattleScript_MoveMissed:: effectivenesssound resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSleep:: @@ -318,21 +321,21 @@ BattleScript_EffectSleep:: BattleScript_AlreadyAsleep:: setalreadystatusedmoveattempt BS_ATTACKER - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNALREADYASLEEP - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_WasntAffected:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNWASNTAFFECTED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_CantMakeAsleep:: - pause 0x20 + pause WAIT_TIME_SHORT printfromtable gUproarAwakeStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectPoisonHit:: @@ -357,9 +360,9 @@ BattleScript_EffectAbsorb:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG negativedamage orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_AbsorbLiquidOoze @@ -373,7 +376,7 @@ BattleScript_AbsorbUpdateHp:: datahpupdate BS_ATTACKER jumpifmovehadnoeffect BattleScript_AbsorbTryFainting printfromtable gLeechSeedDrainStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_AbsorbTryFainting:: tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_TARGET, FALSE, NULL @@ -418,9 +421,9 @@ BattleScript_ExplosionLoop: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL moveendto MOVEEND_NEXT_TARGET jumpifnexttargetvalid BattleScript_ExplosionLoop @@ -429,7 +432,7 @@ BattleScript_ExplosionLoop: BattleScript_ExplosionMissed: effectivenesssound resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG moveendto MOVEEND_NEXT_TARGET jumpifnexttargetvalid BattleScript_ExplosionLoop tryfaintmon BS_ATTACKER, FALSE, NULL @@ -449,7 +452,7 @@ BattleScript_EffectDreamEater:: BattleScript_DreamEaterNoEffect: attackstring ppreduce - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_WasntAffected BattleScript_DreamEaterWorked: accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE @@ -467,16 +470,16 @@ BattleScript_DreamEaterWorked: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG negativedamage orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER jumpifmovehadnoeffect BattleScript_DreamEaterTryFaintEnd printstring STRINGID_PKMNDREAMEATEN - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_DreamEaterTryFaintEnd: tryfaintmon BS_TARGET, FALSE, NULL goto BattleScript_MoveEnd @@ -484,12 +487,12 @@ BattleScript_DreamEaterTryFaintEnd: BattleScript_EffectMirrorMove:: attackcanceler attackstring - pause 0x40 + pause WAIT_TIME_LONG trymirrormove ppreduce orbyte gMoveResultFlags, MOVE_RESULT_FAILED printstring STRINGID_MIRRORMOVEFAILED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectAttackUp:: @@ -513,7 +516,7 @@ BattleScript_EffectStatUpAfterAtkCanceler:: ppreduce statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_StatUpEnd jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatUpAttackAnim - pause 0x20 + pause WAIT_TIME_SHORT goto BattleScript_StatUpPrintString BattleScript_StatUpAttackAnim:: attackanimation @@ -523,14 +526,14 @@ BattleScript_StatUpDoAnim:: playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 BattleScript_StatUpPrintString:: printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_StatUpEnd:: goto BattleScript_MoveEnd BattleScript_StatUp:: playanimation BS_EFFECT_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_EffectAttackDown:: @@ -560,7 +563,7 @@ BattleScript_EffectStatDown:: statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StatDownEnd jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatDownDoAnim jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x3, BattleScript_StatDownEnd - pause 0x20 + pause WAIT_TIME_SHORT goto BattleScript_StatDownPrintString BattleScript_StatDownDoAnim:: attackanimation @@ -569,14 +572,14 @@ BattleScript_StatDownDoAnim:: playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 BattleScript_StatDownPrintString:: printfromtable gStatDownStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_StatDownEnd:: goto BattleScript_MoveEnd BattleScript_StatDown:: playanimation BS_EFFECT_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatDownStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_EffectHaze:: @@ -587,7 +590,7 @@ BattleScript_EffectHaze:: waitanimation normalisebuffs printstring STRINGID_STATCHANGESGONE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectBide:: @@ -650,23 +653,23 @@ BattleScript_DoMultiHit:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG printstring STRINGID_EMPTYSTRING3 - waitmessage 0x1 + waitmessage 1 addbyte sMULTIHIT_STRING + 4, 0x1 moveendto MOVEEND_NEXT_TARGET jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_MultiHitPrintStrings decrementmultihit BattleScript_MultiHitLoop goto BattleScript_MultiHitPrintStrings BattleScript_MultiHitNoMoreHits:: - pause 0x20 + pause WAIT_TIME_SHORT BattleScript_MultiHitPrintStrings:: resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG jumpifmovehadnoeffect BattleScript_MultiHitEnd copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6 printstring STRINGID_HITXTIMES - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_MultiHitEnd:: seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL @@ -682,7 +685,7 @@ BattleScript_EffectConversion:: attackanimation waitanimation printstring STRINGID_PKMNCHANGEDTYPE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectFlinchHit:: @@ -700,7 +703,7 @@ BattleScript_EffectRestoreHp:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNREGAINEDHEALTH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectToxic:: @@ -721,14 +724,14 @@ BattleScript_EffectToxic:: setmoveeffect MOVE_EFFECT_TOXIC seteffectprimary resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AlreadyPoisoned:: setalreadystatusedmoveattempt BS_ATTACKER - pause 0x40 + pause WAIT_TIME_LONG printstring STRINGID_PKMNALREADYPOISONED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_ImmunityProtected:: @@ -759,24 +762,24 @@ BattleScript_EffectRest:: jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_RestIsAlreadyAsleep jumpifcantmakeasleep BattleScript_RestCantSleep trysetrest BattleScript_AlreadyAtFullHp - pause 0x20 + pause WAIT_TIME_SHORT printfromtable gRestUsedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_ATTACKER waitstate goto BattleScript_PresentHealTarget BattleScript_RestCantSleep:: - pause 0x40 + pause WAIT_TIME_LONG printfromtable gUproarAwakeStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_RestIsAlreadyAsleep:: setalreadystatusedmoveattempt BS_ATTACKER - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNALREADYASLEEP2 - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectOHKO:: @@ -790,9 +793,9 @@ BattleScript_EffectOHKO:: trysetdestinybondtohappen goto BattleScript_HitFromAtkAnimation BattleScript_KOFail:: - pause 0x40 + pause WAIT_TIME_LONG printfromtable gKOFailedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRazorWind:: @@ -823,7 +826,7 @@ BattleScriptFirstChargingTurn:: seteffectprimary copybyte cMULTISTRING_CHOOSER, sTWOTURN_STRINGID printfromtable gFirstTurnOfTwoStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_EffectSuperFang:: @@ -851,7 +854,7 @@ BattleScript_EffectTrap:: jumpifnotmove MOVE_WHIRLPOOL, BattleScript_DoWrapEffect jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_DoWrapEffect orword gHitMarker, HITMARKER_IGNORE_UNDERWATER - setbyte sDMG_MULTIPLIER, 0x2 + setbyte sDMG_MULTIPLIER, 2 BattleScript_DoWrapEffect:: setmoveeffect MOVE_EFFECT_WRAP goto BattleScript_EffectHit @@ -873,12 +876,12 @@ BattleScript_EffectRecoilIfMiss:: BattleScript_MoveMissedDoDamage:: attackstring ppreduce - pause 0x40 + pause WAIT_TIME_LONG resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd printstring STRINGID_PKMNCRASHED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG damagecalc typecalc adjustnormaldamage @@ -899,7 +902,7 @@ BattleScript_EffectMist:: attackanimation waitanimation printfromtable gMistUsedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectFocusEnergy:: @@ -911,7 +914,7 @@ BattleScript_EffectFocusEnergy:: attackanimation waitanimation printfromtable gFocusEnergyUsedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRecoil:: @@ -934,14 +937,14 @@ BattleScript_EffectConfuse:: setmoveeffect MOVE_EFFECT_CONFUSION seteffectprimary resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AlreadyConfused:: setalreadystatusedmoveattempt BS_ATTACKER - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNALREADYCONFUSED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectAttackUp2:: @@ -972,7 +975,7 @@ BattleScript_EffectTransform:: attackanimation waitanimation printfromtable gTransformUsedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectAttackDown2:: @@ -1000,7 +1003,7 @@ BattleScript_PrintReflectLightScreenSafeguardString:: attackanimation waitanimation printfromtable gReflectLightScreenSafeguardStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectPoison:: @@ -1021,7 +1024,7 @@ BattleScript_EffectPoison:: setmoveeffect MOVE_EFFECT_POISON seteffectprimary resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectParalyze:: @@ -1041,14 +1044,14 @@ BattleScript_EffectParalyze:: setmoveeffect MOVE_EFFECT_PARALYSIS seteffectprimary resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AlreadyParalyzed:: setalreadystatusedmoveattempt BS_ATTACKER - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNISALREADYPARALYZED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_LimberProtected:: @@ -1110,7 +1113,7 @@ BattleScript_EffectSubstitute:: jumpifstatus2 BS_ATTACKER, STATUS2_SUBSTITUTE, BattleScript_AlreadyHasSubstitute setsubstitute jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x1, BattleScript_SubstituteAnim - pause 0x20 + pause WAIT_TIME_SHORT goto BattleScript_SubstituteString BattleScript_SubstituteAnim:: attackanimation @@ -1119,13 +1122,13 @@ BattleScript_SubstituteAnim:: datahpupdate BS_ATTACKER BattleScript_SubstituteString:: printfromtable gSubsituteUsedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AlreadyHasSubstitute:: setalreadystatusedmoveattempt BS_ATTACKER - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNHASSUBSTITUTE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRecharge:: @@ -1136,7 +1139,7 @@ BattleScript_EffectRecharge:: BattleScript_MoveUsedMustRecharge:: printstring STRINGID_PKMNMUSTRECHARGE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRage:: @@ -1161,13 +1164,13 @@ BattleScript_EffectMimic:: attackanimation waitanimation printstring STRINGID_PKMNLEARNEDMOVE2 - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectMetronome:: attackcanceler attackstring - pause 0x20 + pause WAIT_TIME_SHORT attackanimation waitanimation setbyte sB_ANIM_TURN, 0x0 @@ -1177,7 +1180,7 @@ BattleScript_EffectMetronome:: BattleScript_EffectLeechSeed:: attackcanceler attackstring - pause 0x20 + pause WAIT_TIME_SHORT ppreduce jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_ButItFailed accuracycheck BattleScript_DoLeechSeed, ACC_CURR_MOVE @@ -1186,7 +1189,7 @@ BattleScript_DoLeechSeed:: attackanimation waitanimation printfromtable gLeechSeedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSplash:: @@ -1197,7 +1200,7 @@ BattleScript_EffectSplash:: waitanimation incrementgamestat GAME_STAT_USED_SPLASH printstring STRINGID_BUTNOTHINGHAPPENED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectDisable:: @@ -1209,7 +1212,7 @@ BattleScript_EffectDisable:: attackanimation waitanimation printstring STRINGID_PKMNMOVEWASDISABLED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectLevelDamage:: @@ -1253,7 +1256,7 @@ BattleScript_EffectEncore:: attackanimation waitanimation printstring STRINGID_PKMNGOTENCORE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectPainSplit:: @@ -1271,7 +1274,7 @@ BattleScript_EffectPainSplit:: healthbarupdate BS_TARGET datahpupdate BS_TARGET printstring STRINGID_SHAREDPAIN - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSnore:: @@ -1283,7 +1286,7 @@ BattleScript_EffectSnore:: BattleScript_SnoreIsAsleep:: jumpifhalfword CMP_EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_DoSnore printstring STRINGID_PKMNFASTASLEEP - waitmessage 0x40 + waitmessage WAIT_TIME_LONG statusanimation BS_ATTACKER BattleScript_DoSnore:: attackstring @@ -1300,7 +1303,7 @@ BattleScript_EffectConversion2:: attackanimation waitanimation printstring STRINGID_PKMNCHANGEDTYPE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectLockOn:: @@ -1313,7 +1316,7 @@ BattleScript_EffectLockOn:: attackanimation waitanimation printstring STRINGID_PKMNTOOKAIM - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSketch:: @@ -1325,7 +1328,7 @@ BattleScript_EffectSketch:: attackanimation waitanimation printstring STRINGID_PKMNSKETCHEDMOVE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSleepTalk:: @@ -1336,13 +1339,13 @@ BattleScript_EffectSleepTalk:: goto BattleScript_ButItFailed BattleScript_SleepTalkIsAsleep:: printstring STRINGID_PKMNFASTASLEEP - waitmessage 0x40 + waitmessage WAIT_TIME_LONG statusanimation BS_ATTACKER attackstring ppreduce orword gHitMarker, HITMARKER_NO_PPDEDUCT trychoosesleeptalkmove BattleScript_SleepTalkUsingMove - pause 0x40 + pause WAIT_TIME_LONG goto BattleScript_ButItFailed BattleScript_SleepTalkUsingMove:: attackanimation @@ -1359,7 +1362,7 @@ BattleScript_EffectDestinyBond:: attackanimation waitanimation printstring STRINGID_PKMNTRYINGTOTAKEFOE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectFlail:: @@ -1375,7 +1378,7 @@ BattleScript_EffectSpite:: attackanimation waitanimation printstring STRINGID_PKMNREDUCEDPP - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectHealBell:: @@ -1387,15 +1390,15 @@ BattleScript_EffectHealBell:: attackanimation waitanimation printfromtable gPartyStatusHealStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG jumpifnotmove MOVE_HEAL_BELL, BattleScript_PartyHealEnd jumpifbyte CMP_NO_COMMON_BITS, cMULTISTRING_CHOOSER, 0x1, BattleScript_CheckHealBellMon2Unaffected printstring STRINGID_PKMNSXBLOCKSY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_CheckHealBellMon2Unaffected:: jumpifbyte CMP_NO_COMMON_BITS, cMULTISTRING_CHOOSER, 0x2, BattleScript_PartyHealEnd printstring STRINGID_PKMNSXBLOCKSY2 - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_PartyHealEnd:: updatestatusicon BS_ATTACKER_WITH_PARTNER waitstate @@ -1432,25 +1435,25 @@ BattleScript_DoTripleKickAttack:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG printstring STRINGID_EMPTYSTRING3 - waitmessage 0x1 + waitmessage 1 moveendto MOVEEND_NEXT_TARGET jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_TripleKickPrintStrings decrementmultihit BattleScript_TripleKickLoop goto BattleScript_TripleKickPrintStrings BattleScript_TripleKickNoMoreHits:: - pause 0x20 + pause WAIT_TIME_SHORT jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0x0, BattleScript_TripleKickPrintStrings bicbyte gMoveResultFlags, MOVE_RESULT_MISSED BattleScript_TripleKickPrintStrings:: resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0x0, BattleScript_TripleKickEnd jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_TripleKickEnd copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6 printstring STRINGID_HITXTIMES - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_TripleKickEnd:: seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL @@ -1473,7 +1476,7 @@ BattleScript_EffectMeanLook:: setmoveeffect MOVE_EFFECT_PREVENT_ESCAPE seteffectprimary printstring STRINGID_TARGETCANTESCAPENOW - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectNightmare:: @@ -1490,7 +1493,7 @@ BattleScript_NightmareWorked:: setmoveeffect MOVE_EFFECT_NIGHTMARE seteffectprimary printstring STRINGID_PKMNFELLINTONIGHTMARE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectMinimize:: @@ -1515,17 +1518,17 @@ BattleScript_CurseTrySpeed:: setstatchanger STAT_SPEED, 1, TRUE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseTryAttack printfromtable gStatDownStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_CurseTryAttack:: setstatchanger STAT_ATK, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseTryDefence printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_CurseTryDefence:: setstatchanger STAT_DEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseEnd printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_CurseEnd:: goto BattleScript_MoveEnd BattleScript_GhostCurse:: @@ -1545,7 +1548,7 @@ BattleScript_DoGhostCurse:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNLAIDCURSE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG tryfaintmon BS_ATTACKER, FALSE, NULL goto BattleScript_MoveEnd @@ -1558,7 +1561,7 @@ BattleScript_EffectEndure:: attackanimation waitanimation printfromtable gProtectLikeUsedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSpikes:: @@ -1569,7 +1572,7 @@ BattleScript_EffectSpikes:: attackanimation waitanimation printstring STRINGID_SPIKESSCATTERED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectForesight:: @@ -1581,7 +1584,7 @@ BattleScript_EffectForesight:: attackanimation waitanimation printstring STRINGID_PKMNIDENTIFIED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectPerishSong:: @@ -1592,7 +1595,7 @@ BattleScript_EffectPerishSong:: attackanimation waitanimation printstring STRINGID_FAINTINTHREE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG setbyte sBATTLER, 0x0 BattleScript_PerishSongLoop:: jumpifability BS_SCRIPTING, ABILITY_SOUNDPROOF, BattleScript_PerishSongNotAffected @@ -1603,7 +1606,7 @@ BattleScript_PerishSongLoopIncrement:: BattleScript_PerishSongNotAffected:: printstring STRINGID_PKMNSXBLOCKSY2 - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_PerishSongLoopIncrement BattleScript_EffectSandstorm:: @@ -1640,7 +1643,7 @@ BattleScript_EffectSwagger:: setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_SwaggerTryConfuse:: jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_OwnTempoPrevents jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected @@ -1671,7 +1674,7 @@ BattleScript_EffectAttract:: attackanimation waitanimation printstring STRINGID_PKMNFELLINLOVE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectReturn:: @@ -1706,9 +1709,9 @@ BattleScript_EffectMagnitude:: ppreduce selectfirstvalidtarget magnitudedamagecalculation - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_MAGNITUDESTRENGTH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_HitsAllWithUndergroundBonusLoop BattleScript_EffectBatonPass:: @@ -1770,7 +1773,7 @@ BattleScript_MoveWeatherChange:: attackanimation waitanimation printfromtable gMoveWeatherChangeStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG call BattleScript_WeatherFormChanges goto BattleScript_MoveEnd @@ -1804,7 +1807,7 @@ BattleScript_EffectBellyDrum:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNCUTHPMAXEDATTACK - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectPsychUp:: @@ -1815,7 +1818,7 @@ BattleScript_EffectPsychUp:: attackanimation waitanimation printstring STRINGID_PKMNCOPIEDSTATCHANGES - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectMirrorCoat:: @@ -1839,14 +1842,14 @@ BattleScript_EffectSkullBash:: setgraphicalstatchangevalues playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_SkullBashEnd:: goto BattleScript_MoveEnd BattleScript_EffectTwister:: jumpifnostatus3 BS_TARGET, STATUS3_ON_AIR, BattleScript_FlinchEffect orword gHitMarker, HITMARKER_IGNORE_ON_AIR - setbyte sDMG_MULTIPLIER, 0x2 + setbyte sDMG_MULTIPLIER, 2 BattleScript_FlinchEffect:: setmoveeffect MOVE_EFFECT_FLINCH goto BattleScript_EffectHit @@ -1860,11 +1863,11 @@ BattleScript_HitsAllWithUndergroundBonusLoop:: movevaluescleanup jumpifnostatus3 BS_TARGET, STATUS3_UNDERGROUND, BattleScript_HitsAllNoUndergroundBonus orword gHitMarker, HITMARKER_IGNORE_UNDERGROUND - setbyte sDMG_MULTIPLIER, 0x2 + setbyte sDMG_MULTIPLIER, 2 goto BattleScript_DoHitAllWithUndergroundBonus BattleScript_HitsAllNoUndergroundBonus:: bicword gHitMarker, HITMARKER_IGNORE_UNDERGROUND - setbyte sDMG_MULTIPLIER, 0x1 + setbyte sDMG_MULTIPLIER, 1 BattleScript_DoHitAllWithUndergroundBonus:: accuracycheck BattleScript_HitAllWithUndergroundBonusMissed, ACC_CURR_MOVE critcalc @@ -1879,21 +1882,21 @@ BattleScript_DoHitAllWithUndergroundBonus:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG printstring STRINGID_EMPTYSTRING3 - waitmessage 0x1 + waitmessage 1 tryfaintmon BS_TARGET, FALSE, NULL moveendto MOVEEND_NEXT_TARGET jumpifnexttargetvalid BattleScript_HitsAllWithUndergroundBonusLoop end BattleScript_HitAllWithUndergroundBonusMissed:: - pause 0x20 + pause WAIT_TIME_SHORT typecalc effectivenesssound resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG moveendto MOVEEND_NEXT_TARGET jumpifnexttargetvalid BattleScript_HitsAllWithUndergroundBonusLoop end @@ -1906,18 +1909,18 @@ BattleScript_EffectFutureSight:: attackanimation waitanimation printfromtable gFutureMoveUsedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectGust:: jumpifnostatus3 BS_TARGET, STATUS3_ON_AIR, BattleScript_EffectHit orword gHitMarker, HITMARKER_IGNORE_ON_AIR - setbyte sDMG_MULTIPLIER, 0x2 + setbyte sDMG_MULTIPLIER, 2 goto BattleScript_EffectHit BattleScript_EffectStomp:: jumpifnostatus3 BS_TARGET, STATUS3_MINIMIZED, BattleScript_FlinchEffect - setbyte sDMG_MULTIPLIER, 0x2 + setbyte sDMG_MULTIPLIER, 2 goto BattleScript_FlinchEffect BattleScript_EffectSolarbeam:: @@ -1953,7 +1956,7 @@ BattleScript_EffectTeleport:: attackanimation waitanimation printstring STRINGID_PKMNFLEDFROMBATTLE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG setoutcomeonteleport BS_ATTACKER goto BattleScript_MoveEnd @@ -1961,7 +1964,7 @@ BattleScript_EffectBeatUp:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring - pause 0x20 + pause WAIT_TIME_SHORT ppreduce setbyte gBattleCommunication, 0x0 BattleScript_BeatUpLoop:: @@ -1981,9 +1984,9 @@ BattleScript_BeatUpAttack:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL moveendto MOVEEND_NEXT_TARGET goto BattleScript_BeatUpLoop @@ -2056,13 +2059,13 @@ BattleScript_PresentHealTarget:: healthbarupdate BS_TARGET datahpupdate BS_TARGET printstring STRINGID_PKMNREGAINEDHEALTH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AlreadyAtFullHp:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNHPFULL - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectFakeOut:: @@ -2076,17 +2079,17 @@ BattleScript_ButItFailedAtkStringPpReduce:: BattleScript_ButItFailedPpReduce:: ppreduce BattleScript_ButItFailed:: - pause 0x20 + pause WAIT_TIME_SHORT orbyte gMoveResultFlags, MOVE_RESULT_FAILED resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_NotAffected:: - pause 0x20 + pause WAIT_TIME_SHORT orbyte gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectUproar:: @@ -2108,7 +2111,7 @@ BattleScript_EffectStockpile:: attackanimation waitanimation printfromtable gStockpileUsedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSpitUp:: @@ -2122,18 +2125,18 @@ BattleScript_EffectSpitUp:: adjustsetdamage goto BattleScript_HitFromAtkAnimation BattleScript_SpitUpFail:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_FAILEDTOSPITUP - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SpitUpFailProtect:: attackstring ppreduce - pause 0x40 + pause WAIT_TIME_LONG stockpiletobasedamage BattleScript_SpitUpFail resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSwallow:: @@ -2144,9 +2147,9 @@ BattleScript_EffectSwallow:: goto BattleScript_PresentHealTarget BattleScript_SwallowFail:: - pause 0x20 + pause WAIT_TIME_SHORT printfromtable gSwallowFailStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectHail:: @@ -2165,7 +2168,7 @@ BattleScript_EffectTorment:: attackanimation waitanimation printstring STRINGID_PKMNSUBJECTEDTOTORMENT - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectFlatter:: @@ -2183,7 +2186,7 @@ BattleScript_EffectFlatter:: setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_FlatterTryConfuse:: jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_OwnTempoPrevents jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected @@ -2216,9 +2219,9 @@ BattleScript_WaterVeilPrevents:: BattleScript_AlreadyBurned:: setalreadystatusedmoveattempt BS_ATTACKER - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNALREADYHASBURN - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectMemento:: @@ -2238,20 +2241,20 @@ BattleScript_EffectMemento:: statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_EffectMementoTrySpAtk jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_EffectMementoTrySpAtk printfromtable gStatDownStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_EffectMementoTrySpAtk: playstatchangeanimation BS_TARGET, BIT_SPATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO setstatchanger STAT_SPATK, 2, TRUE statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_EffectMementoTryFaint jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_EffectMementoTryFaint printfromtable gStatDownStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_EffectMementoTryFaint: tryfaintmon BS_ATTACKER, FALSE, NULL goto BattleScript_MoveEnd BattleScript_EffectMementoPrintNoEffect: printstring STRINGID_BUTNOEFFECT - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_EffectMementoTryFaint BattleScript_MementoFailProtect: attackstring @@ -2259,10 +2262,10 @@ BattleScript_MementoFailProtect: jumpifattackandspecialattackcannotfall BattleScript_MementoFailEnd BattleScript_MementoFailEnd: setatkhptozero - pause 0x40 + pause WAIT_TIME_LONG effectivenesssound resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG tryfaintmon BS_ATTACKER, FALSE, NULL goto BattleScript_MoveEnd @@ -2271,7 +2274,7 @@ BattleScript_EffectFacade:: goto BattleScript_EffectHit BattleScript_FacadeDoubleDmg:: - setbyte sDMG_MULTIPLIER, 0x2 + setbyte sDMG_MULTIPLIER, 2 goto BattleScript_EffectHit BattleScript_EffectFocusPunch:: @@ -2279,7 +2282,7 @@ BattleScript_EffectFocusPunch:: jumpifnodamage BattleScript_HitFromAccCheck ppreduce printstring STRINGID_PKMNLOSTFOCUS - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSmellingsalt:: @@ -2288,7 +2291,7 @@ BattleScript_EffectSmellingsalt:: jumpifstatus BS_TARGET, STATUS1_PARALYSIS, BattleScript_SmellingsaltDoubleDmg goto BattleScript_EffectHit BattleScript_SmellingsaltDoubleDmg: - setbyte sDMG_MULTIPLIER, 0x2 + setbyte sDMG_MULTIPLIER, 2 goto BattleScript_EffectHit BattleScript_EffectFollowMe:: @@ -2299,16 +2302,16 @@ BattleScript_EffectFollowMe:: attackanimation waitanimation printstring STRINGID_PKMNCENTERATTENTION - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectNaturePower:: attackcanceler attackstring - pause 0x20 + pause WAIT_TIME_SHORT callterrainattack printstring STRINGID_NATUREPOWERTURNEDINTO - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_EffectCharge:: @@ -2319,7 +2322,7 @@ BattleScript_EffectCharge:: attackanimation waitanimation printstring STRINGID_PKMNCHARGINGPOWER - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectTaunt:: @@ -2331,7 +2334,7 @@ BattleScript_EffectTaunt:: attackanimation waitanimation printstring STRINGID_PKMNFELLFORTAUNT - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectHelpingHand:: @@ -2342,7 +2345,7 @@ BattleScript_EffectHelpingHand:: attackanimation waitanimation printstring STRINGID_PKMNREADYTOHELP - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectTrick:: @@ -2355,9 +2358,9 @@ BattleScript_EffectTrick:: attackanimation waitanimation printstring STRINGID_PKMNSWITCHEDITEMS - waitmessage 0x40 + waitmessage WAIT_TIME_LONG printfromtable gItemSwapStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRolePlay:: @@ -2369,7 +2372,7 @@ BattleScript_EffectRolePlay:: attackanimation waitanimation printstring STRINGID_PKMNCOPIEDFOE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectWish:: @@ -2399,7 +2402,7 @@ BattleScript_EffectIngrain:: attackanimation waitanimation printstring STRINGID_PKMNPLANTEDROOTS - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSuperpower:: @@ -2414,7 +2417,7 @@ BattleScript_EffectMagicCoat:: attackanimation waitanimation printstring STRINGID_PKMNSHROUDEDITSELF - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRecycle:: @@ -2425,7 +2428,7 @@ BattleScript_EffectRecycle:: attackanimation waitanimation printstring STRINGID_XFOUNDONEY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRevenge:: @@ -2449,7 +2452,7 @@ BattleScript_BrickBreakAnim:: waitanimation jumpifbyte CMP_LESS_THAN, sB_ANIM_TURN, 0x2, BattleScript_BrickBreakDoHit printstring STRINGID_THEWALLSHATTERED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_BrickBreakDoHit:: typecalc2 effectivenesssound @@ -2458,9 +2461,9 @@ BattleScript_BrickBreakDoHit:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL goto BattleScript_MoveEnd @@ -2479,14 +2482,14 @@ BattleScript_EffectYawn:: attackanimation waitanimation printstring STRINGID_PKMNWASMADEDROWSY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_PrintBankAbilityMadeIneffective:: copybyte sBATTLER, sBATTLER_WITH_ABILITY BattleScript_PrintAbilityMadeIneffective:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNSXMADEITINEFFECTIVE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectKnockOff:: @@ -2520,7 +2523,7 @@ BattleScript_EffectSkillSwap:: attackanimation waitanimation printstring STRINGID_PKMNSWAPPEDABILITIES - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectImprison:: @@ -2531,7 +2534,7 @@ BattleScript_EffectImprison:: attackanimation waitanimation printstring STRINGID_PKMNSEALEDOPPONENTMOVE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRefresh:: @@ -2542,7 +2545,7 @@ BattleScript_EffectRefresh:: attackanimation waitanimation printstring STRINGID_PKMNSTATUSNORMAL - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_ATTACKER goto BattleScript_MoveEnd @@ -2554,7 +2557,7 @@ BattleScript_EffectGrudge:: attackanimation waitanimation printstring STRINGID_PKMNWANTSGRUDGE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSnatch:: @@ -2564,9 +2567,9 @@ BattleScript_EffectSnatch:: ppreduce attackanimation waitanimation - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNWAITSFORTARGET - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectLowKick:: @@ -2604,7 +2607,7 @@ BattleScript_TeeterDanceLoop:: waitanimation seteffectprimary resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_TeeterDanceDoMoveEndIncrement:: moveendto MOVEEND_NEXT_TARGET BattleScript_TeeterDanceLoopIncrement:: @@ -2613,33 +2616,33 @@ BattleScript_TeeterDanceLoopIncrement:: end BattleScript_TeeterDanceOwnTempoPrevents:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNPREVENTSCONFUSIONWITH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_TeeterDanceDoMoveEndIncrement BattleScript_TeeterDanceSafeguardProtected:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNUSEDSAFEGUARD - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_TeeterDanceDoMoveEndIncrement BattleScript_TeeterDanceSubstitutePrevents:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_BUTITFAILED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_TeeterDanceDoMoveEndIncrement BattleScript_TeeterDanceAlreadyConfused:: setalreadystatusedmoveattempt BS_ATTACKER - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNALREADYCONFUSED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_TeeterDanceDoMoveEndIncrement BattleScript_TeeterDanceMissed:: resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_TeeterDanceDoMoveEndIncrement BattleScript_EffectMudSport:: @@ -2651,7 +2654,7 @@ BattleScript_EffectWaterSport:: attackanimation waitanimation printfromtable gSportsUsedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectPoisonFang:: @@ -2683,22 +2686,22 @@ BattleScript_TickleDoMoveAnim:: statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_TickleTryLowerDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_TickleTryLowerDef printfromtable gStatDownStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_TickleTryLowerDef:: playstatchangeanimation BS_TARGET, BIT_DEF, STAT_CHANGE_NEGATIVE setstatchanger STAT_DEF, 1, TRUE statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_TickleEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_TickleEnd printfromtable gStatDownStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_TickleEnd:: goto BattleScript_MoveEnd BattleScript_CantLowerMultipleStats:: - pause 0x20 + pause WAIT_TIME_SHORT orbyte gMoveResultFlags, MOVE_RESULT_FAILED printstring STRINGID_STATSWONTDECREASE2 - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectCosmicPower:: @@ -2716,13 +2719,13 @@ BattleScript_CosmicPowerDoMoveAnim:: statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CosmicPowerTrySpDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CosmicPowerTrySpDef printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_CosmicPowerTrySpDef:: setstatchanger STAT_SPDEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CosmicPowerEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CosmicPowerEnd printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_CosmicPowerEnd:: goto BattleScript_MoveEnd @@ -2745,13 +2748,13 @@ BattleScript_BulkUpDoMoveAnim:: statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BulkUpTryDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_BulkUpTryDef printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_BulkUpTryDef:: setstatchanger STAT_DEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BulkUpEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_BulkUpEnd printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_BulkUpEnd:: goto BattleScript_MoveEnd @@ -2770,21 +2773,21 @@ BattleScript_CalmMindDoMoveAnim:: statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CalmMindTrySpDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CalmMindTrySpDef printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_CalmMindTrySpDef:: setstatchanger STAT_SPDEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CalmMindEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CalmMindEnd printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_CalmMindEnd:: goto BattleScript_MoveEnd BattleScript_CantRaiseMultipleStats:: - pause 0x20 + pause WAIT_TIME_SHORT orbyte gMoveResultFlags, MOVE_RESULT_FAILED printstring STRINGID_STATSWONTINCREASE2 - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectDragonDance:: @@ -2802,13 +2805,13 @@ BattleScript_DragonDanceDoMoveAnim:: statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DragonDanceTrySpeed jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DragonDanceTrySpeed printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_DragonDanceTrySpeed:: setstatchanger STAT_SPEED, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DragonDanceEnd jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DragonDanceEnd printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_DragonDanceEnd:: goto BattleScript_MoveEnd @@ -2820,12 +2823,12 @@ BattleScript_EffectCamouflage:: attackanimation waitanimation printstring STRINGID_PKMNCHANGEDTYPE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_FaintAttacker:: playfaintcry BS_ATTACKER - pause 0x40 + pause WAIT_TIME_LONG dofaintanimation BS_ATTACKER cleareffectsonfaint BS_ATTACKER printstring STRINGID_ATTACKERFAINTED @@ -2833,7 +2836,7 @@ BattleScript_FaintAttacker:: BattleScript_FaintTarget:: playfaintcry BS_TARGET - pause 0x40 + pause WAIT_TIME_LONG dofaintanimation BS_TARGET cleareffectsonfaint BS_TARGET printstring STRINGID_TARGETFAINTED @@ -2948,7 +2951,7 @@ BattleScript_LocalBattleWonLoseTexts:: BattleScript_LocalBattleWonReward:: getmoneyreward printstring STRINGID_PLAYERGOTMONEY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_PayDayMoneyAndPickUpItems:: givepaydaymoney pickup @@ -2962,9 +2965,9 @@ BattleScript_LocalBattleLost:: jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, 0x400, BattleScript_LocalBattleLostEnd BattleScript_LocalBattleLostPrintWhiteOut:: printstring STRINGID_PLAYERWHITEOUT - waitmessage 0x40 + waitmessage WAIT_TIME_LONG printstring STRINGID_PLAYERWHITEOUT2 - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_LocalBattleLostEnd:: end2 BattleScript_CheckDomeDrew:: @@ -3005,23 +3008,23 @@ BattleScript_FrontierLinkBattleLost:: jumpifbattletype BATTLE_TYPE_RECORDED, BattleScript_FrontierLinkBattleLostEnd endlinkbattle BattleScript_FrontierLinkBattleLostEnd:: - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_LinkBattleWonOrLost:: jumpifbattletype BATTLE_TYPE_BATTLE_TOWER, BattleScript_TowerLinkBattleWon printstring STRINGID_BATTLEEND - waitmessage 0x40 + waitmessage WAIT_TIME_LONG jumpifbattletype BATTLE_TYPE_RECORDED, BattleScript_LinkBattleWonOrLostWaitEnd endlinkbattle BattleScript_LinkBattleWonOrLostWaitEnd:: - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_TowerLinkBattleWon:: playtrainerdefeatbgm BS_ATTACKER printstring STRINGID_BATTLEEND - waitmessage 0x40 + waitmessage WAIT_TIME_LONG trainerslidein BS_ATTACKER waitstate printstring STRINGID_TRAINER1LOSETEXT @@ -3033,7 +3036,7 @@ BattleScript_TowerLinkBattleWon:: jumpifbattletype BATTLE_TYPE_RECORDED, BattleScript_TowerLinkBattleWonEnd endlinkbattle BattleScript_TowerLinkBattleWonEnd:: - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_FrontierTrainerBattleWon:: @@ -3062,22 +3065,22 @@ BattleScript_FrontierTrainerBattleWon_End: BattleScript_SmokeBallEscape:: playanimation BS_ATTACKER, B_ANIM_SMOKEBALL_ESCAPE, NULL printstring STRINGID_PKMNFLEDUSINGITS - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_RanAwayUsingMonAbility:: printstring STRINGID_PKMNFLEDUSING - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_GotAwaySafely:: printstring STRINGID_GOTAWAYSAFELY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_WildMonFled:: printstring STRINGID_WILDPKMNFLED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_PrintCantRunFromTrainer:: @@ -3086,7 +3089,7 @@ BattleScript_PrintCantRunFromTrainer:: BattleScript_PrintFailedToRunString:: printfromtable gNoEscapeStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_PrintCantEscapeFromBattle:: @@ -3100,7 +3103,7 @@ BattleScript_PrintFullBox:: BattleScript_ActionSwitch:: hpthresholds2 BS_ATTACKER printstring STRINGID_RETURNMON - setbyte sDMG_MULTIPLIER, 0x2 + setbyte sDMG_MULTIPLIER, 2 jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_PursuitSwitchDmgSetMultihit setmultihit 0x1 goto BattleScript_PursuitSwitchDmgLoop @@ -3133,7 +3136,7 @@ BattleScript_DoSwitchOut:: end2 BattleScript_PursuitDmgOnSwitchOut:: - pause 0x20 + pause WAIT_TIME_SHORT attackstring ppreduce critcalc @@ -3148,9 +3151,9 @@ BattleScript_PursuitDmgOnSwitchOut:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL moveendfromto MOVEEND_ON_DAMAGE_ABILITIES, MOVEEND_CHOICE_MOVE getbattlerfainted BS_TARGET @@ -3161,7 +3164,7 @@ BattleScript_PursuitDmgOnSwitchOutRet: return BattleScript_Pausex20:: - pause 0x20 + pause WAIT_TIME_SHORT return BattleScript_LevelUp:: @@ -3195,7 +3198,7 @@ BattleScript_LearnedNewMove:: buffermovetolearn fanfare MUS_LEVEL_UP printstring STRINGID_PKMNLEARNEDMOVE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatechoicemoveonlvlup BS_ATTACKER goto BattleScript_TryLearnMoveLoop BattleScript_LearnMoveReturn:: @@ -3203,7 +3206,7 @@ BattleScript_LearnMoveReturn:: BattleScript_RainContinuesOrEnds:: printfromtable gRainContinuesStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_RainContinuesOrEndsEnd playanimation BS_ATTACKER, B_ANIM_RAIN_CONTINUES, NULL BattleScript_RainContinuesOrEndsEnd:: @@ -3211,7 +3214,7 @@ BattleScript_RainContinuesOrEndsEnd:: BattleScript_DamagingWeatherContinues:: printfromtable gSandStormHailContinuesStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG playanimation2 BS_ATTACKER, sB_ANIM_ARG1, NULL setbyte gBattleCommunication, 0x0 BattleScript_DamagingWeatherLoop:: @@ -3219,7 +3222,7 @@ BattleScript_DamagingWeatherLoop:: weatherdamage jumpifword CMP_EQUAL, gBattleMoveDamage, 0x0, BattleScript_DamagingWeatherLoopIncrement printfromtable gSandStormHailDmgStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE effectivenesssound hitanimation BS_ATTACKER @@ -3237,41 +3240,41 @@ BattleScript_DamagingWeatherContinuesEnd:: BattleScript_SandStormHailEnds:: printfromtable gSandStormHailEndStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_SunlightContinues:: printstring STRINGID_SUNLIGHTSTRONG - waitmessage 0x40 + waitmessage WAIT_TIME_LONG playanimation BS_ATTACKER, B_ANIM_SUN_CONTINUES, NULL end2 BattleScript_SunlightFaded:: printstring STRINGID_SUNLIGHTFADED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_OverworldWeatherStarts:: printfromtable gWeatherStartsStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG playanimation2 BS_ATTACKER, sB_ANIM_ARG1, NULL end3 BattleScript_SideStatusWoreOff:: printstring STRINGID_PKMNSXWOREOFF - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_SafeguardProtected:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNUSEDSAFEGUARD - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_SafeguardEnds:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNSAFEGUARDEXPIRED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_LeechSeedTurnDrain:: @@ -3291,14 +3294,14 @@ BattleScript_LeechSeedTurnPrintAndUpdateHp:: healthbarupdate BS_TARGET datahpupdate BS_TARGET printfromtable gLeechSeedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_TARGET, FALSE, NULL end2 BattleScript_BideStoringEnergy:: printstring STRINGID_PKMNSTORINGENERGY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_BideAttack:: @@ -3306,7 +3309,7 @@ BattleScript_BideAttack:: setmoveeffect MOVE_EFFECT_CHARGING clearstatusfromeffect BS_ATTACKER printstring STRINGID_PKMNUNLEASHEDENERGY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG accuracycheck BattleScript_MoveMissed, ACC_CURR_MOVE typecalc bicbyte gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE @@ -3321,7 +3324,7 @@ BattleScript_BideAttack:: healthbarupdate BS_TARGET datahpupdate BS_TARGET resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL goto BattleScript_MoveEnd @@ -3330,7 +3333,7 @@ BattleScript_BideNoEnergyToAttack:: setmoveeffect MOVE_EFFECT_CHARGING clearstatusfromeffect BS_ATTACKER printstring STRINGID_PKMNUNLEASHEDENERGY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_ButItFailed BattleScript_SuccessForceOut:: @@ -3353,19 +3356,19 @@ BattleScript_TrainerBattleForceOut:: goto BattleScript_MoveEnd BattleScript_MistProtected:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNPROTECTEDBYMIST - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_RageIsBuilding:: printstring STRINGID_PKMNRAGEBUILDING - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_MoveUsedIsDisabled:: printstring STRINGID_PKMNMOVEISDISABLED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SelectingDisabledMove:: @@ -3374,7 +3377,7 @@ BattleScript_SelectingDisabledMove:: BattleScript_DisabledNoMore:: printstring STRINGID_PKMNMOVEDISABLEDNOMORE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_SelectingDisabledMoveInPalace:: @@ -3385,12 +3388,12 @@ BattleScript_SelectingUnusableMoveInPalace:: BattleScript_EncoredNoMore:: printstring STRINGID_PKMNENCOREENDED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_DestinyBondTakesLife:: printstring STRINGID_PKMNTOOKFOE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER @@ -3444,12 +3447,12 @@ BattleScript_SpikesOnFaintedBattlerFainted:: BattleScript_PrintHurtBySpikes:: printstring STRINGID_PKMNHURTBYSPIKES - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_PerishSongTakesLife:: printstring STRINGID_PKMNPERISHCOUNTFELL - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER @@ -3458,7 +3461,7 @@ BattleScript_PerishSongTakesLife:: BattleScript_PerishSongCountGoesDown:: printstring STRINGID_PKMNPERISHCOUNTFELL - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_AllStatsUp:: @@ -3473,27 +3476,27 @@ BattleScript_AllStatsUpAtk:: setstatchanger STAT_ATK, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpDef printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_AllStatsUpDef:: setstatchanger STAT_DEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpeed printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_AllStatsUpSpeed:: setstatchanger STAT_SPEED, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpAtk printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_AllStatsUpSpAtk:: setstatchanger STAT_SPATK, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpDef printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_AllStatsUpSpDef:: setstatchanger STAT_SPDEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpRet printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_AllStatsUpRet:: return @@ -3503,23 +3506,23 @@ BattleScript_RapidSpinAway:: BattleScript_WrapFree:: printstring STRINGID_PKMNGOTFREE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG copybyte gBattlerTarget, sBATTLER return BattleScript_LeechSeedFree:: printstring STRINGID_PKMNSHEDLEECHSEED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_SpikesFree:: printstring STRINGID_PKMNBLEWAWAYSPIKES - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_MonTookFutureAttack:: printstring STRINGID_PKMNTOOKATTACK - waitmessage 0x40 + waitmessage WAIT_TIME_LONG jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x0, BattleScript_CheckDoomDesireMiss accuracycheck BattleScript_FutureAttackMiss, MOVE_FUTURE_SIGHT goto BattleScript_FutureAttackAnimate @@ -3539,7 +3542,7 @@ BattleScript_DoFutureAttackHit:: healthbarupdate BS_TARGET datahpupdate BS_TARGET resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL atk24 BattleScript_FutureAttackEnd BattleScript_FutureAttackEnd:: @@ -3549,11 +3552,11 @@ BattleScript_FutureAttackEnd:: end2 BattleScript_FutureAttackMiss:: - pause 0x20 + pause WAIT_TIME_SHORT setbyte gMoveResultFlags, 0 orbyte gMoveResultFlags, MOVE_RESULT_FAILED resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG setbyte gMoveResultFlags, 0 end2 @@ -3567,9 +3570,9 @@ BattleScript_SelectingMoveWithNoPP:: BattleScript_NoPPForMove:: attackstring - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_BUTNOPPLEFT - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SelectingTormentedMove:: @@ -3578,7 +3581,7 @@ BattleScript_SelectingTormentedMove:: BattleScript_MoveUsedIsTormented:: printstring STRINGID_PKMNCANTUSEMOVETORMENT - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SelectingTormentedMoveInPalace:: @@ -3591,7 +3594,7 @@ BattleScript_SelectingNotAllowedMoveTaunt:: BattleScript_MoveUsedIsTaunted:: printstring STRINGID_PKMNCANTUSEMOVETAUNT - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SelectingNotAllowedMoveTauntInPalace:: @@ -3602,35 +3605,35 @@ BattleScript_WishComesTrue:: trywish 0x1, BattleScript_WishButFullHp playanimation BS_TARGET, B_ANIM_WISH_HEAL, NULL printstring STRINGID_PKMNWISHCAMETRUE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_TARGET datahpupdate BS_TARGET printstring STRINGID_PKMNREGAINEDHEALTH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_WishButFullHp:: printstring STRINGID_PKMNWISHCAMETRUE - waitmessage 0x40 - pause 0x20 + waitmessage WAIT_TIME_LONG + pause WAIT_TIME_SHORT printstring STRINGID_PKMNHPFULL - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_IngrainTurnHeal:: playanimation BS_ATTACKER, B_ANIM_INGRAIN_HEAL, NULL printstring STRINGID_PKMNABSORBEDNUTRIENTS - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER end2 BattleScript_PrintMonIsRooted:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNANCHOREDITSELF - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AtkDefDown:: @@ -3641,26 +3644,26 @@ BattleScript_AtkDefDown:: statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_AtkDefDown_TryDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_AtkDefDown_TryDef printfromtable gStatDownStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_AtkDefDown_TryDef:: playstatchangeanimation BS_ATTACKER, BIT_DEF, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE setstatchanger STAT_DEF, 1, TRUE statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_AtkDefDown_End jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_AtkDefDown_End printfromtable gStatDownStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_AtkDefDown_End:: return BattleScript_KnockedOff:: playanimation BS_TARGET, B_ANIM_ITEM_KNOCKOFF, NULL printstring STRINGID_PKMNKNOCKEDOFF - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_MoveUsedIsImprisoned:: printstring STRINGID_PKMNCANTUSEMOVESEALED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SelectingImprisonedMove:: @@ -3673,15 +3676,15 @@ BattleScript_SelectingImprisonedMoveInPalace:: BattleScript_GrudgeTakesPp:: printstring STRINGID_PKMNLOSTPPGRUDGE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_MagicCoatBounce:: attackstring ppreduce - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNMOVEBOUNCED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_x800000 setmagiccoattarget BS_ATTACKER return @@ -3692,19 +3695,19 @@ BattleScript_SnatchedMove:: snatchsetbattlers playanimation BS_TARGET, B_ANIM_SNATCH_MOVE, NULL printstring STRINGID_PKMNSNATCHEDMOVE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_x800000 swapattackerwithtarget return BattleScript_EnduredMsg:: printstring STRINGID_PKMNENDUREDHIT - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_OneHitKOMsg:: printstring STRINGID_ONEHITKO - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_SAtkDown2:: @@ -3714,40 +3717,40 @@ BattleScript_SAtkDown2:: statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_SAtkDown2End jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_SAtkDown2End printfromtable gStatDownStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_SAtkDown2End:: return BattleScript_FocusPunchSetUp:: printstring STRINGID_EMPTYSTRING3 - waitmessage 0x1 + waitmessage 1 playanimation BS_ATTACKER, B_ANIM_FOCUS_PUNCH_SETUP, NULL printstring STRINGID_PKMNTIGHTENINGFOCUS - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_MoveUsedIsAsleep:: printstring STRINGID_PKMNFASTASLEEP - waitmessage 0x40 + waitmessage WAIT_TIME_LONG statusanimation BS_ATTACKER goto BattleScript_MoveEnd BattleScript_MoveUsedWokeUp:: bicword gHitMarker, HITMARKER_x10 printfromtable gWokeUpStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_ATTACKER return BattleScript_MonWokeUpInUproar:: printstring STRINGID_PKMNWOKEUPINUPROAR - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_ATTACKER end2 BattleScript_PoisonTurnDmg:: printstring STRINGID_PKMNHURTBYPOISON - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_DoStatusTurnDmg:: statusanimation BS_ATTACKER BattleScript_DoTurnDmg:: @@ -3761,60 +3764,60 @@ BattleScript_DoTurnDmgEnd:: BattleScript_BurnTurnDmg:: printstring STRINGID_PKMNHURTBYBURN - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_DoStatusTurnDmg BattleScript_MoveUsedIsFrozen:: printstring STRINGID_PKMNISFROZEN - waitmessage 0x40 + waitmessage WAIT_TIME_LONG statusanimation BS_ATTACKER goto BattleScript_MoveEnd BattleScript_MoveUsedUnfroze:: printfromtable gGotDefrostedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_ATTACKER return BattleScript_DefrostedViaFireMove:: printstring STRINGID_PKMNWASDEFROSTED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_TARGET return BattleScript_MoveUsedIsParalyzed:: printstring STRINGID_PKMNISPARALYZED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG statusanimation BS_ATTACKER cancelmultiturnmoves BS_ATTACKER goto BattleScript_MoveEnd BattleScript_MoveUsedFlinched:: printstring STRINGID_PKMNFLINCHED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_PrintUproarOverTurns:: printfromtable gUproarOverTurnStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_ThrashConfuses:: chosenstatus2animation BS_ATTACKER, STATUS2_CONFUSION printstring STRINGID_PKMNFATIGUECONFUSION - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_MoveUsedIsConfused:: printstring STRINGID_PKMNISCONFUSED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG status2animation BS_ATTACKER, STATUS2_CONFUSION jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x0, BattleScript_MoveUsedIsConfusedRet BattleScript_DoSelfConfusionDmg:: cancelmultiturnmoves BS_ATTACKER adjustnormaldamage2 printstring STRINGID_ITHURTCONFUSION - waitmessage 0x40 + waitmessage WAIT_TIME_LONG effectivenesssound hitanimation BS_ATTACKER waitstate @@ -3822,7 +3825,7 @@ BattleScript_DoSelfConfusionDmg:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER resultmessage - waitmessage 0x40 + waitmessage WAIT_TIME_LONG tryfaintmon BS_ATTACKER, FALSE, NULL goto BattleScript_MoveEnd BattleScript_MoveUsedIsConfusedRet:: @@ -3830,58 +3833,58 @@ BattleScript_MoveUsedIsConfusedRet:: BattleScript_MoveUsedIsConfusedNoMore:: printstring STRINGID_PKMNHEALEDCONFUSION - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_PrintPayDayMoneyString:: printstring STRINGID_PLAYERPICKEDUPMONEY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_WrapTurnDmg:: playanimation BS_ATTACKER, B_ANIM_TURN_TRAP, sB_ANIM_ARG1 printstring STRINGID_PKMNHURTBY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_DoTurnDmg BattleScript_WrapEnds:: printstring STRINGID_PKMNFREEDFROM - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_MoveUsedIsInLove:: printstring STRINGID_PKMNINLOVE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG status2animation BS_ATTACKER, STATUS2_INFATUATION return BattleScript_MoveUsedIsInLoveCantAttack:: printstring STRINGID_PKMNIMMOBILIZEDBYLOVE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_NightmareTurnDmg:: printstring STRINGID_PKMNLOCKEDINNIGHTMARE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG status2animation BS_ATTACKER, STATUS2_NIGHTMARE goto BattleScript_DoTurnDmg BattleScript_CurseTurnDmg:: printstring STRINGID_PKMNAFFLICTEDBYCURSE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG status2animation BS_ATTACKER, STATUS2_CURSED goto BattleScript_DoTurnDmg BattleScript_TargetPRLZHeal:: printstring STRINGID_PKMNHEALEDPARALYSIS - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_TARGET return BattleScript_MoveEffectSleep:: statusanimation BS_EFFECT_BATTLER printfromtable gFellAsleepStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_UpdateEffectStatusIconRet:: updatestatusicon BS_EFFECT_BATTLER waitstate @@ -3890,7 +3893,7 @@ BattleScript_UpdateEffectStatusIconRet:: BattleScript_YawnMakesAsleep:: statusanimation BS_EFFECT_BATTLER printstring STRINGID_PKMNFELLASLEEP - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_EFFECT_BATTLER waitstate makevisible BS_EFFECT_BATTLER @@ -3899,52 +3902,52 @@ BattleScript_YawnMakesAsleep:: BattleScript_MoveEffectPoison:: statusanimation BS_EFFECT_BATTLER printfromtable gGotPoisonedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_UpdateEffectStatusIconRet BattleScript_MoveEffectBurn:: statusanimation BS_EFFECT_BATTLER printfromtable gGotBurnedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_UpdateEffectStatusIconRet BattleScript_MoveEffectFreeze:: statusanimation BS_EFFECT_BATTLER printfromtable gGotFrozenStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_UpdateEffectStatusIconRet BattleScript_MoveEffectParalysis:: statusanimation BS_EFFECT_BATTLER printfromtable gGotParalyzedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_UpdateEffectStatusIconRet BattleScript_MoveEffectUproar:: printstring STRINGID_PKMNCAUSEDUPROAR - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_MoveEffectToxic:: statusanimation BS_EFFECT_BATTLER printstring STRINGID_PKMNBADLYPOISONED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_UpdateEffectStatusIconRet BattleScript_MoveEffectPayDay:: printstring STRINGID_COINSSCATTERED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_MoveEffectWrap:: printfromtable gWrappedStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_MoveEffectConfusion:: chosenstatus2animation BS_EFFECT_BATTLER, STATUS2_CONFUSION printstring STRINGID_PKMNWASCONFUSED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_MoveEffectRecoil:: @@ -3955,7 +3958,7 @@ BattleScript_DoRecoil:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNHITWITHRECOIL - waitmessage 0x40 + waitmessage WAIT_TIME_LONG tryfaintmon BS_ATTACKER, FALSE, NULL BattleScript_RecoilEnd:: return @@ -3963,11 +3966,11 @@ BattleScript_RecoilEnd:: BattleScript_ItemSteal:: playanimation BS_TARGET, B_ANIM_ITEM_STEAL, NULL printstring STRINGID_PKMNSTOLEITEM - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_DrizzleActivates:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNMADEITRAIN waitstate playanimation BS_BATTLER_0, B_ANIM_RAIN_CONTINUES, NULL @@ -3977,25 +3980,25 @@ BattleScript_DrizzleActivates:: BattleScript_SpeedBoostActivates:: playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printstring STRINGID_PKMNRAISEDSPEED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end3 BattleScript_TraceActivates:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNTRACED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end3 BattleScript_RainDishActivates:: printstring STRINGID_PKMNSXRESTOREDHPALITTLE2 - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER end3 BattleScript_SandstreamActivates:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNSXWHIPPEDUPSANDSTORM waitstate playanimation BS_BATTLER_0, B_ANIM_SANDSTORM_CONTINUES, NULL @@ -4004,7 +4007,7 @@ BattleScript_SandstreamActivates:: BattleScript_ShedSkinActivates:: printstring STRINGID_PKMNSXCUREDYPROBLEM - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_ATTACKER end3 @@ -4024,7 +4027,7 @@ BattleScript_DoCastformChange:: docastformchangeanimation waitstate printstring STRINGID_PKMNTRANSFORMED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_IntimidateActivatesEnd3:: @@ -4032,7 +4035,7 @@ BattleScript_IntimidateActivatesEnd3:: end3 BattleScript_PauseIntimidateActivates: - pause 0x20 + pause WAIT_TIME_SHORT BattleScript_IntimidateActivates:: setbyte gBattlerTarget, 0x0 setstatchanger STAT_ATK, 1, TRUE @@ -4047,20 +4050,20 @@ BattleScript_IntimidateActivatesLoop: setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printstring STRINGID_PKMNCUTSATTACKWITH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_IntimidateActivatesLoopIncrement: addbyte gBattlerTarget, 0x1 goto BattleScript_IntimidateActivatesLoop BattleScript_IntimidateActivatesReturn: return BattleScript_IntimidatePrevented: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PREVENTEDFROMWORKING - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_IntimidateActivatesLoopIncrement BattleScript_DroughtActivates:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNSXINTENSIFIEDSUN waitstate playanimation BS_BATTLER_0, B_ANIM_SUN_CONTINUES, NULL @@ -4069,34 +4072,34 @@ BattleScript_DroughtActivates:: BattleScript_TookAttack:: attackstring - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNSXTOOKATTACK - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED return BattleScript_SturdyPreventsOHKO:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNPROTECTEDBY - pause 0x40 + pause WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_DampStopsExplosion:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNPREVENTSUSAGE - pause 0x40 + pause WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_MoveHPDrain_PPLoss:: ppreduce BattleScript_MoveHPDrain:: attackstring - pause 0x20 + pause WAIT_TIME_SHORT orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_TARGET datahpupdate BS_TARGET printstring STRINGID_PKMNRESTOREDHPUSING - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orbyte gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE goto BattleScript_MoveEnd @@ -4104,9 +4107,9 @@ BattleScript_MonMadeMoveUseless_PPLoss:: ppreduce BattleScript_MonMadeMoveUseless:: attackstring - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNSXMADEYUSELESS - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orbyte gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE goto BattleScript_MoveEnd @@ -4114,83 +4117,83 @@ BattleScript_FlashFireBoost_PPLoss:: ppreduce BattleScript_FlashFireBoost:: attackstring - pause 0x20 + pause WAIT_TIME_SHORT printfromtable gFlashFireStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AbilityPreventsPhasingOut:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNANCHORSITSELFWITH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AbilityNoStatLoss:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNPREVENTSSTATLOSSWITH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_BRNPrevention:: - pause 0x20 + pause WAIT_TIME_SHORT printfromtable gBRNPreventionStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_PRLZPrevention:: - pause 0x20 + pause WAIT_TIME_SHORT printfromtable gPRLZPreventionStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_PSNPrevention:: - pause 0x20 + pause WAIT_TIME_SHORT printfromtable gPSNPreventionStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_ObliviousPreventsAttraction:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNPREVENTSROMANCEWITH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_FlinchPrevention:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNSXPREVENTSFLINCHING - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_OwnTempoPrevents:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNPREVENTSCONFUSIONWITH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SoundproofProtected:: attackstring ppreduce - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNSXBLOCKSY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AbilityNoSpecificStatLoss:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNSXPREVENTSYLOSS - waitmessage 0x40 + waitmessage WAIT_TIME_LONG setbyte cMULTISTRING_CHOOSER, 0x3 return BattleScript_StickyHoldActivates:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNSXMADEYINEFFECTIVE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_ColorChangeActivates:: printstring STRINGID_PKMNCHANGEDTYPEWITH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_RoughSkinActivates:: @@ -4198,14 +4201,14 @@ BattleScript_RoughSkinActivates:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNHURTSWITH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG tryfaintmon BS_ATTACKER, FALSE, NULL return BattleScript_CuteCharmActivates:: status2animation BS_ATTACKER, STATUS2_INFATUATION printstring STRINGID_PKMNSXINFATUATEDY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_ApplySecondaryEffect:: @@ -4219,26 +4222,26 @@ BattleScript_SynchronizeActivates:: return BattleScript_NoItemSteal:: - pause 0x20 + pause WAIT_TIME_SHORT printstring STRINGID_PKMNSXMADEYINEFFECTIVE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_AbilityCuredStatus:: printstring STRINGID_PKMNSXCUREDITSYPROBLEM - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_SCRIPTING return BattleScript_IgnoresWhileAsleep:: printstring STRINGID_PKMNIGNORESASLEEP - waitmessage 0x40 + waitmessage WAIT_TIME_LONG moveendto MOVEEND_NEXT_TARGET end BattleScript_IgnoresAndUsesRandomMove:: printstring STRINGID_PKMNIGNOREDORDERS - waitmessage 0x40 + waitmessage WAIT_TIME_LONG jumptocalledmove FALSE BattleScript_MoveUsedLoafingAround:: @@ -4248,13 +4251,13 @@ BattleScript_MoveUsedLoafingAround:: setbyte cMULTISTRING_CHOOSER, 0x4 BattleScript_82DB6C7:: printfromtable gInobedientStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG moveendto MOVEEND_NEXT_TARGET end BattleScript_IgnoresAndFallsAsleep:: printstring STRINGID_PKMNBEGANTONAP - waitmessage 0x40 + waitmessage WAIT_TIME_LONG setmoveeffect MOVE_EFFECT_SLEEP | MOVE_EFFECT_AFFECTS_USER seteffectprimary moveendto MOVEEND_NEXT_TARGET @@ -4262,7 +4265,7 @@ BattleScript_IgnoresAndFallsAsleep:: BattleScript_IgnoresAndHitsItself:: printstring STRINGID_PKMNWONTOBEY - waitmessage 0x40 + waitmessage WAIT_TIME_LONG goto BattleScript_DoSelfConfusionDmg BattleScript_SubstituteFade:: @@ -4277,7 +4280,7 @@ BattleScript_BerryCurePrlzEnd2:: BattleScript_BerryCureParRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMCUREDPARALYSIS - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_SCRIPTING removeitem BS_SCRIPTING return @@ -4289,7 +4292,7 @@ BattleScript_BerryCurePsnEnd2:: BattleScript_BerryCurePsnRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMCUREDPOISON - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_SCRIPTING removeitem BS_SCRIPTING return @@ -4301,7 +4304,7 @@ BattleScript_BerryCureBrnEnd2:: BattleScript_BerryCureBrnRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMHEALEDBURN - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_SCRIPTING removeitem BS_SCRIPTING return @@ -4313,7 +4316,7 @@ BattleScript_BerryCureFrzEnd2:: BattleScript_BerryCureFrzRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMDEFROSTEDIT - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_SCRIPTING removeitem BS_SCRIPTING return @@ -4325,7 +4328,7 @@ BattleScript_BerryCureSlpEnd2:: BattleScript_BerryCureSlpRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMWOKEIT - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_SCRIPTING removeitem BS_SCRIPTING return @@ -4337,7 +4340,7 @@ BattleScript_BerryCureConfusionEnd2:: BattleScript_BerryCureConfusionRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMSNAPPEDOUT - waitmessage 0x40 + waitmessage WAIT_TIME_LONG removeitem BS_SCRIPTING return @@ -4348,7 +4351,7 @@ BattleScript_BerryCureChosenStatusEnd2:: BattleScript_BerryCureChosenStatusRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printfromtable gBerryEffectStringIds - waitmessage 0x40 + waitmessage WAIT_TIME_LONG updatestatusicon BS_SCRIPTING removeitem BS_SCRIPTING return @@ -4360,14 +4363,14 @@ BattleScript_WhiteHerbEnd2:: BattleScript_WhiteHerbRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDSTATUS - waitmessage 0x40 + waitmessage WAIT_TIME_LONG removeitem BS_SCRIPTING return BattleScript_ItemHealHP_RemoveItem:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHEALTH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER @@ -4377,7 +4380,7 @@ BattleScript_ItemHealHP_RemoveItem:: BattleScript_BerryPPHealEnd2:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDPP - waitmessage 0x40 + waitmessage WAIT_TIME_LONG removeitem BS_ATTACKER end2 @@ -4388,7 +4391,7 @@ BattleScript_ItemHealHP_End2:: BattleScript_ItemHealHP_Ret:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHPALITTLE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER @@ -4401,18 +4404,18 @@ BattleScript_SelectingNotAllowedMoveChoiceItem:: BattleScript_FocusBandActivates:: playanimation BS_TARGET, B_ANIM_FOCUS_BAND, NULL printstring STRINGID_PKMNHUNGONWITHX - waitmessage 0x40 + waitmessage WAIT_TIME_LONG return BattleScript_BerryConfuseHealEnd2:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHEALTH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_FORXCOMMAYZ - waitmessage 0x40 + waitmessage WAIT_TIME_LONG setmoveeffect MOVE_EFFECT_CONFUSION | MOVE_EFFECT_AFFECTS_USER seteffectprimary removeitem BS_ATTACKER @@ -4430,7 +4433,7 @@ BattleScript_82DB85B:: BattleScript_BerryFocusEnergyEnd2:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNUSEDXTOGETPUMPED - waitmessage 0x40 + waitmessage WAIT_TIME_LONG removeitem BS_ATTACKER end2 @@ -4448,7 +4451,7 @@ BattleScript_PalaceTryBattlerFlavorText:: palaceflavortext BS_ATTACKER @ BS_ATTACKER here overwritten by gBattleCommunication + 1 jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, TRUE, BattleScript_PalaceEndFlavorText printfromtable gBattlePalaceFlavorTextTable - waitmessage 0x40 + waitmessage WAIT_TIME_LONG BattleScript_PalaceEndFlavorText:: addbyte gBattleCommunication + 1, 1 jumpifbytenotequal gBattleCommunication + 1, gBattlersCount, BattleScript_PalaceTryBattlerFlavorText @@ -4460,12 +4463,12 @@ BattleScript_ArenaTurnBeginning:: waitcry BS_ATTACKER volumedown playse SE_ARENA_TIMEUP1 - pause 0x8 + pause 8 playse SE_ARENA_TIMEUP1 various14 BS_ATTACKER arenajudmengtstring 8 arenawaitmessage 8 - pause 0x40 + pause WAIT_TIME_LONG various15 BS_ATTACKER volumeup end2 @@ -4475,7 +4478,7 @@ BattleScript_82DB8E0:: @ Unused battlescript various14 BS_ATTACKER arenajudmengtstring BS_TARGET arenawaitmessage BS_TARGET - pause 0x40 + pause WAIT_TIME_LONG various15 BS_ATTACKER end2 @@ -4486,16 +4489,16 @@ BattleScript_ArenaDoJudgment:: waitstate volumedown playse SE_ARENA_TIMEUP1 - pause 0x8 + pause 8 playse SE_ARENA_TIMEUP1 - pause 0x40 + pause WAIT_TIME_LONG various14 BS_ATTACKER arenajudmengtstring 1 arenawaitmessage 1 - pause 0x40 + pause WAIT_TIME_LONG setbyte gBattleCommunication, 0x0 arenajudgmentwindow - pause 0x40 + pause WAIT_TIME_LONG arenajudgmentwindow arenajudmengtstring 2 arenawaitmessage 2 @@ -4513,7 +4516,7 @@ BattleScript_ArenaDoJudgment:: arenajudgmentwindow various15 BS_ATTACKER printstring STRINGID_DEFEATEDOPPONENTBYREFEREE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG playfaintcry BS_OPPONENT1 waitcry BS_ATTACKER dofaintanimation BS_OPPONENT1 @@ -4527,7 +4530,7 @@ BattleScript_ArenaJudgmentPlayerLoses: arenajudgmentwindow various15 BS_ATTACKER printstring STRINGID_LOSTTOOPPONENTBYREFEREE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG playfaintcry BS_PLAYER1 waitcry BS_ATTACKER dofaintanimation BS_PLAYER1 @@ -4541,7 +4544,7 @@ BattleScript_ArenaJudgmentDraw: arenajudgmentwindow various15 BS_ATTACKER printstring STRINGID_TIEDOPPONENTBYREFEREE - waitmessage 0x40 + waitmessage WAIT_TIME_LONG playfaintcry BS_PLAYER1 waitcry BS_ATTACKER dofaintanimation BS_PLAYER1 @@ -4560,12 +4563,12 @@ BattleScript_AskIfWantsToForfeitMatch:: BattleScript_PrintPlayerForfeited:: printstring STRINGID_FORFEITEDMATCH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 BattleScript_PrintPlayerForfeitedLinkBattle:: printstring STRINGID_FORFEITEDMATCH - waitmessage 0x40 + waitmessage WAIT_TIME_LONG endlinkbattle - waitmessage 0x40 + waitmessage WAIT_TIME_LONG end2 From a836bd1085c64f34d58584cb0e510d9af72a586c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 02:17:36 -0400 Subject: [PATCH 04/63] Add missing trainer constant use --- data/battle_scripts_1.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 92ef199cc..972346799 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7,6 +7,7 @@ #include "constants/moves.h" #include "constants/songs.h" #include "constants/game_stat.h" +#include "constants/trainers.h" .include "asm/macros.inc" .include "asm/macros/battle_script.inc" .include "constants/constants.inc" @@ -2962,7 +2963,7 @@ BattleScript_LocalBattleLost:: jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_LocalBattleLostPrintTrainersWinText jumpifbattletype BATTLE_TYPE_TRAINER_HILL, BattleScript_LocalBattleLostPrintTrainersWinText jumpifbattletype BATTLE_TYPE_EREADER_TRAINER, BattleScript_LocalBattleLostEnd - jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, 0x400, BattleScript_LocalBattleLostEnd + jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, TRAINER_SECRET_BASE, BattleScript_LocalBattleLostEnd BattleScript_LocalBattleLostPrintWhiteOut:: printstring STRINGID_PLAYERWHITEOUT waitmessage WAIT_TIME_LONG From 9ea9ffde09c9f3ca1772045935b3b0bd858232a0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 2 Apr 2021 02:27:12 -0400 Subject: [PATCH 05/63] Add remaining multistring chooser constants --- data/battle_scripts_1.s | 909 +++++++++++++------------- data/battle_scripts_2.s | 52 +- include/battle.h | 21 +- include/battle_ai_switch_items.h | 20 + include/battle_message.h | 3 +- include/constants/battle.h | 4 + include/constants/battle_string_ids.h | 208 +++++- src/battle_ai_switch_items.c | 27 +- src/battle_main.c | 10 +- src/battle_message.c | 235 ++++--- src/battle_script_commands.c | 235 +++---- src/battle_tv.c | 8 +- src/battle_util.c | 136 ++-- src/battle_util2.c | 7 +- src/pokemon.c | 2 +- 15 files changed, 1104 insertions(+), 773 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 972346799..daaf5eafd 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -13,9 +13,6 @@ .include "constants/constants.inc" .section script_data, "aw", %progbits - -.set WAIT_TIME_LONG, 64 -.set WAIT_TIME_SHORT, 32 .align 2 gBattleScriptsForMoveEffects:: @ 82D86A8 @@ -282,9 +279,9 @@ BattleScript_HitFromAtkAnimation:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL BattleScript_MoveEnd:: @@ -297,11 +294,11 @@ BattleScript_PrintMoveMissed:: attackstring ppreduce BattleScript_MoveMissedPause:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT BattleScript_MoveMissed:: effectivenesssound resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSleep:: @@ -322,21 +319,21 @@ BattleScript_EffectSleep:: BattleScript_AlreadyAsleep:: setalreadystatusedmoveattempt BS_ATTACKER - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNALREADYASLEEP - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_WasntAffected:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNWASNTAFFECTED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_CantMakeAsleep:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printfromtable gUproarAwakeStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectPoisonHit:: @@ -361,23 +358,23 @@ BattleScript_EffectAbsorb:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG negativedamage orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_AbsorbLiquidOoze - setbyte cMULTISTRING_CHOOSER, 0x0 + setbyte cMULTISTRING_CHOOSER, B_MSG_ABSORB goto BattleScript_AbsorbUpdateHp BattleScript_AbsorbLiquidOoze:: manipulatedamage DMG_CHANGE_SIGN - setbyte cMULTISTRING_CHOOSER, 0x1 + setbyte cMULTISTRING_CHOOSER, B_MSG_ABSORB_OOZE BattleScript_AbsorbUpdateHp:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER jumpifmovehadnoeffect BattleScript_AbsorbTryFainting - printfromtable gLeechSeedDrainStringIds - waitmessage WAIT_TIME_LONG + printfromtable gAbsorbDrainStringIds + waitmessage B_WAIT_TIME_LONG BattleScript_AbsorbTryFainting:: tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_TARGET, FALSE, NULL @@ -422,9 +419,9 @@ BattleScript_ExplosionLoop: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL moveendto MOVEEND_NEXT_TARGET jumpifnexttargetvalid BattleScript_ExplosionLoop @@ -433,7 +430,7 @@ BattleScript_ExplosionLoop: BattleScript_ExplosionMissed: effectivenesssound resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG moveendto MOVEEND_NEXT_TARGET jumpifnexttargetvalid BattleScript_ExplosionLoop tryfaintmon BS_ATTACKER, FALSE, NULL @@ -453,7 +450,7 @@ BattleScript_EffectDreamEater:: BattleScript_DreamEaterNoEffect: attackstring ppreduce - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_WasntAffected BattleScript_DreamEaterWorked: accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE @@ -471,16 +468,16 @@ BattleScript_DreamEaterWorked: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG negativedamage orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER jumpifmovehadnoeffect BattleScript_DreamEaterTryFaintEnd printstring STRINGID_PKMNDREAMEATEN - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_DreamEaterTryFaintEnd: tryfaintmon BS_TARGET, FALSE, NULL goto BattleScript_MoveEnd @@ -488,12 +485,12 @@ BattleScript_DreamEaterTryFaintEnd: BattleScript_EffectMirrorMove:: attackcanceler attackstring - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG trymirrormove ppreduce orbyte gMoveResultFlags, MOVE_RESULT_FAILED printstring STRINGID_MIRRORMOVEFAILED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectAttackUp:: @@ -516,8 +513,8 @@ BattleScript_EffectStatUpAfterAtkCanceler:: attackstring ppreduce statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_StatUpEnd - jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatUpAttackAnim - pause WAIT_TIME_SHORT + jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_StatUpAttackAnim + pause B_WAIT_TIME_SHORT goto BattleScript_StatUpPrintString BattleScript_StatUpAttackAnim:: attackanimation @@ -527,14 +524,14 @@ BattleScript_StatUpDoAnim:: playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 BattleScript_StatUpPrintString:: printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_StatUpEnd:: goto BattleScript_MoveEnd BattleScript_StatUp:: playanimation BS_EFFECT_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_EffectAttackDown:: @@ -562,9 +559,9 @@ BattleScript_EffectStatDown:: attackstring ppreduce statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StatDownEnd - jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatDownDoAnim - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x3, BattleScript_StatDownEnd - pause WAIT_TIME_SHORT + jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_StatDownDoAnim + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY, BattleScript_StatDownEnd + pause B_WAIT_TIME_SHORT goto BattleScript_StatDownPrintString BattleScript_StatDownDoAnim:: attackanimation @@ -573,14 +570,14 @@ BattleScript_StatDownDoAnim:: playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 BattleScript_StatDownPrintString:: printfromtable gStatDownStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_StatDownEnd:: goto BattleScript_MoveEnd BattleScript_StatDown:: playanimation BS_EFFECT_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatDownStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_EffectHaze:: @@ -591,7 +588,7 @@ BattleScript_EffectHaze:: waitanimation normalisebuffs printstring STRINGID_STATCHANGESGONE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectBide:: @@ -654,7 +651,7 @@ BattleScript_DoMultiHit:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG printstring STRINGID_EMPTYSTRING3 waitmessage 1 addbyte sMULTIHIT_STRING + 4, 0x1 @@ -663,14 +660,14 @@ BattleScript_DoMultiHit:: decrementmultihit BattleScript_MultiHitLoop goto BattleScript_MultiHitPrintStrings BattleScript_MultiHitNoMoreHits:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT BattleScript_MultiHitPrintStrings:: resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG jumpifmovehadnoeffect BattleScript_MultiHitEnd copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6 printstring STRINGID_HITXTIMES - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_MultiHitEnd:: seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL @@ -686,7 +683,7 @@ BattleScript_EffectConversion:: attackanimation waitanimation printstring STRINGID_PKMNCHANGEDTYPE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectFlinchHit:: @@ -704,7 +701,7 @@ BattleScript_EffectRestoreHp:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNREGAINEDHEALTH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectToxic:: @@ -725,19 +722,19 @@ BattleScript_EffectToxic:: setmoveeffect MOVE_EFFECT_TOXIC seteffectprimary resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AlreadyPoisoned:: setalreadystatusedmoveattempt BS_ATTACKER - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG printstring STRINGID_PKMNALREADYPOISONED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_ImmunityProtected:: copybyte gEffectBattler, gBattlerTarget - setbyte cMULTISTRING_CHOOSER, 0x0 + setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS call BattleScript_PSNPrevention goto BattleScript_MoveEnd @@ -763,24 +760,24 @@ BattleScript_EffectRest:: jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_RestIsAlreadyAsleep jumpifcantmakeasleep BattleScript_RestCantSleep trysetrest BattleScript_AlreadyAtFullHp - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printfromtable gRestUsedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_ATTACKER waitstate goto BattleScript_PresentHealTarget BattleScript_RestCantSleep:: - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG printfromtable gUproarAwakeStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_RestIsAlreadyAsleep:: setalreadystatusedmoveattempt BS_ATTACKER - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNALREADYASLEEP2 - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectOHKO:: @@ -794,15 +791,15 @@ BattleScript_EffectOHKO:: trysetdestinybondtohappen goto BattleScript_HitFromAtkAnimation BattleScript_KOFail:: - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG printfromtable gKOFailedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRazorWind:: jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn - setbyte sTWOTURN_STRINGID, 0 + setbyte sTWOTURN_STRINGID, B_MSG_TURN1_RAZOR_WIND call BattleScriptFirstChargingTurn goto BattleScript_MoveEnd @@ -827,7 +824,7 @@ BattleScriptFirstChargingTurn:: seteffectprimary copybyte cMULTISTRING_CHOOSER, sTWOTURN_STRINGID printfromtable gFirstTurnOfTwoStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_EffectSuperFang:: @@ -877,12 +874,12 @@ BattleScript_EffectRecoilIfMiss:: BattleScript_MoveMissedDoDamage:: attackstring ppreduce - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd printstring STRINGID_PKMNCRASHED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG damagecalc typecalc adjustnormaldamage @@ -903,7 +900,7 @@ BattleScript_EffectMist:: attackanimation waitanimation printfromtable gMistUsedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectFocusEnergy:: @@ -915,7 +912,7 @@ BattleScript_EffectFocusEnergy:: attackanimation waitanimation printfromtable gFocusEnergyUsedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRecoil:: @@ -938,14 +935,14 @@ BattleScript_EffectConfuse:: setmoveeffect MOVE_EFFECT_CONFUSION seteffectprimary resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AlreadyConfused:: setalreadystatusedmoveattempt BS_ATTACKER - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNALREADYCONFUSED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectAttackUp2:: @@ -976,7 +973,7 @@ BattleScript_EffectTransform:: attackanimation waitanimation printfromtable gTransformUsedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectAttackDown2:: @@ -1004,7 +1001,7 @@ BattleScript_PrintReflectLightScreenSafeguardString:: attackanimation waitanimation printfromtable gReflectLightScreenSafeguardStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectPoison:: @@ -1025,7 +1022,7 @@ BattleScript_EffectPoison:: setmoveeffect MOVE_EFFECT_POISON seteffectprimary resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectParalyze:: @@ -1045,19 +1042,19 @@ BattleScript_EffectParalyze:: setmoveeffect MOVE_EFFECT_PARALYSIS seteffectprimary resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AlreadyParalyzed:: setalreadystatusedmoveattempt BS_ATTACKER - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNISALREADYPARALYZED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_LimberProtected:: copybyte gEffectBattler, gBattlerTarget - setbyte cMULTISTRING_CHOOSER, 0x0 + setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS call BattleScript_PRLZPrevention goto BattleScript_MoveEnd @@ -1088,7 +1085,7 @@ BattleScript_EffectAccuracyDownHit:: BattleScript_EffectSkyAttack:: jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn - setbyte sTWOTURN_STRINGID, 3 + setbyte sTWOTURN_STRINGID, B_MSG_TURN1_SKY_ATTACK call BattleScriptFirstChargingTurn goto BattleScript_MoveEnd @@ -1113,8 +1110,8 @@ BattleScript_EffectSubstitute:: waitstate jumpifstatus2 BS_ATTACKER, STATUS2_SUBSTITUTE, BattleScript_AlreadyHasSubstitute setsubstitute - jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x1, BattleScript_SubstituteAnim - pause WAIT_TIME_SHORT + jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_SUBSTITUTE_FAILED, BattleScript_SubstituteAnim + pause B_WAIT_TIME_SHORT goto BattleScript_SubstituteString BattleScript_SubstituteAnim:: attackanimation @@ -1123,13 +1120,13 @@ BattleScript_SubstituteAnim:: datahpupdate BS_ATTACKER BattleScript_SubstituteString:: printfromtable gSubsituteUsedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AlreadyHasSubstitute:: setalreadystatusedmoveattempt BS_ATTACKER - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNHASSUBSTITUTE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRecharge:: @@ -1140,7 +1137,7 @@ BattleScript_EffectRecharge:: BattleScript_MoveUsedMustRecharge:: printstring STRINGID_PKMNMUSTRECHARGE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRage:: @@ -1165,13 +1162,13 @@ BattleScript_EffectMimic:: attackanimation waitanimation printstring STRINGID_PKMNLEARNEDMOVE2 - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectMetronome:: attackcanceler attackstring - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT attackanimation waitanimation setbyte sB_ANIM_TURN, 0x0 @@ -1181,7 +1178,7 @@ BattleScript_EffectMetronome:: BattleScript_EffectLeechSeed:: attackcanceler attackstring - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT ppreduce jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_ButItFailed accuracycheck BattleScript_DoLeechSeed, ACC_CURR_MOVE @@ -1190,7 +1187,7 @@ BattleScript_DoLeechSeed:: attackanimation waitanimation printfromtable gLeechSeedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSplash:: @@ -1201,7 +1198,7 @@ BattleScript_EffectSplash:: waitanimation incrementgamestat GAME_STAT_USED_SPLASH printstring STRINGID_BUTNOTHINGHAPPENED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectDisable:: @@ -1213,7 +1210,7 @@ BattleScript_EffectDisable:: attackanimation waitanimation printstring STRINGID_PKMNMOVEWASDISABLED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectLevelDamage:: @@ -1257,7 +1254,7 @@ BattleScript_EffectEncore:: attackanimation waitanimation printstring STRINGID_PKMNGOTENCORE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectPainSplit:: @@ -1275,7 +1272,7 @@ BattleScript_EffectPainSplit:: healthbarupdate BS_TARGET datahpupdate BS_TARGET printstring STRINGID_SHAREDPAIN - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSnore:: @@ -1287,7 +1284,7 @@ BattleScript_EffectSnore:: BattleScript_SnoreIsAsleep:: jumpifhalfword CMP_EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_DoSnore printstring STRINGID_PKMNFASTASLEEP - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG statusanimation BS_ATTACKER BattleScript_DoSnore:: attackstring @@ -1304,7 +1301,7 @@ BattleScript_EffectConversion2:: attackanimation waitanimation printstring STRINGID_PKMNCHANGEDTYPE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectLockOn:: @@ -1317,7 +1314,7 @@ BattleScript_EffectLockOn:: attackanimation waitanimation printstring STRINGID_PKMNTOOKAIM - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSketch:: @@ -1329,7 +1326,7 @@ BattleScript_EffectSketch:: attackanimation waitanimation printstring STRINGID_PKMNSKETCHEDMOVE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSleepTalk:: @@ -1340,13 +1337,13 @@ BattleScript_EffectSleepTalk:: goto BattleScript_ButItFailed BattleScript_SleepTalkIsAsleep:: printstring STRINGID_PKMNFASTASLEEP - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG statusanimation BS_ATTACKER attackstring ppreduce orword gHitMarker, HITMARKER_NO_PPDEDUCT trychoosesleeptalkmove BattleScript_SleepTalkUsingMove - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG goto BattleScript_ButItFailed BattleScript_SleepTalkUsingMove:: attackanimation @@ -1363,7 +1360,7 @@ BattleScript_EffectDestinyBond:: attackanimation waitanimation printstring STRINGID_PKMNTRYINGTOTAKEFOE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectFlail:: @@ -1379,7 +1376,7 @@ BattleScript_EffectSpite:: attackanimation waitanimation printstring STRINGID_PKMNREDUCEDPP - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectHealBell:: @@ -1391,15 +1388,15 @@ BattleScript_EffectHealBell:: attackanimation waitanimation printfromtable gPartyStatusHealStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG jumpifnotmove MOVE_HEAL_BELL, BattleScript_PartyHealEnd - jumpifbyte CMP_NO_COMMON_BITS, cMULTISTRING_CHOOSER, 0x1, BattleScript_CheckHealBellMon2Unaffected + jumpifbyte CMP_NO_COMMON_BITS, cMULTISTRING_CHOOSER, B_MSG_BELL_SOUNDPROOF_ATTACKER, BattleScript_CheckHealBellMon2Unaffected printstring STRINGID_PKMNSXBLOCKSY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_CheckHealBellMon2Unaffected:: - jumpifbyte CMP_NO_COMMON_BITS, cMULTISTRING_CHOOSER, 0x2, BattleScript_PartyHealEnd + jumpifbyte CMP_NO_COMMON_BITS, cMULTISTRING_CHOOSER, B_MSG_BELL_SOUNDPROOF_PARTNER, BattleScript_PartyHealEnd printstring STRINGID_PKMNSXBLOCKSY2 - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_PartyHealEnd:: updatestatusicon BS_ATTACKER_WITH_PARTNER waitstate @@ -1436,7 +1433,7 @@ BattleScript_DoTripleKickAttack:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG printstring STRINGID_EMPTYSTRING3 waitmessage 1 moveendto MOVEEND_NEXT_TARGET @@ -1444,17 +1441,17 @@ BattleScript_DoTripleKickAttack:: decrementmultihit BattleScript_TripleKickLoop goto BattleScript_TripleKickPrintStrings BattleScript_TripleKickNoMoreHits:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0x0, BattleScript_TripleKickPrintStrings bicbyte gMoveResultFlags, MOVE_RESULT_MISSED BattleScript_TripleKickPrintStrings:: resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0x0, BattleScript_TripleKickEnd jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_TripleKickEnd copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6 printstring STRINGID_HITXTIMES - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_TripleKickEnd:: seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL @@ -1477,7 +1474,7 @@ BattleScript_EffectMeanLook:: setmoveeffect MOVE_EFFECT_PREVENT_ESCAPE seteffectprimary printstring STRINGID_TARGETCANTESCAPENOW - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectNightmare:: @@ -1494,7 +1491,7 @@ BattleScript_NightmareWorked:: setmoveeffect MOVE_EFFECT_NIGHTMARE seteffectprimary printstring STRINGID_PKMNFELLINTONIGHTMARE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectMinimize:: @@ -1519,17 +1516,17 @@ BattleScript_CurseTrySpeed:: setstatchanger STAT_SPEED, 1, TRUE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseTryAttack printfromtable gStatDownStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_CurseTryAttack:: setstatchanger STAT_ATK, 1, FALSE - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseTryDefence + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseTryDefense printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG -BattleScript_CurseTryDefence:: + waitmessage B_WAIT_TIME_LONG +BattleScript_CurseTryDefense:: setstatchanger STAT_DEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseEnd printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_CurseEnd:: goto BattleScript_MoveEnd BattleScript_GhostCurse:: @@ -1549,7 +1546,7 @@ BattleScript_DoGhostCurse:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNLAIDCURSE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_ATTACKER, FALSE, NULL goto BattleScript_MoveEnd @@ -1562,7 +1559,7 @@ BattleScript_EffectEndure:: attackanimation waitanimation printfromtable gProtectLikeUsedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSpikes:: @@ -1573,7 +1570,7 @@ BattleScript_EffectSpikes:: attackanimation waitanimation printstring STRINGID_SPIKESSCATTERED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectForesight:: @@ -1585,7 +1582,7 @@ BattleScript_EffectForesight:: attackanimation waitanimation printstring STRINGID_PKMNIDENTIFIED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectPerishSong:: @@ -1596,7 +1593,7 @@ BattleScript_EffectPerishSong:: attackanimation waitanimation printstring STRINGID_FAINTINTHREE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG setbyte sBATTLER, 0x0 BattleScript_PerishSongLoop:: jumpifability BS_SCRIPTING, ABILITY_SOUNDPROOF, BattleScript_PerishSongNotAffected @@ -1607,7 +1604,7 @@ BattleScript_PerishSongLoopIncrement:: BattleScript_PerishSongNotAffected:: printstring STRINGID_PKMNSXBLOCKSY2 - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_PerishSongLoopIncrement BattleScript_EffectSandstorm:: @@ -1640,11 +1637,11 @@ BattleScript_EffectSwagger:: waitanimation setstatchanger STAT_ATK, 2, FALSE statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_SwaggerTryConfuse - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_SwaggerTryConfuse + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_SwaggerTryConfuse setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_SwaggerTryConfuse:: jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_OwnTempoPrevents jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected @@ -1675,7 +1672,7 @@ BattleScript_EffectAttract:: attackanimation waitanimation printstring STRINGID_PKMNFELLINLOVE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectReturn:: @@ -1710,9 +1707,9 @@ BattleScript_EffectMagnitude:: ppreduce selectfirstvalidtarget magnitudedamagecalculation - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_MAGNITUDESTRENGTH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_HitsAllWithUndergroundBonusLoop BattleScript_EffectBatonPass:: @@ -1774,7 +1771,7 @@ BattleScript_MoveWeatherChange:: attackanimation waitanimation printfromtable gMoveWeatherChangeStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG call BattleScript_WeatherFormChanges goto BattleScript_MoveEnd @@ -1808,7 +1805,7 @@ BattleScript_EffectBellyDrum:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNCUTHPMAXEDATTACK - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectPsychUp:: @@ -1819,7 +1816,7 @@ BattleScript_EffectPsychUp:: attackanimation waitanimation printstring STRINGID_PKMNCOPIEDSTATCHANGES - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectMirrorCoat:: @@ -1835,15 +1832,15 @@ BattleScript_EffectMirrorCoat:: BattleScript_EffectSkullBash:: jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn - setbyte sTWOTURN_STRINGID, 2 + setbyte sTWOTURN_STRINGID, B_MSG_TURN1_SKULL_BASH call BattleScriptFirstChargingTurn setstatchanger STAT_DEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_SkullBashEnd - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_SkullBashEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_SkullBashEnd setgraphicalstatchangevalues playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_SkullBashEnd:: goto BattleScript_MoveEnd @@ -1883,9 +1880,9 @@ BattleScript_DoHitAllWithUndergroundBonus:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG printstring STRINGID_EMPTYSTRING3 waitmessage 1 tryfaintmon BS_TARGET, FALSE, NULL @@ -1893,11 +1890,11 @@ BattleScript_DoHitAllWithUndergroundBonus:: jumpifnexttargetvalid BattleScript_HitsAllWithUndergroundBonusLoop end BattleScript_HitAllWithUndergroundBonusMissed:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT typecalc effectivenesssound resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG moveendto MOVEEND_NEXT_TARGET jumpifnexttargetvalid BattleScript_HitsAllWithUndergroundBonusLoop end @@ -1910,7 +1907,7 @@ BattleScript_EffectFutureSight:: attackanimation waitanimation printfromtable gFutureMoveUsedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectGust:: @@ -1931,7 +1928,7 @@ BattleScript_EffectSolarbeam:: BattleScript_SolarbeamDecideTurn:: jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn - setbyte sTWOTURN_STRINGID, 1 + setbyte sTWOTURN_STRINGID, B_MSG_TURN1_SOLAR_BEAM call BattleScriptFirstChargingTurn goto BattleScript_MoveEnd BattleScript_SolarbeamOnFirstTurn:: @@ -1957,7 +1954,7 @@ BattleScript_EffectTeleport:: attackanimation waitanimation printstring STRINGID_PKMNFLEDFROMBATTLE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG setoutcomeonteleport BS_ATTACKER goto BattleScript_MoveEnd @@ -1965,7 +1962,7 @@ BattleScript_EffectBeatUp:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT ppreduce setbyte gBattleCommunication, 0x0 BattleScript_BeatUpLoop:: @@ -1985,9 +1982,9 @@ BattleScript_BeatUpAttack:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL moveendto MOVEEND_NEXT_TARGET goto BattleScript_BeatUpLoop @@ -2000,19 +1997,19 @@ BattleScript_EffectSemiInvulnerable:: jumpifmove MOVE_FLY, BattleScript_FirstTurnFly jumpifmove MOVE_DIVE, BattleScript_FirstTurnDive jumpifmove MOVE_BOUNCE, BattleScript_FirstTurnBounce - setbyte sTWOTURN_STRINGID, 5 + setbyte sTWOTURN_STRINGID, B_MSG_TURN1_DIG goto BattleScript_FirstTurnSemiInvulnerable BattleScript_FirstTurnBounce:: - setbyte sTWOTURN_STRINGID, 7 + setbyte sTWOTURN_STRINGID, B_MSG_TURN1_BOUNCE goto BattleScript_FirstTurnSemiInvulnerable BattleScript_FirstTurnDive:: - setbyte sTWOTURN_STRINGID, 6 + setbyte sTWOTURN_STRINGID, B_MSG_TURN1_DIVE goto BattleScript_FirstTurnSemiInvulnerable BattleScript_FirstTurnFly:: - setbyte sTWOTURN_STRINGID, 4 + setbyte sTWOTURN_STRINGID, B_MSG_TURN1_FLY BattleScript_FirstTurnSemiInvulnerable:: call BattleScriptFirstChargingTurn setsemiinvulnerablebit @@ -2042,7 +2039,7 @@ BattleScript_EffectDefenseCurl:: setdefensecurlbit setstatchanger STAT_DEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DefenseCurlDoStatUpAnim - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatUpPrintString + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_StatUpPrintString attackanimation waitanimation BattleScript_DefenseCurlDoStatUpAnim:: @@ -2060,13 +2057,13 @@ BattleScript_PresentHealTarget:: healthbarupdate BS_TARGET datahpupdate BS_TARGET printstring STRINGID_PKMNREGAINEDHEALTH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AlreadyAtFullHp:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNHPFULL - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectFakeOut:: @@ -2080,17 +2077,17 @@ BattleScript_ButItFailedAtkStringPpReduce:: BattleScript_ButItFailedPpReduce:: ppreduce BattleScript_ButItFailed:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT orbyte gMoveResultFlags, MOVE_RESULT_FAILED resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_NotAffected:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT orbyte gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectUproar:: @@ -2112,7 +2109,7 @@ BattleScript_EffectStockpile:: attackanimation waitanimation printfromtable gStockpileUsedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSpitUp:: @@ -2126,18 +2123,18 @@ BattleScript_EffectSpitUp:: adjustsetdamage goto BattleScript_HitFromAtkAnimation BattleScript_SpitUpFail:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_FAILEDTOSPITUP - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SpitUpFailProtect:: attackstring ppreduce - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG stockpiletobasedamage BattleScript_SpitUpFail resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSwallow:: @@ -2148,9 +2145,9 @@ BattleScript_EffectSwallow:: goto BattleScript_PresentHealTarget BattleScript_SwallowFail:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printfromtable gSwallowFailStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectHail:: @@ -2169,7 +2166,7 @@ BattleScript_EffectTorment:: attackanimation waitanimation printstring STRINGID_PKMNSUBJECTEDTOTORMENT - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectFlatter:: @@ -2183,11 +2180,11 @@ BattleScript_EffectFlatter:: waitanimation setstatchanger STAT_SPATK, 1, FALSE statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_FlatterTryConfuse - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_FlatterTryConfuse + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_FlatterTryConfuse setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_FlatterTryConfuse:: jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_OwnTempoPrevents jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected @@ -2214,15 +2211,15 @@ BattleScript_EffectWillOWisp:: BattleScript_WaterVeilPrevents:: copybyte gEffectBattler, gBattlerTarget - setbyte cMULTISTRING_CHOOSER, 0x0 + setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS call BattleScript_BRNPrevention goto BattleScript_MoveEnd BattleScript_AlreadyBurned:: setalreadystatusedmoveattempt BS_ATTACKER - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNALREADYHASBURN - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectMemento:: @@ -2240,22 +2237,24 @@ BattleScript_EffectMemento:: playstatchangeanimation BS_TARGET, BIT_ATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO setstatchanger STAT_ATK, 2, TRUE statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_EffectMementoTrySpAtk - jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_EffectMementoTrySpAtk + @ Greater than STAT_FELL is checking if the stat cannot decrease + jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, B_MSG_DEFENDER_STAT_FELL, BattleScript_EffectMementoTrySpAtk printfromtable gStatDownStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_EffectMementoTrySpAtk: playstatchangeanimation BS_TARGET, BIT_SPATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO setstatchanger STAT_SPATK, 2, TRUE statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_EffectMementoTryFaint - jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_EffectMementoTryFaint + @ Greater than STAT_FELL is checking if the stat cannot decrease + jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, B_MSG_DEFENDER_STAT_FELL, BattleScript_EffectMementoTryFaint printfromtable gStatDownStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_EffectMementoTryFaint: tryfaintmon BS_ATTACKER, FALSE, NULL goto BattleScript_MoveEnd BattleScript_EffectMementoPrintNoEffect: printstring STRINGID_BUTNOEFFECT - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_EffectMementoTryFaint BattleScript_MementoFailProtect: attackstring @@ -2263,10 +2262,10 @@ BattleScript_MementoFailProtect: jumpifattackandspecialattackcannotfall BattleScript_MementoFailEnd BattleScript_MementoFailEnd: setatkhptozero - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG effectivenesssound resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_ATTACKER, FALSE, NULL goto BattleScript_MoveEnd @@ -2283,7 +2282,7 @@ BattleScript_EffectFocusPunch:: jumpifnodamage BattleScript_HitFromAccCheck ppreduce printstring STRINGID_PKMNLOSTFOCUS - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSmellingsalt:: @@ -2303,16 +2302,16 @@ BattleScript_EffectFollowMe:: attackanimation waitanimation printstring STRINGID_PKMNCENTERATTENTION - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectNaturePower:: attackcanceler attackstring - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT callterrainattack printstring STRINGID_NATUREPOWERTURNEDINTO - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_EffectCharge:: @@ -2323,7 +2322,7 @@ BattleScript_EffectCharge:: attackanimation waitanimation printstring STRINGID_PKMNCHARGINGPOWER - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectTaunt:: @@ -2335,7 +2334,7 @@ BattleScript_EffectTaunt:: attackanimation waitanimation printstring STRINGID_PKMNFELLFORTAUNT - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectHelpingHand:: @@ -2346,7 +2345,7 @@ BattleScript_EffectHelpingHand:: attackanimation waitanimation printstring STRINGID_PKMNREADYTOHELP - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectTrick:: @@ -2359,9 +2358,9 @@ BattleScript_EffectTrick:: attackanimation waitanimation printstring STRINGID_PKMNSWITCHEDITEMS - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG printfromtable gItemSwapStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRolePlay:: @@ -2373,7 +2372,7 @@ BattleScript_EffectRolePlay:: attackanimation waitanimation printstring STRINGID_PKMNCOPIEDFOE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectWish:: @@ -2403,7 +2402,7 @@ BattleScript_EffectIngrain:: attackanimation waitanimation printstring STRINGID_PKMNPLANTEDROOTS - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSuperpower:: @@ -2418,7 +2417,7 @@ BattleScript_EffectMagicCoat:: attackanimation waitanimation printstring STRINGID_PKMNSHROUDEDITSELF - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRecycle:: @@ -2429,7 +2428,7 @@ BattleScript_EffectRecycle:: attackanimation waitanimation printstring STRINGID_XFOUNDONEY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRevenge:: @@ -2453,7 +2452,7 @@ BattleScript_BrickBreakAnim:: waitanimation jumpifbyte CMP_LESS_THAN, sB_ANIM_TURN, 0x2, BattleScript_BrickBreakDoHit printstring STRINGID_THEWALLSHATTERED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_BrickBreakDoHit:: typecalc2 effectivenesssound @@ -2462,9 +2461,9 @@ BattleScript_BrickBreakDoHit:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL goto BattleScript_MoveEnd @@ -2483,14 +2482,14 @@ BattleScript_EffectYawn:: attackanimation waitanimation printstring STRINGID_PKMNWASMADEDROWSY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_PrintBankAbilityMadeIneffective:: copybyte sBATTLER, sBATTLER_WITH_ABILITY BattleScript_PrintAbilityMadeIneffective:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNSXMADEITINEFFECTIVE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectKnockOff:: @@ -2524,7 +2523,7 @@ BattleScript_EffectSkillSwap:: attackanimation waitanimation printstring STRINGID_PKMNSWAPPEDABILITIES - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectImprison:: @@ -2535,7 +2534,7 @@ BattleScript_EffectImprison:: attackanimation waitanimation printstring STRINGID_PKMNSEALEDOPPONENTMOVE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectRefresh:: @@ -2546,7 +2545,7 @@ BattleScript_EffectRefresh:: attackanimation waitanimation printstring STRINGID_PKMNSTATUSNORMAL - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_ATTACKER goto BattleScript_MoveEnd @@ -2558,7 +2557,7 @@ BattleScript_EffectGrudge:: attackanimation waitanimation printstring STRINGID_PKMNWANTSGRUDGE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectSnatch:: @@ -2568,9 +2567,9 @@ BattleScript_EffectSnatch:: ppreduce attackanimation waitanimation - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNWAITSFORTARGET - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectLowKick:: @@ -2608,7 +2607,7 @@ BattleScript_TeeterDanceLoop:: waitanimation seteffectprimary resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_TeeterDanceDoMoveEndIncrement:: moveendto MOVEEND_NEXT_TARGET BattleScript_TeeterDanceLoopIncrement:: @@ -2617,33 +2616,33 @@ BattleScript_TeeterDanceLoopIncrement:: end BattleScript_TeeterDanceOwnTempoPrevents:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNPREVENTSCONFUSIONWITH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_TeeterDanceDoMoveEndIncrement BattleScript_TeeterDanceSafeguardProtected:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNUSEDSAFEGUARD - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_TeeterDanceDoMoveEndIncrement BattleScript_TeeterDanceSubstitutePrevents:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_BUTITFAILED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_TeeterDanceDoMoveEndIncrement BattleScript_TeeterDanceAlreadyConfused:: setalreadystatusedmoveattempt BS_ATTACKER - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNALREADYCONFUSED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_TeeterDanceDoMoveEndIncrement BattleScript_TeeterDanceMissed:: resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_TeeterDanceDoMoveEndIncrement BattleScript_EffectMudSport:: @@ -2655,7 +2654,7 @@ BattleScript_EffectWaterSport:: attackanimation waitanimation printfromtable gSportsUsedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectPoisonFang:: @@ -2685,24 +2684,24 @@ BattleScript_TickleDoMoveAnim:: playstatchangeanimation BS_TARGET, BIT_ATK, STAT_CHANGE_NEGATIVE setstatchanger STAT_ATK, 1, TRUE statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_TickleTryLowerDef - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_TickleTryLowerDef + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_TickleTryLowerDef printfromtable gStatDownStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_TickleTryLowerDef:: playstatchangeanimation BS_TARGET, BIT_DEF, STAT_CHANGE_NEGATIVE setstatchanger STAT_DEF, 1, TRUE statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_TickleEnd - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_TickleEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_TickleEnd printfromtable gStatDownStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_TickleEnd:: goto BattleScript_MoveEnd BattleScript_CantLowerMultipleStats:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT orbyte gMoveResultFlags, MOVE_RESULT_FAILED printstring STRINGID_STATSWONTDECREASE2 - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectCosmicPower:: @@ -2718,15 +2717,15 @@ BattleScript_CosmicPowerDoMoveAnim:: playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, 0x0 setstatchanger STAT_DEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CosmicPowerTrySpDef - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CosmicPowerTrySpDef + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CosmicPowerTrySpDef printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_CosmicPowerTrySpDef:: setstatchanger STAT_SPDEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CosmicPowerEnd - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CosmicPowerEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CosmicPowerEnd printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_CosmicPowerEnd:: goto BattleScript_MoveEnd @@ -2747,15 +2746,15 @@ BattleScript_BulkUpDoMoveAnim:: playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF, 0x0 setstatchanger STAT_ATK, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BulkUpTryDef - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_BulkUpTryDef + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_BulkUpTryDef printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_BulkUpTryDef:: setstatchanger STAT_DEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BulkUpEnd - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_BulkUpEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_BulkUpEnd printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_BulkUpEnd:: goto BattleScript_MoveEnd @@ -2772,23 +2771,23 @@ BattleScript_CalmMindDoMoveAnim:: playstatchangeanimation BS_ATTACKER, BIT_SPATK | BIT_SPDEF, 0x0 setstatchanger STAT_SPATK, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CalmMindTrySpDef - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CalmMindTrySpDef + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CalmMindTrySpDef printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_CalmMindTrySpDef:: setstatchanger STAT_SPDEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CalmMindEnd - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CalmMindEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CalmMindEnd printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_CalmMindEnd:: goto BattleScript_MoveEnd BattleScript_CantRaiseMultipleStats:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT orbyte gMoveResultFlags, MOVE_RESULT_FAILED printstring STRINGID_STATSWONTINCREASE2 - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_EffectDragonDance:: @@ -2804,15 +2803,15 @@ BattleScript_DragonDanceDoMoveAnim:: playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPEED, 0x0 setstatchanger STAT_ATK, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DragonDanceTrySpeed - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DragonDanceTrySpeed + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DragonDanceTrySpeed printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_DragonDanceTrySpeed:: setstatchanger STAT_SPEED, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DragonDanceEnd - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DragonDanceEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DragonDanceEnd printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_DragonDanceEnd:: goto BattleScript_MoveEnd @@ -2824,12 +2823,12 @@ BattleScript_EffectCamouflage:: attackanimation waitanimation printstring STRINGID_PKMNCHANGEDTYPE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_FaintAttacker:: playfaintcry BS_ATTACKER - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG dofaintanimation BS_ATTACKER cleareffectsonfaint BS_ATTACKER printstring STRINGID_ATTACKERFAINTED @@ -2837,7 +2836,7 @@ BattleScript_FaintAttacker:: BattleScript_FaintTarget:: playfaintcry BS_TARGET - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG dofaintanimation BS_TARGET cleareffectsonfaint BS_TARGET printstring STRINGID_TARGETFAINTED @@ -2952,7 +2951,7 @@ BattleScript_LocalBattleWonLoseTexts:: BattleScript_LocalBattleWonReward:: getmoneyreward printstring STRINGID_PLAYERGOTMONEY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_PayDayMoneyAndPickUpItems:: givepaydaymoney pickup @@ -2966,9 +2965,9 @@ BattleScript_LocalBattleLost:: jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, TRAINER_SECRET_BASE, BattleScript_LocalBattleLostEnd BattleScript_LocalBattleLostPrintWhiteOut:: printstring STRINGID_PLAYERWHITEOUT - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG printstring STRINGID_PLAYERWHITEOUT2 - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_LocalBattleLostEnd:: end2 BattleScript_CheckDomeDrew:: @@ -3009,23 +3008,23 @@ BattleScript_FrontierLinkBattleLost:: jumpifbattletype BATTLE_TYPE_RECORDED, BattleScript_FrontierLinkBattleLostEnd endlinkbattle BattleScript_FrontierLinkBattleLostEnd:: - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_LinkBattleWonOrLost:: jumpifbattletype BATTLE_TYPE_BATTLE_TOWER, BattleScript_TowerLinkBattleWon printstring STRINGID_BATTLEEND - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG jumpifbattletype BATTLE_TYPE_RECORDED, BattleScript_LinkBattleWonOrLostWaitEnd endlinkbattle BattleScript_LinkBattleWonOrLostWaitEnd:: - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_TowerLinkBattleWon:: playtrainerdefeatbgm BS_ATTACKER printstring STRINGID_BATTLEEND - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG trainerslidein BS_ATTACKER waitstate printstring STRINGID_TRAINER1LOSETEXT @@ -3037,7 +3036,7 @@ BattleScript_TowerLinkBattleWon:: jumpifbattletype BATTLE_TYPE_RECORDED, BattleScript_TowerLinkBattleWonEnd endlinkbattle BattleScript_TowerLinkBattleWonEnd:: - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_FrontierTrainerBattleWon:: @@ -3066,22 +3065,22 @@ BattleScript_FrontierTrainerBattleWon_End: BattleScript_SmokeBallEscape:: playanimation BS_ATTACKER, B_ANIM_SMOKEBALL_ESCAPE, NULL printstring STRINGID_PKMNFLEDUSINGITS - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_RanAwayUsingMonAbility:: printstring STRINGID_PKMNFLEDUSING - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_GotAwaySafely:: printstring STRINGID_GOTAWAYSAFELY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_WildMonFled:: printstring STRINGID_WILDPKMNFLED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_PrintCantRunFromTrainer:: @@ -3090,7 +3089,7 @@ BattleScript_PrintCantRunFromTrainer:: BattleScript_PrintFailedToRunString:: printfromtable gNoEscapeStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_PrintCantEscapeFromBattle:: @@ -3137,7 +3136,7 @@ BattleScript_DoSwitchOut:: end2 BattleScript_PursuitDmgOnSwitchOut:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT attackstring ppreduce critcalc @@ -3152,9 +3151,9 @@ BattleScript_PursuitDmgOnSwitchOut:: healthbarupdate BS_TARGET datahpupdate BS_TARGET critmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL moveendfromto MOVEEND_ON_DAMAGE_ABILITIES, MOVEEND_CHOICE_MOVE getbattlerfainted BS_TARGET @@ -3165,7 +3164,7 @@ BattleScript_PursuitDmgOnSwitchOutRet: return BattleScript_Pausex20:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT return BattleScript_LevelUp:: @@ -3199,7 +3198,7 @@ BattleScript_LearnedNewMove:: buffermovetolearn fanfare MUS_LEVEL_UP printstring STRINGID_PKMNLEARNEDMOVE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatechoicemoveonlvlup BS_ATTACKER goto BattleScript_TryLearnMoveLoop BattleScript_LearnMoveReturn:: @@ -3207,15 +3206,15 @@ BattleScript_LearnMoveReturn:: BattleScript_RainContinuesOrEnds:: printfromtable gRainContinuesStringIds - waitmessage WAIT_TIME_LONG - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_RainContinuesOrEndsEnd + waitmessage B_WAIT_TIME_LONG + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_RAIN_STOPPED, BattleScript_RainContinuesOrEndsEnd playanimation BS_ATTACKER, B_ANIM_RAIN_CONTINUES, NULL BattleScript_RainContinuesOrEndsEnd:: end2 BattleScript_DamagingWeatherContinues:: printfromtable gSandStormHailContinuesStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG playanimation2 BS_ATTACKER, sB_ANIM_ARG1, NULL setbyte gBattleCommunication, 0x0 BattleScript_DamagingWeatherLoop:: @@ -3223,7 +3222,7 @@ BattleScript_DamagingWeatherLoop:: weatherdamage jumpifword CMP_EQUAL, gBattleMoveDamage, 0x0, BattleScript_DamagingWeatherLoopIncrement printfromtable gSandStormHailDmgStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE effectivenesssound hitanimation BS_ATTACKER @@ -3241,41 +3240,41 @@ BattleScript_DamagingWeatherContinuesEnd:: BattleScript_SandStormHailEnds:: printfromtable gSandStormHailEndStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_SunlightContinues:: printstring STRINGID_SUNLIGHTSTRONG - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG playanimation BS_ATTACKER, B_ANIM_SUN_CONTINUES, NULL end2 BattleScript_SunlightFaded:: printstring STRINGID_SUNLIGHTFADED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_OverworldWeatherStarts:: printfromtable gWeatherStartsStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG playanimation2 BS_ATTACKER, sB_ANIM_ARG1, NULL end3 BattleScript_SideStatusWoreOff:: printstring STRINGID_PKMNSXWOREOFF - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_SafeguardProtected:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNUSEDSAFEGUARD - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_SafeguardEnds:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNSAFEGUARDEXPIRED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_LeechSeedTurnDrain:: @@ -3286,23 +3285,23 @@ BattleScript_LeechSeedTurnDrain:: copyword gBattleMoveDamage, gHpDealt jumpifability BS_ATTACKER, ABILITY_LIQUID_OOZE, BattleScript_LeechSeedTurnPrintLiquidOoze manipulatedamage DMG_CHANGE_SIGN - setbyte cMULTISTRING_CHOOSER, 0x3 + setbyte cMULTISTRING_CHOOSER, B_MSG_LEECH_SEED_DRAIN goto BattleScript_LeechSeedTurnPrintAndUpdateHp BattleScript_LeechSeedTurnPrintLiquidOoze:: - setbyte cMULTISTRING_CHOOSER, 0x4 + setbyte cMULTISTRING_CHOOSER, B_MSG_LEECH_SEED_OOZE BattleScript_LeechSeedTurnPrintAndUpdateHp:: orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 healthbarupdate BS_TARGET datahpupdate BS_TARGET printfromtable gLeechSeedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_TARGET, FALSE, NULL end2 BattleScript_BideStoringEnergy:: printstring STRINGID_PKMNSTORINGENERGY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_BideAttack:: @@ -3310,7 +3309,7 @@ BattleScript_BideAttack:: setmoveeffect MOVE_EFFECT_CHARGING clearstatusfromeffect BS_ATTACKER printstring STRINGID_PKMNUNLEASHEDENERGY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG accuracycheck BattleScript_MoveMissed, ACC_CURR_MOVE typecalc bicbyte gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE @@ -3325,7 +3324,7 @@ BattleScript_BideAttack:: healthbarupdate BS_TARGET datahpupdate BS_TARGET resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL goto BattleScript_MoveEnd @@ -3334,7 +3333,7 @@ BattleScript_BideNoEnergyToAttack:: setmoveeffect MOVE_EFFECT_CHARGING clearstatusfromeffect BS_ATTACKER printstring STRINGID_PKMNUNLEASHEDENERGY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_ButItFailed BattleScript_SuccessForceOut:: @@ -3357,19 +3356,19 @@ BattleScript_TrainerBattleForceOut:: goto BattleScript_MoveEnd BattleScript_MistProtected:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNPROTECTEDBYMIST - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_RageIsBuilding:: printstring STRINGID_PKMNRAGEBUILDING - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_MoveUsedIsDisabled:: printstring STRINGID_PKMNMOVEISDISABLED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SelectingDisabledMove:: @@ -3378,7 +3377,7 @@ BattleScript_SelectingDisabledMove:: BattleScript_DisabledNoMore:: printstring STRINGID_PKMNMOVEDISABLEDNOMORE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_SelectingDisabledMoveInPalace:: @@ -3389,12 +3388,12 @@ BattleScript_SelectingUnusableMoveInPalace:: BattleScript_EncoredNoMore:: printstring STRINGID_PKMNENCOREENDED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_DestinyBondTakesLife:: printstring STRINGID_PKMNTOOKFOE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER @@ -3448,12 +3447,12 @@ BattleScript_SpikesOnFaintedBattlerFainted:: BattleScript_PrintHurtBySpikes:: printstring STRINGID_PKMNHURTBYSPIKES - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_PerishSongTakesLife:: printstring STRINGID_PKMNPERISHCOUNTFELL - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER @@ -3462,7 +3461,7 @@ BattleScript_PerishSongTakesLife:: BattleScript_PerishSongCountGoesDown:: printstring STRINGID_PKMNPERISHCOUNTFELL - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_AllStatsUp:: @@ -3477,27 +3476,27 @@ BattleScript_AllStatsUpAtk:: setstatchanger STAT_ATK, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpDef printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_AllStatsUpDef:: setstatchanger STAT_DEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpeed printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_AllStatsUpSpeed:: setstatchanger STAT_SPEED, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpAtk printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_AllStatsUpSpAtk:: setstatchanger STAT_SPATK, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpDef printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_AllStatsUpSpDef:: setstatchanger STAT_SPDEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpRet printfromtable gStatUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_AllStatsUpRet:: return @@ -3507,31 +3506,31 @@ BattleScript_RapidSpinAway:: BattleScript_WrapFree:: printstring STRINGID_PKMNGOTFREE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG copybyte gBattlerTarget, sBATTLER return BattleScript_LeechSeedFree:: printstring STRINGID_PKMNSHEDLEECHSEED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_SpikesFree:: printstring STRINGID_PKMNBLEWAWAYSPIKES - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_MonTookFutureAttack:: printstring STRINGID_PKMNTOOKATTACK - waitmessage WAIT_TIME_LONG - jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x0, BattleScript_CheckDoomDesireMiss + waitmessage B_WAIT_TIME_LONG + jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_FUTURE_SIGHT, BattleScript_CheckDoomDesireMiss accuracycheck BattleScript_FutureAttackMiss, MOVE_FUTURE_SIGHT goto BattleScript_FutureAttackAnimate BattleScript_CheckDoomDesireMiss:: accuracycheck BattleScript_FutureAttackMiss, MOVE_DOOM_DESIRE BattleScript_FutureAttackAnimate:: adjustnormaldamage2 - jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x0, BattleScript_FutureHitAnimDoomDesire + jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_FUTURE_SIGHT, BattleScript_FutureHitAnimDoomDesire playanimation BS_ATTACKER, B_ANIM_FUTURE_SIGHT_HIT, NULL goto BattleScript_DoFutureAttackHit BattleScript_FutureHitAnimDoomDesire:: @@ -3543,7 +3542,7 @@ BattleScript_DoFutureAttackHit:: healthbarupdate BS_TARGET datahpupdate BS_TARGET resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL atk24 BattleScript_FutureAttackEnd BattleScript_FutureAttackEnd:: @@ -3553,11 +3552,11 @@ BattleScript_FutureAttackEnd:: end2 BattleScript_FutureAttackMiss:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT setbyte gMoveResultFlags, 0 orbyte gMoveResultFlags, MOVE_RESULT_FAILED resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG setbyte gMoveResultFlags, 0 end2 @@ -3571,9 +3570,9 @@ BattleScript_SelectingMoveWithNoPP:: BattleScript_NoPPForMove:: attackstring - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_BUTNOPPLEFT - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SelectingTormentedMove:: @@ -3582,7 +3581,7 @@ BattleScript_SelectingTormentedMove:: BattleScript_MoveUsedIsTormented:: printstring STRINGID_PKMNCANTUSEMOVETORMENT - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SelectingTormentedMoveInPalace:: @@ -3595,7 +3594,7 @@ BattleScript_SelectingNotAllowedMoveTaunt:: BattleScript_MoveUsedIsTaunted:: printstring STRINGID_PKMNCANTUSEMOVETAUNT - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SelectingNotAllowedMoveTauntInPalace:: @@ -3606,35 +3605,35 @@ BattleScript_WishComesTrue:: trywish 0x1, BattleScript_WishButFullHp playanimation BS_TARGET, B_ANIM_WISH_HEAL, NULL printstring STRINGID_PKMNWISHCAMETRUE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_TARGET datahpupdate BS_TARGET printstring STRINGID_PKMNREGAINEDHEALTH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_WishButFullHp:: printstring STRINGID_PKMNWISHCAMETRUE - waitmessage WAIT_TIME_LONG - pause WAIT_TIME_SHORT + waitmessage B_WAIT_TIME_LONG + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNHPFULL - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_IngrainTurnHeal:: playanimation BS_ATTACKER, B_ANIM_INGRAIN_HEAL, NULL printstring STRINGID_PKMNABSORBEDNUTRIENTS - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER end2 BattleScript_PrintMonIsRooted:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNANCHOREDITSELF - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AtkDefDown:: @@ -3643,28 +3642,28 @@ BattleScript_AtkDefDown:: playstatchangeanimation BS_ATTACKER, BIT_ATK, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE setstatchanger STAT_ATK, 1, TRUE statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_AtkDefDown_TryDef - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_AtkDefDown_TryDef + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_AtkDefDown_TryDef printfromtable gStatDownStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_AtkDefDown_TryDef:: playstatchangeanimation BS_ATTACKER, BIT_DEF, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE setstatchanger STAT_DEF, 1, TRUE statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_AtkDefDown_End - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_AtkDefDown_End + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_AtkDefDown_End printfromtable gStatDownStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_AtkDefDown_End:: return BattleScript_KnockedOff:: playanimation BS_TARGET, B_ANIM_ITEM_KNOCKOFF, NULL printstring STRINGID_PKMNKNOCKEDOFF - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_MoveUsedIsImprisoned:: printstring STRINGID_PKMNCANTUSEMOVESEALED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SelectingImprisonedMove:: @@ -3677,15 +3676,15 @@ BattleScript_SelectingImprisonedMoveInPalace:: BattleScript_GrudgeTakesPp:: printstring STRINGID_PKMNLOSTPPGRUDGE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_MagicCoatBounce:: attackstring ppreduce - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNMOVEBOUNCED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_x800000 setmagiccoattarget BS_ATTACKER return @@ -3696,19 +3695,19 @@ BattleScript_SnatchedMove:: snatchsetbattlers playanimation BS_TARGET, B_ANIM_SNATCH_MOVE, NULL printstring STRINGID_PKMNSNATCHEDMOVE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_x800000 swapattackerwithtarget return BattleScript_EnduredMsg:: printstring STRINGID_PKMNENDUREDHIT - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_OneHitKOMsg:: printstring STRINGID_ONEHITKO - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_SAtkDown2:: @@ -3716,9 +3715,9 @@ BattleScript_SAtkDown2:: playstatchangeanimation BS_ATTACKER, BIT_SPATK, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO setstatchanger STAT_SPATK, 2, TRUE statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_SAtkDown2End - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_SAtkDown2End + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_SAtkDown2End printfromtable gStatDownStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_SAtkDown2End:: return @@ -3727,31 +3726,31 @@ BattleScript_FocusPunchSetUp:: waitmessage 1 playanimation BS_ATTACKER, B_ANIM_FOCUS_PUNCH_SETUP, NULL printstring STRINGID_PKMNTIGHTENINGFOCUS - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_MoveUsedIsAsleep:: printstring STRINGID_PKMNFASTASLEEP - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG statusanimation BS_ATTACKER goto BattleScript_MoveEnd BattleScript_MoveUsedWokeUp:: bicword gHitMarker, HITMARKER_x10 printfromtable gWokeUpStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_ATTACKER return BattleScript_MonWokeUpInUproar:: printstring STRINGID_PKMNWOKEUPINUPROAR - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_ATTACKER end2 BattleScript_PoisonTurnDmg:: printstring STRINGID_PKMNHURTBYPOISON - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_DoStatusTurnDmg:: statusanimation BS_ATTACKER BattleScript_DoTurnDmg:: @@ -3765,60 +3764,60 @@ BattleScript_DoTurnDmgEnd:: BattleScript_BurnTurnDmg:: printstring STRINGID_PKMNHURTBYBURN - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_DoStatusTurnDmg BattleScript_MoveUsedIsFrozen:: printstring STRINGID_PKMNISFROZEN - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG statusanimation BS_ATTACKER goto BattleScript_MoveEnd BattleScript_MoveUsedUnfroze:: printfromtable gGotDefrostedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_ATTACKER return BattleScript_DefrostedViaFireMove:: printstring STRINGID_PKMNWASDEFROSTED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_TARGET return BattleScript_MoveUsedIsParalyzed:: printstring STRINGID_PKMNISPARALYZED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG statusanimation BS_ATTACKER cancelmultiturnmoves BS_ATTACKER goto BattleScript_MoveEnd BattleScript_MoveUsedFlinched:: printstring STRINGID_PKMNFLINCHED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_PrintUproarOverTurns:: printfromtable gUproarOverTurnStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_ThrashConfuses:: chosenstatus2animation BS_ATTACKER, STATUS2_CONFUSION printstring STRINGID_PKMNFATIGUECONFUSION - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_MoveUsedIsConfused:: printstring STRINGID_PKMNISCONFUSED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG status2animation BS_ATTACKER, STATUS2_CONFUSION - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x0, BattleScript_MoveUsedIsConfusedRet + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, FALSE, BattleScript_MoveUsedIsConfusedRet BattleScript_DoSelfConfusionDmg:: cancelmultiturnmoves BS_ATTACKER adjustnormaldamage2 printstring STRINGID_ITHURTCONFUSION - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG effectivenesssound hitanimation BS_ATTACKER waitstate @@ -3826,7 +3825,7 @@ BattleScript_DoSelfConfusionDmg:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER resultmessage - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_ATTACKER, FALSE, NULL goto BattleScript_MoveEnd BattleScript_MoveUsedIsConfusedRet:: @@ -3834,58 +3833,58 @@ BattleScript_MoveUsedIsConfusedRet:: BattleScript_MoveUsedIsConfusedNoMore:: printstring STRINGID_PKMNHEALEDCONFUSION - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_PrintPayDayMoneyString:: printstring STRINGID_PLAYERPICKEDUPMONEY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_WrapTurnDmg:: playanimation BS_ATTACKER, B_ANIM_TURN_TRAP, sB_ANIM_ARG1 printstring STRINGID_PKMNHURTBY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_DoTurnDmg BattleScript_WrapEnds:: printstring STRINGID_PKMNFREEDFROM - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_MoveUsedIsInLove:: printstring STRINGID_PKMNINLOVE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG status2animation BS_ATTACKER, STATUS2_INFATUATION return BattleScript_MoveUsedIsInLoveCantAttack:: printstring STRINGID_PKMNIMMOBILIZEDBYLOVE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_NightmareTurnDmg:: printstring STRINGID_PKMNLOCKEDINNIGHTMARE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG status2animation BS_ATTACKER, STATUS2_NIGHTMARE goto BattleScript_DoTurnDmg BattleScript_CurseTurnDmg:: printstring STRINGID_PKMNAFFLICTEDBYCURSE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG status2animation BS_ATTACKER, STATUS2_CURSED goto BattleScript_DoTurnDmg BattleScript_TargetPRLZHeal:: printstring STRINGID_PKMNHEALEDPARALYSIS - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_TARGET return BattleScript_MoveEffectSleep:: statusanimation BS_EFFECT_BATTLER printfromtable gFellAsleepStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_UpdateEffectStatusIconRet:: updatestatusicon BS_EFFECT_BATTLER waitstate @@ -3894,7 +3893,7 @@ BattleScript_UpdateEffectStatusIconRet:: BattleScript_YawnMakesAsleep:: statusanimation BS_EFFECT_BATTLER printstring STRINGID_PKMNFELLASLEEP - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_EFFECT_BATTLER waitstate makevisible BS_EFFECT_BATTLER @@ -3903,52 +3902,52 @@ BattleScript_YawnMakesAsleep:: BattleScript_MoveEffectPoison:: statusanimation BS_EFFECT_BATTLER printfromtable gGotPoisonedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_UpdateEffectStatusIconRet BattleScript_MoveEffectBurn:: statusanimation BS_EFFECT_BATTLER printfromtable gGotBurnedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_UpdateEffectStatusIconRet BattleScript_MoveEffectFreeze:: statusanimation BS_EFFECT_BATTLER printfromtable gGotFrozenStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_UpdateEffectStatusIconRet BattleScript_MoveEffectParalysis:: statusanimation BS_EFFECT_BATTLER printfromtable gGotParalyzedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_UpdateEffectStatusIconRet BattleScript_MoveEffectUproar:: printstring STRINGID_PKMNCAUSEDUPROAR - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_MoveEffectToxic:: statusanimation BS_EFFECT_BATTLER printstring STRINGID_PKMNBADLYPOISONED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_UpdateEffectStatusIconRet BattleScript_MoveEffectPayDay:: printstring STRINGID_COINSSCATTERED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_MoveEffectWrap:: printfromtable gWrappedStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_MoveEffectConfusion:: chosenstatus2animation BS_EFFECT_BATTLER, STATUS2_CONFUSION printstring STRINGID_PKMNWASCONFUSED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_MoveEffectRecoil:: @@ -3959,7 +3958,7 @@ BattleScript_DoRecoil:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNHITWITHRECOIL - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_ATTACKER, FALSE, NULL BattleScript_RecoilEnd:: return @@ -3967,11 +3966,11 @@ BattleScript_RecoilEnd:: BattleScript_ItemSteal:: playanimation BS_TARGET, B_ANIM_ITEM_STEAL, NULL printstring STRINGID_PKMNSTOLEITEM - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_DrizzleActivates:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNMADEITRAIN waitstate playanimation BS_BATTLER_0, B_ANIM_RAIN_CONTINUES, NULL @@ -3981,25 +3980,25 @@ BattleScript_DrizzleActivates:: BattleScript_SpeedBoostActivates:: playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printstring STRINGID_PKMNRAISEDSPEED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end3 BattleScript_TraceActivates:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNTRACED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end3 BattleScript_RainDishActivates:: printstring STRINGID_PKMNSXRESTOREDHPALITTLE2 - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER end3 BattleScript_SandstreamActivates:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNSXWHIPPEDUPSANDSTORM waitstate playanimation BS_BATTLER_0, B_ANIM_SANDSTORM_CONTINUES, NULL @@ -4008,7 +4007,7 @@ BattleScript_SandstreamActivates:: BattleScript_ShedSkinActivates:: printstring STRINGID_PKMNSXCUREDYPROBLEM - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_ATTACKER end3 @@ -4028,7 +4027,7 @@ BattleScript_DoCastformChange:: docastformchangeanimation waitstate printstring STRINGID_PKMNTRANSFORMED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_IntimidateActivatesEnd3:: @@ -4036,7 +4035,7 @@ BattleScript_IntimidateActivatesEnd3:: end3 BattleScript_PauseIntimidateActivates: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT BattleScript_IntimidateActivates:: setbyte gBattlerTarget, 0x0 setstatchanger STAT_ATK, 1, TRUE @@ -4047,24 +4046,24 @@ BattleScript_IntimidateActivatesLoop: jumpifability BS_TARGET, ABILITY_HYPER_CUTTER, BattleScript_IntimidatePrevented jumpifability BS_TARGET, ABILITY_WHITE_SMOKE, BattleScript_IntimidatePrevented statbuffchange STAT_BUFF_NOT_PROTECT_AFFECTED | STAT_BUFF_ALLOW_PTR, BattleScript_IntimidateActivatesLoopIncrement - jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_IntimidateActivatesLoopIncrement + jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 1, BattleScript_IntimidateActivatesLoopIncrement setgraphicalstatchangevalues playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printstring STRINGID_PKMNCUTSATTACKWITH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_IntimidateActivatesLoopIncrement: addbyte gBattlerTarget, 0x1 goto BattleScript_IntimidateActivatesLoop BattleScript_IntimidateActivatesReturn: return BattleScript_IntimidatePrevented: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PREVENTEDFROMWORKING - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_IntimidateActivatesLoopIncrement BattleScript_DroughtActivates:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNSXINTENSIFIEDSUN waitstate playanimation BS_BATTLER_0, B_ANIM_SUN_CONTINUES, NULL @@ -4073,34 +4072,34 @@ BattleScript_DroughtActivates:: BattleScript_TookAttack:: attackstring - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNSXTOOKATTACK - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED return BattleScript_SturdyPreventsOHKO:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNPROTECTEDBY - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_DampStopsExplosion:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNPREVENTSUSAGE - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_MoveHPDrain_PPLoss:: ppreduce BattleScript_MoveHPDrain:: attackstring - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_TARGET datahpupdate BS_TARGET printstring STRINGID_PKMNRESTOREDHPUSING - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orbyte gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE goto BattleScript_MoveEnd @@ -4108,9 +4107,9 @@ BattleScript_MonMadeMoveUseless_PPLoss:: ppreduce BattleScript_MonMadeMoveUseless:: attackstring - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNSXMADEYUSELESS - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orbyte gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE goto BattleScript_MoveEnd @@ -4118,83 +4117,83 @@ BattleScript_FlashFireBoost_PPLoss:: ppreduce BattleScript_FlashFireBoost:: attackstring - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printfromtable gFlashFireStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AbilityPreventsPhasingOut:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNANCHORSITSELFWITH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AbilityNoStatLoss:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNPREVENTSSTATLOSSWITH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_BRNPrevention:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printfromtable gBRNPreventionStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_PRLZPrevention:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printfromtable gPRLZPreventionStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_PSNPrevention:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printfromtable gPSNPreventionStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_ObliviousPreventsAttraction:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNPREVENTSROMANCEWITH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_FlinchPrevention:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNSXPREVENTSFLINCHING - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_OwnTempoPrevents:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNPREVENTSCONFUSIONWITH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_SoundproofProtected:: attackstring ppreduce - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNSXBLOCKSY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_AbilityNoSpecificStatLoss:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNSXPREVENTSYLOSS - waitmessage WAIT_TIME_LONG - setbyte cMULTISTRING_CHOOSER, 0x3 + waitmessage B_WAIT_TIME_LONG + setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY return BattleScript_StickyHoldActivates:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNSXMADEYINEFFECTIVE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd BattleScript_ColorChangeActivates:: printstring STRINGID_PKMNCHANGEDTYPEWITH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_RoughSkinActivates:: @@ -4202,14 +4201,14 @@ BattleScript_RoughSkinActivates:: healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNHURTSWITH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_ATTACKER, FALSE, NULL return BattleScript_CuteCharmActivates:: status2animation BS_ATTACKER, STATUS2_INFATUATION printstring STRINGID_PKMNSXINFATUATEDY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_ApplySecondaryEffect:: @@ -4223,42 +4222,42 @@ BattleScript_SynchronizeActivates:: return BattleScript_NoItemSteal:: - pause WAIT_TIME_SHORT + pause B_WAIT_TIME_SHORT printstring STRINGID_PKMNSXMADEYINEFFECTIVE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_AbilityCuredStatus:: printstring STRINGID_PKMNSXCUREDITSYPROBLEM - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_SCRIPTING return BattleScript_IgnoresWhileAsleep:: printstring STRINGID_PKMNIGNORESASLEEP - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG moveendto MOVEEND_NEXT_TARGET end BattleScript_IgnoresAndUsesRandomMove:: printstring STRINGID_PKMNIGNOREDORDERS - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG jumptocalledmove FALSE BattleScript_MoveUsedLoafingAround:: - jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x4, BattleScript_82DB6C7 - setbyte gBattleCommunication, 0x0 + jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_INCAPABLE_OF_POWER, BattleScript_MoveUsedLoafingAroundMsg + setbyte gBattleCommunication, 0 various24 BS_ATTACKER - setbyte cMULTISTRING_CHOOSER, 0x4 -BattleScript_82DB6C7:: + setbyte cMULTISTRING_CHOOSER, B_MSG_INCAPABLE_OF_POWER +BattleScript_MoveUsedLoafingAroundMsg:: printfromtable gInobedientStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG moveendto MOVEEND_NEXT_TARGET end BattleScript_IgnoresAndFallsAsleep:: printstring STRINGID_PKMNBEGANTONAP - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG setmoveeffect MOVE_EFFECT_SLEEP | MOVE_EFFECT_AFFECTS_USER seteffectprimary moveendto MOVEEND_NEXT_TARGET @@ -4266,7 +4265,7 @@ BattleScript_IgnoresAndFallsAsleep:: BattleScript_IgnoresAndHitsItself:: printstring STRINGID_PKMNWONTOBEY - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG goto BattleScript_DoSelfConfusionDmg BattleScript_SubstituteFade:: @@ -4281,7 +4280,7 @@ BattleScript_BerryCurePrlzEnd2:: BattleScript_BerryCureParRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMCUREDPARALYSIS - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_SCRIPTING removeitem BS_SCRIPTING return @@ -4293,7 +4292,7 @@ BattleScript_BerryCurePsnEnd2:: BattleScript_BerryCurePsnRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMCUREDPOISON - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_SCRIPTING removeitem BS_SCRIPTING return @@ -4305,7 +4304,7 @@ BattleScript_BerryCureBrnEnd2:: BattleScript_BerryCureBrnRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMHEALEDBURN - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_SCRIPTING removeitem BS_SCRIPTING return @@ -4317,7 +4316,7 @@ BattleScript_BerryCureFrzEnd2:: BattleScript_BerryCureFrzRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMDEFROSTEDIT - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_SCRIPTING removeitem BS_SCRIPTING return @@ -4329,7 +4328,7 @@ BattleScript_BerryCureSlpEnd2:: BattleScript_BerryCureSlpRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMWOKEIT - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_SCRIPTING removeitem BS_SCRIPTING return @@ -4341,7 +4340,7 @@ BattleScript_BerryCureConfusionEnd2:: BattleScript_BerryCureConfusionRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMSNAPPEDOUT - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG removeitem BS_SCRIPTING return @@ -4352,7 +4351,7 @@ BattleScript_BerryCureChosenStatusEnd2:: BattleScript_BerryCureChosenStatusRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printfromtable gBerryEffectStringIds - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_SCRIPTING removeitem BS_SCRIPTING return @@ -4364,14 +4363,14 @@ BattleScript_WhiteHerbEnd2:: BattleScript_WhiteHerbRet:: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDSTATUS - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG removeitem BS_SCRIPTING return BattleScript_ItemHealHP_RemoveItem:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHEALTH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER @@ -4381,7 +4380,7 @@ BattleScript_ItemHealHP_RemoveItem:: BattleScript_BerryPPHealEnd2:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDPP - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG removeitem BS_ATTACKER end2 @@ -4392,7 +4391,7 @@ BattleScript_ItemHealHP_End2:: BattleScript_ItemHealHP_Ret:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHPALITTLE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER @@ -4405,18 +4404,18 @@ BattleScript_SelectingNotAllowedMoveChoiceItem:: BattleScript_FocusBandActivates:: playanimation BS_TARGET, B_ANIM_FOCUS_BAND, NULL printstring STRINGID_PKMNHUNGONWITHX - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG return BattleScript_BerryConfuseHealEnd2:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHEALTH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_FORXCOMMAYZ - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG setmoveeffect MOVE_EFFECT_CONFUSION | MOVE_EFFECT_AFFECTS_USER seteffectprimary removeitem BS_ATTACKER @@ -4424,9 +4423,9 @@ BattleScript_BerryConfuseHealEnd2:: BattleScript_BerryStatRaiseEnd2:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_82DB85B -BattleScript_82DB85B:: - setbyte cMULTISTRING_CHOOSER, 0x4 + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BerryStatRaiseDoStatUp +BattleScript_BerryStatRaiseDoStatUp:: + setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_ROSE_ITEM call BattleScript_StatUp removeitem BS_ATTACKER end2 @@ -4434,7 +4433,7 @@ BattleScript_82DB85B:: BattleScript_BerryFocusEnergyEnd2:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNUSEDXTOGETPUMPED - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG removeitem BS_ATTACKER end2 @@ -4452,7 +4451,7 @@ BattleScript_PalaceTryBattlerFlavorText:: palaceflavortext BS_ATTACKER @ BS_ATTACKER here overwritten by gBattleCommunication + 1 jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, TRUE, BattleScript_PalaceEndFlavorText printfromtable gBattlePalaceFlavorTextTable - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG BattleScript_PalaceEndFlavorText:: addbyte gBattleCommunication + 1, 1 jumpifbytenotequal gBattleCommunication + 1, gBattlersCount, BattleScript_PalaceTryBattlerFlavorText @@ -4469,7 +4468,7 @@ BattleScript_ArenaTurnBeginning:: various14 BS_ATTACKER arenajudmengtstring 8 arenawaitmessage 8 - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG various15 BS_ATTACKER volumeup end2 @@ -4479,7 +4478,7 @@ BattleScript_82DB8E0:: @ Unused battlescript various14 BS_ATTACKER arenajudmengtstring BS_TARGET arenawaitmessage BS_TARGET - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG various15 BS_ATTACKER end2 @@ -4492,14 +4491,14 @@ BattleScript_ArenaDoJudgment:: playse SE_ARENA_TIMEUP1 pause 8 playse SE_ARENA_TIMEUP1 - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG various14 BS_ATTACKER arenajudmengtstring 1 arenawaitmessage 1 - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG setbyte gBattleCommunication, 0x0 arenajudgmentwindow - pause WAIT_TIME_LONG + pause B_WAIT_TIME_LONG arenajudgmentwindow arenajudmengtstring 2 arenawaitmessage 2 @@ -4517,7 +4516,7 @@ BattleScript_ArenaDoJudgment:: arenajudgmentwindow various15 BS_ATTACKER printstring STRINGID_DEFEATEDOPPONENTBYREFEREE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG playfaintcry BS_OPPONENT1 waitcry BS_ATTACKER dofaintanimation BS_OPPONENT1 @@ -4531,7 +4530,7 @@ BattleScript_ArenaJudgmentPlayerLoses: arenajudgmentwindow various15 BS_ATTACKER printstring STRINGID_LOSTTOOPPONENTBYREFEREE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG playfaintcry BS_PLAYER1 waitcry BS_ATTACKER dofaintanimation BS_PLAYER1 @@ -4545,7 +4544,7 @@ BattleScript_ArenaJudgmentDraw: arenajudgmentwindow various15 BS_ATTACKER printstring STRINGID_TIEDOPPONENTBYREFEREE - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG playfaintcry BS_PLAYER1 waitcry BS_ATTACKER dofaintanimation BS_PLAYER1 @@ -4564,12 +4563,12 @@ BattleScript_AskIfWantsToForfeitMatch:: BattleScript_PrintPlayerForfeited:: printstring STRINGID_FORFEITEDMATCH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 BattleScript_PrintPlayerForfeitedLinkBattle:: printstring STRINGID_FORFEITEDMATCH - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG endlinkbattle - waitmessage WAIT_TIME_LONG + waitmessage B_WAIT_TIME_LONG end2 diff --git a/data/battle_scripts_2.s b/data/battle_scripts_2.s index caa6cddac..4b8ca0d87 100644 --- a/data/battle_scripts_2.s +++ b/data/battle_scripts_2.s @@ -69,16 +69,16 @@ BattleScript_PrintCaughtMonInfo:: trysetcaughtmondexflags BattleScript_TryNicknameCaughtMon printstring STRINGID_PKMNDATAADDEDTODEX waitstate - setbyte gBattleCommunication, 0x0 + setbyte gBattleCommunication, 0 displaydexinfo BattleScript_TryNicknameCaughtMon:: printstring STRINGID_GIVENICKNAMECAPTURED waitstate - setbyte gBattleCommunication, 0x0 + setbyte gBattleCommunication, 0 trygivecaughtmonnick BattleScript_GiveCaughtMonEnd givecaughtmon printfromtable gCaughtMonStringIds - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG goto BattleScript_SuccessBallThrowEnd BattleScript_GiveCaughtMonEnd:: givecaughtmon @@ -93,21 +93,21 @@ BattleScript_WallyBallThrow:: BattleScript_ShakeBallThrow:: printfromtable gBallEscapeStringIds - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0x0, BattleScript_ShakeBallThrowEnd printstring STRINGID_OUTOFSAFARIBALLS - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG setbyte gBattleOutcome, B_OUTCOME_NO_SAFARI_BALLS BattleScript_ShakeBallThrowEnd:: finishaction BattleScript_TrainerBallBlock:: - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG printstring STRINGID_TRAINERBLOCKEDBALL - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG printstring STRINGID_DONTBEATHIEF - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG finishaction BattleScript_PlayerUsesItem:: @@ -117,16 +117,16 @@ BattleScript_PlayerUsesItem:: BattleScript_OpponentUsesHealItem:: printstring STRINGID_EMPTYSTRING3 - pause 0x30 + pause B_WAIT_TIME_MED playse SE_USE_ITEM printstring STRINGID_TRAINER1USEDITEM - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG useitemonopponent orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNSITEMRESTOREDHEALTH - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_ATTACKER setbyte sMOVEEND_STATE, 0xF moveend 0x1, 0x0 @@ -134,13 +134,13 @@ BattleScript_OpponentUsesHealItem:: BattleScript_OpponentUsesStatusCureItem:: printstring STRINGID_EMPTYSTRING3 - pause 0x30 + pause B_WAIT_TIME_MED playse SE_USE_ITEM printstring STRINGID_TRAINER1USEDITEM - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG useitemonopponent printfromtable gTrainerItemCuredStatusStringIds - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG updatestatusicon BS_ATTACKER setbyte sMOVEEND_STATE, 0xF moveend 0x1, 0x0 @@ -148,26 +148,26 @@ BattleScript_OpponentUsesStatusCureItem:: BattleScript_OpponentUsesXItem:: printstring STRINGID_EMPTYSTRING3 - pause 0x30 + pause B_WAIT_TIME_MED playse SE_USE_ITEM printstring STRINGID_TRAINER1USEDITEM - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG useitemonopponent printfromtable gStatUpStringIds - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG setbyte sMOVEEND_STATE, 0xF moveend 0x1, 0x0 finishaction BattleScript_OpponentUsesGuardSpecs:: printstring STRINGID_EMPTYSTRING3 - pause 0x30 + pause B_WAIT_TIME_MED playse SE_USE_ITEM printstring STRINGID_TRAINER1USEDITEM - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG useitemonopponent printfromtable gMistUsedStringIds - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG setbyte sMOVEEND_STATE, 0xF moveend 0x1, 0x0 finishaction @@ -179,29 +179,29 @@ BattleScript_RunByUsingItem:: BattleScript_ActionWatchesCarefully: printstring STRINGID_PKMNWATCHINGCAREFULLY - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG end2 BattleScript_ActionGetNear: printfromtable gSafariGetNearStringIds - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG end2 BattleScript_ActionThrowPokeblock: printstring STRINGID_THREWPOKEBLOCKATPKMN - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG playanimation BS_ATTACKER, B_ANIM_POKEBLOCK_THROW, NULL printfromtable gSafariPokeblockResultStringIds - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG end2 BattleScript_ActionWallyThrow: printstring STRINGID_RETURNMON - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG returnatktoball waitstate trainerslidein BS_TARGET waitstate printstring STRINGID_YOUTHROWABALLNOWRIGHT - waitmessage 0x40 + waitmessage B_WAIT_TIME_LONG end2 diff --git a/include/battle.h b/include/battle.h index 954d33b07..14ecfbdd3 100644 --- a/include/battle.h +++ b/include/battle.h @@ -40,16 +40,17 @@ #define MAX_TRAINER_ITEMS 4 // array entries for battle communication -#define MULTIUSE_STATE 0x0 -#define CURSOR_POSITION 0x1 -#define TASK_ID 0x1 // task Id and cursor position share the same field -#define SPRITES_INIT_STATE1 0x1 // shares the Id as well -#define SPRITES_INIT_STATE2 0x2 -#define MOVE_EFFECT_BYTE 0x3 -#define ACTIONS_CONFIRMED_COUNT 0x4 -#define MULTISTRING_CHOOSER 0x5 -#define MSG_DISPLAY 0x7 -#define BATTLE_COMMUNICATION_ENTRIES_COUNT 0x8 +#define MULTIUSE_STATE 0 +#define CURSOR_POSITION 1 +#define TASK_ID 1 // task Id and cursor position share the same field +#define SPRITES_INIT_STATE1 1 // shares the Id as well +#define SPRITES_INIT_STATE2 2 +#define MOVE_EFFECT_BYTE 3 +#define ACTIONS_CONFIRMED_COUNT 4 +#define MULTISTRING_CHOOSER 5 +#define MISS_TYPE 6 +#define MSG_DISPLAY 7 +#define BATTLE_COMMUNICATION_ENTRIES_COUNT 8 #define MOVE_TARGET_SELECTED 0x0 #define MOVE_TARGET_DEPENDS 0x1 diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h index 0a230e7f6..db390346d 100644 --- a/include/battle_ai_switch_items.h +++ b/include/battle_ai_switch_items.h @@ -11,6 +11,26 @@ enum AI_ITEM_NOT_RECOGNIZABLE }; +enum { + AI_HEAL_CONFUSION, + AI_HEAL_PARALYSIS, + AI_HEAL_FREEZE, + AI_HEAL_BURN, + AI_HEAL_POISON, + AI_HEAL_SLEEP, +}; + +enum { + AI_X_ATTACK, + AI_X_DEFEND, + AI_X_SPEED, + AI_X_SPATK, + AI_X_SPDEF, // Unused + AI_X_ACCURACY, + AI_X_EVASION, // Unused + AI_DIRE_HIT, +}; + void AI_TrySwitchOrUseItem(void); u8 GetMostSuitableMonToSwitchInto(void); diff --git a/include/battle_message.h b/include/battle_message.h index 011a1cb0c..da3009d63 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -223,7 +223,6 @@ extern const u8* const gBattleStringsTable[]; extern const u8* const gStatNamesTable[]; extern const u8* const gPokeblockWasTooXStringTable[]; extern const u8* const gRefereeStringsTable[]; -extern const u8* const gStatNamesTable2[]; extern const u8 *const gRoundsStringTable[]; extern const u8 gText_PkmnIsEvolving[]; @@ -269,7 +268,7 @@ extern const u8 gText_Win[]; extern const u8 gText_Loss[]; extern const u8 gText_Draw[]; extern const u8 gText_StatRose[]; -extern const u8 gText_PkmnsStatChanged2[]; +extern const u8 gText_DefendersStatRose[]; extern const u8 gText_PkmnGettingPumped[]; extern const u8 gText_PkmnShroudedInMist[]; extern const u8 gText_PkmnsXPreventsSwitching[]; diff --git a/include/constants/battle.h b/include/constants/battle.h index e6ebc85e4..3dbd83255 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -302,4 +302,8 @@ #define BATTLE_TERRAIN_BUILDING 8 #define BATTLE_TERRAIN_PLAIN 9 +#define B_WAIT_TIME_LONG 64 +#define B_WAIT_TIME_MED 48 +#define B_WAIT_TIME_SHORT 32 + #endif // GUARD_CONSTANTS_BATTLE_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index f5b036b5d..f1c589fee 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -214,10 +214,10 @@ #define STRINGID_STATROSE 210 #define STRINGID_STATHARSHLY 211 #define STRINGID_STATFELL 212 -#define STRINGID_PKMNSSTATCHANGED 213 -#define STRINGID_PKMNSSTATCHANGED2 214 -#define STRINGID_PKMNSSTATCHANGED3 215 -#define STRINGID_PKMNSSTATCHANGED4 216 +#define STRINGID_ATTACKERSSTATROSE 213 +#define STRINGID_DEFENDERSSTATROSE 214 +#define STRINGID_ATTACKERSSTATFELL 215 +#define STRINGID_DEFENDERSSTATFELL 216 #define STRINGID_CRITICALHIT 217 #define STRINGID_ONEHITKO 218 #define STRINGID_123POOF 219 @@ -326,7 +326,7 @@ #define STRINGID_SOOTHINGAROMA 322 #define STRINGID_ITEMSCANTBEUSEDNOW 323 #define STRINGID_FORXCOMMAYZ 324 -#define STRINGID_USINGXTHEYOFZN 325 +#define STRINGID_USINGITEMSTATOFPKMNROSE 325 #define STRINGID_PKMNUSEDXTOGETPUMPED 326 #define STRINGID_PKMNSXMADEYUSELESS 327 #define STRINGID_PKMNTRAPPEDBYSANDTOMB 328 @@ -383,11 +383,207 @@ #define STRINGID_TRAINER1WINTEXT 379 #define STRINGID_TRAINER2WINTEXT 380 -// Indexes into gMissStringIds + +// The below IDs are all indexes into battle message tables, +// used to determine which of a set of messages to print. +// They are assigned to the MULTISTRING_CHOOSER byte of gBattleCommunication +// and read when e.g. the command printfromtable is used. + +// gStatUpStringIds +#define B_MSG_ATTACKER_STAT_ROSE 0 +#define B_MSG_DEFENDER_STAT_ROSE 1 +#define B_MSG_STAT_WONT_INCREASE 2 +#define B_MSG_STAT_ROSE_EMPTY 3 +#define B_MSG_STAT_ROSE_ITEM 4 +#define B_MSG_USED_DIRE_HIT 5 + +// gStatDownStringIds +#define B_MSG_ATTACKER_STAT_FELL 0 +#define B_MSG_DEFENDER_STAT_FELL 1 +#define B_MSG_STAT_WONT_DECREASE 2 +#define B_MSG_STAT_FELL_EMPTY 3 + +// gMissStringIds #define B_MSG_MISSED 0 #define B_MSG_PROTECTED 1 #define B_MSG_AVOIDED_ATK 2 #define B_MSG_AVOIDED_DMG 3 #define B_MSG_GROUND_MISS 4 +// gAbsorbDrainStringIds +#define B_MSG_ABSORB 0 +#define B_MSG_ABSORB_OOZE 1 + +// gLeechSeedStringIds +#define B_MSG_LEECH_SEED_SET 0 +#define B_MSG_LEECH_SEED_MISS 1 +#define B_MSG_LEECH_SEED_FAIL 2 +#define B_MSG_LEECH_SEED_DRAIN 3 +#define B_MSG_LEECH_SEED_OOZE 4 + +// gBattlePalaceFlavorTextTable +#define B_MSG_GLINT_IN_EYE 0 +#define B_MSG_GETTING_IN_POS 1 +#define B_MSG_GROWL_DEEPLY 2 +#define B_MSG_EAGER_FOR_MORE 3 + +// gFirstTurnOfTwoStringIds +#define B_MSG_TURN1_RAZOR_WIND 0 +#define B_MSG_TURN1_SOLAR_BEAM 1 +#define B_MSG_TURN1_SKULL_BASH 2 +#define B_MSG_TURN1_SKY_ATTACK 3 +#define B_MSG_TURN1_FLY 4 +#define B_MSG_TURN1_DIG 5 +#define B_MSG_TURN1_DIVE 6 +#define B_MSG_TURN1_BOUNCE 7 + +// gMoveWeatherChangeStringIds +#define B_MSG_STARTED_RAIN 0 +#define B_MSG_STARTED_DOWNPOUR 1 +#define B_MSG_WEATHER_FAILED 2 +#define B_MSG_STARTED_SANDSTORM 3 +#define B_MSG_STARTED_SUNLIGHT 4 +#define B_MSG_STARTED_HAIL 5 + +// gRainContinuesStringIds +#define B_MSG_RAIN_CONTINUES 0 +#define B_MSG_DOWNPOUR_CONTINUES 1 +#define B_MSG_RAIN_STOPPED 2 + +// gSandStormHailContinuesStringIds / gSandStormHailDmgStringIds/ gSandStormHailEndStringIds +#define B_MSG_SANDSTORM 0 +#define B_MSG_HAIL 1 + +// gReflectLightScreenSafeguardStringIds +#define B_MSG_SIDE_STATUS_FAILED 0 +#define B_MSG_SET_REFLECT_SINGLE 1 +#define B_MSG_SET_REFLECT_DOUBLE 2 +#define B_MSG_SET_LIGHTSCREEN_SINGLE 3 +#define B_MSG_SET_LIGHTSCREEN_DOUBLE 4 +#define B_MSG_SET_SAFEGUARD 5 + +// gProtectLikeUsedStringIds +#define B_MSG_PROTECTED_ITSELF 0 +#define B_MSG_BRACED_ITSELF 1 +#define B_MSG_PROTECT_FAILED 2 + +// gRestUsedStringIds +#define B_MSG_REST 0 +#define B_MSG_REST_STATUSED 1 + +// gWokeUpStringIds +#define B_MSG_WOKE_UP 0 +#define B_MSG_WOKE_UP_UPROAR 1 + +// gUproarAwakeStringIds +#define B_MSG_CANT_SLEEP_UPROAR 0 +#define B_MSG_UPROAR_KEPT_AWAKE 1 +#define B_MSG_STAYED_AWAKE_USING 2 + +// gUproarOverTurnStringIds +#define B_MSG_UPROAR_CONTINUES 0 +#define B_MSG_UPROAR_ENDS 1 + +// gStockpileUsedStringIds +#define B_MSG_STOCKPILED 0 +#define B_MSG_CANT_STOCKPILE 1 + +// gSwallowFailStringIds +#define B_MSG_SWALLOW_FAILED 0 +#define B_MSG_SWALLOW_FULL_HP 1 + +// gKOFailedStringIds +#define B_MSG_KO_MISS 0 +#define B_MSG_KO_UNAFFECTED 1 + +// gMistUsedStringIds +#define B_MSG_SET_MIST 0 +#define B_MSG_MIST_FAILED 1 + +// gFocusEnergyUsedStringIds +#define B_MSG_GETTING_PUMPED 0 +#define B_MSG_FOCUS_ENERGY_FAILED 1 + +// gTransformUsedStringIds +#define B_MSG_TRANSFORMED 0 +#define B_MSG_TRANSFORM_FAILED 1 + +// gSubsituteUsedStringIds +#define B_MSG_SET_SUBSTITUTE 0 +#define B_MSG_SUBSTITUTE_FAILED 1 + +// gPartyStatusHealStringIds +#define B_MSG_BELL 0 +#define B_MSG_BELL_SOUNDPROOF_ATTACKER 1 +#define B_MSG_BELL_SOUNDPROOF_PARTNER 2 +#define B_MSG_BELL_BOTH_SOUNDPROOF 3 +#define B_MSG_SOOTHING_AROMA 4 + +// gFutureMoveUsedStringIds +#define B_MSG_FUTURE_SIGHT 0 +#define B_MSG_DOOM_DESIRE 1 + +// gItemSwapStringIds +#define B_MSG_ITEM_SWAP_TAKEN 0 +#define B_MSG_ITEM_SWAP_GIVEN 1 +#define B_MSG_ITEM_SWAP_BOTH 2 + +// gSportsUsedStringIds +#define B_MSG_WEAKEN_ELECTRIC 0 +#define B_MSG_WEAKEN_FIRE 1 + +// gCaughtMonStringIds +#define B_MSG_SENT_SOMEONES_PC 0 +#define B_MSG_SENT_LANETTES_PC 1 +#define B_MSG_SOMEONES_BOX_FULL 2 +#define B_MSG_LANETTES_BOX_FULL 3 + +// gInobedientStringIds +#define B_MSG_LOAFING 0 +#define B_MSG_WONT_OBEY 1 +#define B_MSG_TURNED_AWAY 2 +#define B_MSG_PRETEND_NOT_NOTICE 3 +#define B_MSG_INCAPABLE_OF_POWER 4 +// For randomly selecting a disobey string +// Skips the one used for Battle Palace +#define NUM_LOAF_STRINGS 4 + +// gSafariGetNearStringIds +#define B_MSG_CREPT_CLOSER 0 +#define B_MSG_CANT_GET_CLOSER 1 + +// gSafariPokeblockResultStringIds +#define B_MSG_MON_CURIOUS 0 +#define B_MSG_MON_ENTHRALLED 1 +#define B_MSG_MON_IGNORED 2 + +// gFlashFireStringIds +#define B_MSG_FLASH_FIRE_BOOST 0 +#define B_MSG_FLASH_FIRE_NO_BOOST 1 + +// gBerryEffectStringIds +#define B_MSG_CURED_PROBLEM 0 +#define B_MSG_NORMALIZED_STATUS 1 + +// gNoEscapeStringIds +#define B_MSG_CANT_ESCAPE 0 +#define B_MSG_DONT_LEAVE_BIRCH 1 +#define B_MSG_PREVENTS_ESCAPE 2 +#define B_MSG_CANT_ESCAPE_2 3 +#define B_MSG_ATTACKER_CANT_ESCAPE 4 + +// gGotPoisonedStringIds / gGotParalyzedStringIds / gFellAsleepStringIds +// gGotBurnedStringIds / gGotFrozenStringIds / gAttractUsedStringIds +#define B_MSG_STATUSED 0 +#define B_MSG_STATUSED_BY_ABILITY 1 + +// gBRNPreventionStringIds / gPRLZPreventionStringIds / gPSNPreventionStringIds +#define B_MSG_ABILITY_PREVENTS_MOVE_STATUS 0 +#define B_MSG_ABILITY_PREVENTS_ABILITY_STATUS 1 +#define B_MSG_STATUS_HAD_NO_EFFECT 2 + +// gGotDefrostedStringIds +#define B_MSG_DEFROSTED 0 +#define B_MSG_DEFROSTED_BY_MOVE 1 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 263c1e7cc..e92630808 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -863,32 +863,33 @@ static bool8 ShouldUseItem(void) *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) = 0; if (itemEffects[3] & ITEM3_SLEEP && gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) { - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x20; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_SLEEP); shouldUse = TRUE; } - if (itemEffects[3] & ITEM3_POISON && (gBattleMons[gActiveBattler].status1 & STATUS1_POISON || gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_POISON)) + if (itemEffects[3] & ITEM3_POISON && (gBattleMons[gActiveBattler].status1 & STATUS1_POISON + || gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_POISON)) { - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x10; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_POISON); shouldUse = TRUE; } if (itemEffects[3] & ITEM3_BURN && gBattleMons[gActiveBattler].status1 & STATUS1_BURN) { - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x8; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_BURN); shouldUse = TRUE; } if (itemEffects[3] & ITEM3_FREEZE && gBattleMons[gActiveBattler].status1 & STATUS1_FREEZE) { - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x4; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_FREEZE); shouldUse = TRUE; } if (itemEffects[3] & ITEM3_PARALYSIS && gBattleMons[gActiveBattler].status1 & STATUS1_PARALYSIS) { - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x2; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_PARALYSIS); shouldUse = TRUE; } if (itemEffects[3] & ITEM3_CONFUSION && gBattleMons[gActiveBattler].status2 & STATUS2_CONFUSION) { - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x1; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_CONFUSION); shouldUse = TRUE; } break; @@ -897,17 +898,17 @@ static bool8 ShouldUseItem(void) if (gDisableStructs[gActiveBattler].isFirstTurn == 0) break; if (itemEffects[0] & ITEM0_X_ATTACK) - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x1; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_ATTACK); if (itemEffects[1] & ITEM1_X_DEFEND) - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x2; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_DEFEND); if (itemEffects[1] & ITEM1_X_SPEED) - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x4; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_SPEED); if (itemEffects[2] & ITEM2_X_SPATK) - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x8; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_SPATK); if (itemEffects[2] & ITEM2_X_ACCURACY) - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x20; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_ACCURACY); if (itemEffects[0] & ITEM0_DIRE_HIT) - *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x80; + *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_DIRE_HIT); shouldUse = TRUE; break; case AI_ITEM_GUARD_SPECS: diff --git a/src/battle_main.c b/src/battle_main.c index 9bb2268a6..8a85c27f5 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3959,7 +3959,7 @@ u8 IsRunningFromBattleImpossible(void) { gBattleScripting.battler = i; gLastUsedAbility = gBattleMons[i].ability; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE; return 2; } if (side != GetBattlerSide(i) @@ -3969,7 +3969,7 @@ u8 IsRunningFromBattleImpossible(void) { gBattleScripting.battler = i; gLastUsedAbility = gBattleMons[i].ability; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE; return 2; } } @@ -3978,18 +3978,18 @@ u8 IsRunningFromBattleImpossible(void) { gBattleScripting.battler = i - 1; gLastUsedAbility = gBattleMons[i - 1].ability; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE; return 2; } if ((gBattleMons[gActiveBattler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED)) || (gStatuses3[gActiveBattler] & STATUS3_ROOTED)) { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE; return 1; } if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DONT_LEAVE_BIRCH; return 1; } return 0; diff --git a/src/battle_message.c b/src/battle_message.c index 5f088dded..4f219c063 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -305,11 +305,11 @@ static const u8 sText_StatSharply[] = _("sharply "); const u8 gText_StatRose[] = _("rose!"); static const u8 sText_StatHarshly[] = _("harshly "); static const u8 sText_StatFell[] = _("fell!"); -static const u8 sText_PkmnsStatChanged[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}"); -const u8 gText_PkmnsStatChanged2[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}"); -static const u8 sText_UsingXTheYOfZN[] = _("Using {B_LAST_ITEM}, the {B_BUFF1}\nof {B_SCR_ACTIVE_NAME_WITH_PREFIX} {B_BUFF2}"); -static const u8 sText_PkmnsStatChanged3[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}"); -static const u8 sText_PkmnsStatChanged4[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}"); +static const u8 sText_AttackersStatRose[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}"); +const u8 gText_DefendersStatRose[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}"); +static const u8 sText_UsingItemTheStatOfPkmnRose[] = _("Using {B_LAST_ITEM}, the {B_BUFF1}\nof {B_SCR_ACTIVE_NAME_WITH_PREFIX} {B_BUFF2}"); +static const u8 sText_AttackersStatFell[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}"); +static const u8 sText_DefendersStatFell[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}"); static const u8 sText_StatsWontIncrease2[] = _("{B_ATK_NAME_WITH_PREFIX}'s stats won't\ngo any higher!"); static const u8 sText_StatsWontDecrease2[] = _("{B_DEF_NAME_WITH_PREFIX}'s stats won't\ngo any lower!"); static const u8 sText_CriticalHit[] = _("A critical hit!"); @@ -721,10 +721,10 @@ const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_STATROSE - 12] = gText_StatRose, [STRINGID_STATHARSHLY - 12] = sText_StatHarshly, [STRINGID_STATFELL - 12] = sText_StatFell, - [STRINGID_PKMNSSTATCHANGED - 12] = sText_PkmnsStatChanged, - [STRINGID_PKMNSSTATCHANGED2 - 12] = gText_PkmnsStatChanged2, - [STRINGID_PKMNSSTATCHANGED3 - 12] = sText_PkmnsStatChanged3, - [STRINGID_PKMNSSTATCHANGED4 - 12] = sText_PkmnsStatChanged4, + [STRINGID_ATTACKERSSTATROSE - 12] = sText_AttackersStatRose, + [STRINGID_DEFENDERSSTATROSE - 12] = gText_DefendersStatRose, + [STRINGID_ATTACKERSSTATFELL - 12] = sText_AttackersStatFell, + [STRINGID_DEFENDERSSTATFELL - 12] = sText_DefendersStatFell, [STRINGID_CRITICALHIT - 12] = sText_CriticalHit, [STRINGID_ONEHITKO - 12] = sText_OneHitKO, [STRINGID_123POOF - 12] = sText_123Poof, @@ -833,7 +833,7 @@ const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_SOOTHINGAROMA - 12] = sText_SoothingAroma, [STRINGID_ITEMSCANTBEUSEDNOW - 12] = sText_ItemsCantBeUsedNow, [STRINGID_FORXCOMMAYZ - 12] = sText_ForXCommaYZ, - [STRINGID_USINGXTHEYOFZN - 12] = sText_UsingXTheYOfZN, + [STRINGID_USINGITEMSTATOFPKMNROSE - 12] = sText_UsingItemTheStatOfPkmnRose, [STRINGID_PKMNUSEDXTOGETPUMPED - 12] = sText_PkmnUsedXToGetPumped, [STRINGID_PKMNSXMADEYUSELESS - 12] = sText_PkmnsXMadeYUseless, [STRINGID_PKMNTRAPPEDBYSANDTOMB - 12] = sText_PkmnTrappedBySandTomb, @@ -902,105 +902,140 @@ const u16 gMissStringIds[] = const u16 gNoEscapeStringIds[] = { - STRINGID_CANTESCAPE, STRINGID_DONTLEAVEBIRCH, STRINGID_PREVENTSESCAPE, - STRINGID_CANTESCAPE2, STRINGID_ATTACKERCANTESCAPE + [B_MSG_CANT_ESCAPE] = STRINGID_CANTESCAPE, + [B_MSG_DONT_LEAVE_BIRCH] = STRINGID_DONTLEAVEBIRCH, + [B_MSG_PREVENTS_ESCAPE] = STRINGID_PREVENTSESCAPE, + [B_MSG_CANT_ESCAPE_2] = STRINGID_CANTESCAPE2, + [B_MSG_ATTACKER_CANT_ESCAPE] = STRINGID_ATTACKERCANTESCAPE }; const u16 gMoveWeatherChangeStringIds[] = { - STRINGID_STARTEDTORAIN, STRINGID_DOWNPOURSTARTED, STRINGID_BUTITFAILED, - STRINGID_SANDSTORMBREWED, STRINGID_SUNLIGHTGOTBRIGHT, STRINGID_STARTEDHAIL + [B_MSG_STARTED_RAIN] = STRINGID_STARTEDTORAIN, + [B_MSG_STARTED_DOWNPOUR] = STRINGID_DOWNPOURSTARTED, // Unused + [B_MSG_WEATHER_FAILED] = STRINGID_BUTITFAILED, + [B_MSG_STARTED_SANDSTORM] = STRINGID_SANDSTORMBREWED, + [B_MSG_STARTED_SUNLIGHT] = STRINGID_SUNLIGHTGOTBRIGHT, + [B_MSG_STARTED_HAIL] = STRINGID_STARTEDHAIL, }; const u16 gSandStormHailContinuesStringIds[] = { - STRINGID_SANDSTORMRAGES, STRINGID_HAILCONTINUES + [B_MSG_SANDSTORM] = STRINGID_SANDSTORMRAGES, + [B_MSG_HAIL] = STRINGID_HAILCONTINUES }; const u16 gSandStormHailDmgStringIds[] = { - STRINGID_PKMNBUFFETEDBYSANDSTORM, STRINGID_PKMNPELTEDBYHAIL + [B_MSG_SANDSTORM] = STRINGID_PKMNBUFFETEDBYSANDSTORM, + [B_MSG_HAIL] = STRINGID_PKMNPELTEDBYHAIL }; const u16 gSandStormHailEndStringIds[] = { - STRINGID_SANDSTORMSUBSIDED, STRINGID_HAILSTOPPED + [B_MSG_SANDSTORM] = STRINGID_SANDSTORMSUBSIDED, + [B_MSG_HAIL] = STRINGID_HAILSTOPPED }; const u16 gRainContinuesStringIds[] = { - STRINGID_RAINCONTINUES, STRINGID_DOWNPOURCONTINUES, STRINGID_RAINSTOPPED + [B_MSG_RAIN_CONTINUES] = STRINGID_RAINCONTINUES, + [B_MSG_DOWNPOUR_CONTINUES] = STRINGID_DOWNPOURCONTINUES, + [B_MSG_RAIN_STOPPED] = STRINGID_RAINSTOPPED }; const u16 gProtectLikeUsedStringIds[] = { - STRINGID_PKMNPROTECTEDITSELF2, STRINGID_PKMNBRACEDITSELF, STRINGID_BUTITFAILED + [B_MSG_PROTECTED_ITSELF] = STRINGID_PKMNPROTECTEDITSELF2, + [B_MSG_BRACED_ITSELF] = STRINGID_PKMNBRACEDITSELF, + [B_MSG_PROTECT_FAILED] = STRINGID_BUTITFAILED, }; const u16 gReflectLightScreenSafeguardStringIds[] = { - STRINGID_BUTITFAILED, STRINGID_PKMNRAISEDDEF, STRINGID_PKMNRAISEDDEFALITTLE, - STRINGID_PKMNRAISEDSPDEF, STRINGID_PKMNRAISEDSPDEFALITTLE, STRINGID_PKMNCOVEREDBYVEIL + [B_MSG_SIDE_STATUS_FAILED] = STRINGID_BUTITFAILED, + [B_MSG_SET_REFLECT_SINGLE] = STRINGID_PKMNRAISEDDEF, + [B_MSG_SET_REFLECT_DOUBLE] = STRINGID_PKMNRAISEDDEFALITTLE, + [B_MSG_SET_LIGHTSCREEN_SINGLE] = STRINGID_PKMNRAISEDSPDEF, + [B_MSG_SET_LIGHTSCREEN_DOUBLE] = STRINGID_PKMNRAISEDSPDEFALITTLE, + [B_MSG_SET_SAFEGUARD] = STRINGID_PKMNCOVEREDBYVEIL, }; const u16 gLeechSeedStringIds[] = { - STRINGID_PKMNSEEDED, STRINGID_PKMNEVADEDATTACK, - STRINGID_ITDOESNTAFFECT, STRINGID_PKMNSAPPEDBYLEECHSEED, STRINGID_ITSUCKEDLIQUIDOOZE, + [B_MSG_LEECH_SEED_SET] = STRINGID_PKMNSEEDED, + [B_MSG_LEECH_SEED_MISS] = STRINGID_PKMNEVADEDATTACK, + [B_MSG_LEECH_SEED_FAIL] = STRINGID_ITDOESNTAFFECT, + [B_MSG_LEECH_SEED_DRAIN] = STRINGID_PKMNSAPPEDBYLEECHSEED, + [B_MSG_LEECH_SEED_OOZE] = STRINGID_ITSUCKEDLIQUIDOOZE, }; const u16 gRestUsedStringIds[] = { - STRINGID_PKMNWENTTOSLEEP, STRINGID_PKMNSLEPTHEALTHY + [B_MSG_REST] = STRINGID_PKMNWENTTOSLEEP, + [B_MSG_REST_STATUSED] = STRINGID_PKMNSLEPTHEALTHY }; const u16 gUproarOverTurnStringIds[] = { - STRINGID_PKMNMAKINGUPROAR, STRINGID_PKMNCALMEDDOWN + [B_MSG_UPROAR_CONTINUES] = STRINGID_PKMNMAKINGUPROAR, + [B_MSG_UPROAR_ENDS] = STRINGID_PKMNCALMEDDOWN }; const u16 gStockpileUsedStringIds[] = { - STRINGID_PKMNSTOCKPILED, STRINGID_PKMNCANTSTOCKPILE, + [B_MSG_STOCKPILED] = STRINGID_PKMNSTOCKPILED, + [B_MSG_CANT_STOCKPILE] = STRINGID_PKMNCANTSTOCKPILE, }; const u16 gWokeUpStringIds[] = { - STRINGID_PKMNWOKEUP, STRINGID_PKMNWOKEUPINUPROAR + [B_MSG_WOKE_UP] = STRINGID_PKMNWOKEUP, + [B_MSG_WOKE_UP_UPROAR] = STRINGID_PKMNWOKEUPINUPROAR }; const u16 gSwallowFailStringIds[] = { - STRINGID_FAILEDTOSWALLOW, STRINGID_PKMNHPFULL + [B_MSG_SWALLOW_FAILED] = STRINGID_FAILEDTOSWALLOW, + [B_MSG_SWALLOW_FULL_HP] = STRINGID_PKMNHPFULL }; const u16 gUproarAwakeStringIds[] = { - STRINGID_PKMNCANTSLEEPINUPROAR2, STRINGID_UPROARKEPTPKMNAWAKE, STRINGID_PKMNSTAYEDAWAKEUSING + [B_MSG_CANT_SLEEP_UPROAR] = STRINGID_PKMNCANTSLEEPINUPROAR2, + [B_MSG_UPROAR_KEPT_AWAKE] = STRINGID_UPROARKEPTPKMNAWAKE, + [B_MSG_STAYED_AWAKE_USING] = STRINGID_PKMNSTAYEDAWAKEUSING, }; const u16 gStatUpStringIds[] = { - STRINGID_PKMNSSTATCHANGED, STRINGID_PKMNSSTATCHANGED2, STRINGID_STATSWONTINCREASE, - STRINGID_EMPTYSTRING3, STRINGID_USINGXTHEYOFZN, STRINGID_PKMNUSEDXTOGETPUMPED + [B_MSG_ATTACKER_STAT_ROSE] = STRINGID_ATTACKERSSTATROSE, + [B_MSG_DEFENDER_STAT_ROSE] = STRINGID_DEFENDERSSTATROSE, + [B_MSG_STAT_WONT_INCREASE] = STRINGID_STATSWONTINCREASE, + [B_MSG_STAT_ROSE_EMPTY] = STRINGID_EMPTYSTRING3, + [B_MSG_STAT_ROSE_ITEM] = STRINGID_USINGITEMSTATOFPKMNROSE, + [B_MSG_USED_DIRE_HIT] = STRINGID_PKMNUSEDXTOGETPUMPED, }; const u16 gStatDownStringIds[] = { - STRINGID_PKMNSSTATCHANGED3, STRINGID_PKMNSSTATCHANGED4, STRINGID_STATSWONTDECREASE, STRINGID_EMPTYSTRING3 + [B_MSG_ATTACKER_STAT_FELL] = STRINGID_ATTACKERSSTATFELL, + [B_MSG_DEFENDER_STAT_FELL] = STRINGID_DEFENDERSSTATFELL, + [B_MSG_STAT_WONT_DECREASE] = STRINGID_STATSWONTDECREASE, + [B_MSG_STAT_FELL_EMPTY] = STRINGID_EMPTYSTRING3, }; // Index read from sTWOTURN_STRINGID const u16 gFirstTurnOfTwoStringIds[] = { - STRINGID_PKMNWHIPPEDWHIRLWIND, // MOVE_RAZOR_WIND - STRINGID_PKMNTOOKSUNLIGHT, // MOVE_SOLAR_BEAM - STRINGID_PKMNLOWEREDHEAD, // MOVE_SKULL_BASH - STRINGID_PKMNISGLOWING, // MOVE_SKY_ATTACK - STRINGID_PKMNFLEWHIGH, // MOVE_FLY - STRINGID_PKMNDUGHOLE, // MOVE_DIG - STRINGID_PKMNHIDUNDERWATER, // MOVE_DIVE - STRINGID_PKMNSPRANGUP // MOVE_BOUNCE + [B_MSG_TURN1_RAZOR_WIND] = STRINGID_PKMNWHIPPEDWHIRLWIND, + [B_MSG_TURN1_SOLAR_BEAM] = STRINGID_PKMNTOOKSUNLIGHT, + [B_MSG_TURN1_SKULL_BASH] = STRINGID_PKMNLOWEREDHEAD, + [B_MSG_TURN1_SKY_ATTACK] = STRINGID_PKMNISGLOWING, + [B_MSG_TURN1_FLY] = STRINGID_PKMNFLEWHIGH, + [B_MSG_TURN1_DIG] = STRINGID_PKMNDUGHOLE, + [B_MSG_TURN1_DIVE] = STRINGID_PKMNHIDUNDERWATER, + [B_MSG_TURN1_BOUNCE] = STRINGID_PKMNSPRANGUP, }; // Index copied from move's index in gTrappingMoves @@ -1016,89 +1051,109 @@ const u16 gWrappedStringIds[] = const u16 gMistUsedStringIds[] = { - STRINGID_PKMNSHROUDEDINMIST, STRINGID_BUTITFAILED + [B_MSG_SET_MIST] = STRINGID_PKMNSHROUDEDINMIST, + [B_MSG_MIST_FAILED] = STRINGID_BUTITFAILED }; const u16 gFocusEnergyUsedStringIds[] = { - STRINGID_PKMNGETTINGPUMPED, STRINGID_BUTITFAILED + [B_MSG_GETTING_PUMPED] = STRINGID_PKMNGETTINGPUMPED, + [B_MSG_FOCUS_ENERGY_FAILED] = STRINGID_BUTITFAILED }; const u16 gTransformUsedStringIds[] = { - STRINGID_PKMNTRANSFORMEDINTO, STRINGID_BUTITFAILED + [B_MSG_TRANSFORMED] = STRINGID_PKMNTRANSFORMEDINTO, + [B_MSG_TRANSFORM_FAILED] = STRINGID_BUTITFAILED }; const u16 gSubsituteUsedStringIds[] = { - STRINGID_PKMNMADESUBSTITUTE, STRINGID_TOOWEAKFORSUBSTITUTE + [B_MSG_SET_SUBSTITUTE] = STRINGID_PKMNMADESUBSTITUTE, + [B_MSG_SUBSTITUTE_FAILED] = STRINGID_TOOWEAKFORSUBSTITUTE }; const u16 gGotPoisonedStringIds[] = { - STRINGID_PKMNWASPOISONED, STRINGID_PKMNPOISONEDBY + [B_MSG_STATUSED] = STRINGID_PKMNWASPOISONED, + [B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNPOISONEDBY }; const u16 gGotParalyzedStringIds[] = { - STRINGID_PKMNWASPARALYZED, STRINGID_PKMNWASPARALYZEDBY + [B_MSG_STATUSED] = STRINGID_PKMNWASPARALYZED, + [B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNWASPARALYZEDBY }; const u16 gFellAsleepStringIds[] = { - STRINGID_PKMNFELLASLEEP, STRINGID_PKMNMADESLEEP, + [B_MSG_STATUSED] = STRINGID_PKMNFELLASLEEP, + [B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNMADESLEEP, }; const u16 gGotBurnedStringIds[] = { - STRINGID_PKMNWASBURNED, STRINGID_PKMNBURNEDBY + [B_MSG_STATUSED] = STRINGID_PKMNWASBURNED, + [B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNBURNEDBY }; const u16 gGotFrozenStringIds[] = { - STRINGID_PKMNWASFROZEN, STRINGID_PKMNFROZENBY + [B_MSG_STATUSED] = STRINGID_PKMNWASFROZEN, + [B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNFROZENBY }; const u16 gGotDefrostedStringIds[] = { - STRINGID_PKMNWASDEFROSTED2, STRINGID_PKMNWASDEFROSTEDBY + [B_MSG_DEFROSTED] = STRINGID_PKMNWASDEFROSTED2, + [B_MSG_DEFROSTED_BY_MOVE] = STRINGID_PKMNWASDEFROSTEDBY }; const u16 gKOFailedStringIds[] = { - STRINGID_ATTACKMISSED, STRINGID_PKMNUNAFFECTED + [B_MSG_KO_MISS] = STRINGID_ATTACKMISSED, + [B_MSG_KO_UNAFFECTED] = STRINGID_PKMNUNAFFECTED }; const u16 gAttractUsedStringIds[] = { - STRINGID_PKMNFELLINLOVE, STRINGID_PKMNSXINFATUATEDY + [B_MSG_STATUSED] = STRINGID_PKMNFELLINLOVE, + [B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNSXINFATUATEDY }; -const u16 gLeechSeedDrainStringIds[] = +const u16 gAbsorbDrainStringIds[] = { - STRINGID_PKMNENERGYDRAINED, STRINGID_ITSUCKEDLIQUIDOOZE + [B_MSG_ABSORB] = STRINGID_PKMNENERGYDRAINED, + [B_MSG_ABSORB_OOZE] = STRINGID_ITSUCKEDLIQUIDOOZE }; const u16 gSportsUsedStringIds[] = { - STRINGID_ELECTRICITYWEAKENED, STRINGID_FIREWEAKENED + [B_MSG_WEAKEN_ELECTRIC] = STRINGID_ELECTRICITYWEAKENED, + [B_MSG_WEAKEN_FIRE] = STRINGID_FIREWEAKENED }; const u16 gPartyStatusHealStringIds[] = { - STRINGID_BELLCHIMED, STRINGID_BELLCHIMED, STRINGID_BELLCHIMED, STRINGID_BELLCHIMED, - // interesting how there are four instances of the same string - STRINGID_SOOTHINGAROMA + [B_MSG_BELL] = STRINGID_BELLCHIMED, + [B_MSG_BELL_SOUNDPROOF_ATTACKER] = STRINGID_BELLCHIMED, + [B_MSG_BELL_SOUNDPROOF_PARTNER] = STRINGID_BELLCHIMED, + [B_MSG_BELL_BOTH_SOUNDPROOF] = STRINGID_BELLCHIMED, + [B_MSG_SOOTHING_AROMA] = STRINGID_SOOTHINGAROMA }; const u16 gFutureMoveUsedStringIds[] = { - STRINGID_PKMNFORESAWATTACK, STRINGID_PKMNCHOSEXASDESTINY + [B_MSG_FUTURE_SIGHT] = STRINGID_PKMNFORESAWATTACK, + [B_MSG_DOOM_DESIRE] = STRINGID_PKMNCHOSEXASDESTINY }; const u16 gBallEscapeStringIds[] = { - STRINGID_PKMNBROKEFREE, STRINGID_ITAPPEAREDCAUGHT, STRINGID_AARGHALMOSTHADIT, STRINGID_SHOOTSOCLOSE + [BALL_NO_SHAKES] = STRINGID_PKMNBROKEFREE, + [BALL_1_SHAKE] = STRINGID_ITAPPEAREDCAUGHT, + [BALL_2_SHAKES] = STRINGID_AARGHALMOSTHADIT, + [BALL_3_SHAKES_FAIL] = STRINGID_SHOOTSOCLOSE }; // Overworld weathers that don't have an associated battle weather default to "It is raining." @@ -1124,59 +1179,82 @@ const u16 gWeatherStartsStringIds[] = const u16 gInobedientStringIds[] = { - STRINGID_PKMNLOAFING, STRINGID_PKMNWONTOBEY, STRINGID_PKMNTURNEDAWAY, - STRINGID_PKMNPRETENDNOTNOTICE, STRINGID_PKMNINCAPABLEOFPOWER + [B_MSG_LOAFING] = STRINGID_PKMNLOAFING, + [B_MSG_WONT_OBEY] = STRINGID_PKMNWONTOBEY, + [B_MSG_TURNED_AWAY] = STRINGID_PKMNTURNEDAWAY, + [B_MSG_PRETEND_NOT_NOTICE] = STRINGID_PKMNPRETENDNOTNOTICE, + [B_MSG_INCAPABLE_OF_POWER] = STRINGID_PKMNINCAPABLEOFPOWER }; const u16 gSafariGetNearStringIds[] = { - STRINGID_CREPTCLOSER, STRINGID_CANTGETCLOSER + [B_MSG_CREPT_CLOSER] = STRINGID_CREPTCLOSER, + [B_MSG_CANT_GET_CLOSER] = STRINGID_CANTGETCLOSER }; const u16 gSafariPokeblockResultStringIds[] = { - STRINGID_PKMNCURIOUSABOUTX, STRINGID_PKMNENTHRALLEDBYX, STRINGID_PKMNIGNOREDX + [B_MSG_MON_CURIOUS] = STRINGID_PKMNCURIOUSABOUTX, + [B_MSG_MON_ENTHRALLED] = STRINGID_PKMNENTHRALLEDBYX, + [B_MSG_MON_IGNORED] = STRINGID_PKMNIGNOREDX }; const u16 gTrainerItemCuredStatusStringIds[] = { - STRINGID_PKMNSITEMSNAPPEDOUT, STRINGID_PKMNSITEMCUREDPARALYSIS, STRINGID_PKMNSITEMDEFROSTEDIT, - STRINGID_PKMNSITEMHEALEDBURN, STRINGID_PKMNSITEMCUREDPOISON, STRINGID_PKMNSITEMWOKEIT + [AI_HEAL_CONFUSION] = STRINGID_PKMNSITEMSNAPPEDOUT, + [AI_HEAL_PARALYSIS] = STRINGID_PKMNSITEMCUREDPARALYSIS, + [AI_HEAL_FREEZE] = STRINGID_PKMNSITEMDEFROSTEDIT, + [AI_HEAL_BURN] = STRINGID_PKMNSITEMHEALEDBURN, + [AI_HEAL_POISON] = STRINGID_PKMNSITEMCUREDPOISON, + [AI_HEAL_SLEEP] = STRINGID_PKMNSITEMWOKEIT }; const u16 gBerryEffectStringIds[] = { - STRINGID_PKMNSITEMCUREDPROBLEM, STRINGID_PKMNSITEMNORMALIZEDSTATUS + [B_MSG_CURED_PROBLEM] = STRINGID_PKMNSITEMCUREDPROBLEM, + [B_MSG_NORMALIZED_STATUS] = STRINGID_PKMNSITEMNORMALIZEDSTATUS }; const u16 gBRNPreventionStringIds[] = { - STRINGID_PKMNSXPREVENTSBURNS, STRINGID_PKMNSXPREVENTSYSZ, STRINGID_PKMNSXHADNOEFFECTONY + [B_MSG_ABILITY_PREVENTS_MOVE_STATUS] = STRINGID_PKMNSXPREVENTSBURNS, + [B_MSG_ABILITY_PREVENTS_ABILITY_STATUS] = STRINGID_PKMNSXPREVENTSYSZ, + [B_MSG_STATUS_HAD_NO_EFFECT] = STRINGID_PKMNSXHADNOEFFECTONY }; const u16 gPRLZPreventionStringIds[] = { - STRINGID_PKMNPREVENTSPARALYSISWITH, STRINGID_PKMNSXPREVENTSYSZ, STRINGID_PKMNSXHADNOEFFECTONY + [B_MSG_ABILITY_PREVENTS_MOVE_STATUS] = STRINGID_PKMNPREVENTSPARALYSISWITH, + [B_MSG_ABILITY_PREVENTS_ABILITY_STATUS] = STRINGID_PKMNSXPREVENTSYSZ, + [B_MSG_STATUS_HAD_NO_EFFECT] = STRINGID_PKMNSXHADNOEFFECTONY }; const u16 gPSNPreventionStringIds[] = { - STRINGID_PKMNPREVENTSPOISONINGWITH, STRINGID_PKMNSXPREVENTSYSZ, STRINGID_PKMNSXHADNOEFFECTONY + [B_MSG_ABILITY_PREVENTS_MOVE_STATUS] = STRINGID_PKMNPREVENTSPOISONINGWITH, + [B_MSG_ABILITY_PREVENTS_ABILITY_STATUS] = STRINGID_PKMNSXPREVENTSYSZ, + [B_MSG_STATUS_HAD_NO_EFFECT] = STRINGID_PKMNSXHADNOEFFECTONY }; const u16 gItemSwapStringIds[] = { - STRINGID_PKMNOBTAINEDX, STRINGID_PKMNOBTAINEDX2, STRINGID_PKMNOBTAINEDXYOBTAINEDZ + [B_MSG_ITEM_SWAP_TAKEN] = STRINGID_PKMNOBTAINEDX, + [B_MSG_ITEM_SWAP_GIVEN] = STRINGID_PKMNOBTAINEDX2, + [B_MSG_ITEM_SWAP_BOTH] = STRINGID_PKMNOBTAINEDXYOBTAINEDZ }; const u16 gFlashFireStringIds[] = { - STRINGID_PKMNRAISEDFIREPOWERWITH, STRINGID_PKMNSXMADEYINEFFECTIVE + [B_MSG_FLASH_FIRE_BOOST] = STRINGID_PKMNRAISEDFIREPOWERWITH, + [B_MSG_FLASH_FIRE_NO_BOOST] = STRINGID_PKMNSXMADEYINEFFECTIVE }; const u16 gCaughtMonStringIds[] = { - STRINGID_PKMNTRANSFERREDSOMEONESPC, STRINGID_PKMNTRANSFERREDLANETTESPC, STRINGID_PKMNBOXSOMEONESPCFULL, STRINGID_PKMNBOXLANETTESPCFULL, + [B_MSG_SENT_SOMEONES_PC] = STRINGID_PKMNTRANSFERREDSOMEONESPC, + [B_MSG_SENT_LANETTES_PC] = STRINGID_PKMNTRANSFERREDLANETTESPC, + [B_MSG_SOMEONES_BOX_FULL] = STRINGID_PKMNBOXSOMEONESPCFULL, + [B_MSG_LANETTES_BOX_FULL] = STRINGID_PKMNBOXLANETTESPCFULL, }; const u16 gTrappingMoves[] = @@ -1218,7 +1296,8 @@ static const u8 sText_Defense[] = _("DEFENSE"); static const u8 sText_SpAtk[] = _("SP. ATK"); static const u8 sText_SpDef[] = _("SP. DEF"); -const u8 * const gStatNamesTable2[] = +// Unused +static const u8 * const sStatNamesTable2[] = { sText_HP, sText_SpAtk, sText_Attack, sText_SpDef, sText_Defense, sText_Speed @@ -1311,10 +1390,10 @@ static const u8 sText_PkmnEagerForMore[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is const u16 gBattlePalaceFlavorTextTable[] = { - STRINGID_GLINTAPPEARSINEYE, - STRINGID_PKMNGETTINGINTOPOSITION, - STRINGID_PKMNBEGANGROWLINGDEEPLY, - STRINGID_PKMNEAGERFORMORE + [B_MSG_GLINT_IN_EYE] = STRINGID_GLINTAPPEARSINEYE, + [B_MSG_GETTING_IN_POS] = STRINGID_PKMNGETTINGINTOPOSITION, + [B_MSG_GROWL_DEEPLY] = STRINGID_PKMNBEGANGROWLINGDEEPLY, + [B_MSG_EAGER_FOR_MORE] = STRINGID_PKMNEAGERFORMORE, }; static const u8 sText_RefIfNothingIsDecided[] = _("REFEREE: If nothing is decided in\n3 turns, we will go to judging!"); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index e0a3693eb..6cd7debda 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -876,34 +876,33 @@ const ALIGNED(4) u8 gBattlePalaceNatureToMoveGroupLikelihood[NUM_NATURES][4] = [NATURE_QUIRKY] = PALACE_STYLE(56, 22, 56, 22) // 22%, 22% }; -// Indices into gBattlePalaceFlavorTextTable static const u8 sBattlePalaceNatureToFlavorTextId[NUM_NATURES] = { - [NATURE_HARDY] = 3, - [NATURE_LONELY] = 0, - [NATURE_BRAVE] = 1, - [NATURE_ADAMANT] = 0, - [NATURE_NAUGHTY] = 0, - [NATURE_BOLD] = 1, - [NATURE_DOCILE] = 3, - [NATURE_RELAXED] = 0, - [NATURE_IMPISH] = 1, - [NATURE_LAX] = 2, - [NATURE_TIMID] = 2, - [NATURE_HASTY] = 0, - [NATURE_SERIOUS] = 3, - [NATURE_JOLLY] = 1, - [NATURE_NAIVE] = 3, - [NATURE_MODEST] = 1, - [NATURE_MILD] = 2, - [NATURE_QUIET] = 3, - [NATURE_BASHFUL] = 3, - [NATURE_RASH] = 2, - [NATURE_CALM] = 1, - [NATURE_GENTLE] = 0, - [NATURE_SASSY] = 2, - [NATURE_CAREFUL] = 2, - [NATURE_QUIRKY] = 3, + [NATURE_HARDY] = B_MSG_EAGER_FOR_MORE, + [NATURE_LONELY] = B_MSG_GLINT_IN_EYE, + [NATURE_BRAVE] = B_MSG_GETTING_IN_POS, + [NATURE_ADAMANT] = B_MSG_GLINT_IN_EYE, + [NATURE_NAUGHTY] = B_MSG_GLINT_IN_EYE, + [NATURE_BOLD] = B_MSG_GETTING_IN_POS, + [NATURE_DOCILE] = B_MSG_EAGER_FOR_MORE, + [NATURE_RELAXED] = B_MSG_GLINT_IN_EYE, + [NATURE_IMPISH] = B_MSG_GETTING_IN_POS, + [NATURE_LAX] = B_MSG_GROWL_DEEPLY, + [NATURE_TIMID] = B_MSG_GROWL_DEEPLY, + [NATURE_HASTY] = B_MSG_GLINT_IN_EYE, + [NATURE_SERIOUS] = B_MSG_EAGER_FOR_MORE, + [NATURE_JOLLY] = B_MSG_GETTING_IN_POS, + [NATURE_NAIVE] = B_MSG_EAGER_FOR_MORE, + [NATURE_MODEST] = B_MSG_GETTING_IN_POS, + [NATURE_MILD] = B_MSG_GROWL_DEEPLY, + [NATURE_QUIET] = B_MSG_EAGER_FOR_MORE, + [NATURE_BASHFUL] = B_MSG_EAGER_FOR_MORE, + [NATURE_RASH] = B_MSG_GROWL_DEEPLY, + [NATURE_CALM] = B_MSG_GETTING_IN_POS, + [NATURE_GENTLE] = B_MSG_GLINT_IN_EYE, + [NATURE_SASSY] = B_MSG_GROWL_DEEPLY, + [NATURE_CAREFUL] = B_MSG_GROWL_DEEPLY, + [NATURE_QUIRKY] = B_MSG_EAGER_FOR_MORE, }; static void Cmd_attackcanceler(void) @@ -991,7 +990,7 @@ static void Cmd_attackcanceler(void) gMoveResultFlags |= MOVE_RESULT_MISSED; gLastLandedMoves[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0; - gBattleCommunication[6] = B_MSG_PROTECTED; + gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; gBattlescriptCurrInstr++; } else @@ -1024,7 +1023,7 @@ static void Cmd_jumpifaffectedbyprotect(void) { gMoveResultFlags |= MOVE_RESULT_MISSED; JumpIfMoveFailed(5, 0); - gBattleCommunication[6] = B_MSG_PROTECTED; + gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; } else { @@ -1039,7 +1038,7 @@ bool8 JumpIfMoveAffectedByProtect(u16 move) { gMoveResultFlags |= MOVE_RESULT_MISSED; JumpIfMoveFailed(7, move); - gBattleCommunication[6] = B_MSG_PROTECTED; + gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; affected = TRUE; } return affected; @@ -1172,9 +1171,9 @@ static void Cmd_accuracycheck(void) gMoveResultFlags |= MOVE_RESULT_MISSED; if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && (gBattleMoves[move].target == MOVE_TARGET_BOTH || gBattleMoves[move].target == MOVE_TARGET_FOES_AND_ALLY)) - gBattleCommunication[6] = B_MSG_AVOIDED_ATK; + gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_ATK; else - gBattleCommunication[6] = B_MSG_MISSED; + gBattleCommunication[MISS_TYPE] = B_MSG_MISSED; CheckWonderGuardAndLevitate(); } @@ -1370,7 +1369,7 @@ static void Cmd_typecalc(void) gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE); gLastLandedMoves[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0; - gBattleCommunication[6] = B_MSG_GROUND_MISS; + gBattleCommunication[MISS_TYPE] = B_MSG_GROUND_MISS; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } else @@ -1406,7 +1405,7 @@ static void Cmd_typecalc(void) gMoveResultFlags |= MOVE_RESULT_MISSED; gLastLandedMoves[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0; - gBattleCommunication[6] = B_MSG_AVOIDED_DMG; + gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } if (gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) @@ -1429,7 +1428,7 @@ static void CheckWonderGuardAndLevitate(void) if (gBattleMons[gBattlerTarget].ability == ABILITY_LEVITATE && moveType == TYPE_GROUND) { gLastUsedAbility = ABILITY_LEVITATE; - gBattleCommunication[6] = B_MSG_GROUND_MISS; + gBattleCommunication[MISS_TYPE] = B_MSG_GROUND_MISS; RecordAbilityBattle(gBattlerTarget, ABILITY_LEVITATE); return; } @@ -1484,7 +1483,7 @@ static void CheckWonderGuardAndLevitate(void) if (((flags & 2) || !(flags & 1)) && gBattleMoves[gCurrentMove].power) { gLastUsedAbility = ABILITY_WONDER_GUARD; - gBattleCommunication[6] = B_MSG_AVOIDED_DMG; + gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG; RecordAbilityBattle(gBattlerTarget, ABILITY_WONDER_GUARD); } } @@ -2019,9 +2018,9 @@ static void Cmd_resultmessage(void) if (gBattleControllerExecFlags) return; - if (gMoveResultFlags & MOVE_RESULT_MISSED && (!(gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) || gBattleCommunication[6] > B_MSG_AVOIDED_ATK)) + if (gMoveResultFlags & MOVE_RESULT_MISSED && (!(gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) || gBattleCommunication[MISS_TYPE] > B_MSG_AVOIDED_ATK)) { - stringId = gMissStringIds[gBattleCommunication[6]]; + stringId = gMissStringIds[gBattleCommunication[MISS_TYPE]]; gBattleCommunication[MSG_DISPLAY] = 1; } else @@ -2273,12 +2272,12 @@ void SetMoveEffect(bool8 primary, u8 certain) if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS; gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD); } else { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS; } RESET_RETURN } @@ -2289,7 +2288,7 @@ void SetMoveEffect(bool8 primary, u8 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_PSNPrevention; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; RESET_RETURN } if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON)) @@ -2314,12 +2313,12 @@ void SetMoveEffect(bool8 primary, u8 certain) gBattlescriptCurrInstr = BattleScript_BRNPrevention; if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS; gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD); } else { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS; } RESET_RETURN } @@ -2330,7 +2329,7 @@ void SetMoveEffect(bool8 primary, u8 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_BRNPrevention; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; RESET_RETURN } if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE)) @@ -2370,12 +2369,12 @@ void SetMoveEffect(bool8 primary, u8 certain) if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS; gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD); } else { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS; } RESET_RETURN } @@ -2398,12 +2397,12 @@ void SetMoveEffect(bool8 primary, u8 certain) if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS; gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD); } else { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS; } RESET_RETURN } @@ -2414,7 +2413,7 @@ void SetMoveEffect(bool8 primary, u8 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_PSNPrevention; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; RESET_RETURN } if (gBattleMons[gEffectBattler].status1) @@ -2453,12 +2452,12 @@ void SetMoveEffect(bool8 primary, u8 certain) if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED_BY_ABILITY; gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD); } else { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED; } // for synchronize @@ -3579,7 +3578,7 @@ static void MoveValuesCleanUp(void) gBattleScripting.dmgMultiplier = 1; gCritMultiplier = 1; gBattleCommunication[MOVE_EFFECT_BYTE] = 0; - gBattleCommunication[6] = 0; + gBattleCommunication[MISS_TYPE] = 0; gHitMarker &= ~(HITMARKER_DESTINYBOND); gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT); } @@ -4459,7 +4458,7 @@ static void Cmd_typecalc2(void) gLastUsedAbility = gBattleMons[gBattlerTarget].ability; gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE); gLastLandedMoves[gBattlerTarget] = 0; - gBattleCommunication[6] = B_MSG_GROUND_MISS; + gBattleCommunication[MISS_TYPE] = B_MSG_GROUND_MISS; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } else @@ -4534,7 +4533,7 @@ static void Cmd_typecalc2(void) gLastUsedAbility = ABILITY_WONDER_GUARD; gMoveResultFlags |= MOVE_RESULT_MISSED; gLastLandedMoves[gBattlerTarget] = 0; - gBattleCommunication[6] = B_MSG_AVOIDED_DMG; + gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } if (gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) @@ -6446,19 +6445,19 @@ static void Cmd_setprotectlike(void) // protect and endure if (gBattleMoves[gCurrentMove].effect == EFFECT_PROTECT) { gProtectStructs[gBattlerAttacker].protected = 1; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; } if (gBattleMoves[gCurrentMove].effect == EFFECT_ENDURE) { gProtectStructs[gBattlerAttacker].endured = 1; - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BRACED_ITSELF; } gDisableStructs[gBattlerAttacker].protectUses++; } else { gDisableStructs[gBattlerAttacker].protectUses = 0; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECT_FAILED; gMoveResultFlags |= MOVE_RESULT_MISSED; } @@ -6611,12 +6610,12 @@ static void Cmd_setrain(void) if (gBattleWeather & WEATHER_RAIN_ANY) { gMoveResultFlags |= MOVE_RESULT_MISSED; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED; } else { gBattleWeather = WEATHER_RAIN_TEMPORARY; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_RAIN; gWishFutureKnock.weatherDuration = 5; } gBattlescriptCurrInstr++; @@ -6627,7 +6626,7 @@ static void Cmd_setreflect(void) if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_REFLECT) { gMoveResultFlags |= MOVE_RESULT_MISSED; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SIDE_STATUS_FAILED; } else { @@ -6636,9 +6635,9 @@ static void Cmd_setreflect(void) gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].reflectBattlerId = gBattlerAttacker; if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2) - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_REFLECT_DOUBLE; else - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_REFLECT_SINGLE; } gBattlescriptCurrInstr++; } @@ -6648,18 +6647,18 @@ static void Cmd_setseeded(void) if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT || gStatuses3[gBattlerTarget] & STATUS3_LEECHSEED) { gMoveResultFlags |= MOVE_RESULT_MISSED; - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LEECH_SEED_MISS; } else if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_GRASS)) { gMoveResultFlags |= MOVE_RESULT_MISSED; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LEECH_SEED_FAIL; } else { gStatuses3[gBattlerTarget] |= gBattlerAttacker; gStatuses3[gBattlerTarget] |= STATUS3_LEECHSEED; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LEECH_SEED_SET; } gBattlescriptCurrInstr++; @@ -6700,11 +6699,11 @@ static void Cmd_trysetrest(void) else { if (gBattleMons[gBattlerTarget].status1 & ((u8)(~STATUS1_SLEEP))) - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_REST_STATUSED; else - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_REST; - gBattleMons[gBattlerTarget].status1 = 3; + gBattleMons[gBattlerTarget].status1 = STATUS1_SLEEP_TURN(3); BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); MarkBattlerForControllerExec(gActiveBattler); gBattlescriptCurrInstr += 5; @@ -6740,9 +6739,9 @@ bool8 UproarWakeUpCheck(u8 battlerId) if (gBattlerTarget == 0xFF) gBattlerTarget = i; else if (gBattlerTarget == i) - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_SLEEP_UPROAR; else - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_UPROAR_KEPT_AWAKE; break; } @@ -6765,7 +6764,7 @@ static void Cmd_jumpifcantmakeasleep(void) || gBattleMons[gBattlerTarget].ability == ABILITY_VITAL_SPIRIT) { gLastUsedAbility = gBattleMons[gBattlerTarget].ability; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAYED_AWAKE_USING; gBattlescriptCurrInstr = jumpPtr; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } @@ -6780,7 +6779,7 @@ static void Cmd_stockpile(void) if (gDisableStructs[gBattlerAttacker].stockpileCounter == 3) { gMoveResultFlags |= MOVE_RESULT_MISSED; - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_STOCKPILE; } else { @@ -6788,7 +6787,7 @@ static void Cmd_stockpile(void) PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff1, 1, gDisableStructs[gBattlerAttacker].stockpileCounter) - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STOCKPILED; } gBattlescriptCurrInstr++; } @@ -6802,7 +6801,7 @@ static void Cmd_stockpiletobasedamage(void) } else { - if (gBattleCommunication[6] != B_MSG_PROTECTED) + if (gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED) { gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerTarget], gCurrentMove, gSideStatuses[GET_BATTLER_SIDE(gBattlerTarget)], 0, @@ -6826,14 +6825,14 @@ static void Cmd_stockpiletohpheal(void) if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0) { gBattlescriptCurrInstr = jumpPtr; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FAILED; } else if (gBattleMons[gBattlerAttacker].maxHP == gBattleMons[gBattlerAttacker].hp) { gDisableStructs[gBattlerAttacker].stockpileCounter = 0; gBattlescriptCurrInstr = jumpPtr; gBattlerTarget = gBattlerAttacker; - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FULL_HP; } else { @@ -6985,9 +6984,9 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gBattleTextBuff2[index] = B_BUFF_EOS; if (gBattleMons[gActiveBattler].statStages[statId] == MIN_STAT_STAGE) - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAT_WONT_DECREASE; else - gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); + gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL } } @@ -7012,9 +7011,9 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) gBattleTextBuff2[index] = B_BUFF_EOS; if (gBattleMons[gActiveBattler].statStages[statId] == MAX_STAT_STAGE) - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAT_WONT_INCREASE; else - gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); + gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_ROSE or B_MSG_DEFENDER_STAT_ROSE } gBattleMons[gActiveBattler].statStages[statId] += statValue; @@ -7023,10 +7022,10 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr) if (gBattleMons[gActiveBattler].statStages[statId] > MAX_STAT_STAGE) gBattleMons[gActiveBattler].statStages[statId] = MAX_STAT_STAGE; - if (gBattleCommunication[MULTISTRING_CHOOSER] == 2 && flags & STAT_BUFF_ALLOW_PTR) + if (gBattleCommunication[MULTISTRING_CHOOSER] == B_MSG_STAT_WONT_INCREASE && flags & STAT_BUFF_ALLOW_PTR) gMoveResultFlags |= MOVE_RESULT_MISSED; - if (gBattleCommunication[MULTISTRING_CHOOSER] == 2 && !(flags & STAT_BUFF_ALLOW_PTR)) + if (gBattleCommunication[MULTISTRING_CHOOSER] == B_MSG_STAT_WONT_INCREASE && !(flags & STAT_BUFF_ALLOW_PTR)) return STAT_BUFF_DIDNT_WORK; return STAT_BUFF_WORKED; @@ -7358,7 +7357,7 @@ static void Cmd_setlightscreen(void) if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_LIGHTSCREEN) { gMoveResultFlags |= MOVE_RESULT_MISSED; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SIDE_STATUS_FAILED; } else { @@ -7367,9 +7366,9 @@ static void Cmd_setlightscreen(void) gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].lightscreenBattlerId = gBattlerAttacker; if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2) - gBattleCommunication[MULTISTRING_CHOOSER] = 4; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_LIGHTSCREEN_DOUBLE; else - gBattleCommunication[MULTISTRING_CHOOSER] = 3; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_LIGHTSCREEN_SINGLE; } gBattlescriptCurrInstr++; @@ -7453,9 +7452,9 @@ static void Cmd_tryKO(void) { gMoveResultFlags |= MOVE_RESULT_MISSED; if (gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_KO_MISS; else - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_KO_UNAFFECTED; gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } } @@ -7475,12 +7474,12 @@ static void Cmd_setsandstorm(void) if (gBattleWeather & WEATHER_SANDSTORM_ANY) { gMoveResultFlags |= MOVE_RESULT_MISSED; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED; } else { gBattleWeather = WEATHER_SANDSTORM_TEMPORARY; - gBattleCommunication[MULTISTRING_CHOOSER] = 3; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_SANDSTORM; gWishFutureKnock.weatherDuration = 5; } gBattlescriptCurrInstr++; @@ -7621,14 +7620,14 @@ static void Cmd_setmist(void) if (gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistTimer) { gMoveResultFlags |= MOVE_RESULT_FAILED; - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MIST_FAILED; } else { gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistTimer = 5; gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistBattlerId = gBattlerAttacker; gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_MIST; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_MIST; } gBattlescriptCurrInstr++; } @@ -7638,12 +7637,12 @@ static void Cmd_setfocusenergy(void) if (gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY) { gMoveResultFlags |= MOVE_RESULT_FAILED; - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FOCUS_ENERGY_FAILED; } else { gBattleMons[gBattlerAttacker].status2 |= STATUS2_FOCUS_ENERGY; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_GETTING_PUMPED; } gBattlescriptCurrInstr++; } @@ -7656,7 +7655,7 @@ static void Cmd_transformdataexecution(void) || gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE) { gMoveResultFlags |= MOVE_RESULT_FAILED; - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TRANSFORM_FAILED; } else { @@ -7688,7 +7687,7 @@ static void Cmd_transformdataexecution(void) gActiveBattler = gBattlerAttacker; BtlController_EmitResetActionMoveSelection(0, RESET_MOVE_SELECTION); MarkBattlerForControllerExec(gActiveBattler); - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TRANSFORMED; } } @@ -7701,7 +7700,7 @@ static void Cmd_setsubstitute(void) if (gBattleMons[gBattlerAttacker].hp <= hp) { gBattleMoveDamage = 0; - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SUBSTITUTE_FAILED; } else { @@ -7712,7 +7711,7 @@ static void Cmd_setsubstitute(void) gBattleMons[gBattlerAttacker].status2 |= STATUS2_SUBSTITUTE; gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_WRAPPED); gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SUBSTITUTE; gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE; } @@ -8250,7 +8249,7 @@ static void Cmd_healpartystatus(void) struct Pokemon *party; s32 i; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BELL; if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) party = gPlayerParty; @@ -8265,7 +8264,7 @@ static void Cmd_healpartystatus(void) else { RecordAbilityBattle(gBattlerAttacker, gBattleMons[gBattlerAttacker].ability); - gBattleCommunication[MULTISTRING_CHOOSER] |= 1; + gBattleCommunication[MULTISTRING_CHOOSER] |= B_MSG_BELL_SOUNDPROOF_ATTACKER; } gActiveBattler = gBattleScripting.battler = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK); @@ -8281,10 +8280,12 @@ static void Cmd_healpartystatus(void) else { RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability); - gBattleCommunication[MULTISTRING_CHOOSER] |= 2; + gBattleCommunication[MULTISTRING_CHOOSER] |= B_MSG_BELL_SOUNDPROOF_PARTNER; } } + // Because the above MULTISTRING_CHOOSER are ORd, if both are set then it will be B_MSG_BELL_BOTH_SOUNDPROOF + for (i = 0; i < PARTY_SIZE; i++) { u16 species = GetMonData(&party[i], MON_DATA_SPECIES2); @@ -8310,7 +8311,7 @@ static void Cmd_healpartystatus(void) } else // Aromatherapy { - gBattleCommunication[MULTISTRING_CHOOSER] = 4; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SOOTHING_AROMA; toHeal = 0x3F; gBattleMons[gBattlerAttacker].status1 = 0; @@ -8514,14 +8515,14 @@ static void Cmd_setsafeguard(void) if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_SAFEGUARD) { gMoveResultFlags |= MOVE_RESULT_MISSED; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SIDE_STATUS_FAILED; } else { gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_SAFEGUARD; gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].safeguardTimer = 5; gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].safeguardBattlerId = gBattlerAttacker; - gBattleCommunication[MULTISTRING_CHOOSER] = 5; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SAFEGUARD; } gBattlescriptCurrInstr++; @@ -8630,12 +8631,12 @@ static void Cmd_setsunny(void) if (gBattleWeather & WEATHER_SUN_ANY) { gMoveResultFlags |= MOVE_RESULT_MISSED; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED; } else { gBattleWeather = WEATHER_SUN_TEMPORARY; - gBattleCommunication[MULTISTRING_CHOOSER] = 4; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_SUNLIGHT; gWishFutureKnock.weatherDuration = 5; } @@ -8806,9 +8807,9 @@ static void Cmd_trysetfutureattack(void) gWishFutureKnock.futureSightDmg[gBattlerTarget] = gWishFutureKnock.futureSightDmg[gBattlerTarget] * 15 / 10; if (gCurrentMove == MOVE_DOOM_DESIRE) - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOOM_DESIRE; else - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FUTURE_SIGHT; gBattlescriptCurrInstr += 5; } @@ -8912,12 +8913,12 @@ static void Cmd_sethail(void) if (gBattleWeather & WEATHER_HAIL_ANY) { gMoveResultFlags |= MOVE_RESULT_MISSED; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED; } else { gBattleWeather = WEATHER_HAIL; - gBattleCommunication[MULTISTRING_CHOOSER] = 5; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_HAIL; gWishFutureKnock.weatherDuration = 5; } @@ -8928,7 +8929,7 @@ static void Cmd_jumpifattackandspecialattackcannotfall(void) // memento { if (gBattleMons[gBattlerTarget].statStages[STAT_ATK] == MIN_STAT_STAGE && gBattleMons[gBattlerTarget].statStages[STAT_SPATK] == MIN_STAT_STAGE - && gBattleCommunication[6] != B_MSG_PROTECTED) + && gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } @@ -9113,11 +9114,11 @@ static void Cmd_tryswapitems(void) // trick PREPARE_ITEM_BUFFER(gBattleTextBuff2, oldItemAtk) if (oldItemAtk != 0 && *newItemAtk != 0) - gBattleCommunication[MULTISTRING_CHOOSER] = 2; // attacker's item -> <- target's item + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ITEM_SWAP_BOTH; // attacker's item -> <- target's item else if (oldItemAtk == 0 && *newItemAtk != 0) - gBattleCommunication[MULTISTRING_CHOOSER] = 0; // nothing -> <- target's item + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ITEM_SWAP_TAKEN; // nothing -> <- target's item else - gBattleCommunication[MULTISTRING_CHOOSER] = 1; // attacker's item -> <- nothing + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ITEM_SWAP_GIVEN; // attacker's item -> <- nothing } } } @@ -9605,7 +9606,7 @@ static void Cmd_settypebasedhalvers(void) // water and mud sport if (!(gStatuses3[gBattlerAttacker] & STATUS3_MUDSPORT)) { gStatuses3[gBattlerAttacker] |= STATUS3_MUDSPORT; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEAKEN_ELECTRIC; worked = TRUE; } } @@ -9614,7 +9615,7 @@ static void Cmd_settypebasedhalvers(void) // water and mud sport if (!(gStatuses3[gBattlerAttacker] & STATUS3_WATERSPORT)) { gStatuses3[gBattlerAttacker] |= STATUS3_WATERSPORT; - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEAKEN_FIRE; worked = TRUE; } } @@ -9883,7 +9884,6 @@ static void Cmd_handleballthrow(void) else // not caught { gBattleCommunication[MULTISTRING_CHOOSER] = shakes; - // Maybe inject SpriteCB_TestBallThrow here gBattlescriptCurrInstr = BattleScript_ShakeBallThrow; } } @@ -9896,7 +9896,7 @@ static void Cmd_givecaughtmon(void) { if (!ShouldShowBoxWasFullMessage()) { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SENT_SOMEONES_PC; StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2); } @@ -9905,9 +9905,10 @@ static void Cmd_givecaughtmon(void) StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); // box the mon was sent to GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2); StringCopy(gStringVar3, GetBoxNamePtr(GetPCBoxToSendMon())); //box the mon was going to be sent to - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SOMEONES_BOX_FULL; } + // Change to B_MSG_SENT_LANETTES_PC or B_MSG_LANETTES_BOX_FULL if (FlagGet(FLAG_SYS_PC_LANETTE)) gBattleCommunication[MULTISTRING_CHOOSER]++; } diff --git a/src/battle_tv.c b/src/battle_tv.c index 8c8ea90ab..a61f5ff29 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -666,7 +666,7 @@ void BattleTv_SetDataBasedOnString(u16 stringId) case STRINGID_CRITICALHIT: AddMovePoints(PTS_CRITICAL_HIT, moveSlot, 0, 0); break; - case STRINGID_PKMNSSTATCHANGED: + case STRINGID_ATTACKERSSTATROSE: if (gBattleTextBuff1[2] != 0) { if (*statStringId == STRINGID_STATSHARPLY) @@ -675,7 +675,7 @@ void BattleTv_SetDataBasedOnString(u16 stringId) AddMovePoints(PTS_STAT_INCREASE_1, moveSlot, gBattleTextBuff1[2] - 1, 0); } break; - case STRINGID_PKMNSSTATCHANGED2: + case STRINGID_DEFENDERSSTATROSE: if (gBattleTextBuff1[2] != 0) { if (gBattlerAttacker == gBattlerTarget) @@ -691,11 +691,11 @@ void BattleTv_SetDataBasedOnString(u16 stringId) } } break; - case STRINGID_PKMNSSTATCHANGED3: + case STRINGID_ATTACKERSSTATFELL: if (gBattleTextBuff1[2] != 0) AddMovePoints(PTS_STAT_DECREASE_SELF, moveSlot, gBattleTextBuff1[2] - 1, 0); break; - case STRINGID_PKMNSSTATCHANGED4: + case STRINGID_DEFENDERSSTATFELL: if (gBattleTextBuff1[2] != 0) { if (*statStringId == STRINGID_STATHARSHLY) diff --git a/src/battle_util.c b/src/battle_util.c index c0d897707..6fb307d63 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -49,7 +49,29 @@ extern const u8 *const gBattlescriptsForRunningByItem[]; extern const u8 *const gBattlescriptsForUsingItem[]; extern const u8 *const gBattlescriptsForSafariActions[]; -static const u8 sPkblToEscapeFactor[][3] = {{0, 0, 0}, {3, 5, 0}, {2, 3, 0}, {1, 2, 0}, {1, 1, 0}}; +static const u8 sPkblToEscapeFactor[][3] = { + { + [B_MSG_MON_CURIOUS] = 0, + [B_MSG_MON_ENTHRALLED] = 0, + [B_MSG_MON_IGNORED] = 0 + },{ + [B_MSG_MON_CURIOUS] = 3, + [B_MSG_MON_ENTHRALLED] = 5, + [B_MSG_MON_IGNORED] = 0 + },{ + [B_MSG_MON_CURIOUS] = 2, + [B_MSG_MON_ENTHRALLED] = 3, + [B_MSG_MON_IGNORED] = 0 + },{ + [B_MSG_MON_CURIOUS] = 1, + [B_MSG_MON_ENTHRALLED] = 2, + [B_MSG_MON_IGNORED] = 0 + },{ + [B_MSG_MON_CURIOUS] = 1, + [B_MSG_MON_ENTHRALLED] = 1, + [B_MSG_MON_IGNORED] = 0 + } +}; static const u8 sGoNearCounterToCatchFactor[] = {4, 3, 2, 1}; static const u8 sGoNearCounterToEscapeFactor[] = {4, 4, 4, 4}; @@ -238,10 +260,9 @@ void HandleAction_UseMove(void) } } - // choose battlescript - if (gBattleTypeFlags & BATTLE_TYPE_PALACE - && gProtectStructs[gBattlerAttacker].palaceUnableToUseMove) + if (gBattleTypeFlags & BATTLE_TYPE_PALACE && gProtectStructs[gBattlerAttacker].palaceUnableToUseMove) { + // Battle Palace, select battle script for failure to use move if (gBattleMons[gBattlerAttacker].hp == 0) { gCurrentActionFuncId = B_ACTION_FINISHED; @@ -249,13 +270,13 @@ void HandleAction_UseMove(void) } else if (gPalaceSelectionBattleScripts[gBattlerAttacker] != NULL) { - gBattleCommunication[MULTISTRING_CHOOSER] = 4; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_INCAPABLE_OF_POWER; gBattlescriptCurrInstr = gPalaceSelectionBattleScripts[gBattlerAttacker]; gPalaceSelectionBattleScripts[gBattlerAttacker] = NULL; } else { - gBattleCommunication[MULTISTRING_CHOOSER] = 4; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_INCAPABLE_OF_POWER; gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround; } } @@ -318,26 +339,29 @@ void HandleAction_UseItem(void) case AI_ITEM_HEAL_HP: break; case AI_ITEM_CURE_CONDITION: - gBattleCommunication[MULTISTRING_CHOOSER] = 0; - if (*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & 1) + gBattleCommunication[MULTISTRING_CHOOSER] = AI_HEAL_CONFUSION; + if (*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & (1 << AI_HEAL_CONFUSION)) { if (*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & 0x3E) - gBattleCommunication[MULTISTRING_CHOOSER] = 5; + gBattleCommunication[MULTISTRING_CHOOSER] = AI_HEAL_SLEEP; } else { + // Check for other statuses, stopping at first (shouldn't be more than one) while (!(*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & 1)) { *(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) >>= 1; gBattleCommunication[MULTISTRING_CHOOSER]++; + // MULTISTRING_CHOOSER will be either AI_HEAL_PARALYSIS, AI_HEAL_FREEZE, + // AI_HEAL_BURN, AI_HEAL_POISON, or AI_HEAL_SLEEP } } break; case AI_ITEM_X_STAT: - gBattleCommunication[MULTISTRING_CHOOSER] = 4; - if (*(gBattleStruct->AI_itemFlags + (gBattlerAttacker >> 1)) & 0x80) + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAT_ROSE_ITEM; + if (*(gBattleStruct->AI_itemFlags + (gBattlerAttacker >> 1)) & (1 << AI_DIRE_HIT)) { - gBattleCommunication[MULTISTRING_CHOOSER] = 5; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_USED_DIRE_HIT; } else { @@ -356,9 +380,9 @@ void HandleAction_UseItem(void) break; case AI_ITEM_GUARD_SPECS: if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = 2; // Going OOB for gMistUsedStringIds? else - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_MIST; break; } @@ -479,7 +503,7 @@ void HandleAction_Run(void) if (!TryRunFromBattle(gBattlerAttacker)) // failed to run away { ClearFuryCutterDestinyBondGrudge(gBattlerAttacker); - gBattleCommunication[MULTISTRING_CHOOSER] = 3; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE_2; gBattlescriptCurrInstr = BattleScript_PrintFailedToRunString; gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT; } @@ -488,7 +512,7 @@ void HandleAction_Run(void) { if (gBattleMons[gBattlerAttacker].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION)) { - gBattleCommunication[MULTISTRING_CHOOSER] = 4; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ATTACKER_CANT_ESCAPE; gBattlescriptCurrInstr = BattleScript_PrintFailedToRunString; gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT; } @@ -567,11 +591,11 @@ void HandleAction_GoNear(void) if (gBattleStruct->safariGoNearCounter < 3) { gBattleStruct->safariGoNearCounter++; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CREPT_CLOSER; } else { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; // Can't get closer. + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_GET_CLOSER; } gBattlescriptCurrInstr = gBattlescriptsForSafariActions[1]; gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT; @@ -1295,20 +1319,20 @@ u8 DoFieldEndTurnEffects(void) { gBattleWeather &= ~WEATHER_RAIN_TEMPORARY; gBattleWeather &= ~WEATHER_RAIN_DOWNPOUR; - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_STOPPED; } else if (gBattleWeather & WEATHER_RAIN_DOWNPOUR) - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOWNPOUR_CONTINUES; else - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_CONTINUES; } else if (gBattleWeather & WEATHER_RAIN_DOWNPOUR) { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOWNPOUR_CONTINUES; } else { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_CONTINUES; } BattleScriptExecute(BattleScript_RainContinuesOrEnds); @@ -1330,7 +1354,7 @@ u8 DoFieldEndTurnEffects(void) } gBattleScripting.animArg1 = B_ANIM_SANDSTORM_CONTINUES; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SANDSTORM; BattleScriptExecute(gBattlescriptCurrInstr); effect++; } @@ -1368,7 +1392,7 @@ u8 DoFieldEndTurnEffects(void) } gBattleScripting.animArg1 = B_ANIM_HAIL_CONTINUES; - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_HAIL; BattleScriptExecute(gBattlescriptCurrInstr); effect++; } @@ -1597,16 +1621,16 @@ u8 DoBattlerEndTurnEffects(void) if (WasUnableToUseMove(gActiveBattler)) { CancelMultiTurnMoves(gActiveBattler); - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_UPROAR_ENDS; } else if (gBattleMons[gActiveBattler].status2 & STATUS2_UPROAR) { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_UPROAR_CONTINUES; gBattleMons[gActiveBattler].status2 |= STATUS2_MULTIPLETURNS; } else { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_UPROAR_ENDS; CancelMultiTurnMoves(gActiveBattler); } BattleScriptExecute(BattleScript_PrintUproarOverTurns); @@ -1749,9 +1773,9 @@ bool8 HandleWishPerishSongOnTurnEnd(void) && gBattleMons[gActiveBattler].hp != 0) { if (gWishFutureKnock.futureSightMove[gActiveBattler] == MOVE_FUTURE_SIGHT) - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FUTURE_SIGHT; else - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOOM_DESIRE; PREPARE_MOVE_BUFFER(gBattleTextBuff1, gWishFutureKnock.futureSightMove[gActiveBattler]); @@ -1962,7 +1986,7 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_SLEEP); gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE); BattleScriptPushCursor(); - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP_UPROAR; gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp; effect = 2; } @@ -1990,7 +2014,7 @@ u8 AtkCanceller_UnableToUseMove(void) { gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE); BattleScriptPushCursor(); - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP; gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp; effect = 2; } @@ -2019,7 +2043,7 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_FREEZE); BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DEFROSTED; } effect = 2; } @@ -2030,7 +2054,7 @@ u8 AtkCanceller_UnableToUseMove(void) { CancelMultiTurnMoves(gBattlerAttacker); gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LOAFING; gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround; gMoveResultFlags |= MOVE_RESULT_MISSED; effect = 1; @@ -2103,12 +2127,14 @@ u8 AtkCanceller_UnableToUseMove(void) { if (Random() & 1) { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + // The MULTISTRING_CHOOSER is used here as a bool to signal + // to BattleScript_MoveUsedIsConfused whether or not damage was taken + gBattleCommunication[MULTISTRING_CHOOSER] = FALSE; BattleScriptPushCursor(); } else // confusion dmg { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = TRUE; gBattlerTarget = gBattlerAttacker; gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerAttacker], MOVE_POUND, 0, 40, 0, gBattlerAttacker, gBattlerAttacker); gProtectStructs[gBattlerAttacker].confusionSelfDmg = 1; @@ -2195,7 +2221,7 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_FREEZE); BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze; - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DEFROSTED_BY_MOVE; } effect = 2; } @@ -2593,7 +2619,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA if (gBattleMons[battler].statStages[STAT_SPEED] < MAX_STAT_STAGE && gDisableStructs[battler].isFirstTurn != 2) { gBattleMons[battler].statStages[STAT_SPEED]++; - gBattleScripting.animArg1 = 0x11; + gBattleScripting.animArg1 = 14 + STAT_SPEED; gBattleScripting.animArg2 = 0; BattleScriptPushCursorAndCallback(BattleScript_SpeedBoostActivates); gBattleScripting.battler = battler; @@ -2655,7 +2681,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA { if (!(gBattleResources->flags->flags[battler] & RESOURCE_FLAG_FLASH_FIRE)) { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FLASH_FIRE_BOOST; if (gProtectStructs[gBattlerAttacker].notFirstStrike) gBattlescriptCurrInstr = BattleScript_FlashFireBoost; else @@ -2666,7 +2692,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA } else { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FLASH_FIRE_NO_BOOST; if (gProtectStructs[gBattlerAttacker].notFirstStrike) gBattlescriptCurrInstr = BattleScript_FlashFireBoost; else @@ -3431,7 +3457,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gEffectBattler = battlerId; SET_STATCHANGER(STAT_ATK, 1, FALSE); - gBattleScripting.animArg1 = 0xE + STAT_ATK; + gBattleScripting.animArg1 = 14 + STAT_ATK; gBattleScripting.animArg2 = 0; BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); effect = ITEM_STATS_CHANGE; @@ -3445,7 +3471,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gEffectBattler = battlerId; SET_STATCHANGER(STAT_DEF, 1, FALSE); - gBattleScripting.animArg1 = 0xE + STAT_DEF; + gBattleScripting.animArg1 = 14 + STAT_DEF; gBattleScripting.animArg2 = 0; BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); effect = ITEM_STATS_CHANGE; @@ -3459,7 +3485,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gEffectBattler = battlerId; SET_STATCHANGER(STAT_SPEED, 1, FALSE); - gBattleScripting.animArg1 = 0xE + STAT_SPEED; + gBattleScripting.animArg1 = 14 + STAT_SPEED; gBattleScripting.animArg2 = 0; BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); effect = ITEM_STATS_CHANGE; @@ -3473,7 +3499,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gEffectBattler = battlerId; SET_STATCHANGER(STAT_SPATK, 1, FALSE); - gBattleScripting.animArg1 = 0xE + STAT_SPATK; + gBattleScripting.animArg1 = 14 + STAT_SPATK; gBattleScripting.animArg2 = 0; BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); effect = ITEM_STATS_CHANGE; @@ -3487,7 +3513,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gEffectBattler = battlerId; SET_STATCHANGER(STAT_SPDEF, 1, FALSE); - gBattleScripting.animArg1 = 0xE + STAT_SPDEF; + gBattleScripting.animArg1 = 14 + STAT_SPDEF; gBattleScripting.animArg2 = 0; BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); effect = ITEM_STATS_CHANGE; @@ -3622,9 +3648,9 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) i++; } if (!(i > 1)) - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; else - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_NORMALIZED_STATUS; gBattleMons[battlerId].status1 = 0; gBattleMons[battlerId].status2 &= ~(STATUS2_CONFUSION); BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2); @@ -3637,7 +3663,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION); StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2); - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; effect = ITEM_EFFECT_OTHER; } break; @@ -3740,7 +3766,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION); StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); BattleScriptPushCursor(); - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet; effect = ITEM_EFFECT_OTHER; } @@ -3776,7 +3802,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gBattleMons[battlerId].status1 = 0; gBattleMons[battlerId].status2 &= ~(STATUS2_CONFUSION); BattleScriptPushCursor(); - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM; gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet; effect = ITEM_STATUS_CHANGE; } @@ -4016,7 +4042,9 @@ u8 IsMonDisobedient(void) calc = CheckMoveLimitations(gBattlerAttacker, gBitTable[gCurrMovePos], 0xFF); if (calc == 0xF) // all moves cannot be used { - gBattleCommunication[MULTISTRING_CHOOSER] = Random() & 3; + // Randomly select, then print a disobedient string + // B_MSG_LOAFING, B_MSG_WONT_OBEY, B_MSG_TURNED_AWAY, or B_MSG_PRETEND_NOT_NOTICE + gBattleCommunication[MULTISTRING_CHOOSER] = Random() & (NUM_LOAF_STRINGS - 1); gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround; return 1; } @@ -4024,7 +4052,7 @@ u8 IsMonDisobedient(void) { do { - gCurrMovePos = gChosenMovePos = Random() & 3; + gCurrMovePos = gChosenMovePos = Random() & (MAX_MON_MOVES - 1); } while (gBitTable[gCurrMovePos] & calc); gCalledMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos]; @@ -4065,7 +4093,9 @@ u8 IsMonDisobedient(void) } else { - gBattleCommunication[MULTISTRING_CHOOSER] = Random() & 3; + // Randomly select, then print a disobedient string + // B_MSG_LOAFING, B_MSG_WONT_OBEY, B_MSG_TURNED_AWAY, or B_MSG_PRETEND_NOT_NOTICE + gBattleCommunication[MULTISTRING_CHOOSER] = Random() & (NUM_LOAF_STRINGS - 1); gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround; return 1; } diff --git a/src/battle_util2.c b/src/battle_util2.c index 6d51f51e7..def7302d3 100644 --- a/src/battle_util2.c +++ b/src/battle_util2.c @@ -10,6 +10,7 @@ #include "constants/abilities.h" #include "random.h" #include "battle_scripts.h" +#include "constants/battle_string_ids.h" void AllocateBattleResources(void) { @@ -136,7 +137,7 @@ u32 sub_805725C(u8 battlerId) gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP); gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE); BattleScriptPushCursor(); - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP_UPROAR; gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp; effect = 2; } @@ -163,7 +164,7 @@ u32 sub_805725C(u8 battlerId) { gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE); BattleScriptPushCursor(); - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP; gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp; effect = 2; } @@ -183,7 +184,7 @@ u32 sub_805725C(u8 battlerId) gBattleMons[battlerId].status1 &= ~(STATUS1_FREEZE); BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze; - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DEFROSTED; } effect = 2; } diff --git a/src/pokemon.c b/src/pokemon.c index e28fba1b4..9fe008d56 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5366,7 +5366,7 @@ static void BufferStatRoseMessage(s32 arg0) gBattlerTarget = gBattlerInMenuId; StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[arg0]]); StringCopy(gBattleTextBuff2, gText_StatRose); - BattleStringExpandPlaceholdersToDisplayedString(gText_PkmnsStatChanged2); + BattleStringExpandPlaceholdersToDisplayedString(gText_DefendersStatRose); } u8 *UseStatIncreaseItem(u16 itemId) From f4d8a91ba44d7bcf0f9df8db7ca5f7aeb688497f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 3 Apr 2021 12:38:07 -0400 Subject: [PATCH 06/63] Misc battle script cleanup --- asm/macros/battle_script.inc | 2 +- data/battle_scripts_1.s | 216 +++++++++++---------- data/battle_scripts_2.s | 17 +- include/battle_controllers.h | 4 +- include/constants/battle_script_commands.h | 48 ++--- include/constants/battle_string_ids.h | 23 ++- src/battle_controller_link_opponent.c | 6 +- src/battle_controller_link_partner.c | 6 +- src/battle_controller_opponent.c | 6 +- src/battle_controller_player.c | 6 +- src/battle_controller_player_partner.c | 6 +- src/battle_controller_recorded_opponent.c | 6 +- src/battle_controller_recorded_player.c | 6 +- src/battle_controller_safari.c | 6 +- src/battle_controller_wally.c | 6 +- src/battle_controllers.c | 10 +- src/battle_message.c | 24 +-- src/battle_script_commands.c | 62 +++--- src/battle_util.c | 2 +- 19 files changed, 238 insertions(+), 224 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index f3664a1c4..0f51061e8 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1311,7 +1311,7 @@ various \battler, 15 .endm - .macro arenajudmengtstring id:req + .macro arenajudgmentstring id:req various \id, VARIOUS_ARENA_JUDGMENT_STRING .endm diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index daaf5eafd..045db19c5 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1,3 +1,4 @@ +#include "constants/global.h" #include "constants/battle.h" #include "constants/pokemon.h" #include "constants/battle_script_commands.h" @@ -627,9 +628,9 @@ BattleScript_EffectMultiHit:: accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring ppreduce - setmultihitcounter 0x0 + setmultihitcounter 0 initmultihitstring - setbyte sMULTIHIT_EFFECT, 0x0 + setbyte sMULTIHIT_EFFECT, 0 BattleScript_MultiHitLoop:: jumpifhasnohp BS_ATTACKER, BattleScript_MultiHitEnd jumpifhasnohp BS_TARGET, BattleScript_MultiHitPrintStrings @@ -654,7 +655,7 @@ BattleScript_DoMultiHit:: waitmessage B_WAIT_TIME_LONG printstring STRINGID_EMPTYSTRING3 waitmessage 1 - addbyte sMULTIHIT_STRING + 4, 0x1 + addbyte sMULTIHIT_STRING + 4, 1 moveendto MOVEEND_NEXT_TARGET jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_MultiHitPrintStrings decrementmultihit BattleScript_MultiHitLoop @@ -665,7 +666,7 @@ BattleScript_MultiHitPrintStrings:: resultmessage waitmessage B_WAIT_TIME_LONG jumpifmovehadnoeffect BattleScript_MultiHitEnd - copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6 + copyarray gBattleTextBuff1, sMULTIHIT_STRING, 6 printstring STRINGID_HITXTIMES waitmessage B_WAIT_TIME_LONG BattleScript_MultiHitEnd:: @@ -806,7 +807,7 @@ BattleScript_EffectRazorWind:: BattleScript_TwoTurnMovesSecondTurn:: attackcanceler setmoveeffect MOVE_EFFECT_CHARGING - setbyte sB_ANIM_TURN, 0x1 + setbyte sB_ANIM_TURN, 1 clearstatusfromeffect BS_ATTACKER orword gHitMarker, HITMARKER_NO_PPDEDUCT jumpifnotmove MOVE_SKY_ATTACK, BattleScript_HitFromAccCheck @@ -862,9 +863,9 @@ BattleScript_EffectDoubleHit:: accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring ppreduce - setmultihitcounter 0x2 + setmultihitcounter 2 initmultihitstring - setbyte sMULTIHIT_EFFECT, 0x0 + setbyte sMULTIHIT_EFFECT, 0 goto BattleScript_MultiHitLoop BattleScript_EffectRecoilIfMiss:: @@ -1099,7 +1100,7 @@ BattleScript_EffectTwineedle:: setbyte sMULTIHIT_EFFECT, MOVE_EFFECT_POISON attackstring ppreduce - setmultihitcounter 0x2 + setmultihitcounter 2 initmultihitstring goto BattleScript_MultiHitLoop @@ -1171,8 +1172,8 @@ BattleScript_EffectMetronome:: pause B_WAIT_TIME_SHORT attackanimation waitanimation - setbyte sB_ANIM_TURN, 0x0 - setbyte sB_ANIM_TARGETS_HIT, 0x0 + setbyte sB_ANIM_TURN, 0 + setbyte sB_ANIM_TARGETS_HIT, 0 metronome BattleScript_EffectLeechSeed:: @@ -1348,8 +1349,8 @@ BattleScript_SleepTalkIsAsleep:: BattleScript_SleepTalkUsingMove:: attackanimation waitanimation - setbyte sB_ANIM_TURN, 0x0 - setbyte sB_ANIM_TARGETS_HIT, 0x0 + setbyte sB_ANIM_TURN, 0 + setbyte sB_ANIM_TARGETS_HIT, 0 jumptocalledmove TRUE BattleScript_EffectDestinyBond:: @@ -1406,9 +1407,9 @@ BattleScript_EffectTripleKick:: attackcanceler attackstring ppreduce - sethword sTRIPLE_KICK_POWER, 0x0 + sethword sTRIPLE_KICK_POWER, 0 initmultihitstring - setmultihit 0x3 + setmultihit 3 BattleScript_TripleKickLoop:: jumpifhasnohp BS_ATTACKER, BattleScript_TripleKickEnd jumpifhasnohp BS_TARGET, BattleScript_TripleKickNoMoreHits @@ -1418,7 +1419,7 @@ BattleScript_DoTripleKickAttack:: accuracycheck BattleScript_TripleKickNoMoreHits, ACC_CURR_MOVE movevaluescleanup addbyte sTRIPLE_KICK_POWER, 10 - addbyte sMULTIHIT_STRING + 4, 0x1 + addbyte sMULTIHIT_STRING + 4, 1 copyhword gDynamicBasePower, sTRIPLE_KICK_POWER critcalc damagecalc @@ -1442,14 +1443,14 @@ BattleScript_DoTripleKickAttack:: goto BattleScript_TripleKickPrintStrings BattleScript_TripleKickNoMoreHits:: pause B_WAIT_TIME_SHORT - jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0x0, BattleScript_TripleKickPrintStrings + jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0, BattleScript_TripleKickPrintStrings bicbyte gMoveResultFlags, MOVE_RESULT_MISSED BattleScript_TripleKickPrintStrings:: resultmessage waitmessage B_WAIT_TIME_LONG - jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0x0, BattleScript_TripleKickEnd + jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0, BattleScript_TripleKickEnd jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_TripleKickEnd - copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6 + copyarray gBattleTextBuff1, sMULTIHIT_STRING, 6 printstring STRINGID_HITXTIMES waitmessage B_WAIT_TIME_LONG BattleScript_TripleKickEnd:: @@ -1510,7 +1511,7 @@ BattleScript_EffectCurse:: jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_DEF, MAX_STAT_STAGE, BattleScript_ButItFailed BattleScript_CurseTrySpeed:: copybyte gBattlerTarget, gBattlerAttacker - setbyte sB_ANIM_TURN, 0x1 + setbyte sB_ANIM_TURN, 1 attackanimation waitanimation setstatchanger STAT_SPEED, 1, TRUE @@ -1540,7 +1541,7 @@ BattleScript_DoGhostCurse:: accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON cursetarget BattleScript_ButItFailed orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE - setbyte sB_ANIM_TURN, 0x0 + setbyte sB_ANIM_TURN, 0 attackanimation waitanimation healthbarupdate BS_ATTACKER @@ -1594,11 +1595,11 @@ BattleScript_EffectPerishSong:: waitanimation printstring STRINGID_FAINTINTHREE waitmessage B_WAIT_TIME_LONG - setbyte sBATTLER, 0x0 + setbyte sBATTLER, 0 BattleScript_PerishSongLoop:: jumpifability BS_SCRIPTING, ABILITY_SOUNDPROOF, BattleScript_PerishSongNotAffected BattleScript_PerishSongLoopIncrement:: - addbyte sBATTLER, 0x1 + addbyte sBATTLER, 1 jumpifbytenotequal sBATTLER, gBattlersCount, BattleScript_PerishSongLoop goto BattleScript_MoveEnd @@ -1720,10 +1721,10 @@ BattleScript_EffectBatonPass:: jumpifcantswitch SWITCH_IGNORE_ESCAPE_PREVENTION | BS_ATTACKER, BattleScript_ButItFailed attackanimation waitanimation - openpartyscreen 0x1, BattleScript_ButItFailed + openpartyscreen BS_ATTACKER, BattleScript_ButItFailed switchoutabilities BS_ATTACKER waitstate - switchhandleorder BS_ATTACKER, 0x2 + switchhandleorder BS_ATTACKER, 2 returntoball BS_ATTACKER getswitchedmondata BS_ATTACKER switchindataupdate BS_ATTACKER @@ -1949,8 +1950,8 @@ BattleScript_EffectTeleport:: ppreduce jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_ButItFailed getifcantrunfrombattle BS_ATTACKER - jumpifbyte CMP_EQUAL, gBattleCommunication, 0x1, BattleScript_ButItFailed - jumpifbyte CMP_EQUAL, gBattleCommunication, 0x2, BattleScript_PrintAbilityMadeIneffective + jumpifbyte CMP_EQUAL, gBattleCommunication, 1, BattleScript_ButItFailed + jumpifbyte CMP_EQUAL, gBattleCommunication, 2, BattleScript_PrintAbilityMadeIneffective attackanimation waitanimation printstring STRINGID_PKMNFLEDFROMBATTLE @@ -1964,13 +1965,13 @@ BattleScript_EffectBeatUp:: attackstring pause B_WAIT_TIME_SHORT ppreduce - setbyte gBattleCommunication, 0x0 + setbyte gBattleCommunication, 0 BattleScript_BeatUpLoop:: movevaluescleanup trydobeatup BattleScript_BeatUpEnd, BattleScript_ButItFailed printstring STRINGID_PKMNATTACK critcalc - jumpifbyte CMP_NOT_EQUAL, gCritMultiplier, 0x2, BattleScript_BeatUpAttack + jumpifbyte CMP_NOT_EQUAL, gCritMultiplier, 2, BattleScript_BeatUpAttack manipulatedamage DMG_DOUBLED BattleScript_BeatUpAttack:: adjustnormaldamage @@ -2018,7 +2019,7 @@ BattleScript_FirstTurnSemiInvulnerable:: BattleScript_SecondTurnSemiInvulnerable:: attackcanceler setmoveeffect MOVE_EFFECT_CHARGING - setbyte sB_ANIM_TURN, 0x1 + setbyte sB_ANIM_TURN, 1 clearstatusfromeffect BS_ATTACKER orword gHitMarker, HITMARKER_NO_PPDEDUCT jumpifnotmove MOVE_BOUNCE, BattleScript_SemiInvulnerableTryHit @@ -2379,7 +2380,7 @@ BattleScript_EffectWish:: attackcanceler attackstring ppreduce - trywish 0x0, BattleScript_ButItFailed + trywish 0, BattleScript_ButItFailed attackanimation waitanimation goto BattleScript_MoveEnd @@ -2390,8 +2391,8 @@ BattleScript_EffectAssist:: assistattackselect BattleScript_ButItFailedPpReduce attackanimation waitanimation - setbyte sB_ANIM_TURN, 0x0 - setbyte sB_ANIM_TARGETS_HIT, 0x0 + setbyte sB_ANIM_TURN, 0 + setbyte sB_ANIM_TARGETS_HIT, 0 jumptocalledmove TRUE BattleScript_EffectIngrain:: @@ -2445,12 +2446,12 @@ BattleScript_EffectBrickBreak:: damagecalc typecalc adjustnormaldamage - jumpifbyte CMP_EQUAL, sB_ANIM_TURN, 0x0, BattleScript_BrickBreakAnim + jumpifbyte CMP_EQUAL, sB_ANIM_TURN, 0, BattleScript_BrickBreakAnim bicbyte gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE BattleScript_BrickBreakAnim:: attackanimation waitanimation - jumpifbyte CMP_LESS_THAN, sB_ANIM_TURN, 0x2, BattleScript_BrickBreakDoHit + jumpifbyte CMP_LESS_THAN, sB_ANIM_TURN, 2, BattleScript_BrickBreakDoHit printstring STRINGID_THEWALLSHATTERED waitmessage B_WAIT_TIME_LONG BattleScript_BrickBreakDoHit:: @@ -2592,7 +2593,7 @@ BattleScript_EffectTeeterDance:: attackcanceler attackstring ppreduce - setbyte gBattlerTarget, 0x0 + setbyte gBattlerTarget, 0 BattleScript_TeeterDanceLoop:: movevaluescleanup setmoveeffect MOVE_EFFECT_CONFUSION @@ -2611,7 +2612,7 @@ BattleScript_TeeterDanceLoop:: BattleScript_TeeterDanceDoMoveEndIncrement:: moveendto MOVEEND_NEXT_TARGET BattleScript_TeeterDanceLoopIncrement:: - addbyte gBattlerTarget, 0x1 + addbyte gBattlerTarget, 1 jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_TeeterDanceLoop end @@ -2714,7 +2715,7 @@ BattleScript_CosmicPowerDoMoveAnim:: attackanimation waitanimation setbyte sSTAT_ANIM_PLAYED, FALSE - playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, 0x0 + playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, 0 setstatchanger STAT_DEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CosmicPowerTrySpDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CosmicPowerTrySpDef @@ -2743,7 +2744,7 @@ BattleScript_BulkUpDoMoveAnim:: attackanimation waitanimation setbyte sSTAT_ANIM_PLAYED, FALSE - playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF, 0x0 + playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF, 0 setstatchanger STAT_ATK, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BulkUpTryDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_BulkUpTryDef @@ -2768,7 +2769,7 @@ BattleScript_CalmMindDoMoveAnim:: attackanimation waitanimation setbyte sSTAT_ANIM_PLAYED, FALSE - playstatchangeanimation BS_ATTACKER, BIT_SPATK | BIT_SPDEF, 0x0 + playstatchangeanimation BS_ATTACKER, BIT_SPATK | BIT_SPDEF, 0 setstatchanger STAT_SPATK, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CalmMindTrySpDef jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CalmMindTrySpDef @@ -2800,7 +2801,7 @@ BattleScript_DragonDanceDoMoveAnim:: attackanimation waitanimation setbyte sSTAT_ANIM_PLAYED, FALSE - playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPEED, 0x0 + playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPEED, 0 setstatchanger STAT_ATK, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DragonDanceTrySpeed jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DragonDanceTrySpeed @@ -2843,40 +2844,40 @@ BattleScript_FaintTarget:: return BattleScript_GiveExp:: - setbyte sGIVEEXP_STATE, 0x0 + setbyte sGIVEEXP_STATE, 0 getexp BS_TARGET end2 BattleScript_HandleFaintedMon:: - atk24 BattleScript_82DA8F6 + atk24 BattleScript_HandleFaintedMonMultiple jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_FaintedMonEnd jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonTryChooseAnother jumpifword CMP_NO_COMMON_BITS, gHitMarker, HITMARKER_x400000, BattleScript_FaintedMonTryChooseAnother printstring STRINGID_USENEXTPKMN - setbyte gBattleCommunication, 0x0 + setbyte gBattleCommunication, 0 yesnobox - jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0x0, BattleScript_FaintedMonTryChooseAnother + jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0, BattleScript_FaintedMonTryChooseAnother jumpifplayerran BattleScript_FaintedMonEnd printstring STRINGID_CANTESCAPE2 BattleScript_FaintedMonTryChooseAnother:: - openpartyscreen 0x3, BattleScript_FaintedMonEnd - switchhandleorder BS_FAINTED, 0x2 + openpartyscreen BS_FAINTED, BattleScript_FaintedMonEnd + switchhandleorder BS_FAINTED, 2 jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonChooseAnother jumpifbattletype BATTLE_TYPE_LINK, BattleScript_FaintedMonChooseAnother jumpifbattletype BATTLE_TYPE_RECORDED_LINK, BattleScript_FaintedMonChooseAnother jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_FaintedMonChooseAnother jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonChooseAnother jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_x400000, BattleScript_FaintedMonChooseAnother - jumpifbyte CMP_EQUAL, sBATTLE_STYLE, 0x1, BattleScript_FaintedMonChooseAnother + jumpifbyte CMP_EQUAL, sBATTLE_STYLE, OPTIONS_BATTLE_STYLE_SET, BattleScript_FaintedMonChooseAnother jumpifcantswitch BS_PLAYER1, BattleScript_FaintedMonChooseAnother printstring STRINGID_ENEMYABOUTTOSWITCHPKMN - setbyte gBattleCommunication, 0x0 + setbyte gBattleCommunication, 0 yesnobox - jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0x1, BattleScript_FaintedMonChooseAnother + jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 1, BattleScript_FaintedMonChooseAnother setatktoplayer0 - openpartyscreen 0x81, BattleScript_FaintedMonChooseAnother - switchhandleorder BS_ATTACKER, 0x2 - jumpifbyte CMP_EQUAL, gBattleCommunication, 0x6, BattleScript_FaintedMonChooseAnother + openpartyscreen BS_ATTACKER | PARTY_SCREEN_OPTIONAL, BattleScript_FaintedMonChooseAnother + switchhandleorder BS_ATTACKER, 2 + jumpifbyte CMP_EQUAL, gBattleCommunication, PARTY_SIZE, BattleScript_FaintedMonChooseAnother atknameinbuff1 resetintimidatetracebits BS_ATTACKER hpthresholds2 BS_ATTACKER @@ -2891,7 +2892,7 @@ BattleScript_FaintedMonTryChooseAnother:: hpthresholds BS_ATTACKER printstring STRINGID_SWITCHINMON hidepartystatussummary BS_ATTACKER - switchinanim BS_ATTACKER, 0x0 + switchinanim BS_ATTACKER, 0 waitstate switchineffects BS_ATTACKER resetsentmonsvalue @@ -2911,14 +2912,14 @@ BattleScript_FaintedMonChooseAnother:: BattleScript_FaintedMonEnd:: end2 -BattleScript_82DA8F6:: - openpartyscreen 0x5, BattleScript_82DA8FC -BattleScript_82DA8FC:: - switchhandleorder BS_FAINTED, 0x0 - openpartyscreen 0x6, BattleScript_82DA92C - switchhandleorder BS_FAINTED, 0x0 -BattleScript_82DA908:: - switchhandleorder BS_FAINTED, 0x3 +BattleScript_HandleFaintedMonMultiple:: + openpartyscreen BS_UNK_5, BattleScript_HandleFaintedMonMultipleStart +BattleScript_HandleFaintedMonMultipleStart:: + switchhandleorder BS_FAINTED, 0 + openpartyscreen BS_UNK_6, BattleScript_HandleFaintedMonMultipleEnd + switchhandleorder BS_FAINTED, 0 +BattleScript_HandleFaintedMonLoop:: + switchhandleorder BS_FAINTED, 3 drawpartystatussummary BS_FAINTED getswitchedmondata BS_FAINTED switchindataupdate BS_FAINTED @@ -2928,8 +2929,8 @@ BattleScript_82DA908:: switchinanim BS_FAINTED, FALSE waitstate switchineffects 5 - jumpifbytenotequal gBattlerFainted, gBattlersCount, BattleScript_82DA908 -BattleScript_82DA92C:: + jumpifbytenotequal gBattlerFainted, gBattlersCount, BattleScript_HandleFaintedMonLoop +BattleScript_HandleFaintedMonMultipleEnd:: end2 BattleScript_LocalTrainerBattleWon:: @@ -3105,10 +3106,10 @@ BattleScript_ActionSwitch:: printstring STRINGID_RETURNMON setbyte sDMG_MULTIPLIER, 2 jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_PursuitSwitchDmgSetMultihit - setmultihit 0x1 + setmultihit 1 goto BattleScript_PursuitSwitchDmgLoop BattleScript_PursuitSwitchDmgSetMultihit:: - setmultihit 0x2 + setmultihit 2 BattleScript_PursuitSwitchDmgLoop:: jumpifnopursuitswitchdmg BattleScript_DoSwitchOut swapattackerwithtarget @@ -3122,7 +3123,7 @@ BattleScript_DoSwitchOut:: returnatktoball waitstate drawpartystatussummary BS_ATTACKER - switchhandleorder BS_ATTACKER, 0x1 + switchhandleorder BS_ATTACKER, 1 getswitchedmondata BS_ATTACKER switchindataupdate BS_ATTACKER hpthresholds BS_ATTACKER @@ -3158,7 +3159,7 @@ BattleScript_PursuitDmgOnSwitchOut:: moveendfromto MOVEEND_ON_DAMAGE_ABILITIES, MOVEEND_CHOICE_MOVE getbattlerfainted BS_TARGET jumpifbyte CMP_EQUAL, gBattleCommunication, FALSE, BattleScript_PursuitDmgOnSwitchOutRet - setbyte sGIVEEXP_STATE, 0x0 + setbyte sGIVEEXP_STATE, 0 getexp BS_TARGET BattleScript_PursuitDmgOnSwitchOutRet: return @@ -3170,7 +3171,7 @@ BattleScript_Pausex20:: BattleScript_LevelUp:: fanfare MUS_LEVEL_UP printstring STRINGID_PKMNGREWTOLV - setbyte sLVLBOX_STATE, 0x0 + setbyte sLVLBOX_STATE, 0 drawlvlupbox handlelearnnewmove BattleScript_LearnedNewMove, BattleScript_LearnMoveReturn, TRUE goto BattleScript_AskToLearnMove @@ -3182,11 +3183,11 @@ BattleScript_AskToLearnMove:: printstring STRINGID_TRYTOLEARNMOVE2 printstring STRINGID_TRYTOLEARNMOVE3 waitstate - setbyte sLEARNMOVE_STATE, 0x0 + setbyte sLEARNMOVE_STATE, 0 yesnoboxlearnmove BattleScript_ForgotAndLearnedNewMove printstring STRINGID_STOPLEARNINGMOVE waitstate - setbyte sLEARNMOVE_STATE, 0x0 + setbyte sLEARNMOVE_STATE, 0 yesnoboxstoplearningmove BattleScript_AskToLearnMove printstring STRINGID_DIDNOTLEARNMOVE goto BattleScript_TryLearnMoveLoop @@ -3216,11 +3217,11 @@ BattleScript_DamagingWeatherContinues:: printfromtable gSandStormHailContinuesStringIds waitmessage B_WAIT_TIME_LONG playanimation2 BS_ATTACKER, sB_ANIM_ARG1, NULL - setbyte gBattleCommunication, 0x0 + setbyte gBattleCommunication, 0 BattleScript_DamagingWeatherLoop:: - copyarraywithindex gBattlerAttacker, gBattlerByTurnOrder, gBattleCommunication, 0x1 + copyarraywithindex gBattlerAttacker, gBattlerByTurnOrder, gBattleCommunication, 1 weatherdamage - jumpifword CMP_EQUAL, gBattleMoveDamage, 0x0, BattleScript_DamagingWeatherLoopIncrement + jumpifword CMP_EQUAL, gBattleMoveDamage, 0, BattleScript_DamagingWeatherLoopIncrement printfromtable gSandStormHailDmgStringIds waitmessage B_WAIT_TIME_LONG orword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE @@ -3232,7 +3233,7 @@ BattleScript_DamagingWeatherLoop:: atk24 BattleScript_DamagingWeatherLoopIncrement BattleScript_DamagingWeatherLoopIncrement:: jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_DamagingWeatherContinuesEnd - addbyte gBattleCommunication, 0x1 + addbyte gBattleCommunication, 1 jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop BattleScript_DamagingWeatherContinuesEnd:: bicword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE @@ -3315,7 +3316,7 @@ BattleScript_BideAttack:: bicbyte gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE copyword gBattleMoveDamage, sBIDE_DMG adjustsetdamage - setbyte sB_ANIM_TURN, 0x1 + setbyte sB_ANIM_TURN, 1 attackanimation waitanimation effectivenesssound @@ -3410,7 +3411,7 @@ BattleScript_SpikesOnAttacker:: return BattleScript_SpikesOnAttackerFainted:: - setbyte sGIVEEXP_STATE, 0x0 + setbyte sGIVEEXP_STATE, 0 getexp BS_ATTACKER moveendall goto BattleScript_HandleFaintedMon @@ -3425,7 +3426,7 @@ BattleScript_SpikesOnTarget:: return BattleScript_SpikesOnTargetFainted:: - setbyte sGIVEEXP_STATE, 0x0 + setbyte sGIVEEXP_STATE, 0 getexp BS_TARGET moveendall goto BattleScript_HandleFaintedMon @@ -3440,7 +3441,7 @@ BattleScript_SpikesOnFaintedBattler:: return BattleScript_SpikesOnFaintedBattlerFainted:: - setbyte sGIVEEXP_STATE, 0x0 + setbyte sGIVEEXP_STATE, 0 getexp BS_FAINTED moveendall goto BattleScript_HandleFaintedMon @@ -3472,7 +3473,7 @@ BattleScript_AllStatsUp:: jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPDEF, MAX_STAT_STAGE, BattleScript_AllStatsUpRet BattleScript_AllStatsUpAtk:: setbyte sSTAT_ANIM_PLAYED, FALSE - playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPEED | BIT_SPATK | BIT_SPDEF, 0x0 + playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPEED | BIT_SPATK | BIT_SPDEF, 0 setstatchanger STAT_ATK, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpDef printfromtable gStatUpStringIds @@ -3602,7 +3603,7 @@ BattleScript_SelectingNotAllowedMoveTauntInPalace:: goto BattleScript_SelectingUnusableMoveInPalace BattleScript_WishComesTrue:: - trywish 0x1, BattleScript_WishButFullHp + trywish 1, BattleScript_WishButFullHp playanimation BS_TARGET, B_ANIM_WISH_HEAL, NULL printstring STRINGID_PKMNWISHCAMETRUE waitmessage B_WAIT_TIME_LONG @@ -4012,10 +4013,10 @@ BattleScript_ShedSkinActivates:: end3 BattleScript_WeatherFormChanges:: - setbyte sBATTLER, 0x0 + setbyte sBATTLER, 0 BattleScript_WeatherFormChangesLoop:: trycastformdatachange - addbyte sBATTLER, 0x1 + addbyte sBATTLER, 1 jumpifbytenotequal sBATTLER, gBattlersCount, BattleScript_WeatherFormChangesLoop return @@ -4037,7 +4038,7 @@ BattleScript_IntimidateActivatesEnd3:: BattleScript_PauseIntimidateActivates: pause B_WAIT_TIME_SHORT BattleScript_IntimidateActivates:: - setbyte gBattlerTarget, 0x0 + setbyte gBattlerTarget, 0 setstatchanger STAT_ATK, 1, TRUE BattleScript_IntimidateActivatesLoop: trygetintimidatetarget BattleScript_IntimidateActivatesReturn @@ -4052,7 +4053,7 @@ BattleScript_IntimidateActivatesLoop: printstring STRINGID_PKMNCUTSATTACKWITH waitmessage B_WAIT_TIME_LONG BattleScript_IntimidateActivatesLoopIncrement: - addbyte gBattlerTarget, 0x1 + addbyte gBattlerTarget, 1 goto BattleScript_IntimidateActivatesLoop BattleScript_IntimidateActivatesReturn: return @@ -4466,18 +4467,19 @@ BattleScript_ArenaTurnBeginning:: pause 8 playse SE_ARENA_TIMEUP1 various14 BS_ATTACKER - arenajudmengtstring 8 - arenawaitmessage 8 + arenajudgmentstring B_MSG_REF_COMMENCE_BATTLE + arenawaitmessage B_MSG_REF_COMMENCE_BATTLE pause B_WAIT_TIME_LONG various15 BS_ATTACKER volumeup end2 - -BattleScript_82DB8E0:: @ Unused battlescript + +@ Unused +BattleScript_ArenaNothingDecided:: playse SE_DING_DONG various14 BS_ATTACKER - arenajudmengtstring BS_TARGET - arenawaitmessage BS_TARGET + arenajudgmentstring B_MSG_REF_NOTHING_IS_DECIDED + arenawaitmessage B_MSG_REF_NOTHING_IS_DECIDED pause B_WAIT_TIME_LONG various15 BS_ATTACKER end2 @@ -4493,26 +4495,26 @@ BattleScript_ArenaDoJudgment:: playse SE_ARENA_TIMEUP1 pause B_WAIT_TIME_LONG various14 BS_ATTACKER - arenajudmengtstring 1 - arenawaitmessage 1 + arenajudgmentstring B_MSG_REF_THATS_IT + arenawaitmessage B_MSG_REF_THATS_IT pause B_WAIT_TIME_LONG - setbyte gBattleCommunication, 0x0 + setbyte gBattleCommunication, 0 arenajudgmentwindow pause B_WAIT_TIME_LONG arenajudgmentwindow - arenajudmengtstring 2 - arenawaitmessage 2 + arenajudgmentstring B_MSG_REF_JUDGE_MIND + arenawaitmessage B_MSG_REF_JUDGE_MIND arenajudgmentwindow - arenajudmengtstring 3 - arenawaitmessage 3 + arenajudgmentstring B_MSG_REF_JUDGE_SKILL + arenawaitmessage B_MSG_REF_JUDGE_SKILL arenajudgmentwindow - arenajudmengtstring 4 - arenawaitmessage 4 + arenajudgmentstring B_MSG_REF_JUDGE_BODY + arenawaitmessage B_MSG_REF_JUDGE_BODY arenajudgmentwindow - jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0x3, BattleScript_ArenaJudgmentPlayerLoses - jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0x4, BattleScript_ArenaJudgmentDraw - arenajudmengtstring 5 - arenawaitmessage 5 + jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 3, BattleScript_ArenaJudgmentPlayerLoses + jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 4, BattleScript_ArenaJudgmentDraw + arenajudgmentstring B_MSG_REF_PLAYER_WON + arenawaitmessage B_MSG_REF_PLAYER_WON arenajudgmentwindow various15 BS_ATTACKER printstring STRINGID_DEFEATEDOPPONENTBYREFEREE @@ -4525,8 +4527,8 @@ BattleScript_ArenaDoJudgment:: end2 BattleScript_ArenaJudgmentPlayerLoses: - arenajudmengtstring 6 - arenawaitmessage 6 + arenajudgmentstring B_MSG_REF_OPPONENT_WON + arenawaitmessage B_MSG_REF_OPPONENT_WON arenajudgmentwindow various15 BS_ATTACKER printstring STRINGID_LOSTTOOPPONENTBYREFEREE @@ -4539,8 +4541,8 @@ BattleScript_ArenaJudgmentPlayerLoses: end2 BattleScript_ArenaJudgmentDraw: - arenajudmengtstring 7 - arenawaitmessage 7 + arenajudgmentstring B_MSG_REF_DRAW + arenawaitmessage B_MSG_REF_DRAW arenajudgmentwindow various15 BS_ATTACKER printstring STRINGID_TIEDOPPONENTBYREFEREE diff --git a/data/battle_scripts_2.s b/data/battle_scripts_2.s index 4b8ca0d87..378819a94 100644 --- a/data/battle_scripts_2.s +++ b/data/battle_scripts_2.s @@ -95,7 +95,7 @@ BattleScript_ShakeBallThrow:: printfromtable gBallEscapeStringIds waitmessage B_WAIT_TIME_LONG jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd - jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0x0, BattleScript_ShakeBallThrowEnd + jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0, BattleScript_ShakeBallThrowEnd printstring STRINGID_OUTOFSAFARIBALLS waitmessage B_WAIT_TIME_LONG setbyte gBattleOutcome, B_OUTCOME_NO_SAFARI_BALLS @@ -111,8 +111,7 @@ BattleScript_TrainerBallBlock:: finishaction BattleScript_PlayerUsesItem:: - setbyte sMOVEEND_STATE, 0xF - moveend 0x1, 0x0 + moveendcase MOVEEND_MIRROR_MOVE end BattleScript_OpponentUsesHealItem:: @@ -128,8 +127,7 @@ BattleScript_OpponentUsesHealItem:: printstring STRINGID_PKMNSITEMRESTOREDHEALTH waitmessage B_WAIT_TIME_LONG updatestatusicon BS_ATTACKER - setbyte sMOVEEND_STATE, 0xF - moveend 0x1, 0x0 + moveendcase MOVEEND_MIRROR_MOVE finishaction BattleScript_OpponentUsesStatusCureItem:: @@ -142,8 +140,7 @@ BattleScript_OpponentUsesStatusCureItem:: printfromtable gTrainerItemCuredStatusStringIds waitmessage B_WAIT_TIME_LONG updatestatusicon BS_ATTACKER - setbyte sMOVEEND_STATE, 0xF - moveend 0x1, 0x0 + moveendcase MOVEEND_MIRROR_MOVE finishaction BattleScript_OpponentUsesXItem:: @@ -155,8 +152,7 @@ BattleScript_OpponentUsesXItem:: useitemonopponent printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG - setbyte sMOVEEND_STATE, 0xF - moveend 0x1, 0x0 + moveendcase MOVEEND_MIRROR_MOVE finishaction BattleScript_OpponentUsesGuardSpecs:: @@ -168,8 +164,7 @@ BattleScript_OpponentUsesGuardSpecs:: useitemonopponent printfromtable gMistUsedStringIds waitmessage B_WAIT_TIME_LONG - setbyte sMOVEEND_STATE, 0xF - moveend 0x1, 0x0 + moveendcase MOVEEND_MIRROR_MOVE finishaction BattleScript_RunByUsingItem:: diff --git a/include/battle_controllers.h b/include/battle_controllers.h index da76ab0c6..34e916b0f 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -156,7 +156,7 @@ enum CONTROLLER_CLEARUNKFLAG, CONTROLLER_TOGGLEUNKFLAG, CONTROLLER_HITANIMATION, - CONTROLLER_42, + CONTROLLER_CANTSWITCH, CONTROLLER_PLAYSE, CONTROLLER_PLAYFANFAREORBGM, CONTROLLER_FAINTINGCRY, @@ -227,7 +227,7 @@ void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused void BtlController_EmitClearUnkFlag(u8 bufferId); // unused void BtlController_EmitToggleUnkFlag(u8 bufferId); // unused void BtlController_EmitHitAnimation(u8 bufferId); -void BtlController_EmitCmd42(u8 bufferId); +void BtlController_EmitCantSwitch(u8 bufferId); void BtlController_EmitPlaySE(u8 bufferId, u16 songId); void BtlController_EmitPlayFanfareOrBGM(u8 bufferId, u16 songId, bool8 playBGM); void BtlController_EmitFaintingCry(u8 bufferId); diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index cef0b184d..9794589af 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -39,8 +39,10 @@ #define BS_ATTACKER 1 #define BS_EFFECT_BATTLER 2 #define BS_FAINTED 3 -#define BS_BATTLER_0 7 #define BS_ATTACKER_WITH_PARTNER 4 // for Cmd_updatestatusicon +#define BS_UNK_5 5 +#define BS_UNK_6 6 +#define BS_BATTLER_0 7 #define BS_ATTACKER_SIDE 8 // for Cmd_jumpifability #define BS_NOT_ATTACKER_SIDE 9 // for Cmd_jumpifability #define BS_SCRIPTING 10 @@ -55,12 +57,12 @@ #define ACC_CURR_MOVE 0 // compare operands -#define CMP_EQUAL 0x0 -#define CMP_NOT_EQUAL 0x1 -#define CMP_GREATER_THAN 0x2 -#define CMP_LESS_THAN 0x3 -#define CMP_COMMON_BITS 0x4 -#define CMP_NO_COMMON_BITS 0x5 +#define CMP_EQUAL 0 +#define CMP_NOT_EQUAL 1 +#define CMP_GREATER_THAN 2 +#define CMP_LESS_THAN 3 +#define CMP_COMMON_BITS 4 +#define CMP_NO_COMMON_BITS 5 // Cmd_various #define VARIOUS_CANCEL_MULTI_TURN_MOVES 0 @@ -93,27 +95,29 @@ #define DMG_DOUBLED 2 // Cmd_jumpifcantswitch -#define SWITCH_IGNORE_ESCAPE_PREVENTION 0x80 +#define SWITCH_IGNORE_ESCAPE_PREVENTION (1 << 7) // Cmd_statbuffchange -#define STAT_BUFF_ALLOW_PTR 0x1 // If set, allow use of jumpptr. Set in every use of statbuffchange -#define STAT_BUFF_NOT_PROTECT_AFFECTED 0x20 +#define STAT_BUFF_ALLOW_PTR (1 << 0) // If set, allow use of jumpptr. Set in every use of statbuffchange +#define STAT_BUFF_NOT_PROTECT_AFFECTED (1 << 5) // stat change flags for Cmd_playstatchangeanimation -#define STAT_CHANGE_NEGATIVE 0x1 -#define STAT_CHANGE_BY_TWO 0x2 -#define STAT_CHANGE_MULTIPLE_STATS 0x4 -#define STAT_CHANGE_CANT_PREVENT 0x8 +#define STAT_CHANGE_NEGATIVE (1 << 0) +#define STAT_CHANGE_BY_TWO (1 << 1) +#define STAT_CHANGE_MULTIPLE_STATS (1 << 2) +#define STAT_CHANGE_CANT_PREVENT (1 << 3) // stat flags for Cmd_playstatchangeanimation -#define BIT_HP 0x1 -#define BIT_ATK 0x2 -#define BIT_DEF 0x4 -#define BIT_SPEED 0x8 -#define BIT_SPATK 0x10 -#define BIT_SPDEF 0x20 -#define BIT_ACC 0x40 -#define BIT_EVASION 0x80 +#define BIT_HP (1 << 0) +#define BIT_ATK (1 << 1) +#define BIT_DEF (1 << 2) +#define BIT_SPEED (1 << 3) +#define BIT_SPATK (1 << 4) +#define BIT_SPDEF (1 << 5) +#define BIT_ACC (1 << 6) +#define BIT_EVASION (1 << 7) + +#define PARTY_SCREEN_OPTIONAL (1 << 7) // Flag for first argument to openpartyscreen // cases for Cmd_moveend #define MOVEEND_RAGE 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index f1c589fee..f22541272 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -421,12 +421,6 @@ #define B_MSG_LEECH_SEED_DRAIN 3 #define B_MSG_LEECH_SEED_OOZE 4 -// gBattlePalaceFlavorTextTable -#define B_MSG_GLINT_IN_EYE 0 -#define B_MSG_GETTING_IN_POS 1 -#define B_MSG_GROWL_DEEPLY 2 -#define B_MSG_EAGER_FOR_MORE 3 - // gFirstTurnOfTwoStringIds #define B_MSG_TURN1_RAZOR_WIND 0 #define B_MSG_TURN1_SOLAR_BEAM 1 @@ -586,4 +580,21 @@ #define B_MSG_DEFROSTED 0 #define B_MSG_DEFROSTED_BY_MOVE 1 +// gBattlePalaceFlavorTextTable +#define B_MSG_GLINT_IN_EYE 0 +#define B_MSG_GETTING_IN_POS 1 +#define B_MSG_GROWL_DEEPLY 2 +#define B_MSG_EAGER_FOR_MORE 3 + +// gRefereeStringsTable +#define B_MSG_REF_NOTHING_IS_DECIDED 0 +#define B_MSG_REF_THATS_IT 1 +#define B_MSG_REF_JUDGE_MIND 2 +#define B_MSG_REF_JUDGE_SKILL 3 +#define B_MSG_REF_JUDGE_BODY 4 +#define B_MSG_REF_PLAYER_WON 5 +#define B_MSG_REF_OPPONENT_WON 6 +#define B_MSG_REF_DRAW 7 +#define B_MSG_REF_COMMENCE_BATTLE 8 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index dd44bc91b..179ae18e8 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -74,7 +74,7 @@ static void LinkOpponentHandleSetUnkVar(void); static void LinkOpponentHandleClearUnkFlag(void); static void LinkOpponentHandleToggleUnkFlag(void); static void LinkOpponentHandleHitAnimation(void); -static void LinkOpponentHandleCmd42(void); +static void LinkOpponentHandleCantSwitch(void); static void LinkOpponentHandlePlaySE(void); static void LinkOpponentHandlePlayFanfareOrBGM(void); static void LinkOpponentHandleFaintingCry(void); @@ -146,7 +146,7 @@ static void (*const sLinkOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_CLEARUNKFLAG] = LinkOpponentHandleClearUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = LinkOpponentHandleToggleUnkFlag, [CONTROLLER_HITANIMATION] = LinkOpponentHandleHitAnimation, - [CONTROLLER_42] = LinkOpponentHandleCmd42, + [CONTROLLER_CANTSWITCH] = LinkOpponentHandleCantSwitch, [CONTROLLER_PLAYSE] = LinkOpponentHandlePlaySE, [CONTROLLER_PLAYFANFAREORBGM] = LinkOpponentHandlePlayFanfareOrBGM, [CONTROLLER_FAINTINGCRY] = LinkOpponentHandleFaintingCry, @@ -1647,7 +1647,7 @@ static void LinkOpponentHandleHitAnimation(void) } } -static void LinkOpponentHandleCmd42(void) +static void LinkOpponentHandleCantSwitch(void) { LinkOpponentBufferExecCompleted(); } diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 3d6cd7c3b..2bb1cd914 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -72,7 +72,7 @@ static void LinkPartnerHandleSetUnkVar(void); static void LinkPartnerHandleClearUnkFlag(void); static void LinkPartnerHandleToggleUnkFlag(void); static void LinkPartnerHandleHitAnimation(void); -static void LinkPartnerHandleCmd42(void); +static void LinkPartnerHandleCantSwitch(void); static void LinkPartnerHandlePlaySE(void); static void LinkPartnerHandlePlayFanfareOrBGM(void); static void LinkPartnerHandleFaintingCry(void); @@ -143,7 +143,7 @@ static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_CLEARUNKFLAG] = LinkPartnerHandleClearUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = LinkPartnerHandleToggleUnkFlag, [CONTROLLER_HITANIMATION] = LinkPartnerHandleHitAnimation, - [CONTROLLER_42] = LinkPartnerHandleCmd42, + [CONTROLLER_CANTSWITCH] = LinkPartnerHandleCantSwitch, [CONTROLLER_PLAYSE] = LinkPartnerHandlePlaySE, [CONTROLLER_PLAYFANFAREORBGM] = LinkPartnerHandlePlayFanfareOrBGM, [CONTROLLER_FAINTINGCRY] = LinkPartnerHandleFaintingCry, @@ -1477,7 +1477,7 @@ static void LinkPartnerHandleHitAnimation(void) } } -static void LinkPartnerHandleCmd42(void) +static void LinkPartnerHandleCantSwitch(void) { LinkPartnerBufferExecCompleted(); } diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 69f729ee0..2c181c14f 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -79,7 +79,7 @@ static void OpponentHandleSetUnkVar(void); static void OpponentHandleClearUnkFlag(void); static void OpponentHandleToggleUnkFlag(void); static void OpponentHandleHitAnimation(void); -static void OpponentHandleCmd42(void); +static void OpponentHandleCantSwitch(void); static void OpponentHandlePlaySE(void); static void OpponentHandlePlayFanfareOrBGM(void); static void OpponentHandleFaintingCry(void); @@ -151,7 +151,7 @@ static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_CLEARUNKFLAG] = OpponentHandleClearUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = OpponentHandleToggleUnkFlag, [CONTROLLER_HITANIMATION] = OpponentHandleHitAnimation, - [CONTROLLER_42] = OpponentHandleCmd42, + [CONTROLLER_CANTSWITCH] = OpponentHandleCantSwitch, [CONTROLLER_PLAYSE] = OpponentHandlePlaySE, [CONTROLLER_PLAYFANFAREORBGM] = OpponentHandlePlayFanfareOrBGM, [CONTROLLER_FAINTINGCRY] = OpponentHandleFaintingCry, @@ -1813,7 +1813,7 @@ static void OpponentHandleHitAnimation(void) } } -static void OpponentHandleCmd42(void) +static void OpponentHandleCantSwitch(void) { OpponentBufferExecCompleted(); } diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 7b5e55adb..e7801d0e4 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -80,7 +80,7 @@ static void PlayerHandleSetUnkVar(void); static void PlayerHandleClearUnkFlag(void); static void PlayerHandleToggleUnkFlag(void); static void PlayerHandleHitAnimation(void); -static void PlayerHandleCmd42(void); +static void PlayerHandleCantSwitch(void); static void PlayerHandlePlaySE(void); static void PlayerHandlePlayFanfareOrBGM(void); static void PlayerHandleFaintingCry(void); @@ -167,7 +167,7 @@ static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_CLEARUNKFLAG] = PlayerHandleClearUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = PlayerHandleToggleUnkFlag, [CONTROLLER_HITANIMATION] = PlayerHandleHitAnimation, - [CONTROLLER_42] = PlayerHandleCmd42, + [CONTROLLER_CANTSWITCH] = PlayerHandleCantSwitch, [CONTROLLER_PLAYSE] = PlayerHandlePlaySE, [CONTROLLER_PLAYFANFAREORBGM] = PlayerHandlePlayFanfareOrBGM, [CONTROLLER_FAINTINGCRY] = PlayerHandleFaintingCry, @@ -2890,7 +2890,7 @@ static void PlayerHandleHitAnimation(void) } } -static void PlayerHandleCmd42(void) +static void PlayerHandleCantSwitch(void) { PlayerBufferExecCompleted(); } diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 251542a48..cc433a9b2 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -70,7 +70,7 @@ static void PlayerPartnerHandleSetUnkVar(void); static void PlayerPartnerHandleClearUnkFlag(void); static void PlayerPartnerHandleToggleUnkFlag(void); static void PlayerPartnerHandleHitAnimation(void); -static void PlayerPartnerHandleCmd42(void); +static void PlayerPartnerHandleCantSwitch(void); static void PlayerPartnerHandlePlaySE(void); static void PlayerPartnerHandlePlayFanfareOrBGM(void); static void PlayerPartnerHandleFaintingCry(void); @@ -146,7 +146,7 @@ static void (*const sPlayerPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_CLEARUNKFLAG] = PlayerPartnerHandleClearUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = PlayerPartnerHandleToggleUnkFlag, [CONTROLLER_HITANIMATION] = PlayerPartnerHandleHitAnimation, - [CONTROLLER_42] = PlayerPartnerHandleCmd42, + [CONTROLLER_CANTSWITCH] = PlayerPartnerHandleCantSwitch, [CONTROLLER_PLAYSE] = PlayerPartnerHandlePlaySE, [CONTROLLER_PLAYFANFAREORBGM] = PlayerPartnerHandlePlayFanfareOrBGM, [CONTROLLER_FAINTINGCRY] = PlayerPartnerHandleFaintingCry, @@ -1727,7 +1727,7 @@ static void PlayerPartnerHandleHitAnimation(void) } } -static void PlayerPartnerHandleCmd42(void) +static void PlayerPartnerHandleCantSwitch(void) { PlayerPartnerBufferExecCompleted(); } diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 26d93ad28..663d71ec7 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -74,7 +74,7 @@ static void RecordedOpponentHandleSetUnkVar(void); static void RecordedOpponentHandleClearUnkFlag(void); static void RecordedOpponentHandleToggleUnkFlag(void); static void RecordedOpponentHandleHitAnimation(void); -static void RecordedOpponentHandleCmd42(void); +static void RecordedOpponentHandleCantSwitch(void); static void RecordedOpponentHandlePlaySE(void); static void RecordedOpponentHandlePlayFanfareOrBGM(void); static void RecordedOpponentHandleFaintingCry(void); @@ -146,7 +146,7 @@ static void (*const sRecordedOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void [CONTROLLER_CLEARUNKFLAG] = RecordedOpponentHandleClearUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = RecordedOpponentHandleToggleUnkFlag, [CONTROLLER_HITANIMATION] = RecordedOpponentHandleHitAnimation, - [CONTROLLER_42] = RecordedOpponentHandleCmd42, + [CONTROLLER_CANTSWITCH] = RecordedOpponentHandleCantSwitch, [CONTROLLER_PLAYSE] = RecordedOpponentHandlePlaySE, [CONTROLLER_PLAYFANFAREORBGM] = RecordedOpponentHandlePlayFanfareOrBGM, [CONTROLLER_FAINTINGCRY] = RecordedOpponentHandleFaintingCry, @@ -1587,7 +1587,7 @@ static void RecordedOpponentHandleHitAnimation(void) } } -static void RecordedOpponentHandleCmd42(void) +static void RecordedOpponentHandleCantSwitch(void) { RecordedOpponentBufferExecCompleted(); } diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 63a04ac40..aa4154a3f 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -70,7 +70,7 @@ static void RecordedPlayerHandleSetUnkVar(void); static void RecordedPlayerHandleClearUnkFlag(void); static void RecordedPlayerHandleToggleUnkFlag(void); static void RecordedPlayerHandleHitAnimation(void); -static void RecordedPlayerHandleCmd42(void); +static void RecordedPlayerHandleCantSwitch(void); static void RecordedPlayerHandlePlaySE(void); static void RecordedPlayerHandlePlayFanfareOrBGM(void); static void RecordedPlayerHandleFaintingCry(void); @@ -141,7 +141,7 @@ static void (*const sRecordedPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) [CONTROLLER_CLEARUNKFLAG] = RecordedPlayerHandleClearUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = RecordedPlayerHandleToggleUnkFlag, [CONTROLLER_HITANIMATION] = RecordedPlayerHandleHitAnimation, - [CONTROLLER_42] = RecordedPlayerHandleCmd42, + [CONTROLLER_CANTSWITCH] = RecordedPlayerHandleCantSwitch, [CONTROLLER_PLAYSE] = RecordedPlayerHandlePlaySE, [CONTROLLER_PLAYFANFAREORBGM] = RecordedPlayerHandlePlayFanfareOrBGM, [CONTROLLER_FAINTINGCRY] = RecordedPlayerHandleFaintingCry, @@ -1610,7 +1610,7 @@ static void RecordedPlayerHandleHitAnimation(void) } } -static void RecordedPlayerHandleCmd42(void) +static void RecordedPlayerHandleCantSwitch(void) { RecordedPlayerBufferExecCompleted(); } diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index 22c01586d..0fdf32fb6 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -67,7 +67,7 @@ static void SafariHandleSetUnkVar(void); static void SafariHandleClearUnkFlag(void); static void SafariHandleToggleUnkFlag(void); static void SafariHandleHitAnimation(void); -static void SafariHandleCmd42(void); +static void SafariHandleCantSwitch(void); static void SafariHandlePlaySE(void); static void SafariHandlePlayFanfareOrBGM(void); static void SafariHandleFaintingCry(void); @@ -131,7 +131,7 @@ static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_CLEARUNKFLAG] = SafariHandleClearUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = SafariHandleToggleUnkFlag, [CONTROLLER_HITANIMATION] = SafariHandleHitAnimation, - [CONTROLLER_42] = SafariHandleCmd42, + [CONTROLLER_CANTSWITCH] = SafariHandleCantSwitch, [CONTROLLER_PLAYSE] = SafariHandlePlaySE, [CONTROLLER_PLAYFANFAREORBGM] = SafariHandlePlayFanfareOrBGM, [CONTROLLER_FAINTINGCRY] = SafariHandleFaintingCry, @@ -580,7 +580,7 @@ static void SafariHandleHitAnimation(void) SafariBufferExecCompleted(); } -static void SafariHandleCmd42(void) +static void SafariHandleCantSwitch(void) { SafariBufferExecCompleted(); } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index 8b3863c85..8b490a5bf 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -75,7 +75,7 @@ static void WallyHandleSetUnkVar(void); static void WallyHandleClearUnkFlag(void); static void WallyHandleToggleUnkFlag(void); static void WallyHandleHitAnimation(void); -static void WallyHandleCmd42(void); +static void WallyHandleCantSwitch(void); static void WallyHandlePlaySE(void); static void WallyHandlePlayFanfareOrBGM(void); static void WallyHandleFaintingCry(void); @@ -144,7 +144,7 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_CLEARUNKFLAG] = WallyHandleClearUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = WallyHandleToggleUnkFlag, [CONTROLLER_HITANIMATION] = WallyHandleHitAnimation, - [CONTROLLER_42] = WallyHandleCmd42, + [CONTROLLER_CANTSWITCH] = WallyHandleCantSwitch, [CONTROLLER_PLAYSE] = WallyHandlePlaySE, [CONTROLLER_PLAYFANFAREORBGM] = WallyHandlePlayFanfareOrBGM, [CONTROLLER_FAINTINGCRY] = WallyHandleFaintingCry, @@ -1385,7 +1385,7 @@ static void WallyHandleHitAnimation(void) } } -static void WallyHandleCmd42(void) +static void WallyHandleCantSwitch(void) { WallyBufferExecCompleted(); } diff --git a/src/battle_controllers.c b/src/battle_controllers.c index a9f3ab610..0f3234579 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -1385,12 +1385,12 @@ void BtlController_EmitHitAnimation(u8 bufferId) PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitCmd42(u8 bufferId) +void BtlController_EmitCantSwitch(u8 bufferId) { - sBattleBuffersTransferData[0] = CONTROLLER_42; - sBattleBuffersTransferData[1] = CONTROLLER_42; - sBattleBuffersTransferData[2] = CONTROLLER_42; - sBattleBuffersTransferData[3] = CONTROLLER_42; + sBattleBuffersTransferData[0] = CONTROLLER_CANTSWITCH; + sBattleBuffersTransferData[1] = CONTROLLER_CANTSWITCH; + sBattleBuffersTransferData[2] = CONTROLLER_CANTSWITCH; + sBattleBuffersTransferData[3] = CONTROLLER_CANTSWITCH; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } diff --git a/src/battle_message.c b/src/battle_message.c index 4f219c063..7472e2e89 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1401,9 +1401,9 @@ static const u8 sText_RefThatsIt[] = _("REFEREE: That's it! We will now go to\nj static const u8 sText_RefJudgeMind[] = _("REFEREE: Judging category 1, Mind!\nThe POKéMON showing the most guts!\p"); static const u8 sText_RefJudgeSkill[] = _("REFEREE: Judging category 2, Skill!\nThe POKéMON using moves the best!\p"); static const u8 sText_RefJudgeBody[] = _("REFEREE: Judging category 3, Body!\nThe POKéMON with the most vitality!\p"); -static const u8 sText_RefJudgement1[] = _("REFEREE: Judgment: {B_BUFF1} to {B_BUFF2}!\nThe winner is {B_PLAYER_NAME}'s {B_PLAYER_MON1_NAME}!\p"); -static const u8 sText_RefJudgement2[] = _("REFEREE: Judgment: {B_BUFF1} to {B_BUFF2}!\nThe winner is {B_TRAINER1_NAME}'s {B_OPPONENT_MON1_NAME}!\p"); -static const u8 sText_RefJudgement3[] = _("REFEREE: Judgment: 3 to 3!\nWe have a draw!\p"); +static const u8 sText_RefPlayerWon[] = _("REFEREE: Judgment: {B_BUFF1} to {B_BUFF2}!\nThe winner is {B_PLAYER_NAME}'s {B_PLAYER_MON1_NAME}!\p"); +static const u8 sText_RefOpponentWon[] = _("REFEREE: Judgment: {B_BUFF1} to {B_BUFF2}!\nThe winner is {B_TRAINER1_NAME}'s {B_OPPONENT_MON1_NAME}!\p"); +static const u8 sText_RefDraw[] = _("REFEREE: Judgment: 3 to 3!\nWe have a draw!\p"); static const u8 sText_DefeatedOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} defeated the opponent\n{B_OPPONENT_MON1_NAME} in a REFEREE's decision!"); static const u8 sText_LostToOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} lost to the opponent\n{B_OPPONENT_MON1_NAME} in a REFEREE's decision!"); static const u8 sText_TiedOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} tied the opponent\n{B_OPPONENT_MON1_NAME} in a REFEREE's decision!"); @@ -1411,15 +1411,15 @@ static const u8 sText_RefCommenceBattle[] = _("REFEREE: {B_PLAYER_MON1_NAME} VS const u8 * const gRefereeStringsTable[] = { - sText_RefIfNothingIsDecided, - sText_RefThatsIt, - sText_RefJudgeMind, - sText_RefJudgeSkill, - sText_RefJudgeBody, - sText_RefJudgement1, - sText_RefJudgement2, - sText_RefJudgement3, - sText_RefCommenceBattle, + [B_MSG_REF_NOTHING_IS_DECIDED] = sText_RefIfNothingIsDecided, + [B_MSG_REF_THATS_IT] = sText_RefThatsIt, + [B_MSG_REF_JUDGE_MIND] = sText_RefJudgeMind, + [B_MSG_REF_JUDGE_SKILL] = sText_RefJudgeSkill, + [B_MSG_REF_JUDGE_BODY] = sText_RefJudgeBody, + [B_MSG_REF_PLAYER_WON] = sText_RefPlayerWon, + [B_MSG_REF_OPPONENT_WON] = sText_RefOpponentWon, + [B_MSG_REF_DRAW] = sText_RefDraw, + [B_MSG_REF_COMMENCE_BATTLE] = sText_RefCommenceBattle, }; static const u8 sText_QuestionForfeitMatch[] = _("Would you like to forfeit the match\nand quit now?"); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6cd7debda..3962c4369 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4801,7 +4801,9 @@ static void Cmd_jumpifcantswitch(void) } } -static void sub_804CF10(u8 slotId) +// Opens the party screen to choose a new Pokémon to send out +// slotId is the Pokémon to replace +static void ChooseMonToSendOut(u8 slotId) { *(gBattleStruct->field_58 + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler]; *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; @@ -4822,7 +4824,7 @@ static void Cmd_openpartyscreen(void) flags = 0; jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 2); - if (gBattlescriptCurrInstr[1] == 5) + if (gBattlescriptCurrInstr[1] == BS_UNK_5) { if ((gBattleTypeFlags & (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_MULTI)) != BATTLE_TYPE_DOUBLE) { @@ -4830,7 +4832,7 @@ static void Cmd_openpartyscreen(void) { if (gHitMarker & HITMARKER_FAINTED(gActiveBattler)) { - if (HasNoMonsToSwitch(gActiveBattler, 6, 6)) + if (HasNoMonsToSwitch(gActiveBattler, PARTY_SIZE, PARTY_SIZE)) { gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); @@ -4839,7 +4841,7 @@ static void Cmd_openpartyscreen(void) } else if (!gSpecialStatuses[gActiveBattler].flag40) { - sub_804CF10(PARTY_SIZE); + ChooseMonToSendOut(PARTY_SIZE); gSpecialStatuses[gActiveBattler].flag40 = 1; } } @@ -4859,16 +4861,16 @@ static void Cmd_openpartyscreen(void) if (gBitTable[0] & hitmarkerFaintBits) { gActiveBattler = 0; - if (HasNoMonsToSwitch(0, 6, 6)) + if (HasNoMonsToSwitch(0, PARTY_SIZE, PARTY_SIZE)) { gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); - BtlController_EmitCmd42(0); + BtlController_EmitCantSwitch(0); MarkBattlerForControllerExec(gActiveBattler); } else if (!gSpecialStatuses[gActiveBattler].flag40) { - sub_804CF10(gBattleStruct->monToSwitchIntoId[2]); + ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[2]); gSpecialStatuses[gActiveBattler].flag40 = 1; } else @@ -4881,16 +4883,16 @@ static void Cmd_openpartyscreen(void) if (gBitTable[2] & hitmarkerFaintBits && !(gBitTable[0] & hitmarkerFaintBits)) { gActiveBattler = 2; - if (HasNoMonsToSwitch(2, 6, 6)) + if (HasNoMonsToSwitch(2, PARTY_SIZE, PARTY_SIZE)) { gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); - BtlController_EmitCmd42(0); + BtlController_EmitCantSwitch(0); MarkBattlerForControllerExec(gActiveBattler); } else if (!gSpecialStatuses[gActiveBattler].flag40) { - sub_804CF10(gBattleStruct->monToSwitchIntoId[0]); + ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[0]); gSpecialStatuses[gActiveBattler].flag40 = 1; } else if (!(flags & 1)) @@ -4902,16 +4904,16 @@ static void Cmd_openpartyscreen(void) if (gBitTable[1] & hitmarkerFaintBits) { gActiveBattler = 1; - if (HasNoMonsToSwitch(1, 6, 6)) + if (HasNoMonsToSwitch(1, PARTY_SIZE, PARTY_SIZE)) { gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); - BtlController_EmitCmd42(0); + BtlController_EmitCantSwitch(0); MarkBattlerForControllerExec(gActiveBattler); } else if (!gSpecialStatuses[gActiveBattler].flag40) { - sub_804CF10(gBattleStruct->monToSwitchIntoId[3]); + ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[3]); gSpecialStatuses[gActiveBattler].flag40 = 1; } else @@ -4924,16 +4926,16 @@ static void Cmd_openpartyscreen(void) if (gBitTable[3] & hitmarkerFaintBits && !(gBitTable[1] & hitmarkerFaintBits)) { gActiveBattler = 3; - if (HasNoMonsToSwitch(3, 6, 6)) + if (HasNoMonsToSwitch(3, PARTY_SIZE, PARTY_SIZE)) { gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); - BtlController_EmitCmd42(0); + BtlController_EmitCantSwitch(0); MarkBattlerForControllerExec(gActiveBattler); } else if (!gSpecialStatuses[gActiveBattler].flag40) { - sub_804CF10(gBattleStruct->monToSwitchIntoId[1]); + ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[1]); gSpecialStatuses[gActiveBattler].flag40 = 1; } else if (!(flags & 2)) @@ -4977,7 +4979,7 @@ static void Cmd_openpartyscreen(void) } gBattlescriptCurrInstr += 6; } - else if (gBattlescriptCurrInstr[1] == 6) + else if (gBattlescriptCurrInstr[1] == BS_UNK_6) { if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { @@ -4987,32 +4989,32 @@ static void Cmd_openpartyscreen(void) if (gBitTable[2] & hitmarkerFaintBits && gBitTable[0] & hitmarkerFaintBits) { gActiveBattler = 2; - if (HasNoMonsToSwitch(2, gBattleBufferB[0][1], 6)) + if (HasNoMonsToSwitch(2, gBattleBufferB[0][1], PARTY_SIZE)) { gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); - BtlController_EmitCmd42(0); + BtlController_EmitCantSwitch(0); MarkBattlerForControllerExec(gActiveBattler); } else if (!gSpecialStatuses[gActiveBattler].flag40) { - sub_804CF10(gBattleStruct->monToSwitchIntoId[0]); + ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[0]); gSpecialStatuses[gActiveBattler].flag40 = 1; } } if (gBitTable[3] & hitmarkerFaintBits && hitmarkerFaintBits & gBitTable[1]) { gActiveBattler = 3; - if (HasNoMonsToSwitch(3, gBattleBufferB[1][1], 6)) + if (HasNoMonsToSwitch(3, gBattleBufferB[1][1], PARTY_SIZE)) { gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); - BtlController_EmitCmd42(0); + BtlController_EmitCantSwitch(0); MarkBattlerForControllerExec(gActiveBattler); } else if (!gSpecialStatuses[gActiveBattler].flag40) { - sub_804CF10(gBattleStruct->monToSwitchIntoId[1]); + ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[1]); gSpecialStatuses[gActiveBattler].flag40 = 1; } } @@ -5040,17 +5042,17 @@ static void Cmd_openpartyscreen(void) } else { - if (gBattlescriptCurrInstr[1] & 0x80) + if (gBattlescriptCurrInstr[1] & PARTY_SCREEN_OPTIONAL) hitmarkerFaintBits = PARTY_ACTION_CHOOSE_MON; // Used here as the caseId for the EmitChoose function. else hitmarkerFaintBits = PARTY_ACTION_SEND_OUT; - battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(0x80)); + battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(PARTY_SCREEN_OPTIONAL)); if (gSpecialStatuses[battlerId].flag40) { gBattlescriptCurrInstr += 6; } - else if (HasNoMonsToSwitch(battlerId, 6, 6)) + else if (HasNoMonsToSwitch(battlerId, PARTY_SIZE, PARTY_SIZE)) { gActiveBattler = battlerId; gAbsentBattlerFlags |= gBitTable[gActiveBattler]; @@ -6372,10 +6374,10 @@ static void Cmd_various(void) break; case VARIOUS_ARENA_JUDGMENT_STRING: BattleStringExpandPlaceholdersToDisplayedString(gRefereeStringsTable[gBattlescriptCurrInstr[1]]); - BattlePutTextOnWindow(gDisplayedStringBattle, 0x16); + BattlePutTextOnWindow(gDisplayedStringBattle, 22); break; case VARIOUS_ARENA_WAIT_STRING: - if (IsTextPrinterActive(0x16)) + if (IsTextPrinterActive(22)) return; break; case VARIOUS_WAIT_CRY: @@ -7313,7 +7315,7 @@ static void Cmd_tryconversiontypechange(void) // randomly changes user's type to do { - while ((moveChecked = Random() & 3) >= validMoves); + while ((moveChecked = Random() & (MAX_MON_MOVES - 1)) >= validMoves); moveType = gBattleMoves[gBattleMons[gBattlerAttacker].moves[moveChecked]].type; @@ -8138,7 +8140,7 @@ static void Cmd_trychoosesleeptalkmove(void) do { - movePosition = Random() & 3; + movePosition = Random() & (MAX_MON_MOVES - 1); } while ((gBitTable[movePosition] & unusableMovesBits)); gCalledMove = gBattleMons[gBattlerAttacker].moves[movePosition]; diff --git a/src/battle_util.c b/src/battle_util.c index 6fb307d63..e2dfeef27 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1874,7 +1874,7 @@ bool8 HandleFaintedMonActions(void) gBattleStruct->faintedActionsState++; for (i = 0; i < gBattlersCount; i++) { - if (gAbsentBattlerFlags & gBitTable[i] && !HasNoMonsToSwitch(i, 6, 6)) + if (gAbsentBattlerFlags & gBitTable[i] && !HasNoMonsToSwitch(i, PARTY_SIZE, PARTY_SIZE)) gAbsentBattlerFlags &= ~(gBitTable[i]); } // fall through From b6711441f548dfac4a9b1c69d19aa3d28a3b1ec3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 3 Apr 2021 15:18:17 -0400 Subject: [PATCH 07/63] Fix AI Guard Spec use, and Specs->Spec --- data/battle_scripts_2.s | 4 ++-- include/battle_ai_switch_items.h | 2 +- src/battle_ai_switch_items.c | 4 ++-- src/battle_util.c | 13 +++++++++++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/data/battle_scripts_2.s b/data/battle_scripts_2.s index 378819a94..996048dd3 100644 --- a/data/battle_scripts_2.s +++ b/data/battle_scripts_2.s @@ -34,7 +34,7 @@ gBattlescriptsForUsingItem:: @ 82DBD3C .4byte BattleScript_OpponentUsesHealItem @ AI_ITEM_HEAL_HP .4byte BattleScript_OpponentUsesStatusCureItem @ AI_ITEM_CURE_CONDITION .4byte BattleScript_OpponentUsesXItem @ AI_ITEM_X_STAT - .4byte BattleScript_OpponentUsesGuardSpecs @ AI_ITEM_GUARD_SPECS + .4byte BattleScript_OpponentUsesGuardSpec @ AI_ITEM_GUARD_SPEC .align 2 gBattlescriptsForRunningByItem:: @ 82DBD54 @@ -155,7 +155,7 @@ BattleScript_OpponentUsesXItem:: moveendcase MOVEEND_MIRROR_MOVE finishaction -BattleScript_OpponentUsesGuardSpecs:: +BattleScript_OpponentUsesGuardSpec:: printstring STRINGID_EMPTYSTRING3 pause B_WAIT_TIME_MED playse SE_USE_ITEM diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h index db390346d..a0b6fe62c 100644 --- a/include/battle_ai_switch_items.h +++ b/include/battle_ai_switch_items.h @@ -7,7 +7,7 @@ enum AI_ITEM_HEAL_HP, AI_ITEM_CURE_CONDITION, AI_ITEM_X_STAT, - AI_ITEM_GUARD_SPECS, + AI_ITEM_GUARD_SPEC, AI_ITEM_NOT_RECOGNIZABLE }; diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index e92630808..04122b17d 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -789,7 +789,7 @@ static u8 GetAI_ItemType(u8 itemId, const u8 *itemEffect) // NOTE: should take u else if (itemEffect[0] & (ITEM0_DIRE_HIT | ITEM0_X_ATTACK) || itemEffect[1] != 0 || itemEffect[2] != 0) return AI_ITEM_X_STAT; else if (itemEffect[3] & ITEM3_GUARD_SPEC) - return AI_ITEM_GUARD_SPECS; + return AI_ITEM_GUARD_SPEC; else return AI_ITEM_NOT_RECOGNIZABLE; } @@ -911,7 +911,7 @@ static bool8 ShouldUseItem(void) *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_DIRE_HIT); shouldUse = TRUE; break; - case AI_ITEM_GUARD_SPECS: + case AI_ITEM_GUARD_SPEC: battlerSide = GetBattlerSide(gActiveBattler); if (gDisableStructs[gActiveBattler].isFirstTurn != 0 && gSideTimers[battlerSide].mistTimer == 0) shouldUse = TRUE; diff --git a/src/battle_util.c b/src/battle_util.c index e2dfeef27..cbcd445b7 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -378,10 +378,19 @@ void HandleAction_UseItem(void) gBattleScripting.animArg2 = 0; } break; - case AI_ITEM_GUARD_SPECS: + case AI_ITEM_GUARD_SPEC: + // It seems probable that at some point there was a special message for + // an AI trainer using Guard Spec in a double battle. + // There isn't now however, and the assignment to 2 below goes out of + // bounds for gMistUsedStringIds and instead prints "{mon} is getting pumped" + // from the next table, gFocusEnergyUsedStringIds. + // In any case this isn't an issue in the retail version, as no trainers + // are ever given any Guard Spec to use. +#ifndef UBFIX if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - gBattleCommunication[MULTISTRING_CHOOSER] = 2; // Going OOB for gMistUsedStringIds? + gBattleCommunication[MULTISTRING_CHOOSER] = 2; else +#endif gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_MIST; break; } From fe1b757af5ae8e8942d747863d04c4c33e5399d8 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 3 Apr 2021 16:37:00 -0400 Subject: [PATCH 08/63] Some constant use in WallyHandleActions --- src/battle_controller_wally.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index 8b490a5bf..0d1515213 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -190,7 +190,7 @@ static void WallyHandleActions(void) switch (gBattleStruct->wallyBattleState) { case 0: - gBattleStruct->wallyWaitFrames = 64; + gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG; gBattleStruct->wallyBattleState++; case 1: if (--gBattleStruct->wallyWaitFrames == 0) @@ -200,7 +200,7 @@ static void WallyHandleActions(void) WallyBufferExecCompleted(); gBattleStruct->wallyBattleState++; gBattleStruct->wallyMovesState = 0; - gBattleStruct->wallyWaitFrames = 64; + gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG; } break; case 2: @@ -211,17 +211,17 @@ static void WallyHandleActions(void) WallyBufferExecCompleted(); gBattleStruct->wallyBattleState++; gBattleStruct->wallyMovesState = 0; - gBattleStruct->wallyWaitFrames = 64; + gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG; } break; case 3: if (--gBattleStruct->wallyWaitFrames == 0) { - BtlController_EmitTwoReturnValues(1, 9, 0); + BtlController_EmitTwoReturnValues(1, B_ACTION_WALLY_THROW, 0); WallyBufferExecCompleted(); gBattleStruct->wallyBattleState++; gBattleStruct->wallyMovesState = 0; - gBattleStruct->wallyWaitFrames = 64; + gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG; } break; case 4: @@ -230,7 +230,7 @@ static void WallyHandleActions(void) PlaySE(SE_SELECT); ActionSelectionDestroyCursorAt(0); ActionSelectionCreateCursorAt(1, 0); - gBattleStruct->wallyWaitFrames = 64; + gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG; gBattleStruct->wallyBattleState++; } break; From 1494a8303579e2bd92d24554b1f3e1cebd97a273 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 3 Apr 2021 22:47:58 -0400 Subject: [PATCH 09/63] Sync drought with pokefirered, add weather tags --- include/field_weather.h | 28 ++++++++++++---- src/field_weather.c | 54 +++++++++++++++--------------- src/field_weather_effect.c | 68 +++++++++++++++++++------------------- 3 files changed, 82 insertions(+), 68 deletions(-) diff --git a/include/field_weather.h b/include/field_weather.h index 9ecf52501..894c661be 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -4,6 +4,21 @@ #include "sprite.h" #include "constants/field_weather.h" +#define TAG_WEATHER_START 0x1200 +enum { + GFXTAG_CLOUD = TAG_WEATHER_START, + GFXTAG_FOG_H, + GFXTAG_ASH, + GFXTAG_FOG_D, + GFXTAG_SANDSTORM, + GFXTAG_BUBBLE, + GFXTAG_RAIN, +}; +enum { + PALTAG_WEATHER = TAG_WEATHER_START, + PALTAG_WEATHER_2 +}; + struct Weather { union @@ -105,10 +120,10 @@ struct Weather u8 blendFrameCounter; u8 blendDelay; u8 filler_73B[0x3C-0x3B]; - s16 unknown_73C; - s16 unknown_73E; - s16 unknown_740; - s16 unknown_742; + s16 droughtBrightnessStage; + s16 droughtLastBrightnessStage; + s16 droughtTimer; + s16 droughtState; u8 filler_744[0xD-4]; s8 loadDroughtPalsIndex; u8 loadDroughtPalsOffset; @@ -136,9 +151,8 @@ u8 sub_80ABF20(void); void LoadCustomWeatherSpritePalette(const u16 *palette); void ResetDroughtWeatherPaletteLoading(void); bool8 LoadDroughtWeatherPalettes(void); -void sub_80ABFE0(s8 gammaIndex); -void sub_80ABFF0(void); -void sub_80AC01C(void); +void DroughtStateInit(void); +void DroughtStateRun(void); void Weather_SetBlendCoeffs(u8 eva, u8 evb); void Weather_SetTargetBlendCoeffs(u8 eva, u8 evb, int delay); bool8 Weather_UpdateBlend(void); diff --git a/src/field_weather.c b/src/field_weather.c index 655e24590..331f0be78 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -160,11 +160,11 @@ void StartWeather(void) { if (!FuncIsActiveTask(Task_WeatherMain)) { - u8 index = AllocSpritePalette(0x1200); + u8 index = AllocSpritePalette(TAG_WEATHER_START); CpuCopy32(gFogPalette, &gPlttBufferUnfaded[0x100 + index * 16], 32); BuildGammaShiftTables(); gWeatherPtr->altGammaSpritePalIndex = index; - gWeatherPtr->weatherPicSpritePalIndex = AllocSpritePalette(0x1201); + gWeatherPtr->weatherPicSpritePalIndex = AllocSpritePalette(PALTAG_WEATHER_2); gWeatherPtr->rainSpriteCount = 0; gWeatherPtr->curRainSpriteIndex = 0; gWeatherPtr->cloudSpritesCreated = 0; @@ -885,50 +885,50 @@ bool8 LoadDroughtWeatherPalettes(void) return FALSE; } -void sub_80ABFE0(s8 gammaIndex) +static void SetDroughtGamma(s8 gammaIndex) { sub_80ABC48(-gammaIndex - 1); } -void sub_80ABFF0(void) +void DroughtStateInit(void) { - gWeatherPtr->unknown_73C = 0; - gWeatherPtr->unknown_740 = 0; - gWeatherPtr->unknown_742 = 0; - gWeatherPtr->unknown_73E = 0; + gWeatherPtr->droughtBrightnessStage = 0; + gWeatherPtr->droughtTimer = 0; + gWeatherPtr->droughtState = 0; + gWeatherPtr->droughtLastBrightnessStage = 0; } -void sub_80AC01C(void) +void DroughtStateRun(void) { - switch (gWeatherPtr->unknown_742) + switch (gWeatherPtr->droughtState) { case 0: - if (++gWeatherPtr->unknown_740 > 5) + if (++gWeatherPtr->droughtTimer > 5) { - gWeatherPtr->unknown_740 = 0; - sub_80ABFE0(gWeatherPtr->unknown_73C++); - if (gWeatherPtr->unknown_73C > 5) + gWeatherPtr->droughtTimer = 0; + SetDroughtGamma(gWeatherPtr->droughtBrightnessStage++); + if (gWeatherPtr->droughtBrightnessStage > 5) { - gWeatherPtr->unknown_73E = gWeatherPtr->unknown_73C; - gWeatherPtr->unknown_742 = 1; - gWeatherPtr->unknown_740 = 0x3C; + gWeatherPtr->droughtLastBrightnessStage = gWeatherPtr->droughtBrightnessStage; + gWeatherPtr->droughtState = 1; + gWeatherPtr->droughtTimer = 60; } } break; case 1: - gWeatherPtr->unknown_740 = (gWeatherPtr->unknown_740 + 3) & 0x7F; - gWeatherPtr->unknown_73C = ((gSineTable[gWeatherPtr->unknown_740] - 1) >> 6) + 2; - if (gWeatherPtr->unknown_73C != gWeatherPtr->unknown_73E) - sub_80ABFE0(gWeatherPtr->unknown_73C); - gWeatherPtr->unknown_73E = gWeatherPtr->unknown_73C; + gWeatherPtr->droughtTimer = (gWeatherPtr->droughtTimer + 3) & 0x7F; + gWeatherPtr->droughtBrightnessStage = ((gSineTable[gWeatherPtr->droughtTimer] - 1) >> 6) + 2; + if (gWeatherPtr->droughtBrightnessStage != gWeatherPtr->droughtLastBrightnessStage) + SetDroughtGamma(gWeatherPtr->droughtBrightnessStage); + gWeatherPtr->droughtLastBrightnessStage = gWeatherPtr->droughtBrightnessStage; break; case 2: - if (++gWeatherPtr->unknown_740 > 5) + if (++gWeatherPtr->droughtTimer > 5) { - gWeatherPtr->unknown_740 = 0; - sub_80ABFE0(--gWeatherPtr->unknown_73C); - if (gWeatherPtr->unknown_73C == 3) - gWeatherPtr->unknown_742 = 0; + gWeatherPtr->droughtTimer = 0; + SetDroughtGamma(--gWeatherPtr->droughtBrightnessStage); + if (gWeatherPtr->droughtBrightnessStage == 3) + gWeatherPtr->droughtState = 0; } break; } diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 320a10670..b8a09faad 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -51,7 +51,7 @@ static const struct SpriteSheet sCloudSpriteSheet = { .data = gWeatherCloudTiles, .size = sizeof(gWeatherCloudTiles), - .tag = 0x1200 + .tag = GFXTAG_CLOUD }; static const struct OamData sCloudSpriteOamData = @@ -84,8 +84,8 @@ static const union AnimCmd *const sCloudSpriteAnimCmds[] = static const struct SpriteTemplate sCloudSpriteTemplate = { - .tileTag = 0x1200, - .paletteTag = 0x1201, + .tileTag = GFXTAG_CLOUD, + .paletteTag = PALTAG_WEATHER_2, .oam = &sCloudSpriteOamData, .anims = sCloudSpriteAnimCmds, .images = NULL, @@ -214,7 +214,7 @@ static void DestroyCloudSprites(void) DestroySprite(gWeatherPtr->sprites.s1.cloudSprites[i]); } - FreeSpriteTilesByTag(0x1200); + FreeSpriteTilesByTag(GFXTAG_CLOUD); gWeatherPtr->cloudSpritesCreated = FALSE; } @@ -264,19 +264,19 @@ void Drought_Main(void) gWeatherPtr->initStep++; break; case 3: - sub_80ABFF0(); + DroughtStateInit(); gWeatherPtr->initStep++; break; case 4: - sub_80AC01C(); - if (gWeatherPtr->unknown_73C == 6) + DroughtStateRun(); + if (gWeatherPtr->droughtBrightnessStage == 6) { gWeatherPtr->weatherGfxLoaded = TRUE; gWeatherPtr->initStep++; } break; default: - sub_80AC01C(); + DroughtStateRun(); break; } } @@ -288,7 +288,7 @@ bool8 Drought_Finish(void) void StartDroughtWeatherBlend(void) { - CreateTask(UpdateDroughtBlend, 0x50); + CreateTask(UpdateDroughtBlend, 80); } #define tState data[0] @@ -437,8 +437,8 @@ static const union AnimCmd *const sRainSpriteAnimCmds[] = static const struct SpriteTemplate sRainSpriteTemplate = { - .tileTag = 4614, - .paletteTag = 0x1200, + .tileTag = GFXTAG_RAIN, + .paletteTag = PALTAG_WEATHER, .oam = &sRainSpriteOamData, .anims = sRainSpriteAnimCmds, .images = NULL, @@ -466,7 +466,7 @@ static const struct SpriteSheet sRainSpriteSheet = { .data = gWeatherRainTiles, .size = sizeof(gWeatherRainTiles), - .tag = 0x1206, + .tag = GFXTAG_RAIN, }; void Rain_InitVars(void) @@ -744,7 +744,7 @@ static void DestroyRainSprites(void) DestroySprite(gWeatherPtr->sprites.s1.rainSprites[i]); } gWeatherPtr->rainSpriteCount = 0; - FreeSpriteTilesByTag(0x1206); + FreeSpriteTilesByTag(GFXTAG_RAIN); } #undef tCounter @@ -879,7 +879,7 @@ static const union AnimCmd *const sSnowflakeAnimCmds[] = static const struct SpriteTemplate sSnowflakeSpriteTemplate = { .tileTag = 0xFFFF, - .paletteTag = 0x1200, + .paletteTag = PALTAG_WEATHER, .oam = &sSnowflakeSpriteOamData, .anims = sSnowflakeAnimCmds, .images = sSnowflakeSpriteImages, @@ -1317,8 +1317,8 @@ static const union AffineAnimCmd *const gSpriteAffineAnimTable_839AB8C[] = static void FogHorizontalSpriteCallback(struct Sprite *); static const struct SpriteTemplate sFogHorizontalSpriteTemplate = { - .tileTag = 0x1201, - .paletteTag = 0x1200, + .tileTag = GFXTAG_FOG_H, + .paletteTag = PALTAG_WEATHER, .oam = &gOamData_839AB2C, .anims = gSpriteAnimTable_839AB64, .images = NULL, @@ -1433,7 +1433,7 @@ static void CreateFogHorizontalSprites(void) struct SpriteSheet fogHorizontalSpriteSheet = { .data = gWeatherFogHorizontalTiles, .size = sizeof(gWeatherFogHorizontalTiles), - .tag = 0x1201, + .tag = GFXTAG_FOG_H, }; LoadSpriteSheet(&fogHorizontalSpriteSheet); for (i = 0; i < NUM_FOG_HORIZONTAL_SPRITES; i++) @@ -1469,7 +1469,7 @@ static void DestroyFogHorizontalSprites(void) DestroySprite(gWeatherPtr->sprites.s2.fogHSprites[i]); } - FreeSpriteTilesByTag(0x1201); + FreeSpriteTilesByTag(GFXTAG_FOG_H); gWeatherPtr->fogHSpritesCreated = 0; } } @@ -1567,7 +1567,7 @@ static const struct SpriteSheet sAshSpriteSheet = { .data = gWeatherAshTiles, .size = sizeof(gWeatherAshTiles), - .tag = 0x1202, + .tag = GFXTAG_ASH, }; static void LoadAshSpriteSheet(void) @@ -1603,8 +1603,8 @@ static const union AnimCmd *const sAshSpriteAnimCmds[] = static const struct SpriteTemplate sAshSpriteTemplate = { - .tileTag = 4610, - .paletteTag = 0x1200, + .tileTag = GFXTAG_ASH, + .paletteTag = PALTAG_WEATHER, .oam = &sAshSpriteOamData, .anims = sAshSpriteAnimCmds, .images = NULL, @@ -1659,7 +1659,7 @@ static void DestroyAshSprites(void) DestroySprite(gWeatherPtr->sprites.s2.ashSprites[i]); } - FreeSpriteTilesByTag(0x1202); + FreeSpriteTilesByTag(GFXTAG_ASH); gWeatherPtr->ashSpritesCreated = FALSE; } } @@ -1790,7 +1790,7 @@ static const struct SpriteSheet gFogDiagonalSpriteSheet = { .data = gWeatherFogDiagonalTiles, .size = sizeof(gWeatherFogDiagonalTiles), - .tag = 0x1203, + .tag = GFXTAG_FOG_D, }; static const struct OamData sFogDiagonalSpriteOamData = @@ -1820,8 +1820,8 @@ static const union AnimCmd *const sFogDiagonalSpriteAnimCmds[] = static const struct SpriteTemplate sFogDiagonalSpriteTemplate = { - .tileTag = 0x1203, - .paletteTag = 0x1200, + .tileTag = GFXTAG_FOG_D, + .paletteTag = PALTAG_WEATHER, .oam = &sFogDiagonalSpriteOamData, .anims = sFogDiagonalSpriteAnimCmds, .images = NULL, @@ -1875,7 +1875,7 @@ static void DestroyFogDiagonalSprites(void) DestroySprite(gWeatherPtr->sprites.s2.fogDSprites[i]); } - FreeSpriteTilesByTag(0x1203); + FreeSpriteTilesByTag(GFXTAG_FOG_D); gWeatherPtr->fogDSpritesCreated = FALSE; } } @@ -2018,7 +2018,7 @@ static void DestroySandstormSprites(void) } gWeatherPtr->sandstormSpritesCreated = FALSE; - FreeSpriteTilesByTag(0x1204); + FreeSpriteTilesByTag(GFXTAG_SANDSTORM); } if (gWeatherPtr->sandstormSwirlSpritesCreated) @@ -2067,8 +2067,8 @@ static const union AnimCmd *const sSandstormSpriteAnimCmds[] = static const struct SpriteTemplate sSandstormSpriteTemplate = { - .tileTag = 0x1204, - .paletteTag = 0x1201, + .tileTag = GFXTAG_SANDSTORM, + .paletteTag = PALTAG_WEATHER_2, .oam = &sSandstormSpriteOamData, .anims = sSandstormSpriteAnimCmds, .images = NULL, @@ -2080,7 +2080,7 @@ static const struct SpriteSheet sSandstormSpriteSheet = { .data = gWeatherSandstormTiles, .size = sizeof(gWeatherSandstormTiles), - .tag = 0x1204, + .tag = GFXTAG_SANDSTORM, }; // Regular sandstorm sprites @@ -2242,7 +2242,7 @@ static const struct SpriteSheet sWeatherBubbleSpriteSheet = { .data = gWeatherBubbleTiles, .size = sizeof(gWeatherBubbleTiles), - .tag = 0x1205, + .tag = GFXTAG_BUBBLE, }; static const s16 sBubbleStartCoords[][2] = @@ -2322,8 +2322,8 @@ static const union AnimCmd *const sBubbleSpriteAnimCmds[] = static const struct SpriteTemplate sBubbleSpriteTemplate = { - .tileTag = 0x1205, - .paletteTag = 0x1200, + .tileTag = GFXTAG_BUBBLE, + .paletteTag = PALTAG_WEATHER, .oam = &gOamData_AffineOff_ObjNormal_8x8, .anims = sBubbleSpriteAnimCmds, .images = NULL, @@ -2363,7 +2363,7 @@ static void DestroyBubbleSprites(void) DestroySprite(&gSprites[i]); } - FreeSpriteTilesByTag(0x1205); + FreeSpriteTilesByTag(GFXTAG_BUBBLE); gWeatherPtr->bubblesSpriteCount = 0; } } From b926fa6b0741cc878e4de5fe81183af12275d267 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 4 Apr 2021 00:23:06 -0400 Subject: [PATCH 10/63] Document thunderstorm --- include/field_weather.h | 43 +++++++----- src/field_weather.c | 6 +- src/field_weather_effect.c | 140 ++++++++++++++++++++++--------------- 3 files changed, 111 insertions(+), 78 deletions(-) diff --git a/include/field_weather.h b/include/field_weather.h index 894c661be..48118c9a6 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -46,11 +46,11 @@ struct Weather u8 gammaStepDelay; u8 gammaStepFrameCounter; u16 fadeDestColor; - /*0x6C6*/ u8 palProcessingState; - /*0x6C7*/ u8 fadeScreenCounter; - /*0x6C8*/ bool8 readyForInit; - /*0x6C9*/ u8 taskId; - /*0x6CA*/ u8 unknown_6CA; + u8 palProcessingState; + u8 fadeScreenCounter; + bool8 readyForInit; + u8 taskId; + u8 unknown_6CA; u8 unknown_6CB; u16 initStep; u16 finishStep; @@ -60,6 +60,7 @@ struct Weather bool8 weatherChangeComplete; u8 weatherPicSpritePalIndex; u8 altGammaSpritePalIndex; + // Rain u16 rainSpriteVisibleCounter; u8 curRainSpriteIndex; u8 targetRainSpriteCount; @@ -67,37 +68,41 @@ struct Weather u8 rainSpriteVisibleDelay; u8 isDownpour; u8 rainStrength; - /*0x6DE*/ u8 cloudSpritesCreated; - u8 filler_6DF[1]; + u8 cloudSpritesCreated; + // Snow u16 snowflakeVisibleCounter; u16 unknown_6E2; u8 snowflakeSpriteCount; u8 targetSnowflakeSpriteCount; - u16 unknown_6E6; + // Thunderstorm + u16 thunderDelay; u16 thunderCounter; - u8 unknown_6EA; - u8 unknown_6EB; - u8 unknown_6EC; - u8 thunderTriggered; + bool8 thunderAllowEnd; + bool8 thunderSkipShort; + u8 thunderShortRetries; + bool8 thunderTriggered; + // Horizontal fog u16 fogHScrollPosX; u16 fogHScrollCounter; u16 fogHScrollOffset; u8 lightenedFogSpritePals[6]; u8 lightenedFogSpritePalsCount; u8 fogHSpritesCreated; + // Ash u16 ashBaseSpritesX; u16 unknown_6FE; u8 ashSpritesCreated; - u8 filler_701[3]; + // Sandstorm u32 sandstormXOffset; u32 sandstormYOffset; - u8 filler_70C[2]; + u16 sandstormUnused; u16 sandstormBaseSpritesX; u16 sandstormPosY; u16 sandstormWaveIndex; u16 sandstormWaveCounter; u8 sandstormSpritesCreated; u8 sandstormSwirlSpritesCreated; + // Diagonal fog u16 fogDBaseSpritesX; u16 fogDPosY; u16 fogDScrollXCounter; @@ -105,13 +110,13 @@ struct Weather u16 fogDXOffset; u16 fogDYOffset; u8 fogDSpritesCreated; - u8 filler_725[1]; + // Bubbles u16 bubblesDelayCounter; u16 bubblesDelayIndex; u16 bubblesCoordsIndex; u16 bubblesSpriteCount; u8 bubblesSpritesCreated; - u8 filler_72F; + u16 currBlendEVA; u16 currBlendEVB; u16 targetBlendEVA; @@ -119,12 +124,12 @@ struct Weather u8 blendUpdateCounter; u8 blendFrameCounter; u8 blendDelay; - u8 filler_73B[0x3C-0x3B]; + // Drought s16 droughtBrightnessStage; s16 droughtLastBrightnessStage; s16 droughtTimer; s16 droughtState; - u8 filler_744[0xD-4]; + u8 droughtUnused[9]; s8 loadDroughtPalsIndex; u8 loadDroughtPalsOffset; }; @@ -141,7 +146,7 @@ void StartWeather(void); void SetNextWeather(u8 weather); void SetCurrentAndNextWeather(u8 weather); void SetCurrentAndNextWeatherNoDelay(u8 weather); -void sub_80ABC48(s8 gammaIndex); +void ApplyWeatherGammaShiftIfIdle(s8 gammaIndex); void sub_80ABC7C(u8 gammaIndex, u8 gammaTargetIndex, u8 gammaStepDelay); void FadeScreen(u8 mode, s8 delay); bool8 IsWeatherNotFadingIn(void); diff --git a/src/field_weather.c b/src/field_weather.c index 331f0be78..67051377c 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -710,7 +710,7 @@ static bool8 LightenSpritePaletteInFog(u8 paletteIndex) return FALSE; } -void sub_80ABC48(s8 gammaIndex) +void ApplyWeatherGammaShiftIfIdle(s8 gammaIndex) { if (gWeatherPtr->palProcessingState == WEATHER_PAL_STATE_IDLE) { @@ -728,7 +728,7 @@ void sub_80ABC7C(u8 gammaIndex, u8 gammaTargetIndex, u8 gammaStepDelay) gWeatherPtr->gammaTargetIndex = gammaTargetIndex; gWeatherPtr->gammaStepFrameCounter = 0; gWeatherPtr->gammaStepDelay = gammaStepDelay; - sub_80ABC48(gammaIndex); + ApplyWeatherGammaShiftIfIdle(gammaIndex); } } @@ -887,7 +887,7 @@ bool8 LoadDroughtWeatherPalettes(void) static void SetDroughtGamma(s8 gammaIndex) { - sub_80ABC48(-gammaIndex - 1); + ApplyWeatherGammaShiftIfIdle(-gammaIndex - 1); } void DroughtStateInit(void) diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index b8a09faad..1069bc9a2 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -677,7 +677,7 @@ static bool8 CreateRainSprite(void) if (spriteId != MAX_SPRITES) { - gSprites[spriteId].tActive = 0; + gSprites[spriteId].tActive = FALSE; gSprites[spriteId].tRandom = spriteIndex * 145; while (gSprites[spriteId].tRandom >= 600) gSprites[spriteId].tRandom -= 600; @@ -722,12 +722,12 @@ static bool8 UpdateVisibleRainSprites(void) gWeatherPtr->rainSpriteVisibleCounter = 0; if (gWeatherPtr->curRainSpriteIndex < gWeatherPtr->targetRainSpriteCount) { - gWeatherPtr->sprites.s1.rainSprites[gWeatherPtr->curRainSpriteIndex++]->tActive = 1; + gWeatherPtr->sprites.s1.rainSprites[gWeatherPtr->curRainSpriteIndex++]->tActive = TRUE; } else { gWeatherPtr->curRainSpriteIndex--; - gWeatherPtr->sprites.s1.rainSprites[gWeatherPtr->curRainSpriteIndex]->tActive = 0; + gWeatherPtr->sprites.s1.rainSprites[gWeatherPtr->curRainSpriteIndex]->tActive = FALSE; gWeatherPtr->sprites.s1.rainSprites[gWeatherPtr->curRainSpriteIndex]->invisible = TRUE; } } @@ -1011,9 +1011,32 @@ static void UpdateSnowflakeSprite(struct Sprite *sprite) // WEATHER_RAIN_THUNDERSTORM //------------------------------------------------------------------------------ +enum { + // This block of states is run only once + // when first setting up the thunderstorm + TSTORM_STATE_LOAD_RAIN, + TSTORM_STATE_CREATE_RAIN, + TSTORM_STATE_INIT_RAIN, + TSTORM_STATE_WAIT_CHANGE, + + // The thunderstorm loops through these states, + // not necessarily in order. + TSTORM_STATE_LOOP_START, + TSTORM_STATE_LOOP_WAIT, + TSTORM_STATE_INIT_THUNDER_SHORT_1, + TSTORM_STATE_INIT_THUNDER_SHORT_2, + TSTORM_STATE_TRY_THUNDER_SHORT, + TSTORM_STATE_TRY_NEW_THUNDER, + TSTORM_STATE_WAIT_THUNDER_SHORT, + TSTORM_STATE_INIT_THUNDER_LONG, + TSTORM_STATE_WAIT_THUNDER_LONG, + TSTORM_STATE_FADE_THUNDER_LONG, + TSTORM_STATE_END_THUNDER_LONG, +}; + void Thunderstorm_InitVars(void) { - gWeatherPtr->initStep = 0; + gWeatherPtr->initStep = TSTORM_STATE_LOAD_RAIN; gWeatherPtr->weatherGfxLoaded = FALSE; gWeatherPtr->rainSpriteVisibleCounter = 0; gWeatherPtr->rainSpriteVisibleDelay = 4; @@ -1022,7 +1045,7 @@ void Thunderstorm_InitVars(void) gWeatherPtr->gammaTargetIndex = 3; gWeatherPtr->gammaStepDelay = 20; gWeatherPtr->weatherGfxLoaded = FALSE; // duplicate assignment - gWeatherPtr->thunderTriggered = 0; + gWeatherPtr->thunderTriggered = FALSE; SetRainStrengthFromSoundEffect(SE_THUNDERSTORM); } @@ -1042,7 +1065,7 @@ static void SetThunderCounter(u16); void Downpour_InitVars(void) { - gWeatherPtr->initStep = 0; + gWeatherPtr->initStep = TSTORM_STATE_LOAD_RAIN; gWeatherPtr->weatherGfxLoaded = FALSE; gWeatherPtr->rainSpriteVisibleCounter = 0; gWeatherPtr->rainSpriteVisibleDelay = 4; @@ -1066,100 +1089,105 @@ void Thunderstorm_Main(void) UpdateThunderSound(); switch (gWeatherPtr->initStep) { - case 0: + case TSTORM_STATE_LOAD_RAIN: LoadRainSpriteSheet(); gWeatherPtr->initStep++; break; - case 1: + case TSTORM_STATE_CREATE_RAIN: if (!CreateRainSprite()) gWeatherPtr->initStep++; break; - case 2: + case TSTORM_STATE_INIT_RAIN: if (!UpdateVisibleRainSprites()) { gWeatherPtr->weatherGfxLoaded = TRUE; gWeatherPtr->initStep++; } break; - case 3: + case TSTORM_STATE_WAIT_CHANGE: if (gWeatherPtr->palProcessingState != WEATHER_PAL_STATE_CHANGING_WEATHER) - gWeatherPtr->initStep = 6; + gWeatherPtr->initStep = TSTORM_STATE_INIT_THUNDER_SHORT_1; break; - case 4: - gWeatherPtr->unknown_6EA = 1; - gWeatherPtr->unknown_6E6 = (Random() % 360) + 360; + case TSTORM_STATE_LOOP_START: + gWeatherPtr->thunderAllowEnd = TRUE; + gWeatherPtr->thunderDelay = (Random() % 360) + 360; gWeatherPtr->initStep++; // fall through - case 5: - if (--gWeatherPtr->unknown_6E6 == 0) + case TSTORM_STATE_LOOP_WAIT: + // Wait between 360-720 frames before trying thunder again + if (--gWeatherPtr->thunderDelay == 0) gWeatherPtr->initStep++; break; - case 6: - gWeatherPtr->unknown_6EA = 1; - gWeatherPtr->unknown_6EB = Random() % 2; + case TSTORM_STATE_INIT_THUNDER_SHORT_1: + gWeatherPtr->thunderAllowEnd = TRUE; + gWeatherPtr->thunderSkipShort = Random() % 2; gWeatherPtr->initStep++; break; - case 7: - gWeatherPtr->unknown_6EC = (Random() & 1) + 1; + case TSTORM_STATE_INIT_THUNDER_SHORT_2: + gWeatherPtr->thunderShortRetries = (Random() & 1) + 1; gWeatherPtr->initStep++; // fall through - case 8: - sub_80ABC48(19); - if (gWeatherPtr->unknown_6EB == 0 && gWeatherPtr->unknown_6EC == 1) - SetThunderCounter(20); + case TSTORM_STATE_TRY_THUNDER_SHORT: + ApplyWeatherGammaShiftIfIdle(19); + if (!gWeatherPtr->thunderSkipShort && gWeatherPtr->thunderShortRetries == 1) + SetThunderCounter(20); // Do short thunder - gWeatherPtr->unknown_6E6 = (Random() % 3) + 6; + gWeatherPtr->thunderDelay = (Random() % 3) + 6; gWeatherPtr->initStep++; break; - case 9: - if (--gWeatherPtr->unknown_6E6 == 0) + case TSTORM_STATE_TRY_NEW_THUNDER: + if (--gWeatherPtr->thunderDelay == 0) { - sub_80ABC48(3); - gWeatherPtr->unknown_6EA = 1; - if (--gWeatherPtr->unknown_6EC != 0) + ApplyWeatherGammaShiftIfIdle(3); + gWeatherPtr->thunderAllowEnd = TRUE; + if (--gWeatherPtr->thunderShortRetries != 0) { - gWeatherPtr->unknown_6E6 = (Random() % 16) + 60; - gWeatherPtr->initStep = 10; + // Try a short thunder again + gWeatherPtr->thunderDelay = (Random() % 16) + 60; + gWeatherPtr->initStep = TSTORM_STATE_WAIT_THUNDER_SHORT; } - else if (gWeatherPtr->unknown_6EB == 0) + else if (!gWeatherPtr->thunderSkipShort) { - gWeatherPtr->initStep = 4; + // No more thunder, restart loop + gWeatherPtr->initStep = TSTORM_STATE_LOOP_START; } else { - gWeatherPtr->initStep = 11; + // Set up long thunder + gWeatherPtr->initStep = TSTORM_STATE_INIT_THUNDER_LONG; } } break; - case 10: - if (--gWeatherPtr->unknown_6E6 == 0) - gWeatherPtr->initStep = 8; + case TSTORM_STATE_WAIT_THUNDER_SHORT: + if (--gWeatherPtr->thunderDelay == 0) + gWeatherPtr->initStep = TSTORM_STATE_TRY_THUNDER_SHORT; break; - case 11: - gWeatherPtr->unknown_6E6 = (Random() % 16) + 60; + case TSTORM_STATE_INIT_THUNDER_LONG: + gWeatherPtr->thunderDelay = (Random() % 16) + 60; gWeatherPtr->initStep++; break; - case 12: - if (--gWeatherPtr->unknown_6E6 == 0) + case TSTORM_STATE_WAIT_THUNDER_LONG: + if (--gWeatherPtr->thunderDelay == 0) { + // Do long thunder SetThunderCounter(100); - sub_80ABC48(19); - gWeatherPtr->unknown_6E6 = (Random() & 0xF) + 30; + ApplyWeatherGammaShiftIfIdle(19); + gWeatherPtr->thunderDelay = (Random() & 0xF) + 30; gWeatherPtr->initStep++; } break; - case 13: - if (--gWeatherPtr->unknown_6E6 == 0) + case TSTORM_STATE_FADE_THUNDER_LONG: + if (--gWeatherPtr->thunderDelay == 0) { sub_80ABC7C(19, 3, 5); gWeatherPtr->initStep++; } break; - case 14: + case TSTORM_STATE_END_THUNDER_LONG: if (gWeatherPtr->palProcessingState == WEATHER_PAL_STATE_IDLE) { - gWeatherPtr->unknown_6EA = 1; - gWeatherPtr->initStep = 4; + gWeatherPtr->thunderAllowEnd = TRUE; + gWeatherPtr->initStep = TSTORM_STATE_LOOP_START; } break; } @@ -1170,12 +1198,12 @@ bool8 Thunderstorm_Finish(void) switch (gWeatherPtr->finishStep) { case 0: - gWeatherPtr->unknown_6EA = 0; + gWeatherPtr->thunderAllowEnd = FALSE; gWeatherPtr->finishStep++; // fall through case 1: Thunderstorm_Main(); - if (gWeatherPtr->unknown_6EA) + if (gWeatherPtr->thunderAllowEnd) { if (gWeatherPtr->nextWeather == WEATHER_RAIN || gWeatherPtr->nextWeather == WEATHER_RAIN_THUNDERSTORM @@ -1203,16 +1231,16 @@ bool8 Thunderstorm_Finish(void) static void SetThunderCounter(u16 max) { - if (gWeatherPtr->thunderTriggered == 0) + if (!gWeatherPtr->thunderTriggered) { gWeatherPtr->thunderCounter = Random() % max; - gWeatherPtr->thunderTriggered = 1; + gWeatherPtr->thunderTriggered = TRUE; } } static void UpdateThunderSound(void) { - if (gWeatherPtr->thunderTriggered == 1) + if (gWeatherPtr->thunderTriggered == TRUE) { if (gWeatherPtr->thunderCounter == 0) { @@ -1224,7 +1252,7 @@ static void UpdateThunderSound(void) else PlaySE(SE_THUNDER2); - gWeatherPtr->thunderTriggered = 0; + gWeatherPtr->thunderTriggered = FALSE; } else { From 5fa20534f9843d5ede403474e675be5330b8060d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 4 Apr 2021 00:52:17 -0400 Subject: [PATCH 11/63] Label remaining fields in Weather struct --- include/field_weather.h | 9 ++++----- src/field_weather.c | 17 +++++++++-------- src/field_weather_effect.c | 7 ++++--- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/include/field_weather.h b/include/field_weather.h index 48118c9a6..696864983 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -50,8 +50,8 @@ struct Weather u8 fadeScreenCounter; bool8 readyForInit; u8 taskId; - u8 unknown_6CA; - u8 unknown_6CB; + u8 fadeInFirstFrame; + u8 fadeInTimer; u16 initStep; u16 finishStep; u8 currWeather; @@ -71,7 +71,7 @@ struct Weather u8 cloudSpritesCreated; // Snow u16 snowflakeVisibleCounter; - u16 unknown_6E2; + u16 snowflakeTimer; u8 snowflakeSpriteCount; u8 targetSnowflakeSpriteCount; // Thunderstorm @@ -90,7 +90,7 @@ struct Weather u8 fogHSpritesCreated; // Ash u16 ashBaseSpritesX; - u16 unknown_6FE; + u16 ashUnused; u8 ashSpritesCreated; // Sandstorm u32 sandstormXOffset; @@ -152,7 +152,6 @@ void FadeScreen(u8 mode, s8 delay); bool8 IsWeatherNotFadingIn(void); void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex); void ApplyWeatherGammaShiftToPal(u8 paletteIndex); -u8 sub_80ABF20(void); void LoadCustomWeatherSpritePalette(const u16 *palette); void ResetDroughtWeatherPaletteLoading(void); bool8 LoadDroughtWeatherPalettes(void); diff --git a/src/field_weather.c b/src/field_weather.c index 67051377c..6fc1d331a 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -365,8 +365,8 @@ static void UpdateWeatherGammaShift(void) static void FadeInScreenWithWeather(void) { - if (++gWeatherPtr->unknown_6CB > 1) - gWeatherPtr->unknown_6CA = 0; + if (++gWeatherPtr->fadeInTimer > 1) + gWeatherPtr->fadeInFirstFrame = FALSE; switch (gWeatherPtr->currWeather) { @@ -793,8 +793,8 @@ void FadeScreen(u8 mode, s8 delay) BeginNormalPaletteFade(PALETTES_ALL, delay, 16, 0, fadeColor); gWeatherPtr->palProcessingState = WEATHER_PAL_STATE_SCREEN_FADING_IN; - gWeatherPtr->unknown_6CA = 1; - gWeatherPtr->unknown_6CB = 0; + gWeatherPtr->fadeInFirstFrame = TRUE; + gWeatherPtr->fadeInTimer = 0; Weather_SetBlendCoeffs(gWeatherPtr->currBlendEVA, gWeatherPtr->currBlendEVB); gWeatherPtr->readyForInit = TRUE; } @@ -813,7 +813,7 @@ void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex) switch (gWeatherPtr->palProcessingState) { case WEATHER_PAL_STATE_SCREEN_FADING_IN: - if (gWeatherPtr->unknown_6CA != 0) + if (gWeatherPtr->fadeInFirstFrame) { if (gWeatherPtr->currWeather == WEATHER_FOG_HORIZONTAL) MarkFogSpritePalToLighten(paletteIndex); @@ -848,12 +848,13 @@ void ApplyWeatherGammaShiftToPal(u8 paletteIndex) ApplyGammaShift(paletteIndex, 1, gWeatherPtr->gammaIndex); } -u8 sub_80ABF20(void) +// Unused +static bool8 IsFirstFrameOfWeatherFadeIn(void) { if (gWeatherPtr->palProcessingState == WEATHER_PAL_STATE_SCREEN_FADING_IN) - return gWeatherPtr->unknown_6CA; + return gWeatherPtr->fadeInFirstFrame; else - return 0; + return FALSE; } void LoadCustomWeatherSpritePalette(const u16 *palette) diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 1069bc9a2..e0103c5a3 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -941,13 +941,14 @@ static void InitSnowflakeSpriteMovement(struct Sprite *sprite) static void WaitSnowflakeSprite(struct Sprite *sprite) { - if (gWeatherPtr->unknown_6E2 > 18) + // Timer is never incremented + if (gWeatherPtr->snowflakeTimer > 18) { sprite->invisible = FALSE; sprite->callback = UpdateSnowflakeSprite; sprite->pos1.y = 250 - (gSpriteCoordOffsetY + sprite->centerToCornerVecY); sprite->tPosY = sprite->pos1.y * 128; - gWeatherPtr->unknown_6E2 = 0; + gWeatherPtr->snowflakeTimer = 0; } } @@ -1519,7 +1520,7 @@ void Ash_InitVars(void) gWeatherPtr->weatherGfxLoaded = FALSE; gWeatherPtr->gammaTargetIndex = 0; gWeatherPtr->gammaStepDelay = 20; - gWeatherPtr->unknown_6FE = 20; + gWeatherPtr->ashUnused = 20; // Never read if (!gWeatherPtr->ashSpritesCreated) { Weather_SetBlendCoeffs(0, 16); From f90026826a0c4fb1f85a3e1648026392cb5072f9 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 4 Apr 2021 17:52:07 -0400 Subject: [PATCH 12/63] Document some weather, field effects --- include/event_object_movement.h | 2 +- include/field_weather.h | 3 +- src/event_object_movement.c | 16 +- src/field_effect_helpers.c | 257 +++++++++++++++++++------------- src/field_weather.c | 27 ++-- src/fldeff_sweetscent.c | 2 +- src/overworld.c | 2 +- 7 files changed, 179 insertions(+), 130 deletions(-) diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 1e754dcd9..79b8921f0 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -198,7 +198,7 @@ u8 GetMoveDirectionFastestAnimNum(u8); u8 GetLedgeJumpDirection(s16, s16, u8); void CameraObjectSetFollowedObjectId(u8 objectId); u16 GetObjectPaletteTag(u8 palSlot); -void UpdateObjectEventSpriteVisibility(struct Sprite *sprite, bool8 invisible); +void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible); s16 GetFigure8XOffset(s16 idx); s16 GetFigure8YOffset(s16 idx); void CameraObjectReset2(void); diff --git a/include/field_weather.h b/include/field_weather.h index 696864983..9c6a4ab7a 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -160,13 +160,12 @@ void DroughtStateRun(void); void Weather_SetBlendCoeffs(u8 eva, u8 evb); void Weather_SetTargetBlendCoeffs(u8 eva, u8 evb, int delay); bool8 Weather_UpdateBlend(void); -void sub_80AC274(u8 a); u8 GetCurrentWeather(void); void SetRainStrengthFromSoundEffect(u16 soundEffect); void PlayRainStoppingSoundEffect(void); u8 IsWeatherChangeComplete(void); void SetWeatherScreenFadeOut(void); -void sub_80AC3E4(void); +void SetWeatherPalStateIdle(void); void PreservePaletteInWeather(u8 preservedPalIndex); void ResetPreservedPalettesInWeather(void); diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 1a7d08db2..8ab6268fc 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -7919,11 +7919,11 @@ void GroundEffect_SpawnOnTallGrass(struct ObjectEvent *objEvent, struct Sprite * gFieldEffectArguments[0] = objEvent->currentCoords.x; gFieldEffectArguments[1] = objEvent->currentCoords.y; gFieldEffectArguments[2] = objEvent->previousElevation; - gFieldEffectArguments[3] = 2; + gFieldEffectArguments[3] = 2; // priority gFieldEffectArguments[4] = objEvent->localId << 8 | objEvent->mapNum; gFieldEffectArguments[5] = objEvent->mapGroup; gFieldEffectArguments[6] = (u8)gSaveBlock1Ptr->location.mapNum << 8 | (u8)gSaveBlock1Ptr->location.mapGroup; - gFieldEffectArguments[7] = 1; + gFieldEffectArguments[7] = TRUE; // skip to end of anim FieldEffectStart(FLDEFF_TALL_GRASS); } @@ -7932,11 +7932,11 @@ void GroundEffect_StepOnTallGrass(struct ObjectEvent *objEvent, struct Sprite *s gFieldEffectArguments[0] = objEvent->currentCoords.x; gFieldEffectArguments[1] = objEvent->currentCoords.y; gFieldEffectArguments[2] = objEvent->previousElevation; - gFieldEffectArguments[3] = 2; + gFieldEffectArguments[3] = 2; // priority gFieldEffectArguments[4] = objEvent->localId << 8 | objEvent->mapNum; gFieldEffectArguments[5] = objEvent->mapGroup; gFieldEffectArguments[6] = (u8)gSaveBlock1Ptr->location.mapNum << 8 | (u8)gSaveBlock1Ptr->location.mapGroup; - gFieldEffectArguments[7] = 0; + gFieldEffectArguments[7] = FALSE; // don't skip to end of anim FieldEffectStart(FLDEFF_TALL_GRASS); } @@ -8621,7 +8621,7 @@ bool8 SpriteAnimEnded(struct Sprite *sprite) return FALSE; } -void UpdateObjectEventSpriteVisibility(struct Sprite *sprite, bool8 invisible) +void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible) { u16 x, y; s16 x2, y2; @@ -8642,9 +8642,9 @@ void UpdateObjectEventSpriteVisibility(struct Sprite *sprite, bool8 invisible) x2 = x - (sprite->centerToCornerVecX >> 1); y2 = y - (sprite->centerToCornerVecY >> 1); - if ((s16)x > 255 || x2 < -16) + if ((s16)x >= DISPLAY_WIDTH + 16 || x2 < -16) sprite->invisible = TRUE; - if ((s16)y > 175 || y2 < -16) + if ((s16)y >= DISPLAY_HEIGHT + 16 || y2 < -16) sprite->invisible = TRUE; } @@ -8656,7 +8656,7 @@ static void UpdateObjectEventSprite(struct Sprite *sprite) { UpdateObjectEventSpritePosition(sprite); SetObjectSubpriorityByZCoord(sprite->data[1], sprite, 1); - UpdateObjectEventSpriteVisibility(sprite, sprite->tInvisible); + UpdateObjectEventSpriteInvisibility(sprite, sprite->tInvisible); } // Unused diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 67102a83b..b263ecb88 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -19,13 +19,13 @@ static void UpdateObjectReflectionSprite(struct Sprite *); static void LoadObjectReflectionPalette(struct ObjectEvent *objectEvent, struct Sprite *sprite); static void LoadObjectHighBridgeReflectionPalette(struct ObjectEvent *, u8); static void LoadObjectRegularReflectionPalette(struct ObjectEvent *, u8); -static void sub_81561FC(struct Sprite *, u8, u8); +static void UpdateGrassFieldEffectSubpriority(struct Sprite *, u8, u8); static void FadeFootprintsTireTracks_Step0(struct Sprite *); static void FadeFootprintsTireTracks_Step1(struct Sprite *); static void UpdateFeetInFlowingWaterFieldEffect(struct Sprite *); -static void UpdateAshFieldEffect_Step0(struct Sprite *); -static void UpdateAshFieldEffect_Step1(struct Sprite *); -static void UpdateAshFieldEffect_Step2(struct Sprite *); +static void UpdateAshFieldEffect_Wait(struct Sprite *); +static void UpdateAshFieldEffect_Show(struct Sprite *); +static void UpdateAshFieldEffect_End(struct Sprite *); static void SynchroniseSurfAnim(struct ObjectEvent *, struct Sprite *); static void sub_81556E8(struct ObjectEvent *, struct Sprite *); static void CreateBobbingEffect(struct ObjectEvent *, struct Sprite *, struct Sprite *); @@ -273,6 +273,16 @@ void UpdateShadowFieldEffect(struct Sprite *sprite) } } +// Sprite data for FLDEFF_TALL_GRASS and FLDEFF_LONG_GRASS +#define sElevation data[0] +#define sX data[1] +#define sY data[2] +#define sMapNum data[3] // Lower 8 bits +#define sLocalId data[3] >> 8 // Upper 8 bits +#define sMapGroup data[4] +#define sCurrentMap data[5] +#define sObjectMoved data[7] + u32 FldEff_TallGrass(void) { s16 x; @@ -289,16 +299,15 @@ u32 FldEff_TallGrass(void) sprite = &gSprites[spriteId]; sprite->coordOffsetEnabled = TRUE; sprite->oam.priority = gFieldEffectArguments[3]; - sprite->data[0] = gFieldEffectArguments[2]; - sprite->data[1] = gFieldEffectArguments[0]; - sprite->data[2] = gFieldEffectArguments[1]; - sprite->data[3] = gFieldEffectArguments[4]; - sprite->data[4] = gFieldEffectArguments[5]; - sprite->data[5] = gFieldEffectArguments[6]; + sprite->sElevation = gFieldEffectArguments[2]; + sprite->sX = gFieldEffectArguments[0]; + sprite->sY = gFieldEffectArguments[1]; + sprite->sMapNum = gFieldEffectArguments[4]; // Also sLocalId + sprite->sMapGroup = gFieldEffectArguments[5]; + sprite->sCurrentMap = gFieldEffectArguments[6]; + if (gFieldEffectArguments[7]) - { - SeekSpriteAnim(sprite, 4); - } + SeekSpriteAnim(sprite, 4); // Skip to end of anim } return 0; } @@ -312,37 +321,48 @@ void UpdateTallGrassFieldEffect(struct Sprite *sprite) u8 objectEventId; struct ObjectEvent *objectEvent; - mapNum = sprite->data[5] >> 8; - mapGroup = sprite->data[5]; + mapNum = sprite->sCurrentMap >> 8; + mapGroup = sprite->sCurrentMap; if (gCamera.active && (gSaveBlock1Ptr->location.mapNum != mapNum || gSaveBlock1Ptr->location.mapGroup != mapGroup)) { - sprite->data[1] -= gCamera.x; - sprite->data[2] -= gCamera.y; - sprite->data[5] = ((u8)gSaveBlock1Ptr->location.mapNum << 8) | (u8)gSaveBlock1Ptr->location.mapGroup; + sprite->sX -= gCamera.x; + sprite->sY -= gCamera.y; + sprite->sCurrentMap = ((u8)gSaveBlock1Ptr->location.mapNum << 8) | (u8)gSaveBlock1Ptr->location.mapGroup; } - localId = sprite->data[3] >> 8; - mapNum = sprite->data[3]; - mapGroup = sprite->data[4]; - metatileBehavior = MapGridGetMetatileBehaviorAt(sprite->data[1], sprite->data[2]); - if (TryGetObjectEventIdByLocalIdAndMap(localId, mapNum, mapGroup, &objectEventId) || !MetatileBehavior_IsTallGrass(metatileBehavior) || (sprite->data[7] && sprite->animEnded)) + localId = sprite->sLocalId; + mapNum = sprite->sMapNum; + mapGroup = sprite->sMapGroup; + metatileBehavior = MapGridGetMetatileBehaviorAt(sprite->sX, sprite->sY); + + if (TryGetObjectEventIdByLocalIdAndMap(localId, mapNum, mapGroup, &objectEventId) + || !MetatileBehavior_IsTallGrass(metatileBehavior) + || (sprite->sObjectMoved && sprite->animEnded)) { FieldEffectStop(sprite, FLDEFF_TALL_GRASS); } else { + // Check if the object that triggered the effect has moved away objectEvent = &gObjectEvents[objectEventId]; - if ((objectEvent->currentCoords.x != sprite->data[1] || objectEvent->currentCoords.y != sprite->data[2]) && (objectEvent->previousCoords.x != sprite->data[1] || objectEvent->previousCoords.y != sprite->data[2])) - sprite->data[7] = TRUE; + if ((objectEvent->currentCoords.x != sprite->sX + || objectEvent->currentCoords.y != sprite->sY) + && (objectEvent->previousCoords.x != sprite->sX + || objectEvent->previousCoords.y != sprite->sY)) + sprite->sObjectMoved = TRUE; + // Metatile behavior var re-used metatileBehavior = 0; if (sprite->animCmdIndex == 0) metatileBehavior = 4; - UpdateObjectEventSpriteVisibility(sprite, 0); - sub_81561FC(sprite, sprite->data[0], metatileBehavior); + UpdateObjectEventSpriteInvisibility(sprite, FALSE); + UpdateGrassFieldEffectSubpriority(sprite, sprite->sElevation, metatileBehavior); } } +// Sprite data for FLDEFF_JUMP_TALL_GRASS and FLDEFF_JUMP_LONG_GRASS +#define sFldEff data[1] + u32 FldEff_JumpTallGrass(void) { u8 spriteId; @@ -355,8 +375,8 @@ u32 FldEff_JumpTallGrass(void) sprite = &gSprites[spriteId]; sprite->coordOffsetEnabled = TRUE; sprite->oam.priority = gFieldEffectArguments[3]; - sprite->data[0] = gFieldEffectArguments[2]; - sprite->data[1] = FLDEFF_JUMP_TALL_GRASS; + sprite->sElevation = gFieldEffectArguments[2]; + sprite->sFldEff = FLDEFF_JUMP_TALL_GRASS; } return 0; } @@ -371,11 +391,14 @@ u8 FindTallGrassFieldEffectSpriteId(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s if (gSprites[i].inUse) { sprite = &gSprites[i]; - if (sprite->callback == UpdateTallGrassFieldEffect && (x == sprite->data[1] && y == sprite->data[2]) && (localId == (u8)(sprite->data[3] >> 8) && mapNum == (sprite->data[3] & 0xFF) && mapGroup == sprite->data[4])) + if (sprite->callback == UpdateTallGrassFieldEffect + && (x == sprite->sX && y == sprite->sY) + && localId == (u8)(sprite->sLocalId) + && mapNum == (sprite->sMapNum & 0xFF) + && mapGroup == sprite->sMapGroup) return i; } } - return MAX_SPRITES; } @@ -395,16 +418,15 @@ u32 FldEff_LongGrass(void) sprite = &gSprites[spriteId]; sprite->coordOffsetEnabled = TRUE; sprite->oam.priority = ZCoordToPriority(gFieldEffectArguments[2]); - sprite->data[0] = gFieldEffectArguments[2]; - sprite->data[1] = gFieldEffectArguments[0]; - sprite->data[2] = gFieldEffectArguments[1]; - sprite->data[3] = gFieldEffectArguments[4]; - sprite->data[4] = gFieldEffectArguments[5]; - sprite->data[5] = gFieldEffectArguments[6]; + sprite->sElevation = gFieldEffectArguments[2]; + sprite->sX = gFieldEffectArguments[0]; + sprite->sY = gFieldEffectArguments[1]; + sprite->sMapNum = gFieldEffectArguments[4]; // Also sLocalId + sprite->sMapGroup = gFieldEffectArguments[5]; + sprite->sCurrentMap = gFieldEffectArguments[6]; + if (gFieldEffectArguments[7]) - { - SeekSpriteAnim(sprite, 6); - } + SeekSpriteAnim(sprite, 6); // Skip to end of anim } return 0; } @@ -418,34 +440,47 @@ void UpdateLongGrassFieldEffect(struct Sprite *sprite) u8 objectEventId; struct ObjectEvent *objectEvent; - mapNum = sprite->data[5] >> 8; - mapGroup = sprite->data[5]; + mapNum = sprite->sCurrentMap >> 8; + mapGroup = sprite->sCurrentMap; if (gCamera.active && (gSaveBlock1Ptr->location.mapNum != mapNum || gSaveBlock1Ptr->location.mapGroup != mapGroup)) { - sprite->data[1] -= gCamera.x; - sprite->data[2] -= gCamera.y; - sprite->data[5] = ((u8)gSaveBlock1Ptr->location.mapNum << 8) | (u8)gSaveBlock1Ptr->location.mapGroup; + sprite->sX -= gCamera.x; + sprite->sY -= gCamera.y; + sprite->sCurrentMap = ((u8)gSaveBlock1Ptr->location.mapNum << 8) | (u8)gSaveBlock1Ptr->location.mapGroup; } - localId = sprite->data[3] >> 8; - mapNum = sprite->data[3]; - mapGroup = sprite->data[4]; + localId = sprite->sLocalId; + mapNum = sprite->sMapNum; + mapGroup = sprite->sMapGroup; metatileBehavior = MapGridGetMetatileBehaviorAt(sprite->data[1], sprite->data[2]); - if (TryGetObjectEventIdByLocalIdAndMap(localId, mapNum, mapGroup, &objectEventId) || !MetatileBehavior_IsLongGrass(metatileBehavior) || (sprite->data[7] && sprite->animEnded)) + if (TryGetObjectEventIdByLocalIdAndMap(localId, mapNum, mapGroup, &objectEventId) + || !MetatileBehavior_IsLongGrass(metatileBehavior) + || (sprite->sObjectMoved && sprite->animEnded)) { FieldEffectStop(sprite, FLDEFF_LONG_GRASS); } else { + // Check if the object that triggered the effect has moved away objectEvent = &gObjectEvents[objectEventId]; - if ((objectEvent->currentCoords.x != sprite->data[1] || objectEvent->currentCoords.y != sprite->data[2]) && (objectEvent->previousCoords.x != sprite->data[1] || objectEvent->previousCoords.y != sprite->data[2])) - { - sprite->data[7] = TRUE; - } - UpdateObjectEventSpriteVisibility(sprite, 0); - sub_81561FC(sprite, sprite->data[0], 0); + if ((objectEvent->currentCoords.x != sprite->data[1] + || objectEvent->currentCoords.y != sprite->data[2]) + && (objectEvent->previousCoords.x != sprite->data[1] + || objectEvent->previousCoords.y != sprite->data[2])) + sprite->sObjectMoved = TRUE; + + UpdateObjectEventSpriteInvisibility(sprite, FALSE); + UpdateGrassFieldEffectSubpriority(sprite, sprite->sElevation, 0); } } +#undef sX +#undef sY +#undef sMapNum +#undef sLocalId +#undef sMapGroup +#undef sCurrentMap +#undef sObjectMoved + u32 FldEff_JumpLongGrass(void) { u8 spriteId; @@ -458,8 +493,8 @@ u32 FldEff_JumpLongGrass(void) sprite = &gSprites[spriteId]; sprite->coordOffsetEnabled = TRUE; sprite->oam.priority = gFieldEffectArguments[3]; - sprite->data[0] = gFieldEffectArguments[2]; - sprite->data[1] = FLDEFF_JUMP_LONG_GRASS; + sprite->sElevation = gFieldEffectArguments[2]; + sprite->sFldEff = FLDEFF_JUMP_LONG_GRASS; } return 0; } @@ -520,7 +555,7 @@ void UpdateShortGrassFieldEffect(struct Sprite *sprite) sprite->pos2.y = (graphicsInfo->height >> 1) - 8; sprite->subpriority = linkedSprite->subpriority - 1; sprite->oam.priority = linkedSprite->oam.priority; - UpdateObjectEventSpriteVisibility(sprite, linkedSprite->invisible); + UpdateObjectEventSpriteInvisibility(sprite, linkedSprite->invisible); } } @@ -594,14 +629,14 @@ static void FadeFootprintsTireTracks_Step0(struct Sprite *sprite) if (++sprite->data[1] > 40) sprite->data[0] = 1; - UpdateObjectEventSpriteVisibility(sprite, FALSE); + UpdateObjectEventSpriteInvisibility(sprite, FALSE); } static void FadeFootprintsTireTracks_Step1(struct Sprite *sprite) { sprite->invisible ^= 1; sprite->data[1]++; - UpdateObjectEventSpriteVisibility(sprite, sprite->invisible); + UpdateObjectEventSpriteInvisibility(sprite, sprite->invisible); if (sprite->data[1] > 56) { FieldEffectStop(sprite, sprite->data[7]); @@ -648,7 +683,7 @@ void UpdateSplashFieldEffect(struct Sprite *sprite) { sprite->pos1.x = gSprites[gObjectEvents[objectEventId].spriteId].pos1.x; sprite->pos1.y = gSprites[gObjectEvents[objectEventId].spriteId].pos1.y; - UpdateObjectEventSpriteVisibility(sprite, FALSE); + UpdateObjectEventSpriteInvisibility(sprite, FALSE); } } @@ -734,7 +769,7 @@ static void UpdateFeetInFlowingWaterFieldEffect(struct Sprite *sprite) sprite->pos1.x = linkedSprite->pos1.x; sprite->pos1.y = linkedSprite->pos1.y; sprite->subpriority = linkedSprite->subpriority; - UpdateObjectEventSpriteVisibility(sprite, FALSE); + UpdateObjectEventSpriteInvisibility(sprite, FALSE); if (objectEvent->currentCoords.x != sprite->data[3] || objectEvent->currentCoords.y != sprite->data[4]) { sprite->data[3] = objectEvent->currentCoords.x; @@ -804,7 +839,7 @@ void UpdateHotSpringsWaterFieldEffect(struct Sprite *sprite) sprite->pos1.x = linkedSprite->pos1.x; sprite->pos1.y = (graphicsInfo->height >> 1) + linkedSprite->pos1.y - 8; sprite->subpriority = linkedSprite->subpriority - 1; - UpdateObjectEventSpriteVisibility(sprite, FALSE); + UpdateObjectEventSpriteInvisibility(sprite, FALSE); } } @@ -876,14 +911,21 @@ u32 FldEff_WaterSurfacing(void) return 0; } -void StartAshFieldEffect(s16 x, s16 y, u16 metatileId, s16 d) +// Sprite data for FLDEFF_ASH +#define sState data[0] +#define sX data[1] +#define sY data[2] +#define sMetatileId data[3] +#define sDelay data[4] + +void StartAshFieldEffect(s16 x, s16 y, u16 metatileId, s16 delay) { gFieldEffectArguments[0] = x; gFieldEffectArguments[1] = y; - gFieldEffectArguments[2] = 0x52; - gFieldEffectArguments[3] = 1; + gFieldEffectArguments[2] = 82; // subpriority + gFieldEffectArguments[3] = 1; // priority gFieldEffectArguments[4] = metatileId; - gFieldEffectArguments[5] = d; + gFieldEffectArguments[5] = delay; FieldEffectStart(FLDEFF_ASH); } @@ -903,50 +945,56 @@ u32 FldEff_Ash(void) sprite = &gSprites[spriteId]; sprite->coordOffsetEnabled = TRUE; sprite->oam.priority = gFieldEffectArguments[3]; - sprite->data[1] = gFieldEffectArguments[0]; - sprite->data[2] = gFieldEffectArguments[1]; - sprite->data[3] = gFieldEffectArguments[4]; - sprite->data[4] = gFieldEffectArguments[5]; + sprite->sX = gFieldEffectArguments[0]; + sprite->sY = gFieldEffectArguments[1]; + sprite->sMetatileId = gFieldEffectArguments[4]; + sprite->sDelay = gFieldEffectArguments[5]; } return 0; } void (*const gAshFieldEffectFuncs[])(struct Sprite *) = { - UpdateAshFieldEffect_Step0, - UpdateAshFieldEffect_Step1, - UpdateAshFieldEffect_Step2 + UpdateAshFieldEffect_Wait, + UpdateAshFieldEffect_Show, + UpdateAshFieldEffect_End }; void UpdateAshFieldEffect(struct Sprite *sprite) { - gAshFieldEffectFuncs[sprite->data[0]](sprite); + gAshFieldEffectFuncs[sprite->sState](sprite); } -static void UpdateAshFieldEffect_Step0(struct Sprite *sprite) +static void UpdateAshFieldEffect_Wait(struct Sprite *sprite) { sprite->invisible = TRUE; sprite->animPaused = TRUE; - if (--sprite->data[4] == 0) - sprite->data[0] = 1; + if (--sprite->sDelay == 0) + sprite->sState = 1; } -static void UpdateAshFieldEffect_Step1(struct Sprite *sprite) +static void UpdateAshFieldEffect_Show(struct Sprite *sprite) { sprite->invisible = FALSE; sprite->animPaused = FALSE; - MapGridSetMetatileIdAt(sprite->data[1], sprite->data[2], sprite->data[3]); - CurrentMapDrawMetatileAt(sprite->data[1], sprite->data[2]); + MapGridSetMetatileIdAt(sprite->sX, sprite->sY, sprite->sMetatileId); + CurrentMapDrawMetatileAt(sprite->sX, sprite->sY); gObjectEvents[gPlayerAvatar.objectEventId].triggerGroundEffectsOnMove = TRUE; - sprite->data[0] = 2; + sprite->sState = 2; } -static void UpdateAshFieldEffect_Step2(struct Sprite *sprite) +static void UpdateAshFieldEffect_End(struct Sprite *sprite) { - UpdateObjectEventSpriteVisibility(sprite, FALSE); + UpdateObjectEventSpriteInvisibility(sprite, FALSE); if (sprite->animEnded) FieldEffectStop(sprite, FLDEFF_ASH); } +#undef sState +#undef sX +#undef sY +#undef sMetatileId +#undef sDelay + u32 FldEff_SurfBlob(void) { u8 spriteId; @@ -1048,7 +1096,7 @@ void sub_81556E8(struct ObjectEvent *objectEvent, struct Sprite *sprite) MoveCoords(i, &x, &y); if (MapGridGetZCoordAt(x, y) == 3) { - sprite->data[5] ++; + sprite->data[5]++; break; } } @@ -1182,7 +1230,7 @@ void UpdateSandPileFieldEffect(struct Sprite *sprite) sprite->pos1.x = x; sprite->pos1.y = y; sprite->subpriority = gSprites[gObjectEvents[objectEventId].spriteId].subpriority; - UpdateObjectEventSpriteVisibility(sprite, FALSE); + UpdateObjectEventSpriteInvisibility(sprite, FALSE); } } @@ -1207,7 +1255,7 @@ void UpdateBubblesFieldEffect(struct Sprite *sprite) sprite->data[0] += 0x80; sprite->data[0] &= 0x100; sprite->pos1.y -= sprite->data[0] >> 8; - UpdateObjectEventSpriteVisibility(sprite, FALSE); + UpdateObjectEventSpriteInvisibility(sprite, FALSE); if (sprite->invisible || sprite->animEnded) { FieldEffectStop(sprite, FLDEFF_BUBBLES); @@ -1551,16 +1599,17 @@ void UpdateRayquazaSpotlightEffect(struct Sprite *sprite) #undef sAnimCounter #undef sAnimState +// Used by FLDEFF_JUMP_TALL_GRASS and FLDEFF_JUMP_LONG_GRASS void UpdateJumpImpactEffect(struct Sprite *sprite) { if (sprite->animEnded) { - FieldEffectStop(sprite, sprite->data[1]); + FieldEffectStop(sprite, sprite->sFldEff); } else { - UpdateObjectEventSpriteVisibility(sprite, FALSE); - SetObjectSubpriorityByZCoord(sprite->data[0], sprite, 0); + UpdateObjectEventSpriteInvisibility(sprite, FALSE); + SetObjectSubpriorityByZCoord(sprite->sElevation, sprite, 0); } } @@ -1569,10 +1618,10 @@ void WaitFieldEffectSpriteAnim(struct Sprite *sprite) if (sprite->animEnded) FieldEffectStop(sprite, sprite->data[0]); else - UpdateObjectEventSpriteVisibility(sprite, FALSE); + UpdateObjectEventSpriteInvisibility(sprite, FALSE); } -static void sub_81561FC(struct Sprite *sprite, u8 z, u8 offset) +static void UpdateGrassFieldEffectSubpriority(struct Sprite *sprite, u8 z, u8 offset) { u8 i; s16 var, xhi, lyhi, yhi, ylo; @@ -1606,17 +1655,17 @@ static void sub_81561FC(struct Sprite *sprite, u8 z, u8 offset) } // Unused data. Feel free to remove. -static const u8 gUnknown_085CDC6E[] = +static const u8 sUnusedData[] = { - 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, - 0x01, 0x02, 0x02, 0x01, 0x02, 0x02, 0x01, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, - 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, - 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, - 0x00, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00 + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, + 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, + 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, + 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, + 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -1, 0, 0, -1, 0, 0, -1, 0, -1, -1, 0, -1, + -1, 0, -1, -1, -1, -1, -1, -1, -1, -2, 0, 0 }; diff --git a/src/field_weather.c b/src/field_weather.c index 6fc1d331a..4b9c6a863 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -990,38 +990,39 @@ bool8 Weather_UpdateBlend(void) return FALSE; } -void sub_80AC274(u8 a) +// Unused. Uses the same numbering scheme as the coord events +static void SetFieldWeather(u8 weather) { - switch (a) + switch (weather) { - case 1: + case COORD_EVENT_WEATHER_SUNNY_CLOUDS: SetWeather(WEATHER_SUNNY_CLOUDS); break; - case 2: + case COORD_EVENT_WEATHER_SUNNY: SetWeather(WEATHER_SUNNY); break; - case 3: + case COORD_EVENT_WEATHER_RAIN: SetWeather(WEATHER_RAIN); break; - case 4: + case COORD_EVENT_WEATHER_SNOW: SetWeather(WEATHER_SNOW); break; - case 5: + case COORD_EVENT_WEATHER_RAIN_THUNDERSTORM: SetWeather(WEATHER_RAIN_THUNDERSTORM); break; - case 6: + case COORD_EVENT_WEATHER_FOG_HORIZONTAL: SetWeather(WEATHER_FOG_HORIZONTAL); break; - case 7: + case COORD_EVENT_WEATHER_FOG_DIAGONAL: SetWeather(WEATHER_FOG_DIAGONAL); break; - case 8: + case COORD_EVENT_WEATHER_VOLCANIC_ASH: SetWeather(WEATHER_VOLCANIC_ASH); break; - case 9: + case COORD_EVENT_WEATHER_SANDSTORM: SetWeather(WEATHER_SANDSTORM); break; - case 10: + case COORD_EVENT_WEATHER_SHADE: SetWeather(WEATHER_SHADE); break; } @@ -1085,7 +1086,7 @@ void SetWeatherScreenFadeOut(void) gWeatherPtr->palProcessingState = WEATHER_PAL_STATE_SCREEN_FADING_OUT; } -void sub_80AC3E4(void) +void SetWeatherPalStateIdle(void) { gWeatherPtr->palProcessingState = WEATHER_PAL_STATE_IDLE; } diff --git a/src/fldeff_sweetscent.c b/src/fldeff_sweetscent.c index a9d81501f..55463440c 100644 --- a/src/fldeff_sweetscent.c +++ b/src/fldeff_sweetscent.c @@ -92,7 +92,7 @@ static void FailSweetScentEncounter(u8 taskId) if (!gPaletteFade.active) { CpuFastSet(gPaletteDecompressionBuffer, gPlttBufferUnfaded, 0x100); - sub_80AC3E4(); + SetWeatherPalStateIdle(); ScriptContext1_SetupScript(EventScript_FailSweetScent); DestroyTask(taskId); } diff --git a/src/overworld.c b/src/overworld.c index 9d5e40fb3..3dda9b665 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -3198,7 +3198,7 @@ static void SpriteCB_LinkPlayer(struct Sprite *sprite) else StartSpriteAnimIfDifferent(sprite, GetMoveDirectionAnimNum(linkDirection(objEvent))); - UpdateObjectEventSpriteVisibility(sprite, 0); + UpdateObjectEventSpriteInvisibility(sprite, 0); if (objEvent->triggerGroundEffectsOnMove) { sprite->invisible = ((sprite->data[7] & 4) >> 2); From 553fe6239ab55ac456e80528bfe3a1697a05c2ed Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 5 Apr 2021 10:32:33 -0400 Subject: [PATCH 13/63] Document more field effects --- include/field_effect_helpers.h | 22 +++-- src/field_effect.c | 10 +-- src/field_effect_helpers.c | 142 +++++++++++++++++++-------------- src/field_player_avatar.c | 12 +-- 4 files changed, 108 insertions(+), 78 deletions(-) diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index 9b7b6ffd5..9795d96e8 100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -1,16 +1,22 @@ #ifndef GUARD_FIELD_EFFECT_HELPERS_H #define GUARD_FIELD_EFFECT_HELPERS_H -// Exported type declarations +// States for bobbing up and down while surfing +enum { + // No bobbing + BOB_NONE, + // Both the surf blob/mon should bob up and down + BOB_PLAYER_AND_MON, + // Only the surf blob/mon should bob up and down + // For when the player has jumped/flown off + BOB_JUST_MON, +}; -// Exported RAM declarations - -// Exported ROM declarations u8 CreateWarpArrowSprite(void); -u8 sub_8155800(u8 oldSpriteId); -void SetSurfBobState(u8 spriteId, u8 value); -void SetSurfBobWhileFlyingOutState(u8 spriteId, u8 value); -void SetSurfBobWhileFishingState(u8 spriteId, u8 value, s16 data1); +u8 StartUnderwaterSurfBlobBobbing(u8 oldSpriteId); +void SetSurfBlob_BobState(u8 spriteId, u8 state); +void SetSurfBlob_DontSyncAnim(u8 spriteId, bool8 dontSync); +void SetSurfBlob_PlayerOffset(u8 spriteId, bool8 hasOffset, s16 offset); bool8 sub_8155DA0(struct ObjectEvent *); void sub_8155D78(struct ObjectEvent *); void StartAshFieldEffect(s16, s16, u16, s16); diff --git a/src/field_effect.c b/src/field_effect.c index 445827390..8152f19bb 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -3053,7 +3053,7 @@ static void SurfFieldEffect_End(struct Task *task) gPlayerAvatar.preventStep = FALSE; gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_5; ObjectEventSetHeldMovement(objectEvent, GetFaceDirectionMovementAction(objectEvent->movementDirection)); - SetSurfBobState(objectEvent->fieldEffectSpriteId, 1); + SetSurfBlob_BobState(objectEvent->fieldEffectSpriteId, BOB_PLAYER_AND_MON); UnfreezeObjectEvents(); ScriptContext2_Disable(); FieldEffectActiveListRemove(FLDEFF_USE_SURF); @@ -3204,8 +3204,8 @@ static void FlyOutFieldEffect_BirdLeaveBall(struct Task *task) struct ObjectEvent *objectEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; if (task->tAvatarFlags & PLAYER_AVATAR_FLAG_SURFING) { - SetSurfBobState(objectEvent->fieldEffectSpriteId, 2); - SetSurfBobWhileFlyingOutState(objectEvent->fieldEffectSpriteId, 0); + SetSurfBlob_BobState(objectEvent->fieldEffectSpriteId, BOB_JUST_MON); + SetSurfBlob_DontSyncAnim(objectEvent->fieldEffectSpriteId, FALSE); } task->tBirdSpriteId = CreateFlyBirdSprite(); // Does "leave ball" animation by default task->tState++; @@ -3473,7 +3473,7 @@ static void FlyInFieldEffect_BirdSwoopDown(struct Task *task) SetPlayerAvatarStateMask(PLAYER_AVATAR_FLAG_ON_FOOT); if (task->tAvatarFlags & PLAYER_AVATAR_FLAG_SURFING) { - SetSurfBobState(objectEvent->fieldEffectSpriteId, 0); + SetSurfBlob_BobState(objectEvent->fieldEffectSpriteId, BOB_NONE); } ObjectEventSetGraphicsId(objectEvent, GetPlayerAvatarGraphicsIdByStateId(PLAYER_AVATAR_STATE_SURFING)); CameraObjectReset2(); @@ -3582,7 +3582,7 @@ static void FlyInFieldEffect_End(struct Task *task) if (task->tAvatarFlags & PLAYER_AVATAR_FLAG_SURFING) { state = PLAYER_AVATAR_STATE_SURFING; - SetSurfBobState(objectEvent->fieldEffectSpriteId, 1); + SetSurfBlob_BobState(objectEvent->fieldEffectSpriteId, BOB_PLAYER_AND_MON); } ObjectEventSetGraphicsId(objectEvent, GetPlayerAvatarGraphicsIdByStateId(state)); ObjectEventTurn(objectEvent, DIR_SOUTH); diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index b263ecb88..49116b5d3 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -27,9 +27,9 @@ static void UpdateAshFieldEffect_Wait(struct Sprite *); static void UpdateAshFieldEffect_Show(struct Sprite *); static void UpdateAshFieldEffect_End(struct Sprite *); static void SynchroniseSurfAnim(struct ObjectEvent *, struct Sprite *); -static void sub_81556E8(struct ObjectEvent *, struct Sprite *); -static void CreateBobbingEffect(struct ObjectEvent *, struct Sprite *, struct Sprite *); -static void sub_8155850(struct Sprite *); +static void SynchroniseSurfPosition(struct ObjectEvent *, struct Sprite *); +static void UpdateBobbingEffect(struct ObjectEvent *, struct Sprite *, struct Sprite *); +static void SpriteCB_UnderwaterSurfBlob(struct Sprite *); static u32 ShowDisguiseFieldEffect(u8, u8, u8); #define sReflectionObjEventId data[0] @@ -995,6 +995,12 @@ static void UpdateAshFieldEffect_End(struct Sprite *sprite) #undef sMetatileId #undef sDelay +// Sprite data for FLDEFF_SURF_BLOB +#define tBitfield data[0] +#define tPlayerOffset data[1] +#define tPlayerObjId data[2] + + u32 FldEff_SurfBlob(void) { u8 spriteId; @@ -1002,12 +1008,12 @@ u32 FldEff_SurfBlob(void) SetSpritePosToOffsetMapCoords((s16 *)&gFieldEffectArguments[0], (s16 *)&gFieldEffectArguments[1], 8, 8); spriteId = CreateSpriteAtEnd(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SURF_BLOB], gFieldEffectArguments[0], gFieldEffectArguments[1], 0x96); - if (spriteId !=MAX_SPRITES) + if (spriteId != MAX_SPRITES) { sprite = &gSprites[spriteId]; sprite->coordOffsetEnabled = TRUE; sprite->oam.paletteNum = 0; - sprite->data[2] = gFieldEffectArguments[2]; + sprite->tPlayerObjId = gFieldEffectArguments[2]; sprite->data[3] = -1; sprite->data[6] = -1; sprite->data[7] = -1; @@ -1016,53 +1022,55 @@ u32 FldEff_SurfBlob(void) return spriteId; } -// States for bobbing up and down while surfing -void SetSurfBobState(u8 spriteId, u8 value) + +void SetSurfBlob_BobState(u8 spriteId, u8 state) { - gSprites[spriteId].data[0] = (gSprites[spriteId].data[0] & ~0xF) | (value & 0xF); + gSprites[spriteId].data[0] = (gSprites[spriteId].data[0] & ~0xF) | (state & 0xF); } -void SetSurfBobWhileFlyingOutState(u8 spriteId, u8 value) +void SetSurfBlob_DontSyncAnim(u8 spriteId, bool8 dontSync) { - gSprites[spriteId].data[0] = (gSprites[spriteId].data[0] & ~0xF0) | ((value & 0xF) << 4); + gSprites[spriteId].data[0] = (gSprites[spriteId].data[0] & ~0xF0) | ((dontSync & 0xF) << 4); } -void SetSurfBobWhileFishingState(u8 spriteId, u8 value, s16 data1) +void SetSurfBlob_PlayerOffset(u8 spriteId, bool8 hasOffset, s16 offset) { - gSprites[spriteId].data[0] = (gSprites[spriteId].data[0] & ~0xF00) | ((value & 0xF) << 8); - gSprites[spriteId].data[1] = data1; + gSprites[spriteId].data[0] = (gSprites[spriteId].data[0] & ~0xF00) | ((hasOffset & 0xF) << 8); + gSprites[spriteId].tPlayerOffset = offset; } -static u8 GetSurfBobState(struct Sprite *sprite) +static u8 GetSurfBlob_BobState(struct Sprite *sprite) { return sprite->data[0] & 0xF; } -static u8 GetSurfBobWhileFlyingOutState(struct Sprite *sprite) +// Never TRUE +static u8 GetSurfBlob_DontSyncAnim(struct Sprite *sprite) { return (sprite->data[0] & 0xF0) >> 4; } -static u8 GetSurfBobWhileFishingState(struct Sprite *sprite) +static u8 GetSurfBlob_HasPlayerOffset(struct Sprite *sprite) { return (sprite->data[0] & 0xF00) >> 8; } void UpdateSurfBlobFieldEffect(struct Sprite *sprite) { - struct ObjectEvent *objectEvent; - struct Sprite *linkedSprite; + struct ObjectEvent *playerObj; + struct Sprite *playerSprite; - objectEvent = &gObjectEvents[sprite->data[2]]; - linkedSprite = &gSprites[objectEvent->spriteId]; - SynchroniseSurfAnim(objectEvent, sprite); - sub_81556E8(objectEvent, sprite); - CreateBobbingEffect(objectEvent, linkedSprite, sprite); - sprite->oam.priority = linkedSprite->oam.priority; + playerObj = &gObjectEvents[sprite->tPlayerObjId]; + playerSprite = &gSprites[playerObj->spriteId]; + SynchroniseSurfAnim(playerObj, sprite); + SynchroniseSurfPosition(playerObj, sprite); + UpdateBobbingEffect(playerObj, playerSprite, sprite); + sprite->oam.priority = playerSprite->oam.priority; } -static void SynchroniseSurfAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite) +static void SynchroniseSurfAnim(struct ObjectEvent *playerObj, struct Sprite *sprite) { + // Indexes into sAnimTable_SurfBlob u8 surfBlobDirectionAnims[] = { [DIR_NONE] = 0, [DIR_SOUTH] = 0, @@ -1075,15 +1083,15 @@ static void SynchroniseSurfAnim(struct ObjectEvent *objectEvent, struct Sprite * [DIR_NORTHEAST] = 1, }; - if (GetSurfBobWhileFlyingOutState(sprite) == 0) - StartSpriteAnimIfDifferent(sprite, surfBlobDirectionAnims[objectEvent->movementDirection]); + if (!GetSurfBlob_DontSyncAnim(sprite)) + StartSpriteAnimIfDifferent(sprite, surfBlobDirectionAnims[playerObj->movementDirection]); } -void sub_81556E8(struct ObjectEvent *objectEvent, struct Sprite *sprite) +void SynchroniseSurfPosition(struct ObjectEvent *playerObj, struct Sprite *sprite) { u8 i; - s16 x = objectEvent->currentCoords.x; - s16 y = objectEvent->currentCoords.y; + s16 x = playerObj->currentCoords.x; + s16 y = playerObj->currentCoords.y; s32 spriteY = sprite->pos2.y; if (spriteY == 0 && (x != sprite->data[6] || y != sprite->data[7])) @@ -1103,61 +1111,74 @@ void sub_81556E8(struct ObjectEvent *objectEvent, struct Sprite *sprite) } } -static void CreateBobbingEffect(struct ObjectEvent *objectEvent, struct Sprite *linkedSprite, struct Sprite *sprite) +static void UpdateBobbingEffect(struct ObjectEvent *playerObj, struct Sprite *playerSprite, struct Sprite *sprite) { - u16 unk_085CDC6A[] = {3, 7}; - u8 bobState = GetSurfBobState(sprite); - if (bobState != 0) + u16 intervals[] = {3, 7}; + u8 bobState = GetSurfBlob_BobState(sprite); + if (bobState != BOB_NONE) { - if (((u16)(++ sprite->data[4]) & unk_085CDC6A[sprite->data[5]]) == 0) + // Update bobbing position of surf blob + if (((u16)(++sprite->data[4]) & intervals[sprite->data[5]]) == 0) { sprite->pos2.y += sprite->data[3]; } - if ((sprite->data[4] & 0x0F) == 0) + if ((sprite->data[4] & 15) == 0) { sprite->data[3] = -sprite->data[3]; } - if (bobState != 2) + if (bobState != BOB_JUST_MON) { - if (GetSurfBobWhileFishingState(sprite) == 0) - linkedSprite->pos2.y = sprite->pos2.y; + // Update bobbing position of player + if (!GetSurfBlob_HasPlayerOffset(sprite)) + playerSprite->pos2.y = sprite->pos2.y; else - linkedSprite->pos2.y = sprite->data[1] + sprite->pos2.y; - sprite->pos1.x = linkedSprite->pos1.x; - sprite->pos1.y = linkedSprite->pos1.y + 8; + playerSprite->pos2.y = sprite->tPlayerOffset + sprite->pos2.y; + sprite->pos1.x = playerSprite->pos1.x; + sprite->pos1.y = playerSprite->pos1.y + 8; } } } -u8 sub_8155800(u8 oldSpriteId) +#define sSpriteId data[0] +#define sBobY data[1] +#define sTimer data[2] + +u8 StartUnderwaterSurfBlobBobbing(u8 blobSpriteId) { u8 spriteId; struct Sprite *sprite; + // Create a dummy sprite with its own callback + // that tracks the actual surf blob sprite and + // makes it bob up and down underwater spriteId = CreateSpriteAtEnd(&gDummySpriteTemplate, 0, 0, -1); sprite = &gSprites[spriteId]; - sprite->callback = sub_8155850; + sprite->callback = SpriteCB_UnderwaterSurfBlob; sprite->invisible = TRUE; - sprite->data[0] = oldSpriteId; - sprite->data[1] = 1; + sprite->sSpriteId = blobSpriteId; + sprite->sBobY = 1; return spriteId; } -static void sub_8155850(struct Sprite *sprite) +static void SpriteCB_UnderwaterSurfBlob(struct Sprite *sprite) { - struct Sprite *oldSprite; + struct Sprite *blobSprite; - oldSprite = &gSprites[sprite->data[0]]; - if (((sprite->data[2]++) & 0x03) == 0) + blobSprite = &gSprites[sprite->sSpriteId]; + if (((sprite->sTimer++) & 3) == 0) { - oldSprite->pos2.y += sprite->data[1]; + blobSprite->pos2.y += sprite->sBobY; } - if ((sprite->data[2] & 0x0F) == 0) + if ((sprite->sTimer & 15) == 0) { - sprite->data[1] = -sprite->data[1]; + sprite->sBobY = -sprite->sBobY; } } +#undef sSpriteId +#undef sBobY +#undef sTimer + u32 FldEff_Dust(void) { u8 spriteId; @@ -1397,24 +1418,27 @@ u32 FldEff_Sparkle(void) return 0; } +#define sFinished data[0] +#define sEndTimer data[1] + void UpdateSparkleFieldEffect(struct Sprite *sprite) { - if (sprite->data[0] == 0) + if (!sprite->sFinished) { if (sprite->animEnded) { sprite->invisible = TRUE; - sprite->data[0]++; + sprite->sFinished++; } - - if (sprite->data[0] == 0) - return; } - if (++sprite->data[1] > 34) + if (sprite->sFinished && ++sprite->sEndTimer > 34) FieldEffectStop(sprite, FLDEFF_SPARKLE); } +#undef sFinished +#undef sEndTimer + #define sTimer data[0] #define sState data[2] #define sStartY data[4] diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 4f85ad628..94325bf34 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -863,7 +863,7 @@ static void PlayerAvatarTransition_Surfing(struct ObjectEvent *objEvent) gFieldEffectArguments[2] = gPlayerAvatar.objectEventId; spriteId = FieldEffectStart(FLDEFF_SURF_BLOB); objEvent->fieldEffectSpriteId = spriteId; - SetSurfBobState(spriteId, 1); + SetSurfBlob_BobState(spriteId, BOB_PLAYER_AND_MON); } static void PlayerAvatarTransition_Underwater(struct ObjectEvent *objEvent) @@ -871,7 +871,7 @@ static void PlayerAvatarTransition_Underwater(struct ObjectEvent *objEvent) ObjectEventSetGraphicsId(objEvent, GetPlayerAvatarGraphicsIdByStateId(PLAYER_AVATAR_STATE_UNDERWATER)); ObjectEventTurn(objEvent, objEvent->movementDirection); SetPlayerAvatarStateMask(PLAYER_AVATAR_FLAG_UNDERWATER); - objEvent->fieldEffectSpriteId = sub_8155800(objEvent->spriteId); + objEvent->fieldEffectSpriteId = StartUnderwaterSurfBlobBobbing(objEvent->spriteId); } static void PlayerAvatarTransition_ReturnToField(struct ObjectEvent *objEvent) @@ -1646,7 +1646,7 @@ static void Task_StopSurfingInit(u8 taskId) if (!ObjectEventClearHeldMovementIfFinished(playerObjEvent)) return; } - SetSurfBobState(playerObjEvent->fieldEffectSpriteId, 2); + SetSurfBlob_BobState(playerObjEvent->fieldEffectSpriteId, BOB_JUST_MON); ObjectEventSetHeldMovement(playerObjEvent, GetJumpSpecialMovementAction((u8)gTasks[taskId].data[0])); gTasks[taskId].func = Task_WaitStopSurfing; } @@ -1932,7 +1932,7 @@ static bool8 Fishing_StartEncounter(struct Task *task) ObjectEventSetGraphicsId(playerObjEvent, task->tPlayerGfxId); ObjectEventTurn(playerObjEvent, playerObjEvent->movementDirection); if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING) - SetSurfBobWhileFishingState(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, 0, 0); + SetSurfBlob_PlayerOffset(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, FALSE, 0); gSprites[gPlayerAvatar.spriteId].pos2.x = 0; gSprites[gPlayerAvatar.spriteId].pos2.y = 0; ClearDialogWindowAndFrame(0, TRUE); @@ -1989,7 +1989,7 @@ static bool8 Fishing_PutRodAway(struct Task *task) ObjectEventSetGraphicsId(playerObjEvent, task->tPlayerGfxId); ObjectEventTurn(playerObjEvent, playerObjEvent->movementDirection); if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING) - SetSurfBobWhileFishingState(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, 0, 0); + SetSurfBlob_PlayerOffset(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, FALSE, 0); gSprites[gPlayerAvatar.spriteId].pos2.x = 0; gSprites[gPlayerAvatar.spriteId].pos2.y = 0; task->tStep++; @@ -2048,7 +2048,7 @@ static void AlignFishingAnimationFrames(void) if (animType == 10 || animType == 11) playerSprite->pos2.y = 8; if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING) - SetSurfBobWhileFishingState(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, 1, playerSprite->pos2.y); + SetSurfBlob_PlayerOffset(gObjectEvents[gPlayerAvatar.objectEventId].fieldEffectSpriteId, TRUE, playerSprite->pos2.y); } void SetSpinStartFacingDir(u8 direction) From 806abe2999ebb94b544c2d1db961fcec66c16537 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 5 Apr 2021 19:52:35 -0400 Subject: [PATCH 14/63] Document some objev anims, make objevgfx info static --- include/event_object_movement.h | 1 - src/data/field_effects/field_effect_objects.h | 12 +- .../berry_tree_graphics_tables.h | 146 ++-- src/data/object_events/object_event_anims.h | 749 +++++++++--------- .../object_event_graphics_info.h | 490 ++++++------ .../object_events/object_event_pic_tables.h | 438 +++++----- .../object_events/object_event_subsprites.h | 166 ++-- src/event_object_movement.c | 2 + 8 files changed, 1005 insertions(+), 999 deletions(-) diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 79b8921f0..446d0dd4e 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -65,7 +65,6 @@ struct LockedAnimObjectEvents u8 count; }; -extern const struct SpriteFrameImage gObjectEventPicTable_PechaBerryTree[]; extern const struct OamData gObjectEventBaseOam_32x8; extern const struct OamData gObjectEventBaseOam_32x32; extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[]; diff --git a/src/data/field_effects/field_effect_objects.h b/src/data/field_effects/field_effect_objects.h index 4fc3ecff6..54145efbc 100755 --- a/src/data/field_effects/field_effect_objects.h +++ b/src/data/field_effects/field_effect_objects.h @@ -1263,16 +1263,16 @@ const struct SpriteTemplate gFieldEffectObjectTemplate_SmallSparkle = { const struct SpritePalette gSpritePalette_SmallSparkle = {gFieldEffectPal_SmallSparkle, FLDEFF_PAL_TAG_SMALL_SPARKLE}; -static const union AnimCmd sAnim_Rayquaza[] = { +static const union AnimCmd sAnim_RayquazaSpotlightEffect[] = { ANIMCMD_FRAME(0, 1), ANIMCMD_END, }; -static const union AnimCmd *const sAnimTable_Rayquaza[] = { - sAnim_Rayquaza, +static const union AnimCmd *const sAnimTable_RayquazaSpotlightEffect[] = { + sAnim_RayquazaSpotlightEffect, }; -const struct SpriteFrameImage sPicTable_Rayquaza[] = { +const struct SpriteFrameImage sPicTable_RayquazaSpotlightEffect[] = { overworld_frame(gObjectEventPic_Rayquaza, 4, 4, 0), }; @@ -1280,8 +1280,8 @@ const struct SpriteTemplate gFieldEffectObjectTemplate_Rayquaza = { .tileTag = 0xFFFF, .paletteTag = 0xFFFF, .oam = &gObjectEventBaseOam_32x32, - .anims = sAnimTable_Rayquaza, - .images = sPicTable_Rayquaza, + .anims = sAnimTable_RayquazaSpotlightEffect, + .images = sPicTable_RayquazaSpotlightEffect, .affineAnims = gDummySpriteAffineAnimTable, .callback = UpdateRayquazaSpotlightEffect, }; diff --git a/src/data/object_events/berry_tree_graphics_tables.h b/src/data/object_events/berry_tree_graphics_tables.h index d558b583f..390c82f95 100755 --- a/src/data/object_events/berry_tree_graphics_tables.h +++ b/src/data/object_events/berry_tree_graphics_tables.h @@ -1,4 +1,4 @@ -const struct SpriteFrameImage gObjectEventPicTable_PechaBerryTree[] = { +static const struct SpriteFrameImage sPicTable_PechaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -12,7 +12,7 @@ const struct SpriteFrameImage gObjectEventPicTable_PechaBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Pecha[] = {3, 4, 4, 4, 4}; -const struct SpriteFrameImage gObjectEventPicTable_KelpsyBerryTree[] = { +static const struct SpriteFrameImage sPicTable_KelpsyBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -26,7 +26,7 @@ const struct SpriteFrameImage gObjectEventPicTable_KelpsyBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Kelpsy[] = {3, 4, 2, 2, 2}; -const struct SpriteFrameImage gObjectEventPicTable_WepearBerryTree[] = { +static const struct SpriteFrameImage sPicTable_WepearBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -40,7 +40,7 @@ const struct SpriteFrameImage gObjectEventPicTable_WepearBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Wepear[] = {3, 4, 2, 2, 2}; -const struct SpriteFrameImage gObjectEventPicTable_IapapaBerryTree[] = { +static const struct SpriteFrameImage sPicTable_IapapaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -54,7 +54,7 @@ const struct SpriteFrameImage gObjectEventPicTable_IapapaBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Iapapa[] = {3, 4, 3, 3, 3}; -const struct SpriteFrameImage gObjectEventPicTable_CheriBerryTree[] = { +static const struct SpriteFrameImage sPicTable_CheriBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -68,7 +68,7 @@ const struct SpriteFrameImage gObjectEventPicTable_CheriBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Cheri[] = {3, 4, 4, 4, 4}; -const struct SpriteFrameImage gObjectEventPicTable_FigyBerryTree[] = { +static const struct SpriteFrameImage sPicTable_FigyBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -82,7 +82,7 @@ const struct SpriteFrameImage gObjectEventPicTable_FigyBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Figy[] = {3, 4, 3, 3, 3}; -const struct SpriteFrameImage gObjectEventPicTable_MagoBerryTree[] = { +static const struct SpriteFrameImage sPicTable_MagoBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -96,7 +96,7 @@ const struct SpriteFrameImage gObjectEventPicTable_MagoBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Mago[] = {3, 4, 3, 3, 3}; -const struct SpriteFrameImage gObjectEventPicTable_LumBerryTree[] = { +static const struct SpriteFrameImage sPicTable_LumBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -110,7 +110,7 @@ const struct SpriteFrameImage gObjectEventPicTable_LumBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Lum[] = {3, 4, 4, 4, 4}; -const struct SpriteFrameImage gObjectEventPicTable_RazzBerryTree[] = { +static const struct SpriteFrameImage sPicTable_RazzBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -124,7 +124,7 @@ const struct SpriteFrameImage gObjectEventPicTable_RazzBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Razz[] = {3, 4, 4, 4, 4}; -const struct SpriteFrameImage gObjectEventPicTable_GrepaBerryTree[] = { +static const struct SpriteFrameImage sPicTable_GrepaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -138,7 +138,7 @@ const struct SpriteFrameImage gObjectEventPicTable_GrepaBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Grepa[] = {3, 4, 3, 3, 3}; -const struct SpriteFrameImage gObjectEventPicTable_RabutaBerryTree[] = { +static const struct SpriteFrameImage sPicTable_RabutaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -152,7 +152,7 @@ const struct SpriteFrameImage gObjectEventPicTable_RabutaBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Rabuta[] = {3, 4, 4, 4, 4}; -const struct SpriteFrameImage gObjectEventPicTable_NomelBerryTree[] = { +static const struct SpriteFrameImage sPicTable_NomelBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -166,7 +166,7 @@ const struct SpriteFrameImage gObjectEventPicTable_NomelBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Nomel[] = {3, 4, 3, 3, 3}; -const struct SpriteFrameImage gObjectEventPicTable_LeppaBerryTree[] = { +static const struct SpriteFrameImage sPicTable_LeppaBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -180,7 +180,7 @@ const struct SpriteFrameImage gObjectEventPicTable_LeppaBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Leppa[] = {3, 4, 3, 3, 3}; -const struct SpriteFrameImage gObjectEventPicTable_LiechiBerryTree[] = { +static const struct SpriteFrameImage sPicTable_LiechiBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -194,7 +194,7 @@ const struct SpriteFrameImage gObjectEventPicTable_LiechiBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Liechi[] = {3, 4, 4, 4, 4}; -const struct SpriteFrameImage gObjectEventPicTable_HondewBerryTree[] = { +static const struct SpriteFrameImage sPicTable_HondewBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -208,7 +208,7 @@ const struct SpriteFrameImage gObjectEventPicTable_HondewBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Hondew[] = {3, 4, 5, 5, 5}; -const struct SpriteFrameImage gObjectEventPicTable_AguavBerryTree[] = { +static const struct SpriteFrameImage sPicTable_AguavBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -222,7 +222,7 @@ const struct SpriteFrameImage gObjectEventPicTable_AguavBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Aguav[] = {3, 4, 4, 4, 4}; -const struct SpriteFrameImage gObjectEventPicTable_WikiBerryTree[] = { +static const struct SpriteFrameImage sPicTable_WikiBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -236,7 +236,7 @@ const struct SpriteFrameImage gObjectEventPicTable_WikiBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Wiki[] = {3, 4, 3, 3, 3}; -const struct SpriteFrameImage gObjectEventPicTable_PomegBerryTree[] = { +static const struct SpriteFrameImage sPicTable_PomegBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -250,7 +250,7 @@ const struct SpriteFrameImage gObjectEventPicTable_PomegBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Pomeg[] = {3, 4, 3, 3, 3}; -const struct SpriteFrameImage gObjectEventPicTable_RawstBerryTree[] = { +static const struct SpriteFrameImage sPicTable_RawstBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -264,7 +264,7 @@ const struct SpriteFrameImage gObjectEventPicTable_RawstBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Rawst[] = {3, 4, 4, 4, 4}; -const struct SpriteFrameImage gObjectEventPicTable_SpelonBerryTree[] = { +static const struct SpriteFrameImage sPicTable_SpelonBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -278,7 +278,7 @@ const struct SpriteFrameImage gObjectEventPicTable_SpelonBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Spelon[] = {3, 4, 3, 3, 3}; -const struct SpriteFrameImage gObjectEventPicTable_ChestoBerryTree[] = { +static const struct SpriteFrameImage sPicTable_ChestoBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -292,7 +292,7 @@ const struct SpriteFrameImage gObjectEventPicTable_ChestoBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Chesto[] = {3, 4, 2, 2, 2}; -const struct SpriteFrameImage gObjectEventPicTable_OranBerryTree[] = { +static const struct SpriteFrameImage sPicTable_OranBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -306,7 +306,7 @@ const struct SpriteFrameImage gObjectEventPicTable_OranBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Oran[] = {3, 4, 2, 2, 2}; -const struct SpriteFrameImage gObjectEventPicTable_PersimBerryTree[] = { +static const struct SpriteFrameImage sPicTable_PersimBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -320,7 +320,7 @@ const struct SpriteFrameImage gObjectEventPicTable_PersimBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Persim[] = {3, 4, 2, 2, 2}; -const struct SpriteFrameImage gObjectEventPicTable_SitrusBerryTree[] = { +static const struct SpriteFrameImage sPicTable_SitrusBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -334,7 +334,7 @@ const struct SpriteFrameImage gObjectEventPicTable_SitrusBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Sitrus[] = {3, 4, 4, 4, 4}; -const struct SpriteFrameImage gObjectEventPicTable_AspearBerryTree[] = { +static const struct SpriteFrameImage sPicTable_AspearBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -348,7 +348,7 @@ const struct SpriteFrameImage gObjectEventPicTable_AspearBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Aspear[] = {3, 4, 3, 3, 3}; -const struct SpriteFrameImage gObjectEventPicTable_PamtreBerryTree[] = { +static const struct SpriteFrameImage sPicTable_PamtreBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -362,7 +362,7 @@ const struct SpriteFrameImage gObjectEventPicTable_PamtreBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Pamtre[] = {3, 4, 2, 2, 2}; -const struct SpriteFrameImage gObjectEventPicTable_CornnBerryTree[] = { +static const struct SpriteFrameImage sPicTable_CornnBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -376,7 +376,7 @@ const struct SpriteFrameImage gObjectEventPicTable_CornnBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Cornn[] = {3, 4, 2, 2, 2}; -const struct SpriteFrameImage gObjectEventPicTable_LansatBerryTree[] = { +static const struct SpriteFrameImage sPicTable_LansatBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -390,7 +390,7 @@ const struct SpriteFrameImage gObjectEventPicTable_LansatBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Lansat[] = {3, 4, 2, 2, 2}; -const struct SpriteFrameImage gObjectEventPicTable_DurinBerryTree[] = { +static const struct SpriteFrameImage sPicTable_DurinBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -404,7 +404,7 @@ const struct SpriteFrameImage gObjectEventPicTable_DurinBerryTree[] = { const u8 gBerryTreePaletteSlotTable_Durin[] = {3, 4, 4, 4, 4}; -const struct SpriteFrameImage gObjectEventPicTable_TamatoBerryTree[] = { +static const struct SpriteFrameImage sPicTable_TamatoBerryTree[] = { overworld_frame(gObjectEventPic_BerryTreeDirtPile, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 0), overworld_frame(gObjectEventPic_BerryTreeSprout, 2, 2, 1), @@ -423,49 +423,49 @@ const u8 gDeadBerryTreeObjectEventGraphicsIdTable[] = {OBJ_EVENT_GFX_BERRY_TREE_ const u8 gBerryTreeObjectEventGraphicsIdTable[] = {OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES, OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES}; const struct SpriteFrameImage *const gBerryTreePicTablePointers[] = { - [ITEM_CHERI_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_CheriBerryTree, - [ITEM_CHESTO_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_ChestoBerryTree, - [ITEM_PECHA_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_PechaBerryTree, - [ITEM_RAWST_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_RawstBerryTree, - [ITEM_ASPEAR_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_AspearBerryTree, - [ITEM_LEPPA_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_LeppaBerryTree, - [ITEM_ORAN_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_OranBerryTree, - [ITEM_PERSIM_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_PersimBerryTree, - [ITEM_LUM_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_LumBerryTree, - [ITEM_SITRUS_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_SitrusBerryTree, - [ITEM_FIGY_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_FigyBerryTree, - [ITEM_WIKI_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_WikiBerryTree, - [ITEM_MAGO_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_MagoBerryTree, - [ITEM_AGUAV_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_AguavBerryTree, - [ITEM_IAPAPA_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_IapapaBerryTree, - [ITEM_RAZZ_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_RazzBerryTree, - [ITEM_BLUK_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_RazzBerryTree, - [ITEM_NANAB_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_MagoBerryTree, - [ITEM_WEPEAR_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_WepearBerryTree, - [ITEM_PINAP_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_IapapaBerryTree, - [ITEM_POMEG_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_PomegBerryTree, - [ITEM_KELPSY_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_KelpsyBerryTree, - [ITEM_QUALOT_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_WepearBerryTree, - [ITEM_HONDEW_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_HondewBerryTree, - [ITEM_GREPA_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_GrepaBerryTree, - [ITEM_TAMATO_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_TamatoBerryTree, - [ITEM_CORNN_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_CornnBerryTree, - [ITEM_MAGOST_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_PomegBerryTree, - [ITEM_RABUTA_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_RabutaBerryTree, - [ITEM_NOMEL_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_NomelBerryTree, - [ITEM_SPELON_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_SpelonBerryTree, - [ITEM_PAMTRE_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_PamtreBerryTree, - [ITEM_WATMEL_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_RabutaBerryTree, - [ITEM_DURIN_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_DurinBerryTree, - [ITEM_BELUE_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_HondewBerryTree, - [ITEM_LIECHI_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_LiechiBerryTree, - [ITEM_GANLON_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_HondewBerryTree, - [ITEM_SALAC_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_AguavBerryTree, - [ITEM_PETAYA_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_PomegBerryTree, - [ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_GrepaBerryTree, - [ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_LansatBerryTree, - [ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_CornnBerryTree, - [ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = gObjectEventPicTable_DurinBerryTree, + [ITEM_CHERI_BERRY - FIRST_BERRY_INDEX] = sPicTable_CheriBerryTree, + [ITEM_CHESTO_BERRY - FIRST_BERRY_INDEX] = sPicTable_ChestoBerryTree, + [ITEM_PECHA_BERRY - FIRST_BERRY_INDEX] = sPicTable_PechaBerryTree, + [ITEM_RAWST_BERRY - FIRST_BERRY_INDEX] = sPicTable_RawstBerryTree, + [ITEM_ASPEAR_BERRY - FIRST_BERRY_INDEX] = sPicTable_AspearBerryTree, + [ITEM_LEPPA_BERRY - FIRST_BERRY_INDEX] = sPicTable_LeppaBerryTree, + [ITEM_ORAN_BERRY - FIRST_BERRY_INDEX] = sPicTable_OranBerryTree, + [ITEM_PERSIM_BERRY - FIRST_BERRY_INDEX] = sPicTable_PersimBerryTree, + [ITEM_LUM_BERRY - FIRST_BERRY_INDEX] = sPicTable_LumBerryTree, + [ITEM_SITRUS_BERRY - FIRST_BERRY_INDEX] = sPicTable_SitrusBerryTree, + [ITEM_FIGY_BERRY - FIRST_BERRY_INDEX] = sPicTable_FigyBerryTree, + [ITEM_WIKI_BERRY - FIRST_BERRY_INDEX] = sPicTable_WikiBerryTree, + [ITEM_MAGO_BERRY - FIRST_BERRY_INDEX] = sPicTable_MagoBerryTree, + [ITEM_AGUAV_BERRY - FIRST_BERRY_INDEX] = sPicTable_AguavBerryTree, + [ITEM_IAPAPA_BERRY - FIRST_BERRY_INDEX] = sPicTable_IapapaBerryTree, + [ITEM_RAZZ_BERRY - FIRST_BERRY_INDEX] = sPicTable_RazzBerryTree, + [ITEM_BLUK_BERRY - FIRST_BERRY_INDEX] = sPicTable_RazzBerryTree, + [ITEM_NANAB_BERRY - FIRST_BERRY_INDEX] = sPicTable_MagoBerryTree, + [ITEM_WEPEAR_BERRY - FIRST_BERRY_INDEX] = sPicTable_WepearBerryTree, + [ITEM_PINAP_BERRY - FIRST_BERRY_INDEX] = sPicTable_IapapaBerryTree, + [ITEM_POMEG_BERRY - FIRST_BERRY_INDEX] = sPicTable_PomegBerryTree, + [ITEM_KELPSY_BERRY - FIRST_BERRY_INDEX] = sPicTable_KelpsyBerryTree, + [ITEM_QUALOT_BERRY - FIRST_BERRY_INDEX] = sPicTable_WepearBerryTree, + [ITEM_HONDEW_BERRY - FIRST_BERRY_INDEX] = sPicTable_HondewBerryTree, + [ITEM_GREPA_BERRY - FIRST_BERRY_INDEX] = sPicTable_GrepaBerryTree, + [ITEM_TAMATO_BERRY - FIRST_BERRY_INDEX] = sPicTable_TamatoBerryTree, + [ITEM_CORNN_BERRY - FIRST_BERRY_INDEX] = sPicTable_CornnBerryTree, + [ITEM_MAGOST_BERRY - FIRST_BERRY_INDEX] = sPicTable_PomegBerryTree, + [ITEM_RABUTA_BERRY - FIRST_BERRY_INDEX] = sPicTable_RabutaBerryTree, + [ITEM_NOMEL_BERRY - FIRST_BERRY_INDEX] = sPicTable_NomelBerryTree, + [ITEM_SPELON_BERRY - FIRST_BERRY_INDEX] = sPicTable_SpelonBerryTree, + [ITEM_PAMTRE_BERRY - FIRST_BERRY_INDEX] = sPicTable_PamtreBerryTree, + [ITEM_WATMEL_BERRY - FIRST_BERRY_INDEX] = sPicTable_RabutaBerryTree, + [ITEM_DURIN_BERRY - FIRST_BERRY_INDEX] = sPicTable_DurinBerryTree, + [ITEM_BELUE_BERRY - FIRST_BERRY_INDEX] = sPicTable_HondewBerryTree, + [ITEM_LIECHI_BERRY - FIRST_BERRY_INDEX] = sPicTable_LiechiBerryTree, + [ITEM_GANLON_BERRY - FIRST_BERRY_INDEX] = sPicTable_HondewBerryTree, + [ITEM_SALAC_BERRY - FIRST_BERRY_INDEX] = sPicTable_AguavBerryTree, + [ITEM_PETAYA_BERRY - FIRST_BERRY_INDEX] = sPicTable_PomegBerryTree, + [ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = sPicTable_GrepaBerryTree, + [ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = sPicTable_LansatBerryTree, + [ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = sPicTable_CornnBerryTree, + [ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = sPicTable_DurinBerryTree, }; const u8 *const gBerryTreePaletteSlotTablePointers[] = { diff --git a/src/data/object_events/object_event_anims.h b/src/data/object_events/object_event_anims.h index b319c2845..109c0abc7 100755 --- a/src/data/object_events/object_event_anims.h +++ b/src/data/object_events/object_event_anims.h @@ -1,4 +1,4 @@ -const union AnimCmd gObjectEventImageAnim_StayStill[] = +static const union AnimCmd sAnim_StayStill[] = { ANIMCMD_FRAME(0, 8), ANIMCMD_FRAME(0, 8), @@ -7,31 +7,31 @@ const union AnimCmd gObjectEventImageAnim_StayStill[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpFaceSouth[] = +static const union AnimCmd sAnim_QuintyPlumpFaceSouth[] = { ANIMCMD_FRAME(0, 16), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpFaceNorth[] = +static const union AnimCmd sAnim_QuintyPlumpFaceNorth[] = { ANIMCMD_FRAME(1, 16), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpFaceWest[] = +static const union AnimCmd sAnim_QuintyPlumpFaceWest[] = { ANIMCMD_FRAME(2, 16), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpFaceEast[] = +static const union AnimCmd sAnim_QuintyPlumpFaceEast[] = { ANIMCMD_FRAME(2, 16, .hFlip = TRUE), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoSouth[] = +static const union AnimCmd sAnim_QuintyPlumpGoSouth[] = { ANIMCMD_FRAME(3, 8), ANIMCMD_FRAME(0, 8), @@ -40,7 +40,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoSouth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoNorth[] = +static const union AnimCmd sAnim_QuintyPlumpGoNorth[] = { ANIMCMD_FRAME(4, 8), ANIMCMD_FRAME(1, 8), @@ -49,7 +49,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoNorth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoWest[] = +static const union AnimCmd sAnim_QuintyPlumpGoWest[] = { ANIMCMD_FRAME(5, 8), ANIMCMD_FRAME(2, 8), @@ -58,7 +58,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoWest[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoEast[] = +static const union AnimCmd sAnim_QuintyPlumpGoEast[] = { ANIMCMD_FRAME(5, 8, .hFlip = TRUE), ANIMCMD_FRAME(2, 8, .hFlip = TRUE), @@ -67,7 +67,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoEast[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastSouth[] = +static const union AnimCmd sAnim_QuintyPlumpGoFastSouth[] = { ANIMCMD_FRAME(3, 4), ANIMCMD_FRAME(0, 4), @@ -76,7 +76,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastSouth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastNorth[] = +static const union AnimCmd sAnim_QuintyPlumpGoFastNorth[] = { ANIMCMD_FRAME(4, 4), ANIMCMD_FRAME(1, 4), @@ -85,7 +85,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastNorth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastWest[] = +static const union AnimCmd sAnim_QuintyPlumpGoFastWest[] = { ANIMCMD_FRAME(5, 4), ANIMCMD_FRAME(2, 4), @@ -94,7 +94,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastWest[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastEast[] = +static const union AnimCmd sAnim_QuintyPlumpGoFastEast[] = { ANIMCMD_FRAME(5, 4, .hFlip = TRUE), ANIMCMD_FRAME(2, 4, .hFlip = TRUE), @@ -103,7 +103,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastEast[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFasterSouth[] = +static const union AnimCmd sAnim_QuintyPlumpGoFasterSouth[] = { ANIMCMD_FRAME(3, 2), ANIMCMD_FRAME(0, 2), @@ -112,7 +112,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFasterSouth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFasterNorth[] = +static const union AnimCmd sAnim_QuintyPlumpGoFasterNorth[] = { ANIMCMD_FRAME(4, 2), ANIMCMD_FRAME(1, 2), @@ -121,7 +121,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFasterNorth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFasterWest[] = +static const union AnimCmd sAnim_QuintyPlumpGoFasterWest[] = { ANIMCMD_FRAME(5, 2), ANIMCMD_FRAME(2, 2), @@ -130,7 +130,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFasterWest[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFasterEast[] = +static const union AnimCmd sAnim_QuintyPlumpGoFasterEast[] = { ANIMCMD_FRAME(5, 2, .hFlip = TRUE), ANIMCMD_FRAME(2, 2, .hFlip = TRUE), @@ -139,7 +139,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFasterEast[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastestSouth[] = +static const union AnimCmd sAnim_QuintyPlumpGoFastestSouth[] = { ANIMCMD_FRAME(3, 1), ANIMCMD_FRAME(0, 1), @@ -148,7 +148,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastestSouth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastestNorth[] = +static const union AnimCmd sAnim_QuintyPlumpGoFastestNorth[] = { ANIMCMD_FRAME(4, 1), ANIMCMD_FRAME(1, 1), @@ -157,7 +157,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastestNorth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastestWest[] = +static const union AnimCmd sAnim_QuintyPlumpGoFastestWest[] = { ANIMCMD_FRAME(5, 1), ANIMCMD_FRAME(2, 1), @@ -166,7 +166,7 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastestWest[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastestEast[] = +static const union AnimCmd sAnim_QuintyPlumpGoFastestEast[] = { ANIMCMD_FRAME(5, 1, .hFlip = TRUE), ANIMCMD_FRAME(2, 1, .hFlip = TRUE), @@ -175,31 +175,31 @@ const union AnimCmd gObjectEventImageAnim_QuintyPlumpGoFastestEast[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_FaceSouth[] = +static const union AnimCmd sAnim_FaceSouth[] = { ANIMCMD_FRAME(0, 16), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_FaceNorth[] = +static const union AnimCmd sAnim_FaceNorth[] = { ANIMCMD_FRAME(1, 16), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_FaceWest[] = +static const union AnimCmd sAnim_FaceWest[] = { ANIMCMD_FRAME(2, 16), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_FaceEast[] = +static const union AnimCmd sAnim_FaceEast[] = { ANIMCMD_FRAME(2, 16, .hFlip = TRUE), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoSouth[] = +static const union AnimCmd sAnim_GoSouth[] = { ANIMCMD_FRAME(3, 8), ANIMCMD_FRAME(0, 8), @@ -208,7 +208,7 @@ const union AnimCmd gObjectEventImageAnim_GoSouth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoNorth[] = +static const union AnimCmd sAnim_GoNorth[] = { ANIMCMD_FRAME(5, 8), ANIMCMD_FRAME(1, 8), @@ -217,7 +217,7 @@ const union AnimCmd gObjectEventImageAnim_GoNorth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoWest[] = +static const union AnimCmd sAnim_GoWest[] = { ANIMCMD_FRAME(7, 8), ANIMCMD_FRAME(2, 8), @@ -226,7 +226,7 @@ const union AnimCmd gObjectEventImageAnim_GoWest[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoEast[] = +static const union AnimCmd sAnim_GoEast[] = { ANIMCMD_FRAME(7, 8, .hFlip = TRUE), ANIMCMD_FRAME(2, 8, .hFlip = TRUE), @@ -235,7 +235,7 @@ const union AnimCmd gObjectEventImageAnim_GoEast[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoFastSouth[] = +static const union AnimCmd sAnim_GoFastSouth[] = { ANIMCMD_FRAME(3, 4), ANIMCMD_FRAME(0, 4), @@ -244,7 +244,7 @@ const union AnimCmd gObjectEventImageAnim_GoFastSouth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoFastNorth[] = +static const union AnimCmd sAnim_GoFastNorth[] = { ANIMCMD_FRAME(5, 4), ANIMCMD_FRAME(1, 4), @@ -253,7 +253,7 @@ const union AnimCmd gObjectEventImageAnim_GoFastNorth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoFastWest[] = +static const union AnimCmd sAnim_GoFastWest[] = { ANIMCMD_FRAME(7, 4), ANIMCMD_FRAME(2, 4), @@ -262,7 +262,7 @@ const union AnimCmd gObjectEventImageAnim_GoFastWest[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoFastEast[] = +static const union AnimCmd sAnim_GoFastEast[] = { ANIMCMD_FRAME(7, 4, .hFlip = TRUE), ANIMCMD_FRAME(2, 4, .hFlip = TRUE), @@ -271,7 +271,7 @@ const union AnimCmd gObjectEventImageAnim_GoFastEast[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoFasterSouth[] = +static const union AnimCmd sAnim_GoFasterSouth[] = { ANIMCMD_FRAME(3, 2), ANIMCMD_FRAME(0, 2), @@ -280,7 +280,7 @@ const union AnimCmd gObjectEventImageAnim_GoFasterSouth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoFasterNorth[] = +static const union AnimCmd sAnim_GoFasterNorth[] = { ANIMCMD_FRAME(5, 2), ANIMCMD_FRAME(1, 2), @@ -289,7 +289,7 @@ const union AnimCmd gObjectEventImageAnim_GoFasterNorth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoFasterWest[] = +static const union AnimCmd sAnim_GoFasterWest[] = { ANIMCMD_FRAME(7, 2), ANIMCMD_FRAME(2, 2), @@ -298,7 +298,7 @@ const union AnimCmd gObjectEventImageAnim_GoFasterWest[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoFasterEast[] = +static const union AnimCmd sAnim_GoFasterEast[] = { ANIMCMD_FRAME(7, 2, .hFlip = TRUE), ANIMCMD_FRAME(2, 2, .hFlip = TRUE), @@ -307,7 +307,7 @@ const union AnimCmd gObjectEventImageAnim_GoFasterEast[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoFastestSouth[] = +static const union AnimCmd sAnim_GoFastestSouth[] = { ANIMCMD_FRAME(3, 1), ANIMCMD_FRAME(0, 1), @@ -316,7 +316,7 @@ const union AnimCmd gObjectEventImageAnim_GoFastestSouth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoFastestNorth[] = +static const union AnimCmd sAnim_GoFastestNorth[] = { ANIMCMD_FRAME(5, 1), ANIMCMD_FRAME(1, 1), @@ -325,7 +325,7 @@ const union AnimCmd gObjectEventImageAnim_GoFastestNorth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoFastestWest[] = +static const union AnimCmd sAnim_GoFastestWest[] = { ANIMCMD_FRAME(7, 1), ANIMCMD_FRAME(2, 1), @@ -334,7 +334,7 @@ const union AnimCmd gObjectEventImageAnim_GoFastestWest[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GoFastestEast[] = +static const union AnimCmd sAnim_GoFastestEast[] = { ANIMCMD_FRAME(7, 1, .hFlip = TRUE), ANIMCMD_FRAME(2, 1, .hFlip = TRUE), @@ -343,7 +343,7 @@ const union AnimCmd gObjectEventImageAnim_GoFastestEast[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_RunSouth[] = +static const union AnimCmd sAnim_RunSouth[] = { ANIMCMD_FRAME(12, 5), ANIMCMD_FRAME(9, 3), @@ -352,7 +352,7 @@ const union AnimCmd gObjectEventImageAnim_RunSouth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_RunNorth[] = +static const union AnimCmd sAnim_RunNorth[] = { ANIMCMD_FRAME(14, 5), ANIMCMD_FRAME(10, 3), @@ -361,7 +361,7 @@ const union AnimCmd gObjectEventImageAnim_RunNorth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_RunWest[] = +static const union AnimCmd sAnim_RunWest[] = { ANIMCMD_FRAME(16, 5), ANIMCMD_FRAME(11, 3), @@ -370,7 +370,7 @@ const union AnimCmd gObjectEventImageAnim_RunWest[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_RunEast[] = +static const union AnimCmd sAnim_RunEast[] = { ANIMCMD_FRAME(16, 5, .hFlip = TRUE), ANIMCMD_FRAME(11, 3, .hFlip = TRUE), @@ -379,7 +379,7 @@ const union AnimCmd gObjectEventImageAnim_RunEast[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_FieldMove[] = +static const union AnimCmd sAnim_FieldMove[] = { ANIMCMD_FRAME(0, 4), ANIMCMD_FRAME(1, 4), @@ -389,143 +389,143 @@ const union AnimCmd gObjectEventImageAnim_FieldMove[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_GetOnOffSurfBlobSouth[] = +static const union AnimCmd sAnim_GetOnOffSurfBlobSouth[] = { ANIMCMD_FRAME(9, 32), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GetOnOffSurfBlobNorth[] = +static const union AnimCmd sAnim_GetOnOffSurfBlobNorth[] = { ANIMCMD_FRAME(10, 32), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GetOnOffSurfBlobWest[] = +static const union AnimCmd sAnim_GetOnOffSurfBlobWest[] = { ANIMCMD_FRAME(11, 32), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_GetOnOffSurfBlobEast[] = +static const union AnimCmd sAnim_GetOnOffSurfBlobEast[] = { ANIMCMD_FRAME(11, 32, .hFlip = TRUE), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_BunnyHoppyBackWheelSouth[] = +static const union AnimCmd sAnim_BunnyHoppyBackWheelSouth[] = { ANIMCMD_FRAME(9, 4), ANIMCMD_FRAME(10, 4), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_BunnyHoppyBackWheelNorth[] = +static const union AnimCmd sAnim_BunnyHoppyBackWheelNorth[] = { ANIMCMD_FRAME(13, 4), ANIMCMD_FRAME(14, 4), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_BunnyHoppyBackWheelWest[] = +static const union AnimCmd sAnim_BunnyHoppyBackWheelWest[] = { ANIMCMD_FRAME(17, 4), ANIMCMD_FRAME(18, 4), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_BunnyHoppyBackWheelEast[] = +static const union AnimCmd sAnim_BunnyHoppyBackWheelEast[] = { ANIMCMD_FRAME(17, 4, .hFlip = TRUE), ANIMCMD_FRAME(18, 4, .hFlip = TRUE), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_BunnyHoppyFrontWheelSouth[] = +static const union AnimCmd sAnim_BunnyHoppyFrontWheelSouth[] = { ANIMCMD_FRAME(11, 4), ANIMCMD_FRAME(12, 4), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_BunnyHoppyFrontWheelNorth[] = +static const union AnimCmd sAnim_BunnyHoppyFrontWheelNorth[] = { ANIMCMD_FRAME(15, 4), ANIMCMD_FRAME(16, 4), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_BunnyHoppyFrontWheelWest[] = +static const union AnimCmd sAnim_BunnyHoppyFrontWheelWest[] = { ANIMCMD_FRAME(19, 4), ANIMCMD_FRAME(20, 4), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_BunnyHoppyFrontWheelEast[] = +static const union AnimCmd sAnim_BunnyHoppyFrontWheelEast[] = { ANIMCMD_FRAME(19, 4, .hFlip = TRUE), ANIMCMD_FRAME(20, 4, .hFlip = TRUE), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_StandingWheelieBackWheelSouth[] = +static const union AnimCmd sAnim_StandingWheelieBackWheelSouth[] = { ANIMCMD_FRAME(9, 4), ANIMCMD_FRAME(0, 4), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_StandingWheelieBackWheelNorth[] = +static const union AnimCmd sAnim_StandingWheelieBackWheelNorth[] = { ANIMCMD_FRAME(13, 4), ANIMCMD_FRAME(1, 4), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_StandingWheelieBackWheelWest[] = +static const union AnimCmd sAnim_StandingWheelieBackWheelWest[] = { ANIMCMD_FRAME(17, 4), ANIMCMD_FRAME(2, 4), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_StandingWheelieBackWheelEast[] = +static const union AnimCmd sAnim_StandingWheelieBackWheelEast[] = { ANIMCMD_FRAME(17, 4, .hFlip = TRUE), ANIMCMD_FRAME(2, 4, .hFlip = TRUE), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_StandingWheelieFrontWheelSouth[] = +static const union AnimCmd sAnim_StandingWheelieFrontWheelSouth[] = { ANIMCMD_FRAME(11, 4), ANIMCMD_FRAME(0, 4), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_StandingWheelieFrontWheelNorth[] = +static const union AnimCmd sAnim_StandingWheelieFrontWheelNorth[] = { ANIMCMD_FRAME(15, 4), ANIMCMD_FRAME(1, 4), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_StandingWheelieFrontWheelWest[] = +static const union AnimCmd sAnim_StandingWheelieFrontWheelWest[] = { ANIMCMD_FRAME(19, 4), ANIMCMD_FRAME(2, 4), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_StandingWheelieFrontWheelEast[] = +static const union AnimCmd sAnim_StandingWheelieFrontWheelEast[] = { ANIMCMD_FRAME(19, 4, .hFlip = TRUE), ANIMCMD_FRAME(2, 4, .hFlip = TRUE), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_MovingWheelieSouth[] = +static const union AnimCmd sAnim_MovingWheelieSouth[] = { ANIMCMD_FRAME(21, 4), ANIMCMD_FRAME(10, 4), @@ -534,7 +534,7 @@ const union AnimCmd gObjectEventImageAnim_MovingWheelieSouth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_MovingWheelieNorth[] = +static const union AnimCmd sAnim_MovingWheelieNorth[] = { ANIMCMD_FRAME(23, 4), ANIMCMD_FRAME(14, 4), @@ -543,7 +543,7 @@ const union AnimCmd gObjectEventImageAnim_MovingWheelieNorth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_MovingWheelieWest[] = +static const union AnimCmd sAnim_MovingWheelieWest[] = { ANIMCMD_FRAME(25, 4), ANIMCMD_FRAME(18, 4), @@ -552,7 +552,7 @@ const union AnimCmd gObjectEventImageAnim_MovingWheelieWest[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_MovingWheelieEast[] = +static const union AnimCmd sAnim_MovingWheelieEast[] = { ANIMCMD_FRAME(25, 4, .hFlip = TRUE), ANIMCMD_FRAME(18, 4, .hFlip = TRUE), @@ -561,27 +561,27 @@ const union AnimCmd gObjectEventImageAnim_MovingWheelieEast[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_BerryTreeStage0[] = +static const union AnimCmd sAnim_BerryTreeStage0[] = { ANIMCMD_FRAME(0, 32), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_BerryTreeStage1[] = +static const union AnimCmd sAnim_BerryTreeStage1[] = { ANIMCMD_FRAME(1, 32), ANIMCMD_FRAME(2, 32), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_BerryTreeStage2[] = +static const union AnimCmd sAnim_BerryTreeStage2[] = { ANIMCMD_FRAME(3, 48), ANIMCMD_FRAME(4, 48), ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_BerryTreeStage3[] = +static const union AnimCmd sAnim_BerryTreeStage3[] = { ANIMCMD_FRAME(5, 32), ANIMCMD_FRAME(5, 32), @@ -590,7 +590,7 @@ const union AnimCmd gObjectEventImageAnim_BerryTreeStage3[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_BerryTreeStage4[] = +static const union AnimCmd sAnim_BerryTreeStage4[] = { ANIMCMD_FRAME(7, 48), ANIMCMD_FRAME(7, 48), @@ -599,7 +599,7 @@ const union AnimCmd gObjectEventImageAnim_BerryTreeStage4[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_NurseBow[] = +static const union AnimCmd sAnim_NurseBow[] = { ANIMCMD_FRAME(0, 8), ANIMCMD_FRAME(9, 32), @@ -607,7 +607,7 @@ const union AnimCmd gObjectEventImageAnim_NurseBow[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_RockBreak[] = +static const union AnimCmd sAnim_RockBreak[] = { ANIMCMD_FRAME(0, 8), ANIMCMD_FRAME(1, 8), @@ -616,7 +616,7 @@ const union AnimCmd gObjectEventImageAnim_RockBreak[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_TreeCut[] = +static const union AnimCmd sAnim_TreeCut[] = { ANIMCMD_FRAME(0, 6), ANIMCMD_FRAME(1, 6), @@ -625,7 +625,7 @@ const union AnimCmd gObjectEventImageAnim_TreeCut[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_TakeOutRodSouth[] = +static const union AnimCmd sAnim_TakeOutRodSouth[] = { ANIMCMD_FRAME(8, 4), ANIMCMD_FRAME(9, 4), @@ -634,7 +634,7 @@ const union AnimCmd gObjectEventImageAnim_TakeOutRodSouth[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_TakeOutRodNorth[] = +static const union AnimCmd sAnim_TakeOutRodNorth[] = { ANIMCMD_FRAME(4, 4), ANIMCMD_FRAME(5, 4), @@ -643,7 +643,7 @@ const union AnimCmd gObjectEventImageAnim_TakeOutRodNorth[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_TakeOutRodWest[] = +static const union AnimCmd sAnim_TakeOutRodWest[] = { ANIMCMD_FRAME(0, 4), ANIMCMD_FRAME(1, 4), @@ -652,7 +652,7 @@ const union AnimCmd gObjectEventImageAnim_TakeOutRodWest[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_TakeOutRodEast[] = +static const union AnimCmd sAnim_TakeOutRodEast[] = { ANIMCMD_FRAME(0, 4, .hFlip = TRUE), ANIMCMD_FRAME(1, 4, .hFlip = TRUE), @@ -661,7 +661,7 @@ const union AnimCmd gObjectEventImageAnim_TakeOutRodEast[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_PutAwayRodSouth[] = +static const union AnimCmd sAnim_PutAwayRodSouth[] = { ANIMCMD_FRAME(11, 4), ANIMCMD_FRAME(10, 6), @@ -670,7 +670,7 @@ const union AnimCmd gObjectEventImageAnim_PutAwayRodSouth[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_PutAwayRodNorth[] = +static const union AnimCmd sAnim_PutAwayRodNorth[] = { ANIMCMD_FRAME(7, 4), ANIMCMD_FRAME(6, 6), @@ -679,7 +679,7 @@ const union AnimCmd gObjectEventImageAnim_PutAwayRodNorth[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_PutAwayRodWest[] = +static const union AnimCmd sAnim_PutAwayRodWest[] = { ANIMCMD_FRAME(3, 4), ANIMCMD_FRAME(2, 4), @@ -688,7 +688,7 @@ const union AnimCmd gObjectEventImageAnim_PutAwayRodWest[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_PutAwayRodEast[] = +static const union AnimCmd sAnim_PutAwayRodEast[] = { ANIMCMD_FRAME(3, 4, .hFlip = TRUE), ANIMCMD_FRAME(2, 4, .hFlip = TRUE), @@ -697,7 +697,7 @@ const union AnimCmd gObjectEventImageAnim_PutAwayRodEast[] = ANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_HookedPokemonSouth[] = +static const union AnimCmd sAnim_HookedPokemonSouth[] = { ANIMCMD_FRAME(10, 6), ANIMCMD_FRAME(11, 6), @@ -706,7 +706,7 @@ const union AnimCmd gObjectEventImageAnim_HookedPokemonSouth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_HookedPokemonNorth[] = +static const union AnimCmd sAnim_HookedPokemonNorth[] = { ANIMCMD_FRAME(6, 6), ANIMCMD_FRAME(7, 6), @@ -715,7 +715,7 @@ const union AnimCmd gObjectEventImageAnim_HookedPokemonNorth[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_HookedPokemonWest[] = +static const union AnimCmd sAnim_HookedPokemonWest[] = { ANIMCMD_FRAME(2, 6), ANIMCMD_FRAME(3, 6), @@ -724,7 +724,7 @@ const union AnimCmd gObjectEventImageAnim_HookedPokemonWest[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_HookedPokemonEast[] = +static const union AnimCmd sAnim_HookedPokemonEast[] = { ANIMCMD_FRAME(2, 6, .hFlip = TRUE), ANIMCMD_FRAME(3, 6, .hFlip = TRUE), @@ -733,7 +733,7 @@ const union AnimCmd gObjectEventImageAnim_HookedPokemonEast[] = ANIMCMD_JUMP(0), }; -const union AffineAnimCmd gObjectEventRotScalAnim_8508FD8[] = +static const union AffineAnimCmd sAffineAnim_8508FD8[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, 1, 1), AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 1), @@ -743,7 +743,7 @@ const union AffineAnimCmd gObjectEventRotScalAnim_8508FD8[] = AFFINEANIMCMD_JUMP(0), }; -const union AffineAnimCmd gObjectEventRotScalAnim_8509008[] = +static const union AffineAnimCmd sAffineAnim_8509008[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, -1, 1), AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 1), @@ -754,33 +754,33 @@ const union AffineAnimCmd gObjectEventRotScalAnim_8509008[] = AFFINEANIMCMD_JUMP(0), }; -const union AffineAnimCmd gObjectEventRotScalAnim_8509040[] = +static const union AffineAnimCmd sAffineAnim_8509040[] = { AFFINEANIMCMD_FRAME(0x100, 0x100, 10, 0), AFFINEANIMCMD_END, }; -const union AffineAnimCmd gObjectEventRotScalAnim_8509050[] = +static const union AffineAnimCmd sAffineAnim_8509050[] = { AFFINEANIMCMD_FRAME(0x100, 0x100, 10, 0), AFFINEANIMCMD_END, }; -const union AffineAnimCmd gObjectEventRotScalAnim_8509060[] = +static const union AffineAnimCmd sAffineAnim_8509060[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, -1, 1), AFFINEANIMCMD_LOOP(8), AFFINEANIMCMD_END, }; -const union AffineAnimCmd gObjectEventRotScalAnim_8509078[] = +static const union AffineAnimCmd sAffineAnim_8509078[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, 1, 1), AFFINEANIMCMD_LOOP(8), AFFINEANIMCMD_END, }; -const union AnimCmd gObjectEventImageAnim_HoOhFlapWings[] = +static const union AnimCmd sAnim_HoOhFlapWings[] = { ANIMCMD_FRAME(3, 8), ANIMCMD_FRAME(4, 8), @@ -789,383 +789,388 @@ const union AnimCmd gObjectEventImageAnim_HoOhFlapWings[] = ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_HoOhStayStill[] = +static const union AnimCmd sAnim_HoOhStayStill[] = { ANIMCMD_FRAME(3, 16), ANIMCMD_JUMP(0), }; -const union AnimCmd *const gObjectEventImageAnimTable_Inanimate[] = { - gObjectEventImageAnim_StayStill, +static const union AnimCmd *const sAnimTable_Inanimate[] = { + sAnim_StayStill, }; -const union AnimCmd *const gObjectEventImageAnimTable_QuintyPlump[] = { - gObjectEventImageAnim_QuintyPlumpFaceSouth, - gObjectEventImageAnim_QuintyPlumpFaceNorth, - gObjectEventImageAnim_QuintyPlumpFaceWest, - gObjectEventImageAnim_QuintyPlumpFaceEast, - gObjectEventImageAnim_QuintyPlumpGoSouth, - gObjectEventImageAnim_QuintyPlumpGoNorth, - gObjectEventImageAnim_QuintyPlumpGoWest, - gObjectEventImageAnim_QuintyPlumpGoEast, - gObjectEventImageAnim_QuintyPlumpGoFastSouth, - gObjectEventImageAnim_QuintyPlumpGoFastNorth, - gObjectEventImageAnim_QuintyPlumpGoFastWest, - gObjectEventImageAnim_QuintyPlumpGoFastEast, - gObjectEventImageAnim_QuintyPlumpGoFasterSouth, - gObjectEventImageAnim_QuintyPlumpGoFasterNorth, - gObjectEventImageAnim_QuintyPlumpGoFasterWest, - gObjectEventImageAnim_QuintyPlumpGoFasterEast, - gObjectEventImageAnim_QuintyPlumpGoFastestSouth, - gObjectEventImageAnim_QuintyPlumpGoFastestNorth, - gObjectEventImageAnim_QuintyPlumpGoFastestWest, - gObjectEventImageAnim_QuintyPlumpGoFastestEast, +static const union AnimCmd *const sAnimTable_QuintyPlump[] = { + sAnim_QuintyPlumpFaceSouth, + sAnim_QuintyPlumpFaceNorth, + sAnim_QuintyPlumpFaceWest, + sAnim_QuintyPlumpFaceEast, + sAnim_QuintyPlumpGoSouth, + sAnim_QuintyPlumpGoNorth, + sAnim_QuintyPlumpGoWest, + sAnim_QuintyPlumpGoEast, + sAnim_QuintyPlumpGoFastSouth, + sAnim_QuintyPlumpGoFastNorth, + sAnim_QuintyPlumpGoFastWest, + sAnim_QuintyPlumpGoFastEast, + sAnim_QuintyPlumpGoFasterSouth, + sAnim_QuintyPlumpGoFasterNorth, + sAnim_QuintyPlumpGoFasterWest, + sAnim_QuintyPlumpGoFasterEast, + sAnim_QuintyPlumpGoFastestSouth, + sAnim_QuintyPlumpGoFastestNorth, + sAnim_QuintyPlumpGoFastestWest, + sAnim_QuintyPlumpGoFastestEast, }; -const union AnimCmd *const gObjectEventImageAnimTable_Standard[] = { - gObjectEventImageAnim_FaceSouth, - gObjectEventImageAnim_FaceNorth, - gObjectEventImageAnim_FaceWest, - gObjectEventImageAnim_FaceEast, - gObjectEventImageAnim_GoSouth, - gObjectEventImageAnim_GoNorth, - gObjectEventImageAnim_GoWest, - gObjectEventImageAnim_GoEast, - gObjectEventImageAnim_GoFastSouth, - gObjectEventImageAnim_GoFastNorth, - gObjectEventImageAnim_GoFastWest, - gObjectEventImageAnim_GoFastEast, - gObjectEventImageAnim_GoFasterSouth, - gObjectEventImageAnim_GoFasterNorth, - gObjectEventImageAnim_GoFasterWest, - gObjectEventImageAnim_GoFasterEast, - gObjectEventImageAnim_GoFastestSouth, - gObjectEventImageAnim_GoFastestNorth, - gObjectEventImageAnim_GoFastestWest, - gObjectEventImageAnim_GoFastestEast, +static const union AnimCmd *const sAnimTable_Standard[] = { + sAnim_FaceSouth, + sAnim_FaceNorth, + sAnim_FaceWest, + sAnim_FaceEast, + sAnim_GoSouth, + sAnim_GoNorth, + sAnim_GoWest, + sAnim_GoEast, + sAnim_GoFastSouth, + sAnim_GoFastNorth, + sAnim_GoFastWest, + sAnim_GoFastEast, + sAnim_GoFasterSouth, + sAnim_GoFasterNorth, + sAnim_GoFasterWest, + sAnim_GoFasterEast, + sAnim_GoFastestSouth, + sAnim_GoFastestNorth, + sAnim_GoFastestWest, + sAnim_GoFastestEast, }; -const union AnimCmd *const gObjectEventImageAnimTable_HoOh[] = { - gObjectEventImageAnim_FaceSouth, - gObjectEventImageAnim_FaceNorth, - gObjectEventImageAnim_FaceWest, - gObjectEventImageAnim_FaceEast, - gObjectEventImageAnim_HoOhFlapWings, - gObjectEventImageAnim_HoOhStayStill, - gObjectEventImageAnim_GoWest, - gObjectEventImageAnim_GoEast, - gObjectEventImageAnim_GoFastSouth, - gObjectEventImageAnim_GoFastNorth, - gObjectEventImageAnim_GoFastWest, - gObjectEventImageAnim_GoFastEast, - gObjectEventImageAnim_GoFasterSouth, - gObjectEventImageAnim_GoFasterNorth, - gObjectEventImageAnim_GoFasterWest, - gObjectEventImageAnim_GoFasterEast, - gObjectEventImageAnim_GoFastestSouth, - gObjectEventImageAnim_GoFastestNorth, - gObjectEventImageAnim_GoFastestWest, - gObjectEventImageAnim_GoFastestEast, +static const union AnimCmd *const sAnimTable_HoOh[] = { + sAnim_FaceSouth, + sAnim_FaceNorth, + sAnim_FaceWest, + sAnim_FaceEast, + sAnim_HoOhFlapWings, + sAnim_HoOhStayStill, + sAnim_GoWest, + sAnim_GoEast, + sAnim_GoFastSouth, + sAnim_GoFastNorth, + sAnim_GoFastWest, + sAnim_GoFastEast, + sAnim_GoFasterSouth, + sAnim_GoFasterNorth, + sAnim_GoFasterWest, + sAnim_GoFasterEast, + sAnim_GoFastestSouth, + sAnim_GoFastestNorth, + sAnim_GoFastestWest, + sAnim_GoFastestEast, }; -const union AnimCmd *const gObjectEventImageAnimTable_Groudon3[] = { - gObjectEventImageAnim_FaceSouth, - gObjectEventImageAnim_FaceNorth, - gObjectEventImageAnim_FaceWest, - gObjectEventImageAnim_FaceEast, - gObjectEventImageAnim_GoSouth, - gObjectEventImageAnim_GoEast, - gObjectEventImageAnim_GoWest, - gObjectEventImageAnim_GoEast, - gObjectEventImageAnim_GoFastSouth, - gObjectEventImageAnim_GoFastEast, - gObjectEventImageAnim_GoFastWest, - gObjectEventImageAnim_GoFastEast, - gObjectEventImageAnim_GoFasterSouth, - gObjectEventImageAnim_GoFasterEast, - gObjectEventImageAnim_GoFasterWest, - gObjectEventImageAnim_GoFasterEast, - gObjectEventImageAnim_GoFastestSouth, - gObjectEventImageAnim_GoFastestEast, - gObjectEventImageAnim_GoFastestWest, - gObjectEventImageAnim_GoFastestEast, +static const union AnimCmd *const sAnimTable_GroudonSide[] = { + sAnim_FaceSouth, + sAnim_FaceNorth, + sAnim_FaceWest, + sAnim_FaceEast, + sAnim_GoSouth, + sAnim_GoEast, + sAnim_GoWest, + sAnim_GoEast, + sAnim_GoFastSouth, + sAnim_GoFastEast, + sAnim_GoFastWest, + sAnim_GoFastEast, + sAnim_GoFasterSouth, + sAnim_GoFasterEast, + sAnim_GoFasterWest, + sAnim_GoFasterEast, + sAnim_GoFastestSouth, + sAnim_GoFastestEast, + sAnim_GoFastestWest, + sAnim_GoFastestEast, }; -const union AnimCmd gObjectEventImageAnim_85091F0[] = +static const union AnimCmd sAnim_RayquazaCoiledAwake[] = { ANIMCMD_FRAME(1, 1), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_85091F8[] = +static const union AnimCmd sAnim_RayquazaFlyUp[] = { ANIMCMD_FRAME(4, 1), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_8509200[] = +static const union AnimCmd sAnim_RayquazaCoiledAsleep[] = { ANIMCMD_FRAME(0, 1), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_8509208[] = +static const union AnimCmd sAnim_RayquazaCoiledMouthOpen[] = { ANIMCMD_FRAME(2, 1), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_8509210[] = +static const union AnimCmd sAnim_RayquazaNormal[] = { ANIMCMD_FRAME(3, 1), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_8509218[] = +// Identical to sAnim_RayquazaCoiledAsleep +static const union AnimCmd sAnim_RayquazaFaceSouth[] = { ANIMCMD_FRAME(0, 1), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_8509220[] = +// Identical to sAnim_RayquazaCoiledAsleep +static const union AnimCmd sAnim_RayquazaFaceNorth[] = { ANIMCMD_FRAME(0, 1), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_8509228[] = +// Identical to sAnim_RayquazaCoiledAsleep +static const union AnimCmd sAnim_RayquazaFaceWest[] = { ANIMCMD_FRAME(0, 1), ANIMCMD_JUMP(0), }; -const union AnimCmd gObjectEventImageAnim_8509230[] = +// Identical to sAnim_RayquazaNormal +static const union AnimCmd sAnim_RayquazaFaceEast[] = { ANIMCMD_FRAME(3, 1), ANIMCMD_JUMP(0), }; -const union AnimCmd *const gObjectEventImageAnimTable_Rayquaza2[] = { - gObjectEventImageAnim_8509218, - gObjectEventImageAnim_8509220, - gObjectEventImageAnim_8509228, - gObjectEventImageAnim_8509230, - gObjectEventImageAnim_8509200, - gObjectEventImageAnim_85091F8, - gObjectEventImageAnim_8509208, - gObjectEventImageAnim_8509210, - gObjectEventImageAnim_8509200, - gObjectEventImageAnim_85091F8, - gObjectEventImageAnim_85091F0, - gObjectEventImageAnim_8509210, - gObjectEventImageAnim_8509200, - gObjectEventImageAnim_85091F8, - gObjectEventImageAnim_8509208, - gObjectEventImageAnim_8509210, - gObjectEventImageAnim_8509200, - gObjectEventImageAnim_85091F8, - gObjectEventImageAnim_8509208, - gObjectEventImageAnim_8509210, +// Though they correspond to facing/walking movements, Rayquaza doesn't have +// equivalent images aside from flying up. Its other frames aside from the 'normal' +// frame are for the sequence where it awakens on Sky Pillar. +// The corresponding facing/walking movements are commented alongside +static const union AnimCmd *const sAnimTable_Rayquaza[] = { + sAnim_RayquazaFaceSouth, // Face South + sAnim_RayquazaFaceNorth, // Face North + sAnim_RayquazaFaceWest, // Face West + sAnim_RayquazaFaceEast, // Face East + sAnim_RayquazaCoiledAsleep, // Go South + sAnim_RayquazaFlyUp, // Go North + sAnim_RayquazaCoiledMouthOpen, // Go West + sAnim_RayquazaNormal, // Go East + sAnim_RayquazaCoiledAsleep, // Go fast South + sAnim_RayquazaFlyUp, // Go fast North + sAnim_RayquazaCoiledAwake, // Go fast West + sAnim_RayquazaNormal, // Go fast East + sAnim_RayquazaCoiledAsleep, // Go faster South + sAnim_RayquazaFlyUp, // Go faster North + sAnim_RayquazaCoiledMouthOpen, // Go faster West + sAnim_RayquazaNormal, // Go faster East + sAnim_RayquazaCoiledAsleep, // Go fastest South + sAnim_RayquazaFlyUp, // Go fastest North + sAnim_RayquazaCoiledMouthOpen, // Go fastest West + sAnim_RayquazaNormal, // Go fastest East }; -const union AnimCmd *const gObjectEventImageAnimTable_BrendanMayNormal[] = { - gObjectEventImageAnim_FaceSouth, - gObjectEventImageAnim_FaceNorth, - gObjectEventImageAnim_FaceWest, - gObjectEventImageAnim_FaceEast, - gObjectEventImageAnim_GoSouth, - gObjectEventImageAnim_GoNorth, - gObjectEventImageAnim_GoWest, - gObjectEventImageAnim_GoEast, - gObjectEventImageAnim_GoFastSouth, - gObjectEventImageAnim_GoFastNorth, - gObjectEventImageAnim_GoFastWest, - gObjectEventImageAnim_GoFastEast, - gObjectEventImageAnim_GoFasterSouth, - gObjectEventImageAnim_GoFasterNorth, - gObjectEventImageAnim_GoFasterWest, - gObjectEventImageAnim_GoFasterEast, - gObjectEventImageAnim_GoFastestSouth, - gObjectEventImageAnim_GoFastestNorth, - gObjectEventImageAnim_GoFastestWest, - gObjectEventImageAnim_GoFastestEast, - gObjectEventImageAnim_RunSouth, - gObjectEventImageAnim_RunNorth, - gObjectEventImageAnim_RunWest, - gObjectEventImageAnim_RunEast, +static const union AnimCmd *const sAnimTable_BrendanMayNormal[] = { + sAnim_FaceSouth, + sAnim_FaceNorth, + sAnim_FaceWest, + sAnim_FaceEast, + sAnim_GoSouth, + sAnim_GoNorth, + sAnim_GoWest, + sAnim_GoEast, + sAnim_GoFastSouth, + sAnim_GoFastNorth, + sAnim_GoFastWest, + sAnim_GoFastEast, + sAnim_GoFasterSouth, + sAnim_GoFasterNorth, + sAnim_GoFasterWest, + sAnim_GoFasterEast, + sAnim_GoFastestSouth, + sAnim_GoFastestNorth, + sAnim_GoFastestWest, + sAnim_GoFastestEast, + sAnim_RunSouth, + sAnim_RunNorth, + sAnim_RunWest, + sAnim_RunEast, }; -const union AnimCmd *const gObjectEventImageAnimTable_AcroBike[] = { - gObjectEventImageAnim_FaceSouth, - gObjectEventImageAnim_FaceNorth, - gObjectEventImageAnim_FaceWest, - gObjectEventImageAnim_FaceEast, - gObjectEventImageAnim_GoSouth, - gObjectEventImageAnim_GoNorth, - gObjectEventImageAnim_GoWest, - gObjectEventImageAnim_GoEast, - gObjectEventImageAnim_GoFastSouth, - gObjectEventImageAnim_GoFastNorth, - gObjectEventImageAnim_GoFastWest, - gObjectEventImageAnim_GoFastEast, - gObjectEventImageAnim_GoFasterSouth, - gObjectEventImageAnim_GoFasterNorth, - gObjectEventImageAnim_GoFasterWest, - gObjectEventImageAnim_GoFasterEast, - gObjectEventImageAnim_GoFastestSouth, - gObjectEventImageAnim_GoFastestNorth, - gObjectEventImageAnim_GoFastestWest, - gObjectEventImageAnim_GoFastestEast, - gObjectEventImageAnim_BunnyHoppyBackWheelSouth, - gObjectEventImageAnim_BunnyHoppyBackWheelNorth, - gObjectEventImageAnim_BunnyHoppyBackWheelWest, - gObjectEventImageAnim_BunnyHoppyBackWheelEast, - gObjectEventImageAnim_BunnyHoppyFrontWheelSouth, - gObjectEventImageAnim_BunnyHoppyFrontWheelNorth, - gObjectEventImageAnim_BunnyHoppyFrontWheelWest, - gObjectEventImageAnim_BunnyHoppyFrontWheelEast, - gObjectEventImageAnim_StandingWheelieBackWheelSouth, - gObjectEventImageAnim_StandingWheelieBackWheelNorth, - gObjectEventImageAnim_StandingWheelieBackWheelWest, - gObjectEventImageAnim_StandingWheelieBackWheelEast, - gObjectEventImageAnim_StandingWheelieFrontWheelSouth, - gObjectEventImageAnim_StandingWheelieFrontWheelNorth, - gObjectEventImageAnim_StandingWheelieFrontWheelWest, - gObjectEventImageAnim_StandingWheelieFrontWheelEast, - gObjectEventImageAnim_MovingWheelieSouth, - gObjectEventImageAnim_MovingWheelieNorth, - gObjectEventImageAnim_MovingWheelieWest, - gObjectEventImageAnim_MovingWheelieEast, +static const union AnimCmd *const sAnimTable_AcroBike[] = { + sAnim_FaceSouth, + sAnim_FaceNorth, + sAnim_FaceWest, + sAnim_FaceEast, + sAnim_GoSouth, + sAnim_GoNorth, + sAnim_GoWest, + sAnim_GoEast, + sAnim_GoFastSouth, + sAnim_GoFastNorth, + sAnim_GoFastWest, + sAnim_GoFastEast, + sAnim_GoFasterSouth, + sAnim_GoFasterNorth, + sAnim_GoFasterWest, + sAnim_GoFasterEast, + sAnim_GoFastestSouth, + sAnim_GoFastestNorth, + sAnim_GoFastestWest, + sAnim_GoFastestEast, + sAnim_BunnyHoppyBackWheelSouth, + sAnim_BunnyHoppyBackWheelNorth, + sAnim_BunnyHoppyBackWheelWest, + sAnim_BunnyHoppyBackWheelEast, + sAnim_BunnyHoppyFrontWheelSouth, + sAnim_BunnyHoppyFrontWheelNorth, + sAnim_BunnyHoppyFrontWheelWest, + sAnim_BunnyHoppyFrontWheelEast, + sAnim_StandingWheelieBackWheelSouth, + sAnim_StandingWheelieBackWheelNorth, + sAnim_StandingWheelieBackWheelWest, + sAnim_StandingWheelieBackWheelEast, + sAnim_StandingWheelieFrontWheelSouth, + sAnim_StandingWheelieFrontWheelNorth, + sAnim_StandingWheelieFrontWheelWest, + sAnim_StandingWheelieFrontWheelEast, + sAnim_MovingWheelieSouth, + sAnim_MovingWheelieNorth, + sAnim_MovingWheelieWest, + sAnim_MovingWheelieEast, }; -const union AnimCmd *const gObjectEventImageAnimTable_Surfing[] = { - gObjectEventImageAnim_FaceSouth, - gObjectEventImageAnim_FaceNorth, - gObjectEventImageAnim_FaceWest, - gObjectEventImageAnim_FaceEast, - gObjectEventImageAnim_GoSouth, - gObjectEventImageAnim_GoNorth, - gObjectEventImageAnim_GoWest, - gObjectEventImageAnim_GoEast, - gObjectEventImageAnim_GoFastSouth, - gObjectEventImageAnim_GoFastNorth, - gObjectEventImageAnim_GoFastWest, - gObjectEventImageAnim_GoFastEast, - gObjectEventImageAnim_GoFasterSouth, - gObjectEventImageAnim_GoFasterNorth, - gObjectEventImageAnim_GoFasterWest, - gObjectEventImageAnim_GoFasterEast, - gObjectEventImageAnim_GoFastestSouth, - gObjectEventImageAnim_GoFastestNorth, - gObjectEventImageAnim_GoFastestWest, - gObjectEventImageAnim_GoFastestEast, - gObjectEventImageAnim_GetOnOffSurfBlobSouth, - gObjectEventImageAnim_GetOnOffSurfBlobNorth, - gObjectEventImageAnim_GetOnOffSurfBlobWest, - gObjectEventImageAnim_GetOnOffSurfBlobEast, +static const union AnimCmd *const sAnimTable_Surfing[] = { + sAnim_FaceSouth, + sAnim_FaceNorth, + sAnim_FaceWest, + sAnim_FaceEast, + sAnim_GoSouth, + sAnim_GoNorth, + sAnim_GoWest, + sAnim_GoEast, + sAnim_GoFastSouth, + sAnim_GoFastNorth, + sAnim_GoFastWest, + sAnim_GoFastEast, + sAnim_GoFasterSouth, + sAnim_GoFasterNorth, + sAnim_GoFasterWest, + sAnim_GoFasterEast, + sAnim_GoFastestSouth, + sAnim_GoFastestNorth, + sAnim_GoFastestWest, + sAnim_GoFastestEast, + sAnim_GetOnOffSurfBlobSouth, + sAnim_GetOnOffSurfBlobNorth, + sAnim_GetOnOffSurfBlobWest, + sAnim_GetOnOffSurfBlobEast, }; -const union AnimCmd *const gObjectEventImageAnimTable_Nurse[] = { - gObjectEventImageAnim_FaceSouth, - gObjectEventImageAnim_FaceNorth, - gObjectEventImageAnim_FaceWest, - gObjectEventImageAnim_FaceEast, - gObjectEventImageAnim_GoSouth, - gObjectEventImageAnim_GoNorth, - gObjectEventImageAnim_GoWest, - gObjectEventImageAnim_GoEast, - gObjectEventImageAnim_GoFastSouth, - gObjectEventImageAnim_GoFastNorth, - gObjectEventImageAnim_GoFastWest, - gObjectEventImageAnim_GoFastEast, - gObjectEventImageAnim_GoFasterSouth, - gObjectEventImageAnim_GoFasterNorth, - gObjectEventImageAnim_GoFasterWest, - gObjectEventImageAnim_GoFasterEast, - gObjectEventImageAnim_GoFastestSouth, - gObjectEventImageAnim_GoFastestNorth, - gObjectEventImageAnim_GoFastestWest, - gObjectEventImageAnim_GoFastestEast, - gObjectEventImageAnim_NurseBow, +static const union AnimCmd *const sAnimTable_Nurse[] = { + sAnim_FaceSouth, + sAnim_FaceNorth, + sAnim_FaceWest, + sAnim_FaceEast, + sAnim_GoSouth, + sAnim_GoNorth, + sAnim_GoWest, + sAnim_GoEast, + sAnim_GoFastSouth, + sAnim_GoFastNorth, + sAnim_GoFastWest, + sAnim_GoFastEast, + sAnim_GoFasterSouth, + sAnim_GoFasterNorth, + sAnim_GoFasterWest, + sAnim_GoFasterEast, + sAnim_GoFastestSouth, + sAnim_GoFastestNorth, + sAnim_GoFastestWest, + sAnim_GoFastestEast, + sAnim_NurseBow, }; -const union AnimCmd *const gObjectEventImageAnimTable_FieldMove[] = { - gObjectEventImageAnim_FieldMove, +static const union AnimCmd *const sAnimTable_FieldMove[] = { + sAnim_FieldMove, }; -const union AnimCmd *const gObjectEventImageAnimTable_BerryTree[] = { - gObjectEventImageAnim_BerryTreeStage0, - gObjectEventImageAnim_BerryTreeStage1, - gObjectEventImageAnim_BerryTreeStage2, - gObjectEventImageAnim_BerryTreeStage3, - gObjectEventImageAnim_BerryTreeStage4, +static const union AnimCmd *const sAnimTable_BerryTree[] = { + sAnim_BerryTreeStage0, + sAnim_BerryTreeStage1, + sAnim_BerryTreeStage2, + sAnim_BerryTreeStage3, + sAnim_BerryTreeStage4, }; -const union AnimCmd *const gObjectEventImageAnimTable_BreakableRock[] = { - gObjectEventImageAnim_StayStill, - gObjectEventImageAnim_RockBreak, +static const union AnimCmd *const sAnimTable_BreakableRock[] = { + sAnim_StayStill, + sAnim_RockBreak, }; -const union AnimCmd *const gObjectEventImageAnimTable_CuttableTree[] = { - gObjectEventImageAnim_StayStill, - gObjectEventImageAnim_TreeCut, +static const union AnimCmd *const sAnimTable_CuttableTree[] = { + sAnim_StayStill, + sAnim_TreeCut, }; -const union AnimCmd *const gObjectEventImageAnimTable_Fishing[] = { - gObjectEventImageAnim_TakeOutRodSouth, - gObjectEventImageAnim_TakeOutRodNorth, - gObjectEventImageAnim_TakeOutRodWest, - gObjectEventImageAnim_TakeOutRodEast, - gObjectEventImageAnim_PutAwayRodSouth, - gObjectEventImageAnim_PutAwayRodNorth, - gObjectEventImageAnim_PutAwayRodWest, - gObjectEventImageAnim_PutAwayRodEast, - gObjectEventImageAnim_HookedPokemonSouth, - gObjectEventImageAnim_HookedPokemonNorth, - gObjectEventImageAnim_HookedPokemonWest, - gObjectEventImageAnim_HookedPokemonEast, +static const union AnimCmd *const sAnimTable_Fishing[] = { + sAnim_TakeOutRodSouth, + sAnim_TakeOutRodNorth, + sAnim_TakeOutRodWest, + sAnim_TakeOutRodEast, + sAnim_PutAwayRodSouth, + sAnim_PutAwayRodNorth, + sAnim_PutAwayRodWest, + sAnim_PutAwayRodEast, + sAnim_HookedPokemonSouth, + sAnim_HookedPokemonNorth, + sAnim_HookedPokemonWest, + sAnim_HookedPokemonEast, }; -const union AffineAnimCmd *const gObjectEventRotScalAnimTable_KyogreGroudon[] = { - gObjectEventRotScalAnim_8508FD8, - gObjectEventRotScalAnim_8509008, - gObjectEventRotScalAnim_8509050, - gObjectEventRotScalAnim_8509040, - gObjectEventRotScalAnim_8509078, - gObjectEventRotScalAnim_8509060, +static const union AffineAnimCmd *const sAffineAnimTable_KyogreGroudon[] = { + sAffineAnim_8508FD8, + sAffineAnim_8509008, + sAffineAnim_8509050, + sAffineAnim_8509040, + sAffineAnim_8509078, + sAffineAnim_8509060, }; const struct UnkStruct_085094AC gUnknown_085094AC[] = { { - .anims = gObjectEventImageAnimTable_QuintyPlump, + .anims = sAnimTable_QuintyPlump, .animPos = {1, 3, 0, 2}, }, { - .anims = gObjectEventImageAnimTable_Standard, + .anims = sAnimTable_Standard, .animPos = {1, 3, 0, 2}, }, { - .anims = gObjectEventImageAnimTable_BrendanMayNormal, + .anims = sAnimTable_BrendanMayNormal, .animPos = {1, 3, 0, 2}, }, { - .anims = gObjectEventImageAnimTable_AcroBike, + .anims = sAnimTable_AcroBike, .animPos = {1, 3, 0, 2}, }, { - .anims = gObjectEventImageAnimTable_Surfing, + .anims = sAnimTable_Surfing, .animPos = {1, 3, 0, 2}, }, { - .anims = gObjectEventImageAnimTable_Nurse, + .anims = sAnimTable_Nurse, .animPos = {1, 3, 0, 2}, }, { - .anims = gObjectEventImageAnimTable_Fishing, + .anims = sAnimTable_Fishing, .animPos = {1, 3, 0, 2}, }, - { - NULL, - {0, 0, 0, 0}, - }, + {}, }; diff --git a/src/data/object_events/object_event_graphics_info.h b/src/data/object_events/object_event_graphics_info.h index c6c78dca9..cd530722b 100755 --- a/src/data/object_events/object_event_graphics_info.h +++ b/src/data/object_events/object_event_graphics_info.h @@ -1,245 +1,245 @@ -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanNormal = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 16, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_BrendanMayNormal, gObjectEventPicTable_BrendanNormal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanMachBike = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_BrendanMachBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanAcroBike = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_AcroBike, gObjectEventPicTable_BrendanAcroBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanSurfing = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Surfing, gObjectEventPicTable_BrendanSurfing, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFieldMove = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_FieldMove, gObjectEventPicTable_BrendanFieldMove, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_QuintyPlump = {0xFFFF, OBJ_EVENT_PAL_TAG_QUINTY_PLUMP, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_L, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_QuintyPlump, gObjectEventPicTable_QuintyPlump, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_NinjaBoy = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_NinjaBoy, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Twin = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Twin, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Boy1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Girl1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Boy2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Girl2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleBoy = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_LittleBoy, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleGirl = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_LittleGirl, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Boy3, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Girl3, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RichBoy = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_RichBoy, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Woman1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FatMan = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_FatMan, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_PokefanF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Man1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Woman2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_ExpertM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_ExpertF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Man2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Woman3, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_PokefanM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman4 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Woman4, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cook = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Cook, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkReceptionist = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_LinkReceptionist, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldMan = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_OldMan, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldWoman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_OldWoman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Camper = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Camper, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Picnicker = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Picnicker, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Man3, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman5 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Woman5, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Youngster = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Youngster, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BugCatcher = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_BugCatcher, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PsychicM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_PsychicM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SchoolKidM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_SchoolKidM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maniac = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Maniac, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HexManiac = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_HexManiac, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 4, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_64x64, gObjectEventSpriteOamTables_64x64, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_RayquazaStill, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_SwimmerM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_SwimmerF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BlackBelt = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_BlackBelt, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Beauty = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Beauty, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Scientist1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lass = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Lass, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Gentleman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Gentleman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sailor = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Sailor, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fisherman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Fisherman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_RunningTriathleteM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_RunningTriathleteF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_TuberF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_TuberM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hiker = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Hiker, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_AcroBike, gObjectEventPicTable_CyclingTriathleteM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_AcroBike, gObjectEventPicTable_CyclingTriathleteF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Nurse = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Nurse, gObjectEventPicTable_Nurse, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ItemBall = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_ItemBall, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTree = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, NULL, gObjectEventImageAnimTable_BerryTree, gObjectEventPicTable_PechaBerryTree, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeEarlyStages = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_BerryTree, gObjectEventPicTable_PechaBerryTree, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeLateStages = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_BerryTree, gObjectEventPicTable_PechaBerryTree, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ProfBirch = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_ProfBirch, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man4 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Man4, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man5 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Man5, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_ReporterM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_ReporterF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MauvilleOldMan1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hipster = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MauvilleOldMan1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Trader = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MauvilleOldMan1, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Storyteller = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MauvilleOldMan2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Giddy = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MauvilleOldMan2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MauvilleOldMan2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MauvilleOldMan2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedNatuDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_UnusedNatuDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMagnemiteDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_UnusedMagnemiteDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedSquirtleDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_UnusedSquirtleDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedWooperDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_UnusedWooperDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPikachuDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_UnusedPikachuDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPorygon2Doll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_UnusedPorygon2Doll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CuttableTree = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_CuttableTree, gObjectEventPicTable_CuttableTree, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MartEmployee = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MartEmployee, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RooftopSaleWoman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_RooftopSaleWoman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Teala = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Teala, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BreakableRock = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_BreakableRock, gObjectEventPicTable_BreakableRock, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PushableBoulder = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_PushableBoulder, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MrBrineysBoat = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MrBrineysBoat, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayNormal = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 16, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_BrendanMayNormal, gObjectEventPicTable_MayNormal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayMachBike = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MayMachBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayAcroBike = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_AcroBike, gObjectEventPicTable_MayAcroBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MaySurfing = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Surfing, gObjectEventPicTable_MaySurfing, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFieldMove = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_FieldMove, gObjectEventPicTable_MayFieldMove, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Truck = {0xFFFF, OBJ_EVENT_PAL_TAG_TRUCK, OBJ_EVENT_PAL_TAG_NONE, 1152, 48, 48, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_48x48, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_Truck, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothCarryingBox = {0xFFFF, OBJ_EVENT_PAL_TAG_VIGOROTH, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_VigorothCarryingBox, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothFacingAway = {0xFFFF, OBJ_EVENT_PAL_TAG_VIGOROTH, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_VigorothFacingAway, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirchsBag = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BirchsBag, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_EnemyZigzagoon = {0xFFFF, OBJ_EVENT_PAL_TAG_ZIGZAGOON, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_EnemyZigzagoon, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Poochyena = {0xFFFF, OBJ_EVENT_PAL_TAG_POOCHYENA, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Poochyena, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Artist = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Artist, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanNormal = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_BrendanMayNormal, gObjectEventPicTable_BrendanNormal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanMachBike = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_BrendanMachBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanAcroBike = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_AcroBike, gObjectEventPicTable_BrendanAcroBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanSurfing = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Surfing, gObjectEventPicTable_BrendanSurfing, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanFieldMove = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_FieldMove, gObjectEventPicTable_BrendanFieldMove, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayNormal = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_BrendanMayNormal, gObjectEventPicTable_MayNormal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayMachBike = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MayMachBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayAcroBike = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_AcroBike, gObjectEventPicTable_MayAcroBike, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMaySurfing = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Surfing, gObjectEventPicTable_MaySurfing, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayFieldMove = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_FieldMove, gObjectEventPicTable_MayFieldMove, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cameraman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Cameraman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanUnderwater = {0xFFFF, OBJ_EVENT_PAL_TAG_PLAYER_UNDERWATER, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_BrendanUnderwater, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayUnderwater = {0xFFFF, OBJ_EVENT_PAL_TAG_PLAYER_UNDERWATER, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MayUnderwater, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MovingBox = {0xFFFF, OBJ_EVENT_PAL_TAG_MOVING_BOX, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 10, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_MovingBox, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CableCar = {0xFFFF, OBJ_EVENT_PAL_TAG_CABLE_CAR, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_64x64, gObjectEventSpriteOamTables_64x64, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_CableCar, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Scientist2, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DevonEmployee = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_DevonEmployee, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_AquaMemberM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_AquaMemberF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MagmaMemberM, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MagmaMemberF, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sidney = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Sidney, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Phoebe = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Phoebe, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Glacia = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Glacia, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Drake = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Drake, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Roxanne = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Roxanne, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brawly = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Brawly, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wattson = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Wattson, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Flannery = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Flannery, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Norman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Norman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Winona = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Winona, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Liza = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Liza, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tate = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Tate, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wallace = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Wallace, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Steven = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Steven, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wally = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Wally, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireLittleBoy = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_RubySapphireLittleBoy, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFishing = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Fishing, gObjectEventPicTable_BrendanFishing, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFishing = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Fishing, gObjectEventPicTable_MayFishing, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HotSpringsOldWoman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_HotSpringsOldWoman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SSTidal = {0xFFFF, OBJ_EVENT_PAL_TAG_SSTIDAL, OBJ_EVENT_PAL_TAG_NONE, 1920, 96, 40, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_8x8, gObjectEventSpriteOamTables_96x40, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_SSTidal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SubmarineShadow = {0xFFFF, OBJ_EVENT_PAL_TAG_SUBMARINE_SHADOW, OBJ_EVENT_PAL_TAG_NONE, 1408, 88, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_8x8, gObjectEventSpriteOamTables_88x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_SubmarineShadow, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PichuDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_PichuDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikachuDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_PikachuDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MarillDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_MarillDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TogepiDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_TogepiDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyndaquilDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_CyndaquilDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ChikoritaDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_ChikoritaDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TotodileDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_TotodileDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_JigglypuffDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_JigglypuffDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MeowthDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_MeowthDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ClefairyDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_ClefairyDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DittoDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_DittoDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SmoochumDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_SmoochumDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TreeckoDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_TreeckoDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TorchicDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_TorchicDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MudkipDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_MudkipDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DuskullDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_DuskullDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WynautDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_WynautDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BaltoyDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BaltoyDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_KecleonDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AzurillDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_AzurillDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SkittyDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_SkittyDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwabluDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_SwabluDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GulpinDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_GulpinDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LotadDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_LotadDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SeedotDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_SeedotDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikaCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_PikaCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RoundCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_RoundCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KissCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_KissCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ZigzagCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_ZigzagCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SpinCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_SpinCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DiamondCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_DiamondCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BallCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BallCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GrassCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_GrassCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FireCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_FireCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WaterCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_WaterCushion, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigSnorlaxDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BigSnorlaxDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRhydonDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BigRhydonDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigLaprasDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BigLaprasDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigVenusaurDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BigVenusaurDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigCharizardDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 3, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BigCharizardDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigBlastoiseDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BigBlastoiseDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigWailmerDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BigWailmerDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegirockDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BigRegirockDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegiceDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BigRegiceDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegisteelDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BigRegisteelDoll, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latias = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_LatiasLatios, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latios = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_LatiasLatios, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GameboyKid = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_GameboyKid, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ContestJudge = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_ContestJudge, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanWatering = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_BrendanWatering, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayWatering = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MayWatering, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanDecorating = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BrendanDecorating, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayDecorating = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_MayDecorating, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Archie = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Archie, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maxie = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Maxie, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kyogre1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_KyogreFront, gObjectEventRotScalAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Groudon1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_GroudonFront, gObjectEventRotScalAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kyogre3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_KyogreSide, gObjectEventRotScalAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Groudon3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Groudon3, gObjectEventPicTable_GroudonSide, gObjectEventRotScalAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fossil = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_Fossil, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regirock = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 3, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Regi, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regice = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Regi, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Registeel = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Regi, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Skitty = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Skitty, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kecleon = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Kecleon, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kyogre2 = {0xFFFF, OBJ_EVENT_PAL_TAG_KYOGRE, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_KyogreFront, gObjectEventRotScalAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Groudon2 = {0xFFFF, OBJ_EVENT_PAL_TAG_GROUDON, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_GroudonFront, gObjectEventRotScalAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 4, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_64x64, gObjectEventSpriteOamTables_64x64, gObjectEventImageAnimTable_Rayquaza2, gObjectEventPicTable_Rayquaza, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Zigzagoon = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Zigzagoon, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Pikachu = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Pikachu, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azumarill = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Azumarill, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wingull = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Wingull, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonBridgeShadow = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 128, 16, 16, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Kecleon, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberMSwimming = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_TuberMSwimming, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azurill = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, gObjectEventSpriteOamTables_16x16, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Azurill, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mom = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Mom, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkBrendan = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_BrendanMayNormal, gObjectEventPicTable_BrendanNormal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkMay = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_BrendanMayNormal, gObjectEventPicTable_MayNormal, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Juan = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Juan, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scott = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Scott, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MysteryEventDeliveryman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_MysteryEventDeliveryman, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Statue = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_Statue, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kirlia = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_S, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Kirlia, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Dusclops = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Dusclops, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnionRoomAttendant = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_UnionRoomAttendant, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Red = {0xFFFF, OBJ_EVENT_PAL_TAG_RED_LEAF, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Red, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Leaf = {0xFFFF, OBJ_EVENT_PAL_TAG_RED_LEAF, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Leaf, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sudowoodo = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Sudowoodo, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mew = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Mew, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Deoxys = {0xFFFF, OBJ_EVENT_PAL_TAG_DEOXYS, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Deoxys, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirthIslandStone = {0xFFFF, OBJ_EVENT_PAL_TAG_BIRTH_ISLAND_STONE, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Inanimate, gObjectEventPicTable_BirthIslandStone, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Anabel = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Anabel, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tucker = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Tucker, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Greta = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Greta, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Spenser = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Spenser, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Noland = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Noland, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lucy = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Lucy, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brandon = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Brandon, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireBrendan = {0xFFFF, OBJ_EVENT_PAL_TAG_RS_BRENDAN, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_RubySapphireBrendan, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireMay = {0xFFFF, OBJ_EVENT_PAL_TAG_RS_MAY, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, gObjectEventSpriteOamTables_16x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_RubySapphireMay, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lugia = {0xFFFF, OBJ_EVENT_PAL_TAG_LUGIA, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_Standard, gObjectEventPicTable_Lugia, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HoOh = {0xFFFF, OBJ_EVENT_PAL_TAG_HO_OH, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, gObjectEventSpriteOamTables_32x32, gObjectEventImageAnimTable_HoOh, gObjectEventPicTable_HoOh, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanNormal = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 16, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BrendanMayNormal, sPicTable_BrendanNormal, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanMachBike = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_BrendanMachBike, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanAcroBike = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_BrendanAcroBike, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanSurfing = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Surfing, sPicTable_BrendanSurfing, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFieldMove = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_FieldMove, sPicTable_BrendanFieldMove, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_QuintyPlump = {0xFFFF, OBJ_EVENT_PAL_TAG_QUINTY_PLUMP, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_L, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_QuintyPlump, sPicTable_QuintyPlump, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_NinjaBoy = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_NinjaBoy, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Twin = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Twin, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Boy1, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Girl1, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Boy2, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Girl2, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleBoy = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_LittleBoy, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleGirl = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_LittleGirl, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Boy3, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Girl3, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RichBoy = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RichBoy, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Woman1, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FatMan = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_FatMan, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_PokefanF, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Man1, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Woman2, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_ExpertM, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_ExpertF, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Man2, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Woman3, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_PokefanM, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman4 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Woman4, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cook = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Cook, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkReceptionist = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_LinkReceptionist, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldMan = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_OldMan, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldWoman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_OldWoman, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Camper = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Camper, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Picnicker = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Picnicker, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Man3, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman5 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Woman5, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Youngster = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Youngster, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BugCatcher = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_BugCatcher, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PsychicM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_PsychicM, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SchoolKidM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_SchoolKidM, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maniac = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Maniac, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HexManiac = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_HexManiac, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 4, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_64x64, sOamTables_64x64, sAnimTable_Standard, sPicTable_RayquazaStill, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_SwimmerM, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_SwimmerF, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BlackBelt = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_BlackBelt, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Beauty = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Beauty, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Scientist1, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lass = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Lass, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Gentleman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Gentleman, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sailor = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Sailor, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fisherman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Fisherman, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RunningTriathleteM, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RunningTriathleteF, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_TuberF, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_TuberM, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hiker = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Hiker, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_CyclingTriathleteM, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_CyclingTriathleteF, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Nurse = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Nurse, sPicTable_Nurse, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ItemBall = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_ItemBall, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTree = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, NULL, sAnimTable_BerryTree, sPicTable_PechaBerryTree, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeEarlyStages = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_BerryTree, sPicTable_PechaBerryTree, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeLateStages = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BerryTree, sPicTable_PechaBerryTree, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ProfBirch = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_ProfBirch, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man4 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Man4, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man5 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Man5, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_ReporterM, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_ReporterF, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan1, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hipster = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan1, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Trader = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan1, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Storyteller = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan2, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Giddy = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan2, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan2, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MauvilleOldMan2, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedNatuDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedNatuDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMagnemiteDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedMagnemiteDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedSquirtleDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedSquirtleDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedWooperDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedWooperDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPikachuDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedPikachuDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPorygon2Doll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_UnusedPorygon2Doll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CuttableTree = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_CuttableTree, sPicTable_CuttableTree, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MartEmployee = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MartEmployee, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RooftopSaleWoman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RooftopSaleWoman, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Teala = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Teala, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BreakableRock = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_BreakableRock, sPicTable_BreakableRock, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PushableBoulder = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_PushableBoulder, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MrBrineysBoat = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_MrBrineysBoat, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayNormal = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 16, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BrendanMayNormal, sPicTable_MayNormal, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayMachBike = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_MayMachBike, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayAcroBike = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_MayAcroBike, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MaySurfing = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Surfing, sPicTable_MaySurfing, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFieldMove = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_FieldMove, sPicTable_MayFieldMove, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Truck = {0xFFFF, OBJ_EVENT_PAL_TAG_TRUCK, OBJ_EVENT_PAL_TAG_NONE, 1152, 48, 48, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_48x48, sAnimTable_Inanimate, sPicTable_Truck, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothCarryingBox = {0xFFFF, OBJ_EVENT_PAL_TAG_VIGOROTH, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_VigorothCarryingBox, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothFacingAway = {0xFFFF, OBJ_EVENT_PAL_TAG_VIGOROTH, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_VigorothFacingAway, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirchsBag = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_BirchsBag, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_EnemyZigzagoon = {0xFFFF, OBJ_EVENT_PAL_TAG_ZIGZAGOON, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_EnemyZigzagoon, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Poochyena = {0xFFFF, OBJ_EVENT_PAL_TAG_POOCHYENA, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Poochyena, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Artist = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Artist, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanNormal = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BrendanMayNormal, sPicTable_BrendanNormal, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanMachBike = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_BrendanMachBike, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanAcroBike = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_BrendanAcroBike, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanSurfing = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Surfing, sPicTable_BrendanSurfing, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanFieldMove = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_FieldMove, sPicTable_BrendanFieldMove, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayNormal = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BrendanMayNormal, sPicTable_MayNormal, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayMachBike = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_MayMachBike, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayAcroBike = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_MayAcroBike, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMaySurfing = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Surfing, sPicTable_MaySurfing, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayFieldMove = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_FieldMove, sPicTable_MayFieldMove, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cameraman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Cameraman, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanUnderwater = {0xFFFF, OBJ_EVENT_PAL_TAG_PLAYER_UNDERWATER, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_BrendanUnderwater, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayUnderwater = {0xFFFF, OBJ_EVENT_PAL_TAG_PLAYER_UNDERWATER, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_MayUnderwater, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MovingBox = {0xFFFF, OBJ_EVENT_PAL_TAG_MOVING_BOX, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 10, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_MovingBox, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CableCar = {0xFFFF, OBJ_EVENT_PAL_TAG_CABLE_CAR, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_64x64, sOamTables_64x64, sAnimTable_Inanimate, sPicTable_CableCar, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Scientist2, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DevonEmployee = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_DevonEmployee, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_AquaMemberM, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_AquaMemberF, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MagmaMemberM, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MagmaMemberF, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sidney = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Sidney, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Phoebe = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Phoebe, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Glacia = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Glacia, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Drake = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Drake, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Roxanne = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Roxanne, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brawly = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Brawly, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wattson = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Wattson, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Flannery = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Flannery, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Norman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Norman, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Winona = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Winona, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Liza = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Liza, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tate = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Tate, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wallace = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Wallace, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Steven = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Steven, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wally = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Wally, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireLittleBoy = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_RubySapphireLittleBoy, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFishing = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Fishing, sPicTable_BrendanFishing, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFishing = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Fishing, sPicTable_MayFishing, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HotSpringsOldWoman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_HotSpringsOldWoman, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SSTidal = {0xFFFF, OBJ_EVENT_PAL_TAG_SSTIDAL, OBJ_EVENT_PAL_TAG_NONE, 1920, 96, 40, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_8x8, sOamTables_96x40, sAnimTable_Standard, sPicTable_SSTidal, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SubmarineShadow = {0xFFFF, OBJ_EVENT_PAL_TAG_SUBMARINE_SHADOW, OBJ_EVENT_PAL_TAG_NONE, 1408, 88, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_8x8, sOamTables_88x32, sAnimTable_Standard, sPicTable_SubmarineShadow, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PichuDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_PichuDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikachuDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_PikachuDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MarillDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_MarillDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TogepiDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_TogepiDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyndaquilDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_CyndaquilDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ChikoritaDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_ChikoritaDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TotodileDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_TotodileDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_JigglypuffDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_JigglypuffDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MeowthDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_MeowthDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ClefairyDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_ClefairyDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DittoDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_DittoDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SmoochumDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_SmoochumDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TreeckoDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_TreeckoDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TorchicDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_TorchicDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MudkipDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_MudkipDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DuskullDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_DuskullDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WynautDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_WynautDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BaltoyDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_BaltoyDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_KecleonDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AzurillDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_AzurillDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SkittyDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_SkittyDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwabluDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_SwabluDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GulpinDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_GulpinDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LotadDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_LotadDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SeedotDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_SeedotDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikaCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_PikaCushion, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RoundCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_RoundCushion, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KissCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_KissCushion, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ZigzagCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_ZigzagCushion, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SpinCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_SpinCushion, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DiamondCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 5, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_DiamondCushion, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BallCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_BallCushion, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GrassCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_GrassCushion, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FireCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_FireCushion, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WaterCushion = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_WaterCushion, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigSnorlaxDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigSnorlaxDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRhydonDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigRhydonDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigLaprasDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigLaprasDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigVenusaurDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigVenusaurDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigCharizardDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 3, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigCharizardDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigBlastoiseDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigBlastoiseDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigWailmerDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigWailmerDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegirockDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigRegirockDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegiceDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigRegiceDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegisteelDoll = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BigRegisteelDoll, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latias = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_LatiasLatios, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latios = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_LatiasLatios, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GameboyKid = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_GameboyKid, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ContestJudge = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_ContestJudge, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanWatering = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_BrendanWatering, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayWatering = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 512, 32, 32, 0, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_MayWatering, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanDecorating = {0xFFFF, OBJ_EVENT_PAL_TAG_BRENDAN, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Inanimate, sPicTable_BrendanDecorating, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayDecorating = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Inanimate, sPicTable_MayDecorating, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Archie = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Archie, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maxie = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Maxie, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kyogre1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_KyogreFront, sAffineAnimTable_KyogreGroudon}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Groudon1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_GroudonFront, sAffineAnimTable_KyogreGroudon}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kyogre3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_KyogreSide, sAffineAnimTable_KyogreGroudon}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Groudon3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_GroudonSide, sPicTable_GroudonSide, sAffineAnimTable_KyogreGroudon}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fossil = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_Fossil, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regirock = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 3, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Regi, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regice = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Regi, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Registeel = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Regi, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Skitty = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Skitty, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kecleon = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Kecleon, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kyogre2 = {0xFFFF, OBJ_EVENT_PAL_TAG_KYOGRE, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_KyogreFront, sAffineAnimTable_KyogreGroudon}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Groudon2 = {0xFFFF, OBJ_EVENT_PAL_TAG_GROUDON, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_GroudonFront, sAffineAnimTable_KyogreGroudon}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 4, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_64x64, sOamTables_64x64, sAnimTable_Rayquaza, sPicTable_Rayquaza, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Zigzagoon = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Zigzagoon, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Pikachu = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Pikachu, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azumarill = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Azumarill, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wingull = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Wingull, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonBridgeShadow = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 128, 16, 16, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Kecleon, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberMSwimming = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_TuberMSwimming, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azurill = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Azurill, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mom = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Mom, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkBrendan = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BrendanMayNormal, sPicTable_BrendanNormal, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkMay = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BrendanMayNormal, sPicTable_MayNormal, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Juan = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Juan, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scott = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Scott, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MysteryEventDeliveryman = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_MysteryEventDeliveryman, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Statue = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Inanimate, sPicTable_Statue, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kirlia = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_S, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Kirlia, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Dusclops = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Dusclops, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnionRoomAttendant = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_UnionRoomAttendant, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Red = {0xFFFF, OBJ_EVENT_PAL_TAG_RED_LEAF, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Red, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Leaf = {0xFFFF, OBJ_EVENT_PAL_TAG_RED_LEAF, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Leaf, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sudowoodo = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Sudowoodo, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mew = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Mew, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Deoxys = {0xFFFF, OBJ_EVENT_PAL_TAG_DEOXYS, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Deoxys, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirthIslandStone = {0xFFFF, OBJ_EVENT_PAL_TAG_BIRTH_ISLAND_STONE, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Inanimate, sPicTable_BirthIslandStone, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Anabel = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Anabel, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tucker = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Tucker, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Greta = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Greta, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Spenser = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Spenser, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Noland = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Noland, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lucy = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Lucy, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brandon = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Brandon, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireBrendan = {0xFFFF, OBJ_EVENT_PAL_TAG_RS_BRENDAN, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RubySapphireBrendan, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireMay = {0xFFFF, OBJ_EVENT_PAL_TAG_RS_MAY, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RubySapphireMay, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lugia = {0xFFFF, OBJ_EVENT_PAL_TAG_LUGIA, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Lugia, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HoOh = {0xFFFF, OBJ_EVENT_PAL_TAG_HO_OH, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_HoOh, sPicTable_HoOh, gDummySpriteAffineAnimTable}; diff --git a/src/data/object_events/object_event_pic_tables.h b/src/data/object_events/object_event_pic_tables.h index 9cfdca7c1..1b8c9c727 100755 --- a/src/data/object_events/object_event_pic_tables.h +++ b/src/data/object_events/object_event_pic_tables.h @@ -1,4 +1,4 @@ -const struct SpriteFrameImage gObjectEventPicTable_BrendanNormal[] = { +static const struct SpriteFrameImage sPicTable_BrendanNormal[] = { overworld_frame(gObjectEventPic_BrendanNormal, 2, 4, 0), overworld_frame(gObjectEventPic_BrendanNormal, 2, 4, 1), overworld_frame(gObjectEventPic_BrendanNormal, 2, 4, 2), @@ -19,7 +19,7 @@ const struct SpriteFrameImage gObjectEventPicTable_BrendanNormal[] = { overworld_frame(gObjectEventPic_BrendanRunning, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_BrendanMachBike[] = { +static const struct SpriteFrameImage sPicTable_BrendanMachBike[] = { overworld_frame(gObjectEventPic_BrendanMachBike, 4, 4, 0), overworld_frame(gObjectEventPic_BrendanMachBike, 4, 4, 1), overworld_frame(gObjectEventPic_BrendanMachBike, 4, 4, 2), @@ -31,7 +31,7 @@ const struct SpriteFrameImage gObjectEventPicTable_BrendanMachBike[] = { overworld_frame(gObjectEventPic_BrendanMachBike, 4, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_BrendanAcroBike[] = { +static const struct SpriteFrameImage sPicTable_BrendanAcroBike[] = { overworld_frame(gObjectEventPic_BrendanAcroBike, 4, 4, 0), overworld_frame(gObjectEventPic_BrendanAcroBike, 4, 4, 1), overworld_frame(gObjectEventPic_BrendanAcroBike, 4, 4, 2), @@ -61,7 +61,7 @@ const struct SpriteFrameImage gObjectEventPicTable_BrendanAcroBike[] = { overworld_frame(gObjectEventPic_BrendanAcroBike, 4, 4, 26), }; -const struct SpriteFrameImage gObjectEventPicTable_BrendanSurfing[] = { +static const struct SpriteFrameImage sPicTable_BrendanSurfing[] = { overworld_frame(gObjectEventPic_BrendanSurfing, 4, 4, 0), overworld_frame(gObjectEventPic_BrendanSurfing, 4, 4, 2), overworld_frame(gObjectEventPic_BrendanSurfing, 4, 4, 4), @@ -76,7 +76,7 @@ const struct SpriteFrameImage gObjectEventPicTable_BrendanSurfing[] = { overworld_frame(gObjectEventPic_BrendanSurfing, 4, 4, 5), }; -const struct SpriteFrameImage gObjectEventPicTable_BrendanUnderwater[] = { +static const struct SpriteFrameImage sPicTable_BrendanUnderwater[] = { overworld_frame(gObjectEventPic_BrendanUnderwater, 4, 4, 0), overworld_frame(gObjectEventPic_BrendanUnderwater, 4, 4, 1), overworld_frame(gObjectEventPic_BrendanUnderwater, 4, 4, 2), @@ -88,7 +88,7 @@ const struct SpriteFrameImage gObjectEventPicTable_BrendanUnderwater[] = { overworld_frame(gObjectEventPic_BrendanUnderwater, 4, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_BrendanFieldMove[] = { +static const struct SpriteFrameImage sPicTable_BrendanFieldMove[] = { overworld_frame(gObjectEventPic_BrendanFieldMove, 4, 4, 0), overworld_frame(gObjectEventPic_BrendanFieldMove, 4, 4, 1), overworld_frame(gObjectEventPic_BrendanFieldMove, 4, 4, 2), @@ -96,7 +96,7 @@ const struct SpriteFrameImage gObjectEventPicTable_BrendanFieldMove[] = { overworld_frame(gObjectEventPic_BrendanFieldMove, 4, 4, 4), }; -const struct SpriteFrameImage gObjectEventPicTable_QuintyPlump[] = { +static const struct SpriteFrameImage sPicTable_QuintyPlump[] = { overworld_frame(gObjectEventPic_QuintyPlump, 4, 4, 0), overworld_frame(gObjectEventPic_QuintyPlump, 4, 4, 1), overworld_frame(gObjectEventPic_QuintyPlump, 4, 4, 2), @@ -106,7 +106,7 @@ const struct SpriteFrameImage gObjectEventPicTable_QuintyPlump[] = { overworld_frame(gObjectEventPic_QuintyPlump, 4, 4, 6), }; -const struct SpriteFrameImage gObjectEventPicTable_NinjaBoy[] = { +static const struct SpriteFrameImage sPicTable_NinjaBoy[] = { overworld_frame(gObjectEventPic_NinjaBoy, 2, 2, 0), overworld_frame(gObjectEventPic_NinjaBoy, 2, 2, 1), overworld_frame(gObjectEventPic_NinjaBoy, 2, 2, 2), @@ -118,7 +118,7 @@ const struct SpriteFrameImage gObjectEventPicTable_NinjaBoy[] = { overworld_frame(gObjectEventPic_NinjaBoy, 2, 2, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Twin[] = { +static const struct SpriteFrameImage sPicTable_Twin[] = { overworld_frame(gObjectEventPic_Twin, 2, 4, 0), overworld_frame(gObjectEventPic_Twin, 2, 4, 1), overworld_frame(gObjectEventPic_Twin, 2, 4, 2), @@ -130,7 +130,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Twin[] = { overworld_frame(gObjectEventPic_Twin, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Boy1[] = { +static const struct SpriteFrameImage sPicTable_Boy1[] = { overworld_frame(gObjectEventPic_Boy1, 2, 4, 0), overworld_frame(gObjectEventPic_Boy1, 2, 4, 1), overworld_frame(gObjectEventPic_Boy1, 2, 4, 2), @@ -142,7 +142,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Boy1[] = { overworld_frame(gObjectEventPic_Boy1, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Girl1[] = { +static const struct SpriteFrameImage sPicTable_Girl1[] = { overworld_frame(gObjectEventPic_Girl1, 2, 4, 0), overworld_frame(gObjectEventPic_Girl1, 2, 4, 1), overworld_frame(gObjectEventPic_Girl1, 2, 4, 2), @@ -154,7 +154,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Girl1[] = { overworld_frame(gObjectEventPic_Girl1, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Boy2[] = { +static const struct SpriteFrameImage sPicTable_Boy2[] = { overworld_frame(gObjectEventPic_Boy2, 2, 4, 0), overworld_frame(gObjectEventPic_Boy2, 2, 4, 1), overworld_frame(gObjectEventPic_Boy2, 2, 4, 2), @@ -166,7 +166,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Boy2[] = { overworld_frame(gObjectEventPic_Boy2, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Girl2[] = { +static const struct SpriteFrameImage sPicTable_Girl2[] = { overworld_frame(gObjectEventPic_Girl2, 2, 4, 0), overworld_frame(gObjectEventPic_Girl2, 2, 4, 1), overworld_frame(gObjectEventPic_Girl2, 2, 4, 2), @@ -178,7 +178,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Girl2[] = { overworld_frame(gObjectEventPic_Girl2, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_LittleBoy[] = { +static const struct SpriteFrameImage sPicTable_LittleBoy[] = { overworld_frame(gObjectEventPic_LittleBoy, 2, 2, 0), overworld_frame(gObjectEventPic_LittleBoy, 2, 2, 1), overworld_frame(gObjectEventPic_LittleBoy, 2, 2, 2), @@ -190,7 +190,7 @@ const struct SpriteFrameImage gObjectEventPicTable_LittleBoy[] = { overworld_frame(gObjectEventPic_LittleBoy, 2, 2, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_LittleGirl[] = { +static const struct SpriteFrameImage sPicTable_LittleGirl[] = { overworld_frame(gObjectEventPic_LittleGirl, 2, 2, 0), overworld_frame(gObjectEventPic_LittleGirl, 2, 2, 1), overworld_frame(gObjectEventPic_LittleGirl, 2, 2, 2), @@ -202,7 +202,7 @@ const struct SpriteFrameImage gObjectEventPicTable_LittleGirl[] = { overworld_frame(gObjectEventPic_LittleGirl, 2, 2, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Boy3[] = { +static const struct SpriteFrameImage sPicTable_Boy3[] = { overworld_frame(gObjectEventPic_Boy3, 2, 4, 0), overworld_frame(gObjectEventPic_Boy3, 2, 4, 1), overworld_frame(gObjectEventPic_Boy3, 2, 4, 2), @@ -214,7 +214,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Boy3[] = { overworld_frame(gObjectEventPic_Boy3, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Girl3[] = { +static const struct SpriteFrameImage sPicTable_Girl3[] = { overworld_frame(gObjectEventPic_Girl3, 2, 4, 0), overworld_frame(gObjectEventPic_Girl3, 2, 4, 1), overworld_frame(gObjectEventPic_Girl3, 2, 4, 2), @@ -226,7 +226,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Girl3[] = { overworld_frame(gObjectEventPic_Girl3, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_RichBoy[] = { +static const struct SpriteFrameImage sPicTable_RichBoy[] = { overworld_frame(gObjectEventPic_RichBoy, 2, 4, 0), overworld_frame(gObjectEventPic_RichBoy, 2, 4, 1), overworld_frame(gObjectEventPic_RichBoy, 2, 4, 2), @@ -238,7 +238,7 @@ const struct SpriteFrameImage gObjectEventPicTable_RichBoy[] = { overworld_frame(gObjectEventPic_RichBoy, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Woman1[] = { +static const struct SpriteFrameImage sPicTable_Woman1[] = { overworld_frame(gObjectEventPic_Woman1, 2, 4, 0), overworld_frame(gObjectEventPic_Woman1, 2, 4, 1), overworld_frame(gObjectEventPic_Woman1, 2, 4, 2), @@ -250,7 +250,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Woman1[] = { overworld_frame(gObjectEventPic_Woman1, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_FatMan[] = { +static const struct SpriteFrameImage sPicTable_FatMan[] = { overworld_frame(gObjectEventPic_FatMan, 2, 4, 0), overworld_frame(gObjectEventPic_FatMan, 2, 4, 1), overworld_frame(gObjectEventPic_FatMan, 2, 4, 2), @@ -262,7 +262,7 @@ const struct SpriteFrameImage gObjectEventPicTable_FatMan[] = { overworld_frame(gObjectEventPic_FatMan, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_PokefanF[] = { +static const struct SpriteFrameImage sPicTable_PokefanF[] = { overworld_frame(gObjectEventPic_PokefanF, 2, 4, 0), overworld_frame(gObjectEventPic_PokefanF, 2, 4, 1), overworld_frame(gObjectEventPic_PokefanF, 2, 4, 2), @@ -274,7 +274,7 @@ const struct SpriteFrameImage gObjectEventPicTable_PokefanF[] = { overworld_frame(gObjectEventPic_PokefanF, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Man1[] = { +static const struct SpriteFrameImage sPicTable_Man1[] = { overworld_frame(gObjectEventPic_Man1, 2, 4, 0), overworld_frame(gObjectEventPic_Man1, 2, 4, 1), overworld_frame(gObjectEventPic_Man1, 2, 4, 2), @@ -286,7 +286,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Man1[] = { overworld_frame(gObjectEventPic_Man1, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Woman2[] = { +static const struct SpriteFrameImage sPicTable_Woman2[] = { overworld_frame(gObjectEventPic_Woman2, 2, 4, 0), overworld_frame(gObjectEventPic_Woman2, 2, 4, 1), overworld_frame(gObjectEventPic_Woman2, 2, 4, 2), @@ -298,7 +298,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Woman2[] = { overworld_frame(gObjectEventPic_Woman2, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_ExpertM[] = { +static const struct SpriteFrameImage sPicTable_ExpertM[] = { overworld_frame(gObjectEventPic_ExpertM, 2, 4, 0), overworld_frame(gObjectEventPic_ExpertM, 2, 4, 1), overworld_frame(gObjectEventPic_ExpertM, 2, 4, 2), @@ -310,7 +310,7 @@ const struct SpriteFrameImage gObjectEventPicTable_ExpertM[] = { overworld_frame(gObjectEventPic_ExpertM, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_ExpertF[] = { +static const struct SpriteFrameImage sPicTable_ExpertF[] = { overworld_frame(gObjectEventPic_ExpertF, 2, 4, 0), overworld_frame(gObjectEventPic_ExpertF, 2, 4, 1), overworld_frame(gObjectEventPic_ExpertF, 2, 4, 2), @@ -322,7 +322,7 @@ const struct SpriteFrameImage gObjectEventPicTable_ExpertF[] = { overworld_frame(gObjectEventPic_ExpertF, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Man2[] = { +static const struct SpriteFrameImage sPicTable_Man2[] = { overworld_frame(gObjectEventPic_Man2, 2, 4, 0), overworld_frame(gObjectEventPic_Man2, 2, 4, 1), overworld_frame(gObjectEventPic_Man2, 2, 4, 2), @@ -334,7 +334,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Man2[] = { overworld_frame(gObjectEventPic_Man2, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Woman3[] = { +static const struct SpriteFrameImage sPicTable_Woman3[] = { overworld_frame(gObjectEventPic_Woman3, 2, 4, 0), overworld_frame(gObjectEventPic_Woman3, 2, 4, 1), overworld_frame(gObjectEventPic_Woman3, 2, 4, 2), @@ -346,7 +346,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Woman3[] = { overworld_frame(gObjectEventPic_Woman3, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_PokefanM[] = { +static const struct SpriteFrameImage sPicTable_PokefanM[] = { overworld_frame(gObjectEventPic_PokefanM, 2, 4, 0), overworld_frame(gObjectEventPic_PokefanM, 2, 4, 1), overworld_frame(gObjectEventPic_PokefanM, 2, 4, 2), @@ -358,7 +358,7 @@ const struct SpriteFrameImage gObjectEventPicTable_PokefanM[] = { overworld_frame(gObjectEventPic_PokefanM, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Woman4[] = { +static const struct SpriteFrameImage sPicTable_Woman4[] = { overworld_frame(gObjectEventPic_Woman4, 2, 4, 0), overworld_frame(gObjectEventPic_Woman4, 2, 4, 1), overworld_frame(gObjectEventPic_Woman4, 2, 4, 2), @@ -370,7 +370,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Woman4[] = { overworld_frame(gObjectEventPic_Woman4, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Cook[] = { +static const struct SpriteFrameImage sPicTable_Cook[] = { overworld_frame(gObjectEventPic_Cook, 2, 4, 0), overworld_frame(gObjectEventPic_Cook, 2, 4, 1), overworld_frame(gObjectEventPic_Cook, 2, 4, 2), @@ -382,7 +382,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Cook[] = { overworld_frame(gObjectEventPic_Cook, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_LinkReceptionist[] = { +static const struct SpriteFrameImage sPicTable_LinkReceptionist[] = { overworld_frame(gObjectEventPic_LinkReceptionist, 2, 4, 0), overworld_frame(gObjectEventPic_LinkReceptionist, 2, 4, 1), overworld_frame(gObjectEventPic_LinkReceptionist, 2, 4, 2), @@ -394,7 +394,7 @@ const struct SpriteFrameImage gObjectEventPicTable_LinkReceptionist[] = { overworld_frame(gObjectEventPic_LinkReceptionist, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_OldMan[] = { +static const struct SpriteFrameImage sPicTable_OldMan[] = { overworld_frame(gObjectEventPic_OldMan, 2, 4, 0), overworld_frame(gObjectEventPic_OldMan, 2, 4, 1), overworld_frame(gObjectEventPic_OldMan, 2, 4, 2), @@ -406,7 +406,7 @@ const struct SpriteFrameImage gObjectEventPicTable_OldMan[] = { overworld_frame(gObjectEventPic_OldMan, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_OldWoman[] = { +static const struct SpriteFrameImage sPicTable_OldWoman[] = { overworld_frame(gObjectEventPic_OldWoman, 2, 4, 0), overworld_frame(gObjectEventPic_OldWoman, 2, 4, 1), overworld_frame(gObjectEventPic_OldWoman, 2, 4, 2), @@ -418,7 +418,7 @@ const struct SpriteFrameImage gObjectEventPicTable_OldWoman[] = { overworld_frame(gObjectEventPic_OldWoman, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Camper[] = { +static const struct SpriteFrameImage sPicTable_Camper[] = { overworld_frame(gObjectEventPic_Camper, 2, 4, 0), overworld_frame(gObjectEventPic_Camper, 2, 4, 1), overworld_frame(gObjectEventPic_Camper, 2, 4, 2), @@ -430,7 +430,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Camper[] = { overworld_frame(gObjectEventPic_Camper, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Picnicker[] = { +static const struct SpriteFrameImage sPicTable_Picnicker[] = { overworld_frame(gObjectEventPic_Picnicker, 2, 4, 0), overworld_frame(gObjectEventPic_Picnicker, 2, 4, 1), overworld_frame(gObjectEventPic_Picnicker, 2, 4, 2), @@ -442,7 +442,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Picnicker[] = { overworld_frame(gObjectEventPic_Picnicker, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Man3[] = { +static const struct SpriteFrameImage sPicTable_Man3[] = { overworld_frame(gObjectEventPic_Man3, 2, 4, 0), overworld_frame(gObjectEventPic_Man3, 2, 4, 1), overworld_frame(gObjectEventPic_Man3, 2, 4, 2), @@ -454,7 +454,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Man3[] = { overworld_frame(gObjectEventPic_Man3, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Woman5[] = { +static const struct SpriteFrameImage sPicTable_Woman5[] = { overworld_frame(gObjectEventPic_Woman5, 2, 4, 0), overworld_frame(gObjectEventPic_Woman5, 2, 4, 1), overworld_frame(gObjectEventPic_Woman5, 2, 4, 2), @@ -466,7 +466,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Woman5[] = { overworld_frame(gObjectEventPic_Woman5, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Youngster[] = { +static const struct SpriteFrameImage sPicTable_Youngster[] = { overworld_frame(gObjectEventPic_Youngster, 2, 4, 0), overworld_frame(gObjectEventPic_Youngster, 2, 4, 1), overworld_frame(gObjectEventPic_Youngster, 2, 4, 2), @@ -478,7 +478,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Youngster[] = { overworld_frame(gObjectEventPic_Youngster, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_BugCatcher[] = { +static const struct SpriteFrameImage sPicTable_BugCatcher[] = { overworld_frame(gObjectEventPic_BugCatcher, 2, 4, 0), overworld_frame(gObjectEventPic_BugCatcher, 2, 4, 1), overworld_frame(gObjectEventPic_BugCatcher, 2, 4, 2), @@ -490,7 +490,7 @@ const struct SpriteFrameImage gObjectEventPicTable_BugCatcher[] = { overworld_frame(gObjectEventPic_BugCatcher, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_PsychicM[] = { +static const struct SpriteFrameImage sPicTable_PsychicM[] = { overworld_frame(gObjectEventPic_PsychicM, 2, 4, 0), overworld_frame(gObjectEventPic_PsychicM, 2, 4, 1), overworld_frame(gObjectEventPic_PsychicM, 2, 4, 2), @@ -502,7 +502,7 @@ const struct SpriteFrameImage gObjectEventPicTable_PsychicM[] = { overworld_frame(gObjectEventPic_PsychicM, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_SchoolKidM[] = { +static const struct SpriteFrameImage sPicTable_SchoolKidM[] = { overworld_frame(gObjectEventPic_SchoolKidM, 2, 4, 0), overworld_frame(gObjectEventPic_SchoolKidM, 2, 4, 1), overworld_frame(gObjectEventPic_SchoolKidM, 2, 4, 2), @@ -514,7 +514,7 @@ const struct SpriteFrameImage gObjectEventPicTable_SchoolKidM[] = { overworld_frame(gObjectEventPic_SchoolKidM, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Maniac[] = { +static const struct SpriteFrameImage sPicTable_Maniac[] = { overworld_frame(gObjectEventPic_Maniac, 2, 4, 0), overworld_frame(gObjectEventPic_Maniac, 2, 4, 1), overworld_frame(gObjectEventPic_Maniac, 2, 4, 2), @@ -526,7 +526,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Maniac[] = { overworld_frame(gObjectEventPic_Maniac, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_HexManiac[] = { +static const struct SpriteFrameImage sPicTable_HexManiac[] = { overworld_frame(gObjectEventPic_HexManiac, 2, 4, 0), overworld_frame(gObjectEventPic_HexManiac, 2, 4, 1), overworld_frame(gObjectEventPic_HexManiac, 2, 4, 2), @@ -538,7 +538,7 @@ const struct SpriteFrameImage gObjectEventPicTable_HexManiac[] = { overworld_frame(gObjectEventPic_HexManiac, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_SwimmerM[] = { +static const struct SpriteFrameImage sPicTable_SwimmerM[] = { overworld_frame(gObjectEventPic_SwimmerM, 2, 4, 0), overworld_frame(gObjectEventPic_SwimmerM, 2, 4, 1), overworld_frame(gObjectEventPic_SwimmerM, 2, 4, 2), @@ -550,7 +550,7 @@ const struct SpriteFrameImage gObjectEventPicTable_SwimmerM[] = { overworld_frame(gObjectEventPic_SwimmerM, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_SwimmerF[] = { +static const struct SpriteFrameImage sPicTable_SwimmerF[] = { overworld_frame(gObjectEventPic_SwimmerF, 2, 4, 0), overworld_frame(gObjectEventPic_SwimmerF, 2, 4, 1), overworld_frame(gObjectEventPic_SwimmerF, 2, 4, 2), @@ -562,7 +562,7 @@ const struct SpriteFrameImage gObjectEventPicTable_SwimmerF[] = { overworld_frame(gObjectEventPic_SwimmerF, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_BlackBelt[] = { +static const struct SpriteFrameImage sPicTable_BlackBelt[] = { overworld_frame(gObjectEventPic_BlackBelt, 2, 4, 0), overworld_frame(gObjectEventPic_BlackBelt, 2, 4, 1), overworld_frame(gObjectEventPic_BlackBelt, 2, 4, 2), @@ -574,7 +574,7 @@ const struct SpriteFrameImage gObjectEventPicTable_BlackBelt[] = { overworld_frame(gObjectEventPic_BlackBelt, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Beauty[] = { +static const struct SpriteFrameImage sPicTable_Beauty[] = { overworld_frame(gObjectEventPic_Beauty, 2, 4, 0), overworld_frame(gObjectEventPic_Beauty, 2, 4, 1), overworld_frame(gObjectEventPic_Beauty, 2, 4, 2), @@ -586,7 +586,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Beauty[] = { overworld_frame(gObjectEventPic_Beauty, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Scientist1[] = { +static const struct SpriteFrameImage sPicTable_Scientist1[] = { overworld_frame(gObjectEventPic_Scientist1, 2, 4, 0), overworld_frame(gObjectEventPic_Scientist1, 2, 4, 1), overworld_frame(gObjectEventPic_Scientist1, 2, 4, 2), @@ -598,7 +598,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Scientist1[] = { overworld_frame(gObjectEventPic_Scientist1, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Lass[] = { +static const struct SpriteFrameImage sPicTable_Lass[] = { overworld_frame(gObjectEventPic_Lass, 2, 4, 0), overworld_frame(gObjectEventPic_Lass, 2, 4, 1), overworld_frame(gObjectEventPic_Lass, 2, 4, 2), @@ -610,7 +610,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Lass[] = { overworld_frame(gObjectEventPic_Lass, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Gentleman[] = { +static const struct SpriteFrameImage sPicTable_Gentleman[] = { overworld_frame(gObjectEventPic_Gentleman, 2, 4, 0), overworld_frame(gObjectEventPic_Gentleman, 2, 4, 1), overworld_frame(gObjectEventPic_Gentleman, 2, 4, 2), @@ -622,7 +622,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Gentleman[] = { overworld_frame(gObjectEventPic_Gentleman, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Sailor[] = { +static const struct SpriteFrameImage sPicTable_Sailor[] = { overworld_frame(gObjectEventPic_Sailor, 2, 4, 0), overworld_frame(gObjectEventPic_Sailor, 2, 4, 1), overworld_frame(gObjectEventPic_Sailor, 2, 4, 2), @@ -634,7 +634,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Sailor[] = { overworld_frame(gObjectEventPic_Sailor, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Fisherman[] = { +static const struct SpriteFrameImage sPicTable_Fisherman[] = { overworld_frame(gObjectEventPic_Fisherman, 2, 4, 0), overworld_frame(gObjectEventPic_Fisherman, 2, 4, 1), overworld_frame(gObjectEventPic_Fisherman, 2, 4, 2), @@ -646,7 +646,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Fisherman[] = { overworld_frame(gObjectEventPic_Fisherman, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_RunningTriathleteM[] = { +static const struct SpriteFrameImage sPicTable_RunningTriathleteM[] = { overworld_frame(gObjectEventPic_RunningTriathleteM, 2, 4, 0), overworld_frame(gObjectEventPic_RunningTriathleteM, 2, 4, 1), overworld_frame(gObjectEventPic_RunningTriathleteM, 2, 4, 2), @@ -658,7 +658,7 @@ const struct SpriteFrameImage gObjectEventPicTable_RunningTriathleteM[] = { overworld_frame(gObjectEventPic_RunningTriathleteM, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_RunningTriathleteF[] = { +static const struct SpriteFrameImage sPicTable_RunningTriathleteF[] = { overworld_frame(gObjectEventPic_RunningTriathleteF, 2, 4, 0), overworld_frame(gObjectEventPic_RunningTriathleteF, 2, 4, 1), overworld_frame(gObjectEventPic_RunningTriathleteF, 2, 4, 2), @@ -670,7 +670,7 @@ const struct SpriteFrameImage gObjectEventPicTable_RunningTriathleteF[] = { overworld_frame(gObjectEventPic_RunningTriathleteF, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_TuberF[] = { +static const struct SpriteFrameImage sPicTable_TuberF[] = { overworld_frame(gObjectEventPic_TuberF, 2, 2, 0), overworld_frame(gObjectEventPic_TuberF, 2, 2, 1), overworld_frame(gObjectEventPic_TuberF, 2, 2, 2), @@ -682,7 +682,7 @@ const struct SpriteFrameImage gObjectEventPicTable_TuberF[] = { overworld_frame(gObjectEventPic_TuberF, 2, 2, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_TuberM[] = { +static const struct SpriteFrameImage sPicTable_TuberM[] = { overworld_frame(gObjectEventPic_TuberM, 2, 2, 0), overworld_frame(gObjectEventPic_TuberM, 2, 2, 1), overworld_frame(gObjectEventPic_TuberM, 2, 2, 2), @@ -694,7 +694,7 @@ const struct SpriteFrameImage gObjectEventPicTable_TuberM[] = { overworld_frame(gObjectEventPic_TuberM, 2, 2, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Hiker[] = { +static const struct SpriteFrameImage sPicTable_Hiker[] = { overworld_frame(gObjectEventPic_Hiker, 2, 4, 0), overworld_frame(gObjectEventPic_Hiker, 2, 4, 1), overworld_frame(gObjectEventPic_Hiker, 2, 4, 2), @@ -706,7 +706,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Hiker[] = { overworld_frame(gObjectEventPic_Hiker, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_CyclingTriathleteM[] = { +static const struct SpriteFrameImage sPicTable_CyclingTriathleteM[] = { overworld_frame(gObjectEventPic_CyclingTriathleteM, 4, 4, 0), overworld_frame(gObjectEventPic_CyclingTriathleteM, 4, 4, 1), overworld_frame(gObjectEventPic_CyclingTriathleteM, 4, 4, 2), @@ -718,7 +718,7 @@ const struct SpriteFrameImage gObjectEventPicTable_CyclingTriathleteM[] = { overworld_frame(gObjectEventPic_CyclingTriathleteM, 4, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_CyclingTriathleteF[] = { +static const struct SpriteFrameImage sPicTable_CyclingTriathleteF[] = { overworld_frame(gObjectEventPic_CyclingTriathleteF, 4, 4, 0), overworld_frame(gObjectEventPic_CyclingTriathleteF, 4, 4, 1), overworld_frame(gObjectEventPic_CyclingTriathleteF, 4, 4, 2), @@ -730,7 +730,7 @@ const struct SpriteFrameImage gObjectEventPicTable_CyclingTriathleteF[] = { overworld_frame(gObjectEventPic_CyclingTriathleteF, 4, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Nurse[] = { +static const struct SpriteFrameImage sPicTable_Nurse[] = { overworld_frame(gObjectEventPic_Nurse, 2, 4, 0), overworld_frame(gObjectEventPic_Nurse, 2, 4, 1), overworld_frame(gObjectEventPic_Nurse, 2, 4, 2), @@ -743,11 +743,11 @@ const struct SpriteFrameImage gObjectEventPicTable_Nurse[] = { overworld_frame(gObjectEventPic_Nurse, 2, 4, 3), }; -const struct SpriteFrameImage gObjectEventPicTable_ItemBall[] = { +static const struct SpriteFrameImage sPicTable_ItemBall[] = { obj_frame_tiles(gObjectEventPic_ItemBall), }; -const struct SpriteFrameImage gObjectEventPicTable_ProfBirch[] = { +static const struct SpriteFrameImage sPicTable_ProfBirch[] = { overworld_frame(gObjectEventPic_ProfBirch, 2, 4, 0), overworld_frame(gObjectEventPic_ProfBirch, 2, 4, 1), overworld_frame(gObjectEventPic_ProfBirch, 2, 4, 2), @@ -759,7 +759,7 @@ const struct SpriteFrameImage gObjectEventPicTable_ProfBirch[] = { overworld_frame(gObjectEventPic_ProfBirch, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Man4[] = { +static const struct SpriteFrameImage sPicTable_Man4[] = { overworld_frame(gObjectEventPic_Man4, 2, 4, 0), overworld_frame(gObjectEventPic_Man4, 2, 4, 1), overworld_frame(gObjectEventPic_Man4, 2, 4, 2), @@ -771,7 +771,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Man4[] = { overworld_frame(gObjectEventPic_Man4, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Man5[] = { +static const struct SpriteFrameImage sPicTable_Man5[] = { overworld_frame(gObjectEventPic_Man5, 2, 4, 0), overworld_frame(gObjectEventPic_Man5, 2, 4, 1), overworld_frame(gObjectEventPic_Man5, 2, 4, 2), @@ -783,7 +783,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Man5[] = { overworld_frame(gObjectEventPic_Man5, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_ReporterM[] = { +static const struct SpriteFrameImage sPicTable_ReporterM[] = { overworld_frame(gObjectEventPic_ReporterM, 2, 4, 0), overworld_frame(gObjectEventPic_ReporterM, 2, 4, 1), overworld_frame(gObjectEventPic_ReporterM, 2, 4, 2), @@ -795,7 +795,7 @@ const struct SpriteFrameImage gObjectEventPicTable_ReporterM[] = { overworld_frame(gObjectEventPic_ReporterM, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_ReporterF[] = { +static const struct SpriteFrameImage sPicTable_ReporterF[] = { overworld_frame(gObjectEventPic_ReporterF, 2, 4, 0), overworld_frame(gObjectEventPic_ReporterF, 2, 4, 1), overworld_frame(gObjectEventPic_ReporterF, 2, 4, 2), @@ -807,7 +807,7 @@ const struct SpriteFrameImage gObjectEventPicTable_ReporterF[] = { overworld_frame(gObjectEventPic_ReporterF, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_MauvilleOldMan1[] = { +static const struct SpriteFrameImage sPicTable_MauvilleOldMan1[] = { overworld_frame(gObjectEventPic_MauvilleOldMan1, 2, 4, 0), overworld_frame(gObjectEventPic_MauvilleOldMan1, 2, 4, 1), overworld_frame(gObjectEventPic_MauvilleOldMan1, 2, 4, 2), @@ -819,7 +819,7 @@ const struct SpriteFrameImage gObjectEventPicTable_MauvilleOldMan1[] = { overworld_frame(gObjectEventPic_MauvilleOldMan1, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_MauvilleOldMan2[] = { +static const struct SpriteFrameImage sPicTable_MauvilleOldMan2[] = { overworld_frame(gObjectEventPic_MauvilleOldMan2, 2, 4, 0), overworld_frame(gObjectEventPic_MauvilleOldMan2, 2, 4, 1), overworld_frame(gObjectEventPic_MauvilleOldMan2, 2, 4, 2), @@ -831,38 +831,38 @@ const struct SpriteFrameImage gObjectEventPicTable_MauvilleOldMan2[] = { overworld_frame(gObjectEventPic_MauvilleOldMan2, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_UnusedNatuDoll[] = { +static const struct SpriteFrameImage sPicTable_UnusedNatuDoll[] = { obj_frame_tiles(gObjectEventPic_UnusedNatuDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_UnusedMagnemiteDoll[] = { +static const struct SpriteFrameImage sPicTable_UnusedMagnemiteDoll[] = { obj_frame_tiles(gObjectEventPic_UnusedMagnemiteDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_UnusedSquirtleDoll[] = { +static const struct SpriteFrameImage sPicTable_UnusedSquirtleDoll[] = { obj_frame_tiles(gObjectEventPic_UnusedSquirtleDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_UnusedWooperDoll[] = { +static const struct SpriteFrameImage sPicTable_UnusedWooperDoll[] = { obj_frame_tiles(gObjectEventPic_UnusedWooperDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_UnusedPikachuDoll[] = { +static const struct SpriteFrameImage sPicTable_UnusedPikachuDoll[] = { obj_frame_tiles(gObjectEventPic_UnusedPikachuDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_UnusedPorygon2Doll[] = { +static const struct SpriteFrameImage sPicTable_UnusedPorygon2Doll[] = { obj_frame_tiles(gObjectEventPic_UnusedPorygon2Doll), }; -const struct SpriteFrameImage gObjectEventPicTable_CuttableTree[] = { +static const struct SpriteFrameImage sPicTable_CuttableTree[] = { overworld_frame(gObjectEventPic_CuttableTree, 2, 2, 0), overworld_frame(gObjectEventPic_CuttableTree, 2, 2, 1), overworld_frame(gObjectEventPic_CuttableTree, 2, 2, 2), overworld_frame(gObjectEventPic_CuttableTree, 2, 2, 3), }; -const struct SpriteFrameImage gObjectEventPicTable_MartEmployee[] = { +static const struct SpriteFrameImage sPicTable_MartEmployee[] = { overworld_frame(gObjectEventPic_MartEmployee, 2, 4, 0), overworld_frame(gObjectEventPic_MartEmployee, 2, 4, 1), overworld_frame(gObjectEventPic_MartEmployee, 2, 4, 2), @@ -874,7 +874,7 @@ const struct SpriteFrameImage gObjectEventPicTable_MartEmployee[] = { overworld_frame(gObjectEventPic_MartEmployee, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_RooftopSaleWoman[] = { +static const struct SpriteFrameImage sPicTable_RooftopSaleWoman[] = { overworld_frame(gObjectEventPic_RooftopSaleWoman, 2, 4, 0), overworld_frame(gObjectEventPic_RooftopSaleWoman, 2, 4, 1), overworld_frame(gObjectEventPic_RooftopSaleWoman, 2, 4, 2), @@ -886,7 +886,7 @@ const struct SpriteFrameImage gObjectEventPicTable_RooftopSaleWoman[] = { overworld_frame(gObjectEventPic_RooftopSaleWoman, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Teala[] = { +static const struct SpriteFrameImage sPicTable_Teala[] = { overworld_frame(gObjectEventPic_Teala, 2, 4, 0), overworld_frame(gObjectEventPic_Teala, 2, 4, 1), overworld_frame(gObjectEventPic_Teala, 2, 4, 2), @@ -898,18 +898,18 @@ const struct SpriteFrameImage gObjectEventPicTable_Teala[] = { overworld_frame(gObjectEventPic_Teala, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_BreakableRock[] = { +static const struct SpriteFrameImage sPicTable_BreakableRock[] = { overworld_frame(gObjectEventPic_BreakableRock, 2, 2, 0), overworld_frame(gObjectEventPic_BreakableRock, 2, 2, 1), overworld_frame(gObjectEventPic_BreakableRock, 2, 2, 2), overworld_frame(gObjectEventPic_BreakableRock, 2, 2, 3), }; -const struct SpriteFrameImage gObjectEventPicTable_PushableBoulder[] = { +static const struct SpriteFrameImage sPicTable_PushableBoulder[] = { obj_frame_tiles(gObjectEventPic_PushableBoulder), }; -const struct SpriteFrameImage gObjectEventPicTable_MrBrineysBoat[] = { +static const struct SpriteFrameImage sPicTable_MrBrineysBoat[] = { overworld_frame(gObjectEventPic_MrBrineysBoat, 4, 4, 0), overworld_frame(gObjectEventPic_MrBrineysBoat, 4, 4, 1), overworld_frame(gObjectEventPic_MrBrineysBoat, 4, 4, 2), @@ -921,11 +921,11 @@ const struct SpriteFrameImage gObjectEventPicTable_MrBrineysBoat[] = { overworld_frame(gObjectEventPic_MrBrineysBoat, 4, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Truck[] = { +static const struct SpriteFrameImage sPicTable_Truck[] = { obj_frame_tiles(gObjectEventPic_Truck), }; -const struct SpriteFrameImage gObjectEventPicTable_VigorothCarryingBox[] = { +static const struct SpriteFrameImage sPicTable_VigorothCarryingBox[] = { overworld_frame(gObjectEventPic_Vigoroth, 4, 4, 0), overworld_frame(gObjectEventPic_Vigoroth, 4, 4, 0), overworld_frame(gObjectEventPic_Vigoroth, 4, 4, 0), @@ -937,7 +937,7 @@ const struct SpriteFrameImage gObjectEventPicTable_VigorothCarryingBox[] = { overworld_frame(gObjectEventPic_Vigoroth, 4, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_VigorothFacingAway[] = { +static const struct SpriteFrameImage sPicTable_VigorothFacingAway[] = { overworld_frame(gObjectEventPic_Vigoroth, 4, 4, 3), overworld_frame(gObjectEventPic_Vigoroth, 4, 4, 3), overworld_frame(gObjectEventPic_Vigoroth, 4, 4, 3), @@ -949,11 +949,11 @@ const struct SpriteFrameImage gObjectEventPicTable_VigorothFacingAway[] = { overworld_frame(gObjectEventPic_Vigoroth, 4, 4, 4), }; -const struct SpriteFrameImage gObjectEventPicTable_BirchsBag[] = { +static const struct SpriteFrameImage sPicTable_BirchsBag[] = { obj_frame_tiles(gObjectEventPic_BirchsBag), }; -const struct SpriteFrameImage gObjectEventPicTable_EnemyZigzagoon[] = { +static const struct SpriteFrameImage sPicTable_EnemyZigzagoon[] = { overworld_frame(gObjectEventPic_EnemyZigzagoon, 4, 4, 0), overworld_frame(gObjectEventPic_EnemyZigzagoon, 4, 4, 1), overworld_frame(gObjectEventPic_EnemyZigzagoon, 4, 4, 2), @@ -965,7 +965,7 @@ const struct SpriteFrameImage gObjectEventPicTable_EnemyZigzagoon[] = { overworld_frame(gObjectEventPic_EnemyZigzagoon, 4, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Poochyena[] = { +static const struct SpriteFrameImage sPicTable_Poochyena[] = { overworld_frame(gObjectEventPic_Poochyena, 4, 4, 0), overworld_frame(gObjectEventPic_Poochyena, 4, 4, 1), overworld_frame(gObjectEventPic_Poochyena, 4, 4, 2), @@ -977,7 +977,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Poochyena[] = { overworld_frame(gObjectEventPic_Poochyena, 4, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Artist[] = { +static const struct SpriteFrameImage sPicTable_Artist[] = { overworld_frame(gObjectEventPic_Artist, 2, 4, 0), overworld_frame(gObjectEventPic_Artist, 2, 4, 1), overworld_frame(gObjectEventPic_Artist, 2, 4, 2), @@ -989,7 +989,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Artist[] = { overworld_frame(gObjectEventPic_Artist, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_MayNormal[] = { +static const struct SpriteFrameImage sPicTable_MayNormal[] = { overworld_frame(gObjectEventPic_MayNormal, 2, 4, 0), overworld_frame(gObjectEventPic_MayNormal, 2, 4, 1), overworld_frame(gObjectEventPic_MayNormal, 2, 4, 2), @@ -1010,7 +1010,7 @@ const struct SpriteFrameImage gObjectEventPicTable_MayNormal[] = { overworld_frame(gObjectEventPic_MayRunning, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_MayMachBike[] = { +static const struct SpriteFrameImage sPicTable_MayMachBike[] = { overworld_frame(gObjectEventPic_MayMachBike, 4, 4, 0), overworld_frame(gObjectEventPic_MayMachBike, 4, 4, 1), overworld_frame(gObjectEventPic_MayMachBike, 4, 4, 2), @@ -1022,7 +1022,7 @@ const struct SpriteFrameImage gObjectEventPicTable_MayMachBike[] = { overworld_frame(gObjectEventPic_MayMachBike, 4, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_MayAcroBike[] = { +static const struct SpriteFrameImage sPicTable_MayAcroBike[] = { overworld_frame(gObjectEventPic_MayAcroBike, 4, 4, 0), overworld_frame(gObjectEventPic_MayAcroBike, 4, 4, 1), overworld_frame(gObjectEventPic_MayAcroBike, 4, 4, 2), @@ -1052,7 +1052,7 @@ const struct SpriteFrameImage gObjectEventPicTable_MayAcroBike[] = { overworld_frame(gObjectEventPic_MayAcroBike, 4, 4, 26), }; -const struct SpriteFrameImage gObjectEventPicTable_MaySurfing[] = { +static const struct SpriteFrameImage sPicTable_MaySurfing[] = { overworld_frame(gObjectEventPic_MaySurfing, 4, 4, 0), overworld_frame(gObjectEventPic_MaySurfing, 4, 4, 2), overworld_frame(gObjectEventPic_MaySurfing, 4, 4, 4), @@ -1067,7 +1067,7 @@ const struct SpriteFrameImage gObjectEventPicTable_MaySurfing[] = { overworld_frame(gObjectEventPic_MaySurfing, 4, 4, 5), }; -const struct SpriteFrameImage gObjectEventPicTable_MayUnderwater[] = { +static const struct SpriteFrameImage sPicTable_MayUnderwater[] = { overworld_frame(gObjectEventPic_MayUnderwater, 4, 4, 0), overworld_frame(gObjectEventPic_MayUnderwater, 4, 4, 1), overworld_frame(gObjectEventPic_MayUnderwater, 4, 4, 2), @@ -1079,7 +1079,7 @@ const struct SpriteFrameImage gObjectEventPicTable_MayUnderwater[] = { overworld_frame(gObjectEventPic_MayUnderwater, 4, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_MayFieldMove[] = { +static const struct SpriteFrameImage sPicTable_MayFieldMove[] = { overworld_frame(gObjectEventPic_MayFieldMove, 4, 4, 0), overworld_frame(gObjectEventPic_MayFieldMove, 4, 4, 1), overworld_frame(gObjectEventPic_MayFieldMove, 4, 4, 2), @@ -1087,7 +1087,7 @@ const struct SpriteFrameImage gObjectEventPicTable_MayFieldMove[] = { overworld_frame(gObjectEventPic_MayFieldMove, 4, 4, 4), }; -const struct SpriteFrameImage gObjectEventPicTable_Cameraman[] = { +static const struct SpriteFrameImage sPicTable_Cameraman[] = { overworld_frame(gObjectEventPic_Cameraman, 2, 4, 0), overworld_frame(gObjectEventPic_Cameraman, 2, 4, 1), overworld_frame(gObjectEventPic_Cameraman, 2, 4, 2), @@ -1099,15 +1099,15 @@ const struct SpriteFrameImage gObjectEventPicTable_Cameraman[] = { overworld_frame(gObjectEventPic_Cameraman, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_MovingBox[] = { +static const struct SpriteFrameImage sPicTable_MovingBox[] = { obj_frame_tiles(gObjectEventPic_MovingBox), }; -const struct SpriteFrameImage gObjectEventPicTable_CableCar[] = { +static const struct SpriteFrameImage sPicTable_CableCar[] = { obj_frame_tiles(gObjectEventPic_CableCar), }; -const struct SpriteFrameImage gObjectEventPicTable_Scientist2[] = { +static const struct SpriteFrameImage sPicTable_Scientist2[] = { overworld_frame(gObjectEventPic_Scientist2, 2, 4, 0), overworld_frame(gObjectEventPic_Scientist2, 2, 4, 1), overworld_frame(gObjectEventPic_Scientist2, 2, 4, 2), @@ -1119,7 +1119,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Scientist2[] = { overworld_frame(gObjectEventPic_Scientist2, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_DevonEmployee[] = { +static const struct SpriteFrameImage sPicTable_DevonEmployee[] = { overworld_frame(gObjectEventPic_DevonEmployee, 2, 4, 0), overworld_frame(gObjectEventPic_DevonEmployee, 2, 4, 1), overworld_frame(gObjectEventPic_DevonEmployee, 2, 4, 2), @@ -1131,7 +1131,7 @@ const struct SpriteFrameImage gObjectEventPicTable_DevonEmployee[] = { overworld_frame(gObjectEventPic_DevonEmployee, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_AquaMemberM[] = { +static const struct SpriteFrameImage sPicTable_AquaMemberM[] = { overworld_frame(gObjectEventPic_AquaMemberM, 2, 4, 0), overworld_frame(gObjectEventPic_AquaMemberM, 2, 4, 1), overworld_frame(gObjectEventPic_AquaMemberM, 2, 4, 2), @@ -1143,7 +1143,7 @@ const struct SpriteFrameImage gObjectEventPicTable_AquaMemberM[] = { overworld_frame(gObjectEventPic_AquaMemberM, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_AquaMemberF[] = { +static const struct SpriteFrameImage sPicTable_AquaMemberF[] = { overworld_frame(gObjectEventPic_AquaMemberF, 2, 4, 0), overworld_frame(gObjectEventPic_AquaMemberF, 2, 4, 1), overworld_frame(gObjectEventPic_AquaMemberF, 2, 4, 2), @@ -1155,7 +1155,7 @@ const struct SpriteFrameImage gObjectEventPicTable_AquaMemberF[] = { overworld_frame(gObjectEventPic_AquaMemberF, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_MagmaMemberM[] = { +static const struct SpriteFrameImage sPicTable_MagmaMemberM[] = { overworld_frame(gObjectEventPic_MagmaMemberM, 2, 4, 0), overworld_frame(gObjectEventPic_MagmaMemberM, 2, 4, 1), overworld_frame(gObjectEventPic_MagmaMemberM, 2, 4, 2), @@ -1167,7 +1167,7 @@ const struct SpriteFrameImage gObjectEventPicTable_MagmaMemberM[] = { overworld_frame(gObjectEventPic_MagmaMemberM, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_MagmaMemberF[] = { +static const struct SpriteFrameImage sPicTable_MagmaMemberF[] = { overworld_frame(gObjectEventPic_MagmaMemberF, 2, 4, 0), overworld_frame(gObjectEventPic_MagmaMemberF, 2, 4, 1), overworld_frame(gObjectEventPic_MagmaMemberF, 2, 4, 2), @@ -1179,7 +1179,7 @@ const struct SpriteFrameImage gObjectEventPicTable_MagmaMemberF[] = { overworld_frame(gObjectEventPic_MagmaMemberF, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Sidney[] = { +static const struct SpriteFrameImage sPicTable_Sidney[] = { overworld_frame(gObjectEventPic_Sidney, 2, 4, 0), overworld_frame(gObjectEventPic_Sidney, 2, 4, 1), overworld_frame(gObjectEventPic_Sidney, 2, 4, 2), @@ -1191,7 +1191,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Sidney[] = { overworld_frame(gObjectEventPic_Sidney, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Phoebe[] = { +static const struct SpriteFrameImage sPicTable_Phoebe[] = { overworld_frame(gObjectEventPic_Phoebe, 2, 4, 0), overworld_frame(gObjectEventPic_Phoebe, 2, 4, 1), overworld_frame(gObjectEventPic_Phoebe, 2, 4, 2), @@ -1203,7 +1203,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Phoebe[] = { overworld_frame(gObjectEventPic_Phoebe, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Glacia[] = { +static const struct SpriteFrameImage sPicTable_Glacia[] = { overworld_frame(gObjectEventPic_Glacia, 2, 4, 0), overworld_frame(gObjectEventPic_Glacia, 2, 4, 1), overworld_frame(gObjectEventPic_Glacia, 2, 4, 2), @@ -1215,7 +1215,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Glacia[] = { overworld_frame(gObjectEventPic_Glacia, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Drake[] = { +static const struct SpriteFrameImage sPicTable_Drake[] = { overworld_frame(gObjectEventPic_Drake, 2, 4, 0), overworld_frame(gObjectEventPic_Drake, 2, 4, 1), overworld_frame(gObjectEventPic_Drake, 2, 4, 2), @@ -1227,7 +1227,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Drake[] = { overworld_frame(gObjectEventPic_Drake, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Roxanne[] = { +static const struct SpriteFrameImage sPicTable_Roxanne[] = { overworld_frame(gObjectEventPic_Roxanne, 2, 4, 0), overworld_frame(gObjectEventPic_Roxanne, 2, 4, 1), overworld_frame(gObjectEventPic_Roxanne, 2, 4, 2), @@ -1239,7 +1239,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Roxanne[] = { overworld_frame(gObjectEventPic_Roxanne, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Brawly[] = { +static const struct SpriteFrameImage sPicTable_Brawly[] = { overworld_frame(gObjectEventPic_Brawly, 2, 4, 0), overworld_frame(gObjectEventPic_Brawly, 2, 4, 1), overworld_frame(gObjectEventPic_Brawly, 2, 4, 2), @@ -1251,7 +1251,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Brawly[] = { overworld_frame(gObjectEventPic_Brawly, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Wattson[] = { +static const struct SpriteFrameImage sPicTable_Wattson[] = { overworld_frame(gObjectEventPic_Wattson, 2, 4, 0), overworld_frame(gObjectEventPic_Wattson, 2, 4, 1), overworld_frame(gObjectEventPic_Wattson, 2, 4, 2), @@ -1263,7 +1263,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Wattson[] = { overworld_frame(gObjectEventPic_Wattson, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Flannery[] = { +static const struct SpriteFrameImage sPicTable_Flannery[] = { overworld_frame(gObjectEventPic_Flannery, 2, 4, 0), overworld_frame(gObjectEventPic_Flannery, 2, 4, 1), overworld_frame(gObjectEventPic_Flannery, 2, 4, 2), @@ -1275,7 +1275,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Flannery[] = { overworld_frame(gObjectEventPic_Flannery, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Norman[] = { +static const struct SpriteFrameImage sPicTable_Norman[] = { overworld_frame(gObjectEventPic_Norman, 2, 4, 0), overworld_frame(gObjectEventPic_Norman, 2, 4, 1), overworld_frame(gObjectEventPic_Norman, 2, 4, 2), @@ -1287,7 +1287,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Norman[] = { overworld_frame(gObjectEventPic_Norman, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Winona[] = { +static const struct SpriteFrameImage sPicTable_Winona[] = { overworld_frame(gObjectEventPic_Winona, 2, 4, 0), overworld_frame(gObjectEventPic_Winona, 2, 4, 1), overworld_frame(gObjectEventPic_Winona, 2, 4, 2), @@ -1299,7 +1299,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Winona[] = { overworld_frame(gObjectEventPic_Winona, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Liza[] = { +static const struct SpriteFrameImage sPicTable_Liza[] = { overworld_frame(gObjectEventPic_Liza, 2, 4, 0), overworld_frame(gObjectEventPic_Liza, 2, 4, 1), overworld_frame(gObjectEventPic_Liza, 2, 4, 2), @@ -1311,7 +1311,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Liza[] = { overworld_frame(gObjectEventPic_Liza, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Tate[] = { +static const struct SpriteFrameImage sPicTable_Tate[] = { overworld_frame(gObjectEventPic_Tate, 2, 4, 0), overworld_frame(gObjectEventPic_Tate, 2, 4, 1), overworld_frame(gObjectEventPic_Tate, 2, 4, 2), @@ -1323,7 +1323,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Tate[] = { overworld_frame(gObjectEventPic_Tate, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Wallace[] = { +static const struct SpriteFrameImage sPicTable_Wallace[] = { overworld_frame(gObjectEventPic_Wallace, 2, 4, 0), overworld_frame(gObjectEventPic_Wallace, 2, 4, 1), overworld_frame(gObjectEventPic_Wallace, 2, 4, 2), @@ -1335,7 +1335,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Wallace[] = { overworld_frame(gObjectEventPic_Wallace, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Steven[] = { +static const struct SpriteFrameImage sPicTable_Steven[] = { overworld_frame(gObjectEventPic_Steven, 2, 4, 0), overworld_frame(gObjectEventPic_Steven, 2, 4, 1), overworld_frame(gObjectEventPic_Steven, 2, 4, 2), @@ -1347,7 +1347,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Steven[] = { overworld_frame(gObjectEventPic_Steven, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Wally[] = { +static const struct SpriteFrameImage sPicTable_Wally[] = { overworld_frame(gObjectEventPic_Wally, 2, 4, 0), overworld_frame(gObjectEventPic_Wally, 2, 4, 1), overworld_frame(gObjectEventPic_Wally, 2, 4, 2), @@ -1359,7 +1359,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Wally[] = { overworld_frame(gObjectEventPic_Wally, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_RubySapphireLittleBoy[] = { +static const struct SpriteFrameImage sPicTable_RubySapphireLittleBoy[] = { overworld_frame(gObjectEventPic_RubySapphireLittleBoy, 2, 2, 0), overworld_frame(gObjectEventPic_RubySapphireLittleBoy, 2, 2, 1), overworld_frame(gObjectEventPic_RubySapphireLittleBoy, 2, 2, 2), @@ -1371,7 +1371,7 @@ const struct SpriteFrameImage gObjectEventPicTable_RubySapphireLittleBoy[] = { overworld_frame(gObjectEventPic_RubySapphireLittleBoy, 2, 2, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_BrendanFishing[] = { +static const struct SpriteFrameImage sPicTable_BrendanFishing[] = { overworld_frame(gObjectEventPic_BrendanFishing, 4, 4, 0), overworld_frame(gObjectEventPic_BrendanFishing, 4, 4, 1), overworld_frame(gObjectEventPic_BrendanFishing, 4, 4, 2), @@ -1386,7 +1386,7 @@ const struct SpriteFrameImage gObjectEventPicTable_BrendanFishing[] = { overworld_frame(gObjectEventPic_BrendanFishing, 4, 4, 11), }; -const struct SpriteFrameImage gObjectEventPicTable_MayFishing[] = { +static const struct SpriteFrameImage sPicTable_MayFishing[] = { overworld_frame(gObjectEventPic_MayFishing, 4, 4, 0), overworld_frame(gObjectEventPic_MayFishing, 4, 4, 1), overworld_frame(gObjectEventPic_MayFishing, 4, 4, 2), @@ -1401,7 +1401,7 @@ const struct SpriteFrameImage gObjectEventPicTable_MayFishing[] = { overworld_frame(gObjectEventPic_MayFishing, 4, 4, 11), }; -const struct SpriteFrameImage gObjectEventPicTable_HotSpringsOldWoman[] = { +static const struct SpriteFrameImage sPicTable_HotSpringsOldWoman[] = { overworld_frame(gObjectEventPic_HotSpringsOldWoman, 2, 4, 0), overworld_frame(gObjectEventPic_HotSpringsOldWoman, 2, 4, 1), overworld_frame(gObjectEventPic_HotSpringsOldWoman, 2, 4, 2), @@ -1413,7 +1413,7 @@ const struct SpriteFrameImage gObjectEventPicTable_HotSpringsOldWoman[] = { overworld_frame(gObjectEventPic_HotSpringsOldWoman, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_SSTidal[] = { +static const struct SpriteFrameImage sPicTable_SSTidal[] = { obj_frame_tiles(gObjectEventPic_SSTidal), obj_frame_tiles(gObjectEventPic_SSTidal), obj_frame_tiles(gObjectEventPic_SSTidal), @@ -1425,7 +1425,7 @@ const struct SpriteFrameImage gObjectEventPicTable_SSTidal[] = { obj_frame_tiles(gObjectEventPic_SSTidal), }; -const struct SpriteFrameImage gObjectEventPicTable_SubmarineShadow[] = { +static const struct SpriteFrameImage sPicTable_SubmarineShadow[] = { obj_frame_tiles(gObjectEventPic_SubmarineShadow), obj_frame_tiles(gObjectEventPic_SubmarineShadow), obj_frame_tiles(gObjectEventPic_SubmarineShadow), @@ -1437,187 +1437,187 @@ const struct SpriteFrameImage gObjectEventPicTable_SubmarineShadow[] = { obj_frame_tiles(gObjectEventPic_SubmarineShadow), }; -const struct SpriteFrameImage gObjectEventPicTable_PichuDoll[] = { +static const struct SpriteFrameImage sPicTable_PichuDoll[] = { obj_frame_tiles(gObjectEventPic_PichuDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_PikachuDoll[] = { +static const struct SpriteFrameImage sPicTable_PikachuDoll[] = { obj_frame_tiles(gObjectEventPic_PikachuDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_MarillDoll[] = { +static const struct SpriteFrameImage sPicTable_MarillDoll[] = { obj_frame_tiles(gObjectEventPic_MarillDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_TogepiDoll[] = { +static const struct SpriteFrameImage sPicTable_TogepiDoll[] = { obj_frame_tiles(gObjectEventPic_TogepiDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_CyndaquilDoll[] = { +static const struct SpriteFrameImage sPicTable_CyndaquilDoll[] = { obj_frame_tiles(gObjectEventPic_CyndaquilDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_ChikoritaDoll[] = { +static const struct SpriteFrameImage sPicTable_ChikoritaDoll[] = { obj_frame_tiles(gObjectEventPic_ChikoritaDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_TotodileDoll[] = { +static const struct SpriteFrameImage sPicTable_TotodileDoll[] = { obj_frame_tiles(gObjectEventPic_TotodileDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_JigglypuffDoll[] = { +static const struct SpriteFrameImage sPicTable_JigglypuffDoll[] = { obj_frame_tiles(gObjectEventPic_JigglypuffDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_MeowthDoll[] = { +static const struct SpriteFrameImage sPicTable_MeowthDoll[] = { obj_frame_tiles(gObjectEventPic_MeowthDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_ClefairyDoll[] = { +static const struct SpriteFrameImage sPicTable_ClefairyDoll[] = { obj_frame_tiles(gObjectEventPic_ClefairyDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_DittoDoll[] = { +static const struct SpriteFrameImage sPicTable_DittoDoll[] = { obj_frame_tiles(gObjectEventPic_DittoDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_SmoochumDoll[] = { +static const struct SpriteFrameImage sPicTable_SmoochumDoll[] = { obj_frame_tiles(gObjectEventPic_SmoochumDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_TreeckoDoll[] = { +static const struct SpriteFrameImage sPicTable_TreeckoDoll[] = { obj_frame_tiles(gObjectEventPic_TreeckoDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_TorchicDoll[] = { +static const struct SpriteFrameImage sPicTable_TorchicDoll[] = { obj_frame_tiles(gObjectEventPic_TorchicDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_MudkipDoll[] = { +static const struct SpriteFrameImage sPicTable_MudkipDoll[] = { obj_frame_tiles(gObjectEventPic_MudkipDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_DuskullDoll[] = { +static const struct SpriteFrameImage sPicTable_DuskullDoll[] = { obj_frame_tiles(gObjectEventPic_DuskullDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_WynautDoll[] = { +static const struct SpriteFrameImage sPicTable_WynautDoll[] = { obj_frame_tiles(gObjectEventPic_WynautDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_BaltoyDoll[] = { +static const struct SpriteFrameImage sPicTable_BaltoyDoll[] = { obj_frame_tiles(gObjectEventPic_BaltoyDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_KecleonDoll[] = { +static const struct SpriteFrameImage sPicTable_KecleonDoll[] = { obj_frame_tiles(gObjectEventPic_KecleonDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_AzurillDoll[] = { +static const struct SpriteFrameImage sPicTable_AzurillDoll[] = { obj_frame_tiles(gObjectEventPic_AzurillDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_SkittyDoll[] = { +static const struct SpriteFrameImage sPicTable_SkittyDoll[] = { obj_frame_tiles(gObjectEventPic_SkittyDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_SwabluDoll[] = { +static const struct SpriteFrameImage sPicTable_SwabluDoll[] = { obj_frame_tiles(gObjectEventPic_SwabluDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_GulpinDoll[] = { +static const struct SpriteFrameImage sPicTable_GulpinDoll[] = { obj_frame_tiles(gObjectEventPic_GulpinDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_LotadDoll[] = { +static const struct SpriteFrameImage sPicTable_LotadDoll[] = { obj_frame_tiles(gObjectEventPic_LotadDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_SeedotDoll[] = { +static const struct SpriteFrameImage sPicTable_SeedotDoll[] = { obj_frame_tiles(gObjectEventPic_SeedotDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_PikaCushion[] = { +static const struct SpriteFrameImage sPicTable_PikaCushion[] = { obj_frame_tiles(gObjectEventPic_PikaCushion), }; -const struct SpriteFrameImage gObjectEventPicTable_RoundCushion[] = { +static const struct SpriteFrameImage sPicTable_RoundCushion[] = { obj_frame_tiles(gObjectEventPic_RoundCushion), }; -const struct SpriteFrameImage gObjectEventPicTable_KissCushion[] = { +static const struct SpriteFrameImage sPicTable_KissCushion[] = { obj_frame_tiles(gObjectEventPic_KissCushion), }; -const struct SpriteFrameImage gObjectEventPicTable_ZigzagCushion[] = { +static const struct SpriteFrameImage sPicTable_ZigzagCushion[] = { obj_frame_tiles(gObjectEventPic_ZigzagCushion), }; -const struct SpriteFrameImage gObjectEventPicTable_SpinCushion[] = { +static const struct SpriteFrameImage sPicTable_SpinCushion[] = { obj_frame_tiles(gObjectEventPic_SpinCushion), }; -const struct SpriteFrameImage gObjectEventPicTable_DiamondCushion[] = { +static const struct SpriteFrameImage sPicTable_DiamondCushion[] = { obj_frame_tiles(gObjectEventPic_DiamondCushion), }; -const struct SpriteFrameImage gObjectEventPicTable_BallCushion[] = { +static const struct SpriteFrameImage sPicTable_BallCushion[] = { obj_frame_tiles(gObjectEventPic_BallCushion), }; -const struct SpriteFrameImage gObjectEventPicTable_GrassCushion[] = { +static const struct SpriteFrameImage sPicTable_GrassCushion[] = { obj_frame_tiles(gObjectEventPic_GrassCushion), }; -const struct SpriteFrameImage gObjectEventPicTable_FireCushion[] = { +static const struct SpriteFrameImage sPicTable_FireCushion[] = { obj_frame_tiles(gObjectEventPic_FireCushion), }; -const struct SpriteFrameImage gObjectEventPicTable_WaterCushion[] = { +static const struct SpriteFrameImage sPicTable_WaterCushion[] = { obj_frame_tiles(gObjectEventPic_WaterCushion), }; -const struct SpriteFrameImage gObjectEventPicTable_BigSnorlaxDoll[] = { +static const struct SpriteFrameImage sPicTable_BigSnorlaxDoll[] = { obj_frame_tiles(gObjectEventPic_BigSnorlaxDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_BigRhydonDoll[] = { +static const struct SpriteFrameImage sPicTable_BigRhydonDoll[] = { obj_frame_tiles(gObjectEventPic_BigRhydonDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_BigLaprasDoll[] = { +static const struct SpriteFrameImage sPicTable_BigLaprasDoll[] = { obj_frame_tiles(gObjectEventPic_BigLaprasDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_BigVenusaurDoll[] = { +static const struct SpriteFrameImage sPicTable_BigVenusaurDoll[] = { obj_frame_tiles(gObjectEventPic_BigVenusaurDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_BigCharizardDoll[] = { +static const struct SpriteFrameImage sPicTable_BigCharizardDoll[] = { obj_frame_tiles(gObjectEventPic_BigCharizardDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_BigBlastoiseDoll[] = { +static const struct SpriteFrameImage sPicTable_BigBlastoiseDoll[] = { obj_frame_tiles(gObjectEventPic_BigBlastoiseDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_BigWailmerDoll[] = { +static const struct SpriteFrameImage sPicTable_BigWailmerDoll[] = { obj_frame_tiles(gObjectEventPic_BigWailmerDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_BigRegirockDoll[] = { +static const struct SpriteFrameImage sPicTable_BigRegirockDoll[] = { obj_frame_tiles(gObjectEventPic_BigRegirockDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_BigRegiceDoll[] = { +static const struct SpriteFrameImage sPicTable_BigRegiceDoll[] = { obj_frame_tiles(gObjectEventPic_BigRegiceDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_BigRegisteelDoll[] = { +static const struct SpriteFrameImage sPicTable_BigRegisteelDoll[] = { obj_frame_tiles(gObjectEventPic_BigRegisteelDoll), }; -const struct SpriteFrameImage gObjectEventPicTable_LatiasLatios[] = { +static const struct SpriteFrameImage sPicTable_LatiasLatios[] = { overworld_frame(gObjectEventPic_LatiasLatios, 4, 4, 0), overworld_frame(gObjectEventPic_LatiasLatios, 4, 4, 0), overworld_frame(gObjectEventPic_LatiasLatios, 4, 4, 0), @@ -1629,7 +1629,7 @@ const struct SpriteFrameImage gObjectEventPicTable_LatiasLatios[] = { overworld_frame(gObjectEventPic_LatiasLatios, 4, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_GameboyKid[] = { +static const struct SpriteFrameImage sPicTable_GameboyKid[] = { overworld_frame(gObjectEventPic_GameboyKid, 2, 4, 0), overworld_frame(gObjectEventPic_GameboyKid, 2, 4, 1), overworld_frame(gObjectEventPic_GameboyKid, 2, 4, 2), @@ -1641,7 +1641,7 @@ const struct SpriteFrameImage gObjectEventPicTable_GameboyKid[] = { overworld_frame(gObjectEventPic_GameboyKid, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_ContestJudge[] = { +static const struct SpriteFrameImage sPicTable_ContestJudge[] = { overworld_frame(gObjectEventPic_ContestJudge, 2, 4, 0), overworld_frame(gObjectEventPic_ContestJudge, 2, 4, 1), overworld_frame(gObjectEventPic_ContestJudge, 2, 4, 2), @@ -1653,7 +1653,7 @@ const struct SpriteFrameImage gObjectEventPicTable_ContestJudge[] = { overworld_frame(gObjectEventPic_ContestJudge, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_BrendanWatering[] = { +static const struct SpriteFrameImage sPicTable_BrendanWatering[] = { overworld_frame(gObjectEventPic_BrendanWatering, 4, 4, 0), overworld_frame(gObjectEventPic_BrendanWatering, 4, 4, 2), overworld_frame(gObjectEventPic_BrendanWatering, 4, 4, 4), @@ -1665,7 +1665,7 @@ const struct SpriteFrameImage gObjectEventPicTable_BrendanWatering[] = { overworld_frame(gObjectEventPic_BrendanWatering, 4, 4, 5), }; -const struct SpriteFrameImage gObjectEventPicTable_MayWatering[] = { +static const struct SpriteFrameImage sPicTable_MayWatering[] = { overworld_frame(gObjectEventPic_MayWatering, 4, 4, 0), overworld_frame(gObjectEventPic_MayWatering, 4, 4, 2), overworld_frame(gObjectEventPic_MayWatering, 4, 4, 4), @@ -1677,15 +1677,15 @@ const struct SpriteFrameImage gObjectEventPicTable_MayWatering[] = { overworld_frame(gObjectEventPic_MayWatering, 4, 4, 5), }; -const struct SpriteFrameImage gObjectEventPicTable_BrendanDecorating[] = { +static const struct SpriteFrameImage sPicTable_BrendanDecorating[] = { obj_frame_tiles(gObjectEventPic_BrendanDecorating), }; -const struct SpriteFrameImage gObjectEventPicTable_MayDecorating[] = { +static const struct SpriteFrameImage sPicTable_MayDecorating[] = { obj_frame_tiles(gObjectEventPic_MayDecorating), }; -const struct SpriteFrameImage gObjectEventPicTable_Archie[] = { +static const struct SpriteFrameImage sPicTable_Archie[] = { overworld_frame(gObjectEventPic_Archie, 2, 4, 0), overworld_frame(gObjectEventPic_Archie, 2, 4, 1), overworld_frame(gObjectEventPic_Archie, 2, 4, 2), @@ -1697,7 +1697,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Archie[] = { overworld_frame(gObjectEventPic_Archie, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Maxie[] = { +static const struct SpriteFrameImage sPicTable_Maxie[] = { overworld_frame(gObjectEventPic_Maxie, 2, 4, 0), overworld_frame(gObjectEventPic_Maxie, 2, 4, 1), overworld_frame(gObjectEventPic_Maxie, 2, 4, 2), @@ -1709,7 +1709,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Maxie[] = { overworld_frame(gObjectEventPic_Maxie, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_KyogreFront[] = { +static const struct SpriteFrameImage sPicTable_KyogreFront[] = { overworld_frame(gObjectEventPic_Kyogre, 4, 4, 0), overworld_frame(gObjectEventPic_Kyogre, 4, 4, 0), overworld_frame(gObjectEventPic_Kyogre, 4, 4, 0), @@ -1721,7 +1721,7 @@ const struct SpriteFrameImage gObjectEventPicTable_KyogreFront[] = { overworld_frame(gObjectEventPic_Kyogre, 4, 4, 1), }; -const struct SpriteFrameImage gObjectEventPicTable_GroudonFront[] = { +static const struct SpriteFrameImage sPicTable_GroudonFront[] = { overworld_frame(gObjectEventPic_Groudon, 4, 4, 0), overworld_frame(gObjectEventPic_Groudon, 4, 4, 0), overworld_frame(gObjectEventPic_Groudon, 4, 4, 0), @@ -1733,7 +1733,7 @@ const struct SpriteFrameImage gObjectEventPicTable_GroudonFront[] = { overworld_frame(gObjectEventPic_Groudon, 4, 4, 1), }; -const struct SpriteFrameImage gObjectEventPicTable_KyogreSide[] = { +static const struct SpriteFrameImage sPicTable_KyogreSide[] = { overworld_frame(gObjectEventPic_Kyogre, 4, 4, 2), overworld_frame(gObjectEventPic_Kyogre, 4, 4, 2), overworld_frame(gObjectEventPic_Kyogre, 4, 4, 2), @@ -1745,7 +1745,7 @@ const struct SpriteFrameImage gObjectEventPicTable_KyogreSide[] = { overworld_frame(gObjectEventPic_Kyogre, 4, 4, 3), }; -const struct SpriteFrameImage gObjectEventPicTable_GroudonSide[] = { +static const struct SpriteFrameImage sPicTable_GroudonSide[] = { overworld_frame(gObjectEventPic_Groudon, 4, 4, 2), overworld_frame(gObjectEventPic_Groudon, 4, 4, 2), overworld_frame(gObjectEventPic_Groudon, 4, 4, 2), @@ -1757,11 +1757,11 @@ const struct SpriteFrameImage gObjectEventPicTable_GroudonSide[] = { overworld_frame(gObjectEventPic_Groudon, 4, 4, 3), }; -const struct SpriteFrameImage gObjectEventPicTable_Fossil[] = { +static const struct SpriteFrameImage sPicTable_Fossil[] = { obj_frame_tiles(gObjectEventPic_Fossil), }; -const struct SpriteFrameImage gObjectEventPicTable_Regi[] = { +static const struct SpriteFrameImage sPicTable_Regi[] = { obj_frame_tiles(gObjectEventPic_Regi), obj_frame_tiles(gObjectEventPic_Regi), obj_frame_tiles(gObjectEventPic_Regi), @@ -1773,7 +1773,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Regi[] = { obj_frame_tiles(gObjectEventPic_Regi), }; -const struct SpriteFrameImage gObjectEventPicTable_Skitty[] = { +static const struct SpriteFrameImage sPicTable_Skitty[] = { overworld_frame(gObjectEventPic_Skitty, 2, 2, 0), overworld_frame(gObjectEventPic_Skitty, 2, 2, 1), overworld_frame(gObjectEventPic_Skitty, 2, 2, 2), @@ -1785,7 +1785,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Skitty[] = { overworld_frame(gObjectEventPic_Skitty, 2, 2, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Kecleon[] = { +static const struct SpriteFrameImage sPicTable_Kecleon[] = { overworld_frame(gObjectEventPic_Kecleon, 2, 2, 0), overworld_frame(gObjectEventPic_Kecleon, 2, 2, 1), overworld_frame(gObjectEventPic_Kecleon, 2, 2, 2), @@ -1797,7 +1797,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Kecleon[] = { overworld_frame(gObjectEventPic_Kecleon, 2, 2, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Rayquaza[] = { +static const struct SpriteFrameImage sPicTable_Rayquaza[] = { overworld_frame(gObjectEventPic_Rayquaza, 8, 8, 0), overworld_frame(gObjectEventPic_Rayquaza, 8, 8, 1), overworld_frame(gObjectEventPic_Rayquaza, 8, 8, 2), @@ -1805,7 +1805,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Rayquaza[] = { overworld_frame(gObjectEventPic_Rayquaza, 8, 8, 4), }; -const struct SpriteFrameImage gObjectEventPicTable_RayquazaStill[] = { +static const struct SpriteFrameImage sPicTable_RayquazaStill[] = { obj_frame_tiles(gObjectEventPic_RayquazaStill), obj_frame_tiles(gObjectEventPic_RayquazaStill), obj_frame_tiles(gObjectEventPic_RayquazaStill), @@ -1817,7 +1817,7 @@ const struct SpriteFrameImage gObjectEventPicTable_RayquazaStill[] = { obj_frame_tiles(gObjectEventPic_RayquazaStill), }; -const struct SpriteFrameImage gObjectEventPicTable_Zigzagoon[] = { +static const struct SpriteFrameImage sPicTable_Zigzagoon[] = { overworld_frame(gObjectEventPic_Zigzagoon, 2, 2, 0), overworld_frame(gObjectEventPic_Zigzagoon, 2, 2, 1), overworld_frame(gObjectEventPic_Zigzagoon, 2, 2, 2), @@ -1829,7 +1829,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Zigzagoon[] = { overworld_frame(gObjectEventPic_Zigzagoon, 2, 2, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Pikachu[] = { +static const struct SpriteFrameImage sPicTable_Pikachu[] = { overworld_frame(gObjectEventPic_Pikachu, 2, 2, 0), overworld_frame(gObjectEventPic_Pikachu, 2, 2, 1), overworld_frame(gObjectEventPic_Pikachu, 2, 2, 2), @@ -1841,7 +1841,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Pikachu[] = { overworld_frame(gObjectEventPic_Pikachu, 2, 2, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Azumarill[] = { +static const struct SpriteFrameImage sPicTable_Azumarill[] = { overworld_frame(gObjectEventPic_Azumarill, 2, 2, 0), overworld_frame(gObjectEventPic_Azumarill, 2, 2, 1), overworld_frame(gObjectEventPic_Azumarill, 2, 2, 2), @@ -1853,7 +1853,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Azumarill[] = { overworld_frame(gObjectEventPic_Azumarill, 2, 2, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Wingull[] = { +static const struct SpriteFrameImage sPicTable_Wingull[] = { overworld_frame(gObjectEventPic_Wingull, 2, 2, 0), overworld_frame(gObjectEventPic_Wingull, 2, 2, 2), overworld_frame(gObjectEventPic_Wingull, 2, 2, 4), @@ -1865,7 +1865,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Wingull[] = { overworld_frame(gObjectEventPic_Wingull, 2, 2, 5), }; -const struct SpriteFrameImage gObjectEventPicTable_TuberMSwimming[] = { +static const struct SpriteFrameImage sPicTable_TuberMSwimming[] = { overworld_frame(gObjectEventPic_TuberMSwimming, 2, 2, 0), overworld_frame(gObjectEventPic_TuberMSwimming, 2, 2, 1), overworld_frame(gObjectEventPic_TuberMSwimming, 2, 2, 2), @@ -1877,7 +1877,7 @@ const struct SpriteFrameImage gObjectEventPicTable_TuberMSwimming[] = { overworld_frame(gObjectEventPic_TuberMSwimming, 2, 2, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Azurill[] = { +static const struct SpriteFrameImage sPicTable_Azurill[] = { overworld_frame(gObjectEventPic_Azurill, 2, 2, 0), overworld_frame(gObjectEventPic_Azurill, 2, 2, 1), overworld_frame(gObjectEventPic_Azurill, 2, 2, 2), @@ -1889,7 +1889,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Azurill[] = { overworld_frame(gObjectEventPic_Azurill, 2, 2, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Mom[] = { +static const struct SpriteFrameImage sPicTable_Mom[] = { overworld_frame(gObjectEventPic_Mom, 2, 4, 0), overworld_frame(gObjectEventPic_Mom, 2, 4, 1), overworld_frame(gObjectEventPic_Mom, 2, 4, 2), @@ -1901,7 +1901,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Mom[] = { overworld_frame(gObjectEventPic_Mom, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Scott[] = { +static const struct SpriteFrameImage sPicTable_Scott[] = { overworld_frame(gObjectEventPic_Scott, 2, 4, 0), overworld_frame(gObjectEventPic_Scott, 2, 4, 1), overworld_frame(gObjectEventPic_Scott, 2, 4, 2), @@ -1913,7 +1913,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Scott[] = { overworld_frame(gObjectEventPic_Scott, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Juan[] = { +static const struct SpriteFrameImage sPicTable_Juan[] = { overworld_frame(gObjectEventPic_Juan, 2, 4, 0), overworld_frame(gObjectEventPic_Juan, 2, 4, 1), overworld_frame(gObjectEventPic_Juan, 2, 4, 2), @@ -1925,7 +1925,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Juan[] = { overworld_frame(gObjectEventPic_Juan, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_MysteryEventDeliveryman[] = { +static const struct SpriteFrameImage sPicTable_MysteryEventDeliveryman[] = { overworld_frame(gObjectEventPic_MysteryEventDeliveryman, 2, 4, 0), overworld_frame(gObjectEventPic_MysteryEventDeliveryman, 2, 4, 1), overworld_frame(gObjectEventPic_MysteryEventDeliveryman, 2, 4, 2), @@ -1937,11 +1937,11 @@ const struct SpriteFrameImage gObjectEventPicTable_MysteryEventDeliveryman[] = { overworld_frame(gObjectEventPic_MysteryEventDeliveryman, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Statue[] = { +static const struct SpriteFrameImage sPicTable_Statue[] = { obj_frame_tiles(gObjectEventPic_Statue), }; -const struct SpriteFrameImage gObjectEventPicTable_Dusclops[] = { +static const struct SpriteFrameImage sPicTable_Dusclops[] = { overworld_frame(gObjectEventPic_Dusclops, 2, 4, 0), overworld_frame(gObjectEventPic_Dusclops, 2, 4, 1), overworld_frame(gObjectEventPic_Dusclops, 2, 4, 2), @@ -1953,7 +1953,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Dusclops[] = { overworld_frame(gObjectEventPic_Dusclops, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Kirlia[] = { +static const struct SpriteFrameImage sPicTable_Kirlia[] = { overworld_frame(gObjectEventPic_Kirlia, 2, 4, 0), overworld_frame(gObjectEventPic_Kirlia, 2, 4, 1), overworld_frame(gObjectEventPic_Kirlia, 2, 4, 2), @@ -1965,7 +1965,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Kirlia[] = { overworld_frame(gObjectEventPic_Kirlia, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_UnionRoomAttendant[] = { +static const struct SpriteFrameImage sPicTable_UnionRoomAttendant[] = { overworld_frame(gObjectEventPic_UnionRoomAttendant, 2, 4, 0), overworld_frame(gObjectEventPic_UnionRoomAttendant, 2, 4, 1), overworld_frame(gObjectEventPic_UnionRoomAttendant, 2, 4, 2), @@ -1977,7 +1977,7 @@ const struct SpriteFrameImage gObjectEventPicTable_UnionRoomAttendant[] = { overworld_frame(gObjectEventPic_UnionRoomAttendant, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Sudowoodo[] = { +static const struct SpriteFrameImage sPicTable_Sudowoodo[] = { overworld_frame(gObjectEventPic_Sudowoodo, 2, 4, 0), overworld_frame(gObjectEventPic_Sudowoodo, 2, 4, 0), overworld_frame(gObjectEventPic_Sudowoodo, 2, 4, 1), @@ -1989,7 +1989,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Sudowoodo[] = { overworld_frame(gObjectEventPic_Sudowoodo, 2, 4, 2), }; -const struct SpriteFrameImage gObjectEventPicTable_Mew[] = { +static const struct SpriteFrameImage sPicTable_Mew[] = { overworld_frame(gObjectEventPic_Mew, 2, 4, 0), overworld_frame(gObjectEventPic_Mew, 2, 4, 1), overworld_frame(gObjectEventPic_Mew, 2, 4, 2), @@ -2001,7 +2001,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Mew[] = { overworld_frame(gObjectEventPic_Mew, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Red[] = { +static const struct SpriteFrameImage sPicTable_Red[] = { overworld_frame(gObjectEventPic_Red, 2, 4, 0), overworld_frame(gObjectEventPic_Red, 2, 4, 1), overworld_frame(gObjectEventPic_Red, 2, 4, 2), @@ -2013,7 +2013,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Red[] = { overworld_frame(gObjectEventPic_Red, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Leaf[] = { +static const struct SpriteFrameImage sPicTable_Leaf[] = { overworld_frame(gObjectEventPic_Leaf, 2, 4, 0), overworld_frame(gObjectEventPic_Leaf, 2, 4, 1), overworld_frame(gObjectEventPic_Leaf, 2, 4, 2), @@ -2025,7 +2025,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Leaf[] = { overworld_frame(gObjectEventPic_Leaf, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Deoxys[] = { +static const struct SpriteFrameImage sPicTable_Deoxys[] = { overworld_frame(gObjectEventPic_Deoxys, 4, 4, 0), overworld_frame(gObjectEventPic_Deoxys, 4, 4, 0), overworld_frame(gObjectEventPic_Deoxys, 4, 4, 0), @@ -2037,11 +2037,11 @@ const struct SpriteFrameImage gObjectEventPicTable_Deoxys[] = { overworld_frame(gObjectEventPic_Deoxys, 4, 4, 0), }; -const struct SpriteFrameImage gObjectEventPicTable_BirthIslandStone[] = { +static const struct SpriteFrameImage sPicTable_BirthIslandStone[] = { obj_frame_tiles(gObjectEventPic_BirthIslandStone), }; -const struct SpriteFrameImage gObjectEventPicTable_Anabel[] = { +static const struct SpriteFrameImage sPicTable_Anabel[] = { overworld_frame(gObjectEventPic_Anabel, 2, 4, 0), overworld_frame(gObjectEventPic_Anabel, 2, 4, 1), overworld_frame(gObjectEventPic_Anabel, 2, 4, 2), @@ -2053,7 +2053,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Anabel[] = { overworld_frame(gObjectEventPic_Anabel, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Tucker[] = { +static const struct SpriteFrameImage sPicTable_Tucker[] = { overworld_frame(gObjectEventPic_Tucker, 2, 4, 0), overworld_frame(gObjectEventPic_Tucker, 2, 4, 1), overworld_frame(gObjectEventPic_Tucker, 2, 4, 2), @@ -2065,7 +2065,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Tucker[] = { overworld_frame(gObjectEventPic_Tucker, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Spenser[] = { +static const struct SpriteFrameImage sPicTable_Spenser[] = { overworld_frame(gObjectEventPic_Spenser, 2, 4, 0), overworld_frame(gObjectEventPic_Spenser, 2, 4, 1), overworld_frame(gObjectEventPic_Spenser, 2, 4, 2), @@ -2077,7 +2077,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Spenser[] = { overworld_frame(gObjectEventPic_Spenser, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Greta[] = { +static const struct SpriteFrameImage sPicTable_Greta[] = { overworld_frame(gObjectEventPic_Greta, 2, 4, 0), overworld_frame(gObjectEventPic_Greta, 2, 4, 1), overworld_frame(gObjectEventPic_Greta, 2, 4, 2), @@ -2089,7 +2089,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Greta[] = { overworld_frame(gObjectEventPic_Greta, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Noland[] = { +static const struct SpriteFrameImage sPicTable_Noland[] = { overworld_frame(gObjectEventPic_Noland, 2, 4, 0), overworld_frame(gObjectEventPic_Noland, 2, 4, 1), overworld_frame(gObjectEventPic_Noland, 2, 4, 2), @@ -2101,7 +2101,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Noland[] = { overworld_frame(gObjectEventPic_Noland, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Lucy[] = { +static const struct SpriteFrameImage sPicTable_Lucy[] = { overworld_frame(gObjectEventPic_Lucy, 2, 4, 0), overworld_frame(gObjectEventPic_Lucy, 2, 4, 1), overworld_frame(gObjectEventPic_Lucy, 2, 4, 2), @@ -2113,7 +2113,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Lucy[] = { overworld_frame(gObjectEventPic_Lucy, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Brandon[] = { +static const struct SpriteFrameImage sPicTable_Brandon[] = { overworld_frame(gObjectEventPic_Brandon, 2, 4, 0), overworld_frame(gObjectEventPic_Brandon, 2, 4, 1), overworld_frame(gObjectEventPic_Brandon, 2, 4, 2), @@ -2125,7 +2125,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Brandon[] = { overworld_frame(gObjectEventPic_Brandon, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_Lugia[] = { +static const struct SpriteFrameImage sPicTable_Lugia[] = { overworld_frame(gObjectEventPic_Lugia, 4, 4, 0), overworld_frame(gObjectEventPic_Lugia, 4, 4, 0), overworld_frame(gObjectEventPic_Lugia, 4, 4, 0), @@ -2137,7 +2137,7 @@ const struct SpriteFrameImage gObjectEventPicTable_Lugia[] = { overworld_frame(gObjectEventPic_Lugia, 4, 4, 1), }; -const struct SpriteFrameImage gObjectEventPicTable_HoOh[] = { +static const struct SpriteFrameImage sPicTable_HoOh[] = { overworld_frame(gObjectEventPic_HoOh, 4, 4, 0), overworld_frame(gObjectEventPic_HoOh, 4, 4, 0), overworld_frame(gObjectEventPic_HoOh, 4, 4, 0), @@ -2149,7 +2149,7 @@ const struct SpriteFrameImage gObjectEventPicTable_HoOh[] = { overworld_frame(gObjectEventPic_HoOh, 4, 4, 1), }; -const struct SpriteFrameImage gObjectEventPicTable_RubySapphireBrendan[] = { +static const struct SpriteFrameImage sPicTable_RubySapphireBrendan[] = { overworld_frame(gObjectEventPic_RubySapphireBrendanNormal, 2, 4, 0), overworld_frame(gObjectEventPic_RubySapphireBrendanNormal, 2, 4, 1), overworld_frame(gObjectEventPic_RubySapphireBrendanNormal, 2, 4, 2), @@ -2161,7 +2161,7 @@ const struct SpriteFrameImage gObjectEventPicTable_RubySapphireBrendan[] = { overworld_frame(gObjectEventPic_RubySapphireBrendanNormal, 2, 4, 8), }; -const struct SpriteFrameImage gObjectEventPicTable_RubySapphireMay[] = { +static const struct SpriteFrameImage sPicTable_RubySapphireMay[] = { overworld_frame(gObjectEventPic_RubySapphireMayNormal, 2, 4, 0), overworld_frame(gObjectEventPic_RubySapphireMayNormal, 2, 4, 1), overworld_frame(gObjectEventPic_RubySapphireMayNormal, 2, 4, 2), diff --git a/src/data/object_events/object_event_subsprites.h b/src/data/object_events/object_event_subsprites.h index 63df1f777..0d55c2df2 100755 --- a/src/data/object_events/object_event_subsprites.h +++ b/src/data/object_events/object_event_subsprites.h @@ -1,4 +1,4 @@ -const struct Subsprite gObjectEventSpriteOamTable_16x16_0[] = { +static const struct Subsprite sOamTable_16x16_0[] = { { .x = -8, .y = -8, @@ -9,7 +9,7 @@ const struct Subsprite gObjectEventSpriteOamTable_16x16_0[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_16x16_1[] = { +static const struct Subsprite sOamTable_16x16_1[] = { { .x = -8, .y = -8, @@ -20,7 +20,7 @@ const struct Subsprite gObjectEventSpriteOamTable_16x16_1[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_16x16_2[] = { +static const struct Subsprite sOamTable_16x16_2[] = { { .x = -8, .y = -8, @@ -39,7 +39,7 @@ const struct Subsprite gObjectEventSpriteOamTable_16x16_2[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_16x16_3[] = { +static const struct Subsprite sOamTable_16x16_3[] = { { .x = -8, .y = -8, @@ -58,7 +58,7 @@ const struct Subsprite gObjectEventSpriteOamTable_16x16_3[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_16x16_4[] = { +static const struct Subsprite sOamTable_16x16_4[] = { { .x = -8, .y = -8, @@ -77,16 +77,16 @@ const struct Subsprite gObjectEventSpriteOamTable_16x16_4[] = { } }; -const struct SubspriteTable gObjectEventSpriteOamTables_16x16[] = { +static const struct SubspriteTable sOamTables_16x16[] = { {0, NULL}, - {1, gObjectEventSpriteOamTable_16x16_0}, - {1, gObjectEventSpriteOamTable_16x16_1}, - {2, gObjectEventSpriteOamTable_16x16_2}, - {2, gObjectEventSpriteOamTable_16x16_3}, - {2, gObjectEventSpriteOamTable_16x16_4} + {1, sOamTable_16x16_0}, + {1, sOamTable_16x16_1}, + {2, sOamTable_16x16_2}, + {2, sOamTable_16x16_3}, + {2, sOamTable_16x16_4} }; -const struct Subsprite gObjectEventSpriteOamTable_16x32_0[] = { +static const struct Subsprite sOamTable_16x32_0[] = { { .x = -8, .y = -16, @@ -97,7 +97,7 @@ const struct Subsprite gObjectEventSpriteOamTable_16x32_0[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_16x32_1[] = { +static const struct Subsprite sOamTable_16x32_1[] = { { .x = -8, .y = -16, @@ -108,7 +108,7 @@ const struct Subsprite gObjectEventSpriteOamTable_16x32_1[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_16x32_2[] = { +static const struct Subsprite sOamTable_16x32_2[] = { { .x = -8, .y = -16, @@ -135,7 +135,7 @@ const struct Subsprite gObjectEventSpriteOamTable_16x32_2[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_16x32_3[] = { +static const struct Subsprite sOamTable_16x32_3[] = { { .x = -8, .y = -16, @@ -154,7 +154,7 @@ const struct Subsprite gObjectEventSpriteOamTable_16x32_3[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_16x32_4[] = { +static const struct Subsprite sOamTable_16x32_4[] = { { .x = -8, .y = -16, @@ -173,16 +173,16 @@ const struct Subsprite gObjectEventSpriteOamTable_16x32_4[] = { } }; -const struct SubspriteTable gObjectEventSpriteOamTables_16x32[] = { +static const struct SubspriteTable sOamTables_16x32[] = { {0, NULL}, - {1, gObjectEventSpriteOamTable_16x32_0}, - {1, gObjectEventSpriteOamTable_16x32_1}, - {3, gObjectEventSpriteOamTable_16x32_2}, - {2, gObjectEventSpriteOamTable_16x32_3}, - {2, gObjectEventSpriteOamTable_16x32_4} + {1, sOamTable_16x32_0}, + {1, sOamTable_16x32_1}, + {3, sOamTable_16x32_2}, + {2, sOamTable_16x32_3}, + {2, sOamTable_16x32_4} }; -const struct Subsprite gObjectEventSpriteOamTable_32x32_0[] = { +static const struct Subsprite sOamTable_32x32_0[] = { { .x = -16, .y = -16, @@ -193,7 +193,7 @@ const struct Subsprite gObjectEventSpriteOamTable_32x32_0[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_32x32_1[] = { +static const struct Subsprite sOamTable_32x32_1[] = { { .x = -16, .y = -16, @@ -204,7 +204,7 @@ const struct Subsprite gObjectEventSpriteOamTable_32x32_1[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_32x32_2[] = { +static const struct Subsprite sOamTable_32x32_2[] = { { .x = -16, .y = -16, @@ -231,7 +231,7 @@ const struct Subsprite gObjectEventSpriteOamTable_32x32_2[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_32x32_3[] = { +static const struct Subsprite sOamTable_32x32_3[] = { { .x = -16, .y = -16, @@ -250,7 +250,7 @@ const struct Subsprite gObjectEventSpriteOamTable_32x32_3[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_32x32_4[] = { +static const struct Subsprite sOamTable_32x32_4[] = { { .x = -16, .y = -16, @@ -269,16 +269,16 @@ const struct Subsprite gObjectEventSpriteOamTable_32x32_4[] = { } }; -const struct SubspriteTable gObjectEventSpriteOamTables_32x32[] = { +static const struct SubspriteTable sOamTables_32x32[] = { {0, NULL}, - {1, gObjectEventSpriteOamTable_32x32_0}, - {1, gObjectEventSpriteOamTable_32x32_1}, - {3, gObjectEventSpriteOamTable_32x32_2}, - {2, gObjectEventSpriteOamTable_32x32_3}, - {2, gObjectEventSpriteOamTable_32x32_4} + {1, sOamTable_32x32_0}, + {1, sOamTable_32x32_1}, + {3, sOamTable_32x32_2}, + {2, sOamTable_32x32_3}, + {2, sOamTable_32x32_4} }; -const struct Subsprite gObjectEventSpriteOamTable_48x48[] = { +static const struct Subsprite sOamTable_48x48[] = { { .x = -24, .y = -24, @@ -377,16 +377,16 @@ const struct Subsprite gObjectEventSpriteOamTable_48x48[] = { } }; -const struct SubspriteTable gObjectEventSpriteOamTables_48x48[] = { - {12, gObjectEventSpriteOamTable_48x48}, - {12, gObjectEventSpriteOamTable_48x48}, - {12, gObjectEventSpriteOamTable_48x48}, - {12, gObjectEventSpriteOamTable_48x48}, - {12, gObjectEventSpriteOamTable_48x48}, - {12, gObjectEventSpriteOamTable_48x48} +static const struct SubspriteTable sOamTables_48x48[] = { + {12, sOamTable_48x48}, + {12, sOamTable_48x48}, + {12, sOamTable_48x48}, + {12, sOamTable_48x48}, + {12, sOamTable_48x48}, + {12, sOamTable_48x48} }; -const struct Subsprite gObjectEventSpriteOamTable_64x32_0[] = { +static const struct Subsprite sOamTable_64x32_0[] = { { .x = -32, .y = -16, @@ -397,7 +397,7 @@ const struct Subsprite gObjectEventSpriteOamTable_64x32_0[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_64x32_1[] = { +static const struct Subsprite sOamTable_64x32_1[] = { { .x = -32, .y = -16, @@ -408,7 +408,7 @@ const struct Subsprite gObjectEventSpriteOamTable_64x32_1[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_64x32_2[] = { +static const struct Subsprite sOamTable_64x32_2[] = { { .x = -32, .y = -16, @@ -419,7 +419,7 @@ const struct Subsprite gObjectEventSpriteOamTable_64x32_2[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_64x32_3[] = { +static const struct Subsprite sOamTable_64x32_3[] = { { .x = -32, .y = -16, @@ -431,16 +431,16 @@ const struct Subsprite gObjectEventSpriteOamTable_64x32_3[] = { }; // Unused -const struct SubspriteTable gObjectEventSpriteOamTables_64x32[] = { +static const struct SubspriteTable sOamTables_64x32[] = { {0, NULL}, - {1, gObjectEventSpriteOamTable_64x32_0}, - {1, gObjectEventSpriteOamTable_64x32_1}, - {1, gObjectEventSpriteOamTable_64x32_2}, - {1, gObjectEventSpriteOamTable_64x32_3}, - {1, gObjectEventSpriteOamTable_64x32_3} + {1, sOamTable_64x32_0}, + {1, sOamTable_64x32_1}, + {1, sOamTable_64x32_2}, + {1, sOamTable_64x32_3}, + {1, sOamTable_64x32_3} }; -const struct Subsprite gObjectEventSpriteOamTable_64x64_0[] = { +static const struct Subsprite sOamTable_64x64_0[] = { { .x = -32, .y = -32, @@ -451,7 +451,7 @@ const struct Subsprite gObjectEventSpriteOamTable_64x64_0[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_64x64_1[] = { +static const struct Subsprite sOamTable_64x64_1[] = { { .x = -32, .y = -32, @@ -462,7 +462,7 @@ const struct Subsprite gObjectEventSpriteOamTable_64x64_1[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_64x64_2[] = { +static const struct Subsprite sOamTable_64x64_2[] = { { .x = -32, .y = -32, @@ -473,7 +473,7 @@ const struct Subsprite gObjectEventSpriteOamTable_64x64_2[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_64x64_3[] = { +static const struct Subsprite sOamTable_64x64_3[] = { { .x = -32, .y = -32, @@ -484,16 +484,16 @@ const struct Subsprite gObjectEventSpriteOamTable_64x64_3[] = { } }; -const struct SubspriteTable gObjectEventSpriteOamTables_64x64[] = { +static const struct SubspriteTable sOamTables_64x64[] = { {0, NULL}, - {1, gObjectEventSpriteOamTable_64x64_0}, - {1, gObjectEventSpriteOamTable_64x64_1}, - {1, gObjectEventSpriteOamTable_64x64_2}, - {1, gObjectEventSpriteOamTable_64x64_3}, - {1, gObjectEventSpriteOamTable_64x64_3} + {1, sOamTable_64x64_0}, + {1, sOamTable_64x64_1}, + {1, sOamTable_64x64_2}, + {1, sOamTable_64x64_3}, + {1, sOamTable_64x64_3} }; -const struct Subsprite gObjectEventSpriteOamTable_96x40_0[] = { +static const struct Subsprite sOamTable_96x40_0[] = { { .x = -48, .y = -20, @@ -616,7 +616,7 @@ const struct Subsprite gObjectEventSpriteOamTable_96x40_0[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_96x40_1[] = { +static const struct Subsprite sOamTable_96x40_1[] = { { .x = -48, .y = -20, @@ -739,7 +739,7 @@ const struct Subsprite gObjectEventSpriteOamTable_96x40_1[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_96x40_2[] = { +static const struct Subsprite sOamTable_96x40_2[] = { { .x = -48, .y = -20, @@ -862,7 +862,7 @@ const struct Subsprite gObjectEventSpriteOamTable_96x40_2[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_96x40_3[] = { +static const struct Subsprite sOamTable_96x40_3[] = { { .x = -48, .y = -20, @@ -986,16 +986,16 @@ const struct Subsprite gObjectEventSpriteOamTable_96x40_3[] = { }; // Used by SS Tidal -const struct SubspriteTable gObjectEventSpriteOamTables_96x40[] = { - {15, gObjectEventSpriteOamTable_96x40_0}, - {15, gObjectEventSpriteOamTable_96x40_0}, - {15, gObjectEventSpriteOamTable_96x40_1}, - {15, gObjectEventSpriteOamTable_96x40_2}, - {15, gObjectEventSpriteOamTable_96x40_3}, - {15, gObjectEventSpriteOamTable_96x40_3} +static const struct SubspriteTable sOamTables_96x40[] = { + {15, sOamTable_96x40_0}, + {15, sOamTable_96x40_0}, + {15, sOamTable_96x40_1}, + {15, sOamTable_96x40_2}, + {15, sOamTable_96x40_3}, + {15, sOamTable_96x40_3} }; -const struct Subsprite gObjectEventSpriteOamTable_88x32_0[] = { +static const struct Subsprite sOamTable_88x32_0[] = { { .x = -48, .y = -20, @@ -1126,7 +1126,7 @@ const struct Subsprite gObjectEventSpriteOamTable_88x32_0[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_88x32_1[] = { +static const struct Subsprite sOamTable_88x32_1[] = { { .x = -48, .y = -20, @@ -1257,7 +1257,7 @@ const struct Subsprite gObjectEventSpriteOamTable_88x32_1[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_88x32_2[] = { +static const struct Subsprite sOamTable_88x32_2[] = { { .x = -48, .y = -20, @@ -1388,7 +1388,7 @@ const struct Subsprite gObjectEventSpriteOamTable_88x32_2[] = { } }; -const struct Subsprite gObjectEventSpriteOamTable_88x32_3[] = { +static const struct Subsprite sOamTable_88x32_3[] = { { .x = -48, .y = -20, @@ -1520,11 +1520,11 @@ const struct Subsprite gObjectEventSpriteOamTable_88x32_3[] = { }; // Used by Submarine Shadow -const struct SubspriteTable gObjectEventSpriteOamTables_88x32[] = { - {16, gObjectEventSpriteOamTable_88x32_0}, - {16, gObjectEventSpriteOamTable_88x32_0}, - {16, gObjectEventSpriteOamTable_88x32_1}, - {16, gObjectEventSpriteOamTable_88x32_2}, - {16, gObjectEventSpriteOamTable_88x32_3}, - {16, gObjectEventSpriteOamTable_88x32_3} +static const struct SubspriteTable sOamTables_88x32[] = { + {16, sOamTable_88x32_0}, + {16, sOamTable_88x32_0}, + {16, sOamTable_88x32_1}, + {16, sOamTable_88x32_2}, + {16, sOamTable_88x32_3}, + {16, sOamTable_88x32_3} }; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 8ab6268fc..746642e15 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -134,6 +134,8 @@ static void InitSpriteForFigure8Anim(struct Sprite *sprite); static bool8 AnimateSpriteInFigure8(struct Sprite *sprite); static void UpdateObjectEventSprite(struct Sprite *); +static const struct SpriteFrameImage sPicTable_PechaBerryTree[]; + 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}; From 00c3044c96631b6e54bdf308d0b2ff9e3d27b9b7 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 02:38:15 -0400 Subject: [PATCH 15/63] Clarify Groudon/Kyogre/Rayquaza gfx names --- data/maps/MagmaHideout_4F/map.json | 8 ++--- data/maps/MarineCave_End/map.json | 2 +- data/maps/SeafloorCavern_Room9/map.json | 8 ++--- data/maps/SeafloorCavern_Room9/scripts.inc | 2 +- data/maps/SkyPillar_Top/map.json | 8 ++--- data/maps/SkyPillar_Top/scripts.inc | 16 ++++++---- data/maps/SootopolisCity/map.json | 6 ++-- data/maps/TerraCave_End/map.json | 2 +- data/scripts/new_game.inc | 6 ++-- include/constants/event_objects.h | 16 +++++----- include/constants/flags.h | 18 +++++------ .../object_event_graphics_info.h | 16 +++++----- .../object_event_graphics_info_pointers.h | 32 +++++++++---------- 13 files changed, 71 insertions(+), 69 deletions(-) diff --git a/data/maps/MagmaHideout_4F/map.json b/data/maps/MagmaHideout_4F/map.json index d38e85fdf..94cf295e0 100644 --- a/data/maps/MagmaHideout_4F/map.json +++ b/data/maps/MagmaHideout_4F/map.json @@ -15,7 +15,7 @@ "connections": null, "object_events": [ { - "graphics_id": "OBJ_EVENT_GFX_GROUDON_1", + "graphics_id": "OBJ_EVENT_GFX_GROUDON_FRONT", "x": 16, "y": 17, "elevation": 0, @@ -25,7 +25,7 @@ "trainer_type": "TRAINER_TYPE_NONE", "trainer_sight_or_berry_tree_id": "0", "script": "0x0", - "flag": "FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_1" + "flag": "FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON" }, { "graphics_id": "OBJ_EVENT_GFX_MAGMA_MEMBER_M", @@ -93,7 +93,7 @@ "flag": "FLAG_HIDE_MAGMA_HIDEOUT_GRUNTS" }, { - "graphics_id": "OBJ_EVENT_GFX_GROUDON_2", + "graphics_id": "OBJ_EVENT_GFX_GROUDON_ASLEEP", "x": 16, "y": 17, "elevation": 3, @@ -103,7 +103,7 @@ "trainer_type": "TRAINER_TYPE_NONE", "trainer_sight_or_berry_tree_id": "0", "script": "0x0", - "flag": "FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_2" + "flag": "FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_ASLEEP" }, { "graphics_id": "OBJ_EVENT_GFX_ITEM_BALL", diff --git a/data/maps/MarineCave_End/map.json b/data/maps/MarineCave_End/map.json index d2e506a14..0beeb7a4c 100644 --- a/data/maps/MarineCave_End/map.json +++ b/data/maps/MarineCave_End/map.json @@ -15,7 +15,7 @@ "connections": null, "object_events": [ { - "graphics_id": "OBJ_EVENT_GFX_KYOGRE_1", + "graphics_id": "OBJ_EVENT_GFX_KYOGRE_FRONT", "x": 9, "y": 22, "elevation": 1, diff --git a/data/maps/SeafloorCavern_Room9/map.json b/data/maps/SeafloorCavern_Room9/map.json index 94ef88e84..0557b0c3e 100644 --- a/data/maps/SeafloorCavern_Room9/map.json +++ b/data/maps/SeafloorCavern_Room9/map.json @@ -15,7 +15,7 @@ "connections": null, "object_events": [ { - "graphics_id": "OBJ_EVENT_GFX_KYOGRE_1", + "graphics_id": "OBJ_EVENT_GFX_KYOGRE_FRONT", "x": 17, "y": 38, "elevation": 3, @@ -25,7 +25,7 @@ "trainer_type": "TRAINER_TYPE_NONE", "trainer_sight_or_berry_tree_id": "0", "script": "0x0", - "flag": "FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_1" + "flag": "FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE" }, { "graphics_id": "OBJ_EVENT_GFX_ARCHIE", @@ -93,7 +93,7 @@ "flag": "FLAG_ITEM_SEAFLOOR_CAVERN_ROOM_9_TM_26" }, { - "graphics_id": "OBJ_EVENT_GFX_KYOGRE_2", + "graphics_id": "OBJ_EVENT_GFX_KYOGRE_ASLEEP", "x": 17, "y": 38, "elevation": 3, @@ -103,7 +103,7 @@ "trainer_type": "TRAINER_TYPE_NONE", "trainer_sight_or_berry_tree_id": "0", "script": "0x0", - "flag": "FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_2" + "flag": "FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_ASLEEP" } ], "warp_events": [ diff --git a/data/maps/SeafloorCavern_Room9/scripts.inc b/data/maps/SeafloorCavern_Room9/scripts.inc index 63c5853c3..53386f33c 100644 --- a/data/maps/SeafloorCavern_Room9/scripts.inc +++ b/data/maps/SeafloorCavern_Room9/scripts.inc @@ -142,7 +142,7 @@ SeafloorCavern_Room9_EventScript_ArchieAwakenKyogre:: @ 8234DC9 setflag FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_ARCHIE setflag FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_MAXIE setflag FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_MAGMA_GRUNTS - setflag FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_1 + setflag FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE setflag FLAG_HIDE_SEAFLOOR_CAVERN_AQUA_GRUNTS setflag FLAG_HIDE_MAP_NAME_POPUP warp MAP_ROUTE128, 255, 38, 22 diff --git a/data/maps/SkyPillar_Top/map.json b/data/maps/SkyPillar_Top/map.json index 90301c53b..a980c6b07 100644 --- a/data/maps/SkyPillar_Top/map.json +++ b/data/maps/SkyPillar_Top/map.json @@ -15,7 +15,7 @@ "connections": null, "object_events": [ { - "graphics_id": "OBJ_EVENT_GFX_RAYQUAZA_2", + "graphics_id": "OBJ_EVENT_GFX_RAYQUAZA", "x": 14, "y": 7, "elevation": 3, @@ -25,10 +25,10 @@ "trainer_type": "TRAINER_TYPE_NONE", "trainer_sight_or_berry_tree_id": "0", "script": "0x0", - "flag": "FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA_2" + "flag": "FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA" }, { - "graphics_id": "OBJ_EVENT_GFX_RAYQUAZA_1", + "graphics_id": "OBJ_EVENT_GFX_RAYQUAZA_STILL", "x": 14, "y": 6, "elevation": 3, @@ -38,7 +38,7 @@ "trainer_type": "TRAINER_TYPE_NONE", "trainer_sight_or_berry_tree_id": "0", "script": "SkyPillar_Top_EventScript_Rayquaza", - "flag": "FLAG_HIDE_RAYQUAZA_SKY_TOWER_SUMMIT" + "flag": "FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA_STILL" } ], "warp_events": [ diff --git a/data/maps/SkyPillar_Top/scripts.inc b/data/maps/SkyPillar_Top/scripts.inc index b8173bc69..86d6cf717 100644 --- a/data/maps/SkyPillar_Top/scripts.inc +++ b/data/maps/SkyPillar_Top/scripts.inc @@ -34,7 +34,7 @@ SkyPillar_Top_EventScript_TryShowRayquaza:: @ 8239705 return SkyPillar_Top_EventScript_ShowRayquaza:: @ 823970F - clearflag FLAG_HIDE_RAYQUAZA_SKY_TOWER_SUMMIT + clearflag FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA_STILL return SkyPillar_Top_OnWarp: @ 8239713 @@ -138,17 +138,19 @@ SkyPillar_Top_EventScript_AwakenRayquaza:: @ 823979A releaseall end +@ Rayquaza has unusual movement frames +@ See comments, or sAnimTable_Rayquaza SkyPillar_Top_Movement_RayquazaStir: @ 823983A delay_16 - walk_in_place_fast_left + walk_in_place_fast_left @ Coiled, awake delay_16 delay_16 delay_16 delay_16 delay_16 - walk_in_place_left + walk_in_place_left @ Coiled, mouth open delay_16 - walk_in_place_right + walk_in_place_right @ Normal, awake delay_16 delay_16 delay_16 @@ -159,11 +161,11 @@ SkyPillar_Top_Movement_RayquazaStir: @ 823983A SkyPillar_Top_Movement_RayquazaFlyOff: @ 823984B delay_16 - walk_in_place_down + walk_in_place_down @ Coiled, asleep delay_8 - walk_in_place_right + walk_in_place_right @ Normal, awake delay_8 - walk_fastest_up + walk_fastest_up @ Fly up slide_up slide_up slide_up diff --git a/data/maps/SootopolisCity/map.json b/data/maps/SootopolisCity/map.json index d4c71db61..f5c265139 100644 --- a/data/maps/SootopolisCity/map.json +++ b/data/maps/SootopolisCity/map.json @@ -119,7 +119,7 @@ "flag": "0" }, { - "graphics_id": "OBJ_EVENT_GFX_GROUDON_3", + "graphics_id": "OBJ_EVENT_GFX_GROUDON_SIDE", "x": 28, "y": 44, "elevation": 0, @@ -132,7 +132,7 @@ "flag": "FLAG_HIDE_SOOTOPOLIS_CITY_GROUDON" }, { - "graphics_id": "OBJ_EVENT_GFX_KYOGRE_3", + "graphics_id": "OBJ_EVENT_GFX_KYOGRE_SIDE", "x": 34, "y": 44, "elevation": 1, @@ -145,7 +145,7 @@ "flag": "FLAG_HIDE_SOOTOPOLIS_CITY_KYOGRE" }, { - "graphics_id": "OBJ_EVENT_GFX_RAYQUAZA_2", + "graphics_id": "OBJ_EVENT_GFX_RAYQUAZA", "x": 31, "y": 41, "elevation": 1, diff --git a/data/maps/TerraCave_End/map.json b/data/maps/TerraCave_End/map.json index b186bddb2..e5fef758b 100644 --- a/data/maps/TerraCave_End/map.json +++ b/data/maps/TerraCave_End/map.json @@ -15,7 +15,7 @@ "connections": null, "object_events": [ { - "graphics_id": "OBJ_EVENT_GFX_GROUDON_1", + "graphics_id": "OBJ_EVENT_GFX_GROUDON_FRONT", "x": 17, "y": 22, "elevation": 1, diff --git a/data/scripts/new_game.inc b/data/scripts/new_game.inc index 422186695..2a314b3d1 100644 --- a/data/scripts/new_game.inc +++ b/data/scripts/new_game.inc @@ -179,8 +179,8 @@ EventScript_ResetAllMapFlags:: @ 82715DE setflag FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_ARCHIE setflag FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_MAXIE setflag FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_MAGMA_GRUNTS - setflag FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_1 - setflag FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_1 + setflag FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE + setflag FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON setflag FLAG_HIDE_SLATEPORT_CITY_HARBOR_CAPTAIN_STERN setflag FLAG_HIDE_SLATEPORT_CITY_HARBOR_AQUA_GRUNT setflag FLAG_HIDE_SLATEPORT_CITY_HARBOR_ARCHIE @@ -271,6 +271,6 @@ EventScript_ResetAllMapFlags:: @ 82715DE setflag FLAG_HIDE_FALLARBOR_TOWN_BATTLE_TENT_SCOTT setflag FLAG_HIDE_EVER_GRANDE_POKEMON_CENTER_1F_SCOTT setflag FLAG_HIDE_SKY_PILLAR_WALLACE - setflag FLAG_HIDE_RAYQUAZA_SKY_TOWER_SUMMIT + setflag FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA_STILL call EventScript_ResetAllBerries end diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 8e026ef2d..7a224940f 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -42,7 +42,7 @@ #define OBJ_EVENT_GFX_SCHOOL_KID_M 38 #define OBJ_EVENT_GFX_MANIAC 39 #define OBJ_EVENT_GFX_HEX_MANIAC 40 -#define OBJ_EVENT_GFX_RAYQUAZA_1 41 +#define OBJ_EVENT_GFX_RAYQUAZA_STILL 41 #define OBJ_EVENT_GFX_SWIMMER_M 42 #define OBJ_EVENT_GFX_SWIMMER_F 43 #define OBJ_EVENT_GFX_BLACK_BELT 44 @@ -198,17 +198,17 @@ #define OBJ_EVENT_GFX_MAY_DECORATING 194 #define OBJ_EVENT_GFX_ARCHIE 195 #define OBJ_EVENT_GFX_MAXIE 196 -#define OBJ_EVENT_GFX_KYOGRE_1 197 -#define OBJ_EVENT_GFX_GROUDON_1 198 +#define OBJ_EVENT_GFX_KYOGRE_FRONT 197 +#define OBJ_EVENT_GFX_GROUDON_FRONT 198 #define OBJ_EVENT_GFX_FOSSIL 199 #define OBJ_EVENT_GFX_REGIROCK 200 #define OBJ_EVENT_GFX_REGICE 201 #define OBJ_EVENT_GFX_REGISTEEL 202 #define OBJ_EVENT_GFX_SKITTY 203 #define OBJ_EVENT_GFX_KECLEON 204 -#define OBJ_EVENT_GFX_KYOGRE_2 205 -#define OBJ_EVENT_GFX_GROUDON_2 206 -#define OBJ_EVENT_GFX_RAYQUAZA_2 207 +#define OBJ_EVENT_GFX_KYOGRE_ASLEEP 205 +#define OBJ_EVENT_GFX_GROUDON_ASLEEP 206 +#define OBJ_EVENT_GFX_RAYQUAZA 207 #define OBJ_EVENT_GFX_ZIGZAGOON_2 208 #define OBJ_EVENT_GFX_PIKACHU 209 #define OBJ_EVENT_GFX_AZUMARILL 210 @@ -222,8 +222,8 @@ #define OBJ_EVENT_GFX_JUAN 218 #define OBJ_EVENT_GFX_SCOTT 219 #define OBJ_EVENT_GFX_POOCHYENA 220 -#define OBJ_EVENT_GFX_KYOGRE_3 221 -#define OBJ_EVENT_GFX_GROUDON_3 222 +#define OBJ_EVENT_GFX_KYOGRE_SIDE 221 +#define OBJ_EVENT_GFX_GROUDON_SIDE 222 #define OBJ_EVENT_GFX_MYSTERY_GIFT_MAN 223 #define OBJ_EVENT_GFX_TRICK_HOUSE_STATUE 224 #define OBJ_EVENT_GFX_KIRLIA 225 diff --git a/include/constants/flags.h b/include/constants/flags.h index 798b42d4d..48606962a 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -91,10 +91,10 @@ #define FLAG_UNUSED_0x04F 0x4F // Unused Flag // Scripts -#define FLAG_HIDE_RAYQUAZA_SKY_TOWER_SUMMIT 0x50 -#define FLAG_SET_WALL_CLOCK 0x51 -#define FLAG_RESCUED_BIRCH 0x52 -#define FLAG_LEGENDARIES_IN_SOOTOPOLIS 0x53 +#define FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA_STILL 0x50 +#define FLAG_SET_WALL_CLOCK 0x51 +#define FLAG_RESCUED_BIRCH 0x52 +#define FLAG_LEGENDARIES_IN_SOOTOPOLIS 0x53 #define FLAG_UNUSED_0x054 0x54 // Unused Flag #define FLAG_UNUSED_0x055 0x55 // Unused Flag @@ -775,7 +775,7 @@ #define FLAG_HIDE_LILYCOVE_FAN_CLUB_INTERVIEWER 0x2DA #define FLAG_HIDE_RUSTBORO_CITY_AQUA_GRUNT 0x2DB #define FLAG_HIDE_RUSTBORO_CITY_DEVON_EMPLOYEE_1 0x2DC -#define FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_2 0x2DD +#define FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_ASLEEP 0x2DD #define FLAG_HIDE_PLAYERS_HOUSE_DAD 0x2DE #define FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_RIVAL_SIBLING 0x2DF #define FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_RIVAL_SIBLING 0x2E0 @@ -815,7 +815,7 @@ #define FLAG_HIDE_ROUTE_111_VIVI_WINSTRATE 0x302 #define FLAG_HIDE_ROUTE_111_VICKY_WINSTRATE 0x303 #define FLAG_HIDE_PETALBURG_GYM_NORMAN 0x304 -#define FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA_2 0x305 +#define FLAG_HIDE_SKY_PILLAR_TOP_RAYQUAZA 0x305 #define FLAG_HIDE_LILYCOVE_CONTEST_HALL_CONTEST_ATTENDANT_1 0x306 #define FLAG_HIDE_LILYCOVE_MUSEUM_CURATOR 0x307 #define FLAG_HIDE_LILYCOVE_MUSEUM_PATRON_1 0x308 @@ -892,16 +892,16 @@ #define FLAG_HIDE_JAGGED_PASS_MAGMA_GUARD 0x34F #define FLAG_HIDE_SLATEPORT_CITY_HARBOR_SUBMARINE_SHADOW 0x350 #define FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_2F_PICHU_DOLL 0x351 -#define FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_2 0x352 +#define FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_ASLEEP 0x352 #define FLAG_HIDE_ROUTE_119_RIVAL 0x353 #define FLAG_HIDE_LILYCOVE_CITY_AQUA_GRUNTS 0x354 -#define FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON_1 0x355 +#define FLAG_HIDE_MAGMA_HIDEOUT_4F_GROUDON 0x355 #define FLAG_HIDE_SOOTOPOLIS_CITY_RESIDENTS 0x356 #define FLAG_HIDE_SKY_PILLAR_WALLACE 0x357 #define FLAG_HIDE_MT_PYRE_SUMMIT_MAXIE 0x358 #define FLAG_HIDE_MAGMA_HIDEOUT_GRUNTS 0x359 #define FLAG_HIDE_VICTORY_ROAD_ENTRANCE_WALLY 0x35A -#define FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE_1 0x35B +#define FLAG_HIDE_SEAFLOOR_CAVERN_ROOM_9_KYOGRE 0x35B #define FLAG_HIDE_SLATEPORT_CITY_HARBOR_SS_TIDAL 0x35C #define FLAG_HIDE_LILYCOVE_HARBOR_SSTIDAL 0x35D #define FLAG_HIDE_MOSSDEEP_CITY_SPACE_CENTER_2F_TEAM_MAGMA 0x35E diff --git a/src/data/object_events/object_event_graphics_info.h b/src/data/object_events/object_event_graphics_info.h index cd530722b..ddc6a1cad 100755 --- a/src/data/object_events/object_event_graphics_info.h +++ b/src/data/object_events/object_event_graphics_info.h @@ -40,7 +40,7 @@ const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PsychicM = {0xFFFF const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SchoolKidM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_SchoolKidM, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maniac = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Maniac, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HexManiac = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_HexManiac, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 4, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_64x64, sOamTables_64x64, sAnimTable_Standard, sPicTable_RayquazaStill, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RayquazaStill = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 4, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_64x64, sOamTables_64x64, sAnimTable_Standard, sPicTable_RayquazaStill, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerM = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_SwimmerM, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerF = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_SwimmerF, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BlackBelt = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_BlackBelt, gDummySpriteAffineAnimTable}; @@ -196,19 +196,19 @@ const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanDecorating const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayDecorating = {0xFFFF, OBJ_EVENT_PAL_TAG_MAY, OBJ_EVENT_PAL_TAG_BRIDGE_REFLECTION, 256, 16, 32, 10, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Inanimate, sPicTable_MayDecorating, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Archie = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Archie, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maxie = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_Maxie, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kyogre1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_KyogreFront, sAffineAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Groudon1 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_GroudonFront, sAffineAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kyogre3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_KyogreSide, sAffineAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Groudon3 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_GroudonSide, sPicTable_GroudonSide, sAffineAnimTable_KyogreGroudon}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreFront = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_KyogreFront, sAffineAnimTable_KyogreGroudon}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonFront = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_GroudonFront, sAffineAnimTable_KyogreGroudon}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreSide = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_KyogreSide, sAffineAnimTable_KyogreGroudon}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonSide = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_GroudonSide, sPicTable_GroudonSide, sAffineAnimTable_KyogreGroudon}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fossil = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_Fossil, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regirock = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 3, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Regi, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regice = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Regi, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Registeel = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_4, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 5, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_Regi, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Skitty = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Skitty, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kecleon = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Kecleon, gDummySpriteAffineAnimTable}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kyogre2 = {0xFFFF, OBJ_EVENT_PAL_TAG_KYOGRE, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_KyogreFront, sAffineAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Groudon2 = {0xFFFF, OBJ_EVENT_PAL_TAG_GROUDON, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_GroudonFront, sAffineAnimTable_KyogreGroudon}; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza2 = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 4, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_64x64, sOamTables_64x64, sAnimTable_Rayquaza, sPicTable_Rayquaza, gDummySpriteAffineAnimTable}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreAsleep = {0xFFFF, OBJ_EVENT_PAL_TAG_KYOGRE, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_KyogreFront, sAffineAnimTable_KyogreGroudon}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonAsleep = {0xFFFF, OBJ_EVENT_PAL_TAG_GROUDON, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_GroudonFront, sAffineAnimTable_KyogreGroudon}; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 2048, 64, 64, 4, SHADOW_SIZE_M, FALSE, TRUE, TRACKS_FOOT, &gObjectEventBaseOam_64x64, sOamTables_64x64, sAnimTable_Rayquaza, sPicTable_Rayquaza, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Zigzagoon = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Zigzagoon, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Pikachu = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_2, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 3, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Pikachu, gDummySpriteAffineAnimTable}; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azumarill = {0xFFFF, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Standard, sPicTable_Azumarill, gDummySpriteAffineAnimTable}; diff --git a/src/data/object_events/object_event_graphics_info_pointers.h b/src/data/object_events/object_event_graphics_info_pointers.h index 0ca70fa33..1c94919a7 100755 --- a/src/data/object_events/object_event_graphics_info_pointers.h +++ b/src/data/object_events/object_event_graphics_info_pointers.h @@ -39,7 +39,7 @@ const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PsychicM; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SchoolKidM; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maniac; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HexManiac; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza1; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RayquazaStill; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerM; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerF; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BlackBelt; @@ -195,17 +195,17 @@ const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanDecorating; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayDecorating; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Archie; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maxie; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kyogre1; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Groudon1; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreFront; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonFront; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fossil; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regirock; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regice; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Registeel; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Skitty; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kecleon; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kyogre2; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Groudon2; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza2; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreAsleep; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonAsleep; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Zigzagoon; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Pikachu; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azumarill; @@ -219,8 +219,8 @@ const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkMay; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Juan; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scott; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Poochyena; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kyogre3; -const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Groudon3; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreSide; +const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonSide; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MysteryEventDeliveryman; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Statue; const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kirlia; @@ -288,7 +288,7 @@ const struct ObjectEventGraphicsInfo *const gObjectEventGraphicsInfoPointers[NUM [OBJ_EVENT_GFX_SCHOOL_KID_M] = &gObjectEventGraphicsInfo_SchoolKidM, [OBJ_EVENT_GFX_MANIAC] = &gObjectEventGraphicsInfo_Maniac, [OBJ_EVENT_GFX_HEX_MANIAC] = &gObjectEventGraphicsInfo_HexManiac, - [OBJ_EVENT_GFX_RAYQUAZA_1] = &gObjectEventGraphicsInfo_Rayquaza1, + [OBJ_EVENT_GFX_RAYQUAZA_STILL] = &gObjectEventGraphicsInfo_RayquazaStill, [OBJ_EVENT_GFX_SWIMMER_M] = &gObjectEventGraphicsInfo_SwimmerM, [OBJ_EVENT_GFX_SWIMMER_F] = &gObjectEventGraphicsInfo_SwimmerF, [OBJ_EVENT_GFX_BLACK_BELT] = &gObjectEventGraphicsInfo_BlackBelt, @@ -444,17 +444,17 @@ const struct ObjectEventGraphicsInfo *const gObjectEventGraphicsInfoPointers[NUM [OBJ_EVENT_GFX_MAY_DECORATING] = &gObjectEventGraphicsInfo_MayDecorating, [OBJ_EVENT_GFX_ARCHIE] = &gObjectEventGraphicsInfo_Archie, [OBJ_EVENT_GFX_MAXIE] = &gObjectEventGraphicsInfo_Maxie, - [OBJ_EVENT_GFX_KYOGRE_1] = &gObjectEventGraphicsInfo_Kyogre1, - [OBJ_EVENT_GFX_GROUDON_1] = &gObjectEventGraphicsInfo_Groudon1, + [OBJ_EVENT_GFX_KYOGRE_FRONT] = &gObjectEventGraphicsInfo_KyogreFront, + [OBJ_EVENT_GFX_GROUDON_FRONT] = &gObjectEventGraphicsInfo_GroudonFront, [OBJ_EVENT_GFX_FOSSIL] = &gObjectEventGraphicsInfo_Fossil, [OBJ_EVENT_GFX_REGIROCK] = &gObjectEventGraphicsInfo_Regirock, [OBJ_EVENT_GFX_REGICE] = &gObjectEventGraphicsInfo_Regice, [OBJ_EVENT_GFX_REGISTEEL] = &gObjectEventGraphicsInfo_Registeel, [OBJ_EVENT_GFX_SKITTY] = &gObjectEventGraphicsInfo_Skitty, [OBJ_EVENT_GFX_KECLEON] = &gObjectEventGraphicsInfo_Kecleon, - [OBJ_EVENT_GFX_KYOGRE_2] = &gObjectEventGraphicsInfo_Kyogre2, - [OBJ_EVENT_GFX_GROUDON_2] = &gObjectEventGraphicsInfo_Groudon2, - [OBJ_EVENT_GFX_RAYQUAZA_2] = &gObjectEventGraphicsInfo_Rayquaza2, + [OBJ_EVENT_GFX_KYOGRE_ASLEEP] = &gObjectEventGraphicsInfo_KyogreAsleep, + [OBJ_EVENT_GFX_GROUDON_ASLEEP] = &gObjectEventGraphicsInfo_GroudonAsleep, + [OBJ_EVENT_GFX_RAYQUAZA] = &gObjectEventGraphicsInfo_Rayquaza, [OBJ_EVENT_GFX_ZIGZAGOON_2] = &gObjectEventGraphicsInfo_Zigzagoon, [OBJ_EVENT_GFX_PIKACHU] = &gObjectEventGraphicsInfo_Pikachu, [OBJ_EVENT_GFX_AZUMARILL] = &gObjectEventGraphicsInfo_Azumarill, @@ -468,8 +468,8 @@ const struct ObjectEventGraphicsInfo *const gObjectEventGraphicsInfoPointers[NUM [OBJ_EVENT_GFX_JUAN] = &gObjectEventGraphicsInfo_Juan, [OBJ_EVENT_GFX_SCOTT] = &gObjectEventGraphicsInfo_Scott, [OBJ_EVENT_GFX_POOCHYENA] = &gObjectEventGraphicsInfo_Poochyena, - [OBJ_EVENT_GFX_KYOGRE_3] = &gObjectEventGraphicsInfo_Kyogre3, - [OBJ_EVENT_GFX_GROUDON_3] = &gObjectEventGraphicsInfo_Groudon3, + [OBJ_EVENT_GFX_KYOGRE_SIDE] = &gObjectEventGraphicsInfo_KyogreSide, + [OBJ_EVENT_GFX_GROUDON_SIDE] = &gObjectEventGraphicsInfo_GroudonSide, [OBJ_EVENT_GFX_MYSTERY_GIFT_MAN] = &gObjectEventGraphicsInfo_MysteryEventDeliveryman, [OBJ_EVENT_GFX_TRICK_HOUSE_STATUE] = &gObjectEventGraphicsInfo_Statue, [OBJ_EVENT_GFX_KIRLIA] = &gObjectEventGraphicsInfo_Kirlia, From 802d2b2f0f4d5d5be80617dfbb53f6fe11cbeeb9 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 03:46:19 -0400 Subject: [PATCH 16/63] Label Kyogre/Groudon anims --- data/maps/SootopolisCity/scripts.inc | 12 +++++------ src/data/object_events/object_event_anims.h | 24 ++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/data/maps/SootopolisCity/scripts.inc b/data/maps/SootopolisCity/scripts.inc index e6ceb6418..00fb6b541 100644 --- a/data/maps/SootopolisCity/scripts.inc +++ b/data/maps/SootopolisCity/scripts.inc @@ -258,8 +258,8 @@ SootopolisCity_EventScript_LegendariesSceneFromPokeCenter:: @ 81E5946 waitmovement 0 waitse playmoncry SPECIES_GROUDON, 2 - applymovement LOCALID_KYOGRE, SootopolisCity_Movement_GroudonAttack - applymovement LOCALID_GROUDON, SootopolisCity_Movement_KyogreDefend + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreDefend + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonAttack waitmovement 0 setvar VAR_0x8004, 1 @ vertical pan setvar VAR_0x8005, 1 @ horizontal pan @@ -358,8 +358,8 @@ SootopolisCity_EventScript_LegendariesSceneFromDive:: @ 81E5A82 waitmovement 0 waitse playmoncry SPECIES_GROUDON, 2 - applymovement LOCALID_KYOGRE, SootopolisCity_Movement_GroudonAttack - applymovement LOCALID_GROUDON, SootopolisCity_Movement_KyogreDefend + applymovement LOCALID_KYOGRE, SootopolisCity_Movement_KyogreDefend + applymovement LOCALID_GROUDON, SootopolisCity_Movement_GroudonAttack waitmovement 0 setvar VAR_0x8004, 1 @ vertical pan setvar VAR_0x8005, 1 @ horizontal pan @@ -431,7 +431,7 @@ SootopolisCity_Movement_KyogreAttack: @ 81E5BB8 clear_affine_anim step_end -SootopolisCity_Movement_GroudonAttack: @ 81E5BC2 +SootopolisCity_Movement_KyogreDefend: @ 81E5BC2 delay_16 delay_16 delay_16 @@ -464,7 +464,7 @@ SootopolisCity_Movement_KyogreIdle: @ 81E5BD6 walk_in_place_slow_left step_end -SootopolisCity_Movement_KyogreDefend: @ 81E5BDD +SootopolisCity_Movement_GroudonAttack: @ 81E5BDD walk_in_place_slow_right walk_in_place_slow_right walk_in_place_slow_right diff --git a/src/data/object_events/object_event_anims.h b/src/data/object_events/object_event_anims.h index 109c0abc7..f3af96f01 100755 --- a/src/data/object_events/object_event_anims.h +++ b/src/data/object_events/object_event_anims.h @@ -733,7 +733,7 @@ static const union AnimCmd sAnim_HookedPokemonEast[] = ANIMCMD_JUMP(0), }; -static const union AffineAnimCmd sAffineAnim_8508FD8[] = +static const union AffineAnimCmd sAffineAnim_KyogreGroudon_GoSouthStart[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, 1, 1), AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 1), @@ -743,7 +743,7 @@ static const union AffineAnimCmd sAffineAnim_8508FD8[] = AFFINEANIMCMD_JUMP(0), }; -static const union AffineAnimCmd sAffineAnim_8509008[] = +static const union AffineAnimCmd sAffineAnim_KyogreGroudon_GoSouth[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, -1, 1), AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 1), @@ -754,26 +754,26 @@ static const union AffineAnimCmd sAffineAnim_8509008[] = AFFINEANIMCMD_JUMP(0), }; -static const union AffineAnimCmd sAffineAnim_8509040[] = +static const union AffineAnimCmd sAffineAnim_KyogreGroudon_AttackEast[] = { AFFINEANIMCMD_FRAME(0x100, 0x100, 10, 0), AFFINEANIMCMD_END, }; -static const union AffineAnimCmd sAffineAnim_8509050[] = +static const union AffineAnimCmd sAffineAnim_KyogreGroudon_AttackWest[] = { AFFINEANIMCMD_FRAME(0x100, 0x100, 10, 0), AFFINEANIMCMD_END, }; -static const union AffineAnimCmd sAffineAnim_8509060[] = +static const union AffineAnimCmd sAffineAnim_KyogreGroudon_DipEast[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, -1, 1), AFFINEANIMCMD_LOOP(8), AFFINEANIMCMD_END, }; -static const union AffineAnimCmd sAffineAnim_8509078[] = +static const union AffineAnimCmd sAffineAnim_KyogreGroudon_DipWest[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, 1, 1), AFFINEANIMCMD_LOOP(8), @@ -1135,12 +1135,12 @@ static const union AnimCmd *const sAnimTable_Fishing[] = { }; static const union AffineAnimCmd *const sAffineAnimTable_KyogreGroudon[] = { - sAffineAnim_8508FD8, - sAffineAnim_8509008, - sAffineAnim_8509050, - sAffineAnim_8509040, - sAffineAnim_8509078, - sAffineAnim_8509060, + sAffineAnim_KyogreGroudon_GoSouthStart, // Used by Kyogre/Groudon when awakened + sAffineAnim_KyogreGroudon_GoSouth, // Used by Kyogre/Groudon when awakened + sAffineAnim_KyogreGroudon_AttackWest, // Used by Kyogre during Sootopolis fight + sAffineAnim_KyogreGroudon_AttackEast, // Unused + sAffineAnim_KyogreGroudon_DipWest, // Unused + sAffineAnim_KyogreGroudon_DipEast, // Unused }; const struct UnkStruct_085094AC gUnknown_085094AC[] = { From 756fad0e61e62e71af6cf451257f882691c004b0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 05:05:33 -0400 Subject: [PATCH 17/63] Document some event object movement --- include/constants/event_object_movement.h | 3 +- include/event_object_movement.h | 16 +- include/field_player_avatar.h | 2 +- .../movement_action_func_tables.h | 12 +- src/event_object_movement.c | 1765 ++++++++--------- src/field_effect_helpers.c | 37 +- src/field_player_avatar.c | 6 +- src/field_specials.c | 4 +- src/fldeff_cut.c | 2 +- src/fldeff_misc.c | 2 +- src/fldeff_sweetscent.c | 4 +- src/overworld.c | 10 +- src/rotating_gate.c | 2 +- 13 files changed, 921 insertions(+), 944 deletions(-) diff --git a/include/constants/event_object_movement.h b/include/constants/event_object_movement.h index 223650081..13e91c415 100755 --- a/include/constants/event_object_movement.h +++ b/include/constants/event_object_movement.h @@ -237,11 +237,12 @@ #define MOVEMENT_ACTION_WALK_RIGHT_AFFINE 0x97 #define MOVEMENT_ACTION_LEVITATE 0x98 #define MOVEMENT_ACTION_STOP_LEVITATE 0x99 -#define MOVEMENT_ACTION_DESTROY_EXTRA_TASK_IF_AT_TOP 0x9A +#define MOVEMENT_ACTION_STOP_LEVITATE_AT_TOP 0x9A #define MOVEMENT_ACTION_FIGURE_8 0x9B #define MOVEMENT_ACTION_FLY_UP 0x9C #define MOVEMENT_ACTION_FLY_DOWN 0x9D #define MOVEMENT_ACTION_STEP_END 0xFE +#define MOVEMENT_ACTION_NONE 0xFF #endif // GUARD_CONSTANTS_EVENT_OBJECT_MOVEMENT_H diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 446d0dd4e..9deacfbb7 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -86,9 +86,9 @@ void LoadPlayerObjectReflectionPalette(u16, u8); void LoadSpecialObjectReflectionPalette(u16, u8); void TryMoveObjectEventToMapCoords(u8, u8, u8, s16, s16); void PatchObjectPalette(u16, u8); -void sub_808E16C(s16, s16); +void SpawnObjectEventsOnReturnToField(s16, s16); void OverrideSecretBaseDecorationSpriteScript(u8 localId, u8 mapNum, u8 mapGroup, u8 decorCat); -void sub_8092FF0(s16, s16, s16 *, s16 *); +void GetMapCoordsFromSpritePos(s16, s16, s16 *, s16 *); u8 GetFaceDirectionAnimNum(u8); void SetSpritePosToOffsetMapCoords(s16 *, s16 *, s16, s16); void ObjectEventClearHeldMovement(struct ObjectEvent *); @@ -110,7 +110,7 @@ void FreeAndReserveObjectSpritePalettes(void); void SetObjectEventSpritePosByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s16 y); void ResetObjectPriority(u8, u8, u8); void SetObjectPriority(u8, u8, u8, u8); -void sub_808E75C(s16, s16); +void AllowObjectAtPosTriggerGroundEffects(s16, s16); void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, void *mapNum, void *mapGroup); void ShiftObjectEventCoords(struct ObjectEvent *, s16, s16); void MoveObjectEventToMapCoords(struct ObjectEvent *, s16, s16); @@ -175,16 +175,8 @@ bool8 IsZCoordMismatchAt(u8, s16, s16); void UnfreezeObjectEvent(struct ObjectEvent *); u8 FindLockedObjectEventIndex(struct ObjectEvent *); bool8 obj_npc_ministep(struct Sprite *sprite); -bool8 sub_80976EC(struct Sprite *sprite); -void sub_80976DC(struct Sprite *, u8); -void sub_809783C(struct Sprite *, u8, u8, u8); -void DoShadowFieldEffect(struct ObjectEvent *); -u8 sub_809785C(struct Sprite *); -u8 sub_80978E4(struct Sprite *); void SetAndStartSpriteAnim(struct Sprite *, u8, u8); bool8 SpriteAnimEnded(struct Sprite *); -void CreateLevitateMovementTask(struct ObjectEvent *); -void DestroyExtraMovementTask(u8); void UnfreezeObjectEvents(void); void FreezeObjectEventsExceptOne(u8 objectEventId); void TurnObjectEventSprite(u8, u8); @@ -195,7 +187,7 @@ u8 GetMoveDirectionFastAnimNum(u8); u8 GetMoveDirectionFasterAnimNum(u8); u8 GetMoveDirectionFastestAnimNum(u8); u8 GetLedgeJumpDirection(s16, s16, u8); -void CameraObjectSetFollowedObjectId(u8 objectId); +void CameraObjectSetFollowedSpriteId(u8 objectId); u16 GetObjectPaletteTag(u8 palSlot); void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible); s16 GetFigure8XOffset(s16 idx); diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index c30ce0b6f..903fe6ef1 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -6,7 +6,7 @@ void ClearPlayerAvatarInfo(void); void SetPlayerAvatarExtraStateTransition(u8, u8); u8 GetPlayerAvatarGenderByGraphicsId(u8); bool8 TestPlayerAvatarFlags(u8); -u8 GetPlayerAvatarObjectId(void); +u8 GetPlayerAvatarSpriteId(void); void PlayerGetDestCoords(s16 *, s16 *); u8 GetPlayerFacingDirection(void); u8 GetPlayerMovementDirection(void); diff --git a/src/data/object_events/movement_action_func_tables.h b/src/data/object_events/movement_action_func_tables.h index 8cf7d1699..295bd51fa 100755 --- a/src/data/object_events/movement_action_func_tables.h +++ b/src/data/object_events/movement_action_func_tables.h @@ -252,7 +252,7 @@ u8 MovementAction_AcroEndWheelieMoveRight_Step0(struct ObjectEvent *, struct Spr u8 MovementAction_AcroEndWheelieMoveRight_Step1(struct ObjectEvent *, struct Sprite *); u8 MovementAction_Levitate_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_StopLevitate_Step0(struct ObjectEvent *, struct Sprite *); -u8 MovementAction_DestroyExtraTaskIfAtTop_Step0(struct ObjectEvent *, struct Sprite *); +u8 MovementAction_StopLevitateAtTop_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_StoreAndLockAnim_Step0(struct ObjectEvent *, struct Sprite *); u8 MovementAction_Finish(struct ObjectEvent *, struct Sprite *); u8 MovementAction_FreeAndUnlockAnim_Step0(struct ObjectEvent *, struct Sprite *); @@ -416,7 +416,7 @@ u8 (*const gMovementActionFuncs_WalkLeftAffine[])(struct ObjectEvent *, struct S u8 (*const gMovementActionFuncs_WalkRightAffine[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_Levitate[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_StopLevitate[])(struct ObjectEvent *, struct Sprite *); -u8 (*const gMovementActionFuncs_DestroyExtraTaskIfAtTop[])(struct ObjectEvent *, struct Sprite *); +u8 (*const gMovementActionFuncs_StopLevitateAtTop[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_Figure8[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_FlyUp[])(struct ObjectEvent *, struct Sprite *); u8 (*const gMovementActionFuncs_FlyDown[])(struct ObjectEvent *, struct Sprite *); @@ -576,7 +576,7 @@ u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *) [MOVEMENT_ACTION_WALK_RIGHT_AFFINE] = gMovementActionFuncs_WalkRightAffine, [MOVEMENT_ACTION_LEVITATE] = gMovementActionFuncs_Levitate, [MOVEMENT_ACTION_STOP_LEVITATE] = gMovementActionFuncs_StopLevitate, - [MOVEMENT_ACTION_DESTROY_EXTRA_TASK_IF_AT_TOP] = gMovementActionFuncs_DestroyExtraTaskIfAtTop, + [MOVEMENT_ACTION_STOP_LEVITATE_AT_TOP] = gMovementActionFuncs_StopLevitateAtTop, [MOVEMENT_ACTION_FIGURE_8] = gMovementActionFuncs_Figure8, [MOVEMENT_ACTION_FLY_UP] = gMovementActionFuncs_FlyUp, [MOVEMENT_ACTION_FLY_DOWN] = gMovementActionFuncs_FlyDown, @@ -602,7 +602,7 @@ u8 (*const gMovementActionFuncs_FaceRight[])(struct ObjectEvent *, struct Sprite MovementAction_PauseSpriteAnim, }; -u8 (*const gUnknown_0850DEE8[])(u8) = { +static u8 (*const sDirectionAnimFuncsBySpeed[])(u8) = { GetMoveDirectionAnimNum, GetMoveDirectionFastAnimNum, GetMoveDirectionFastAnimNum, @@ -1507,7 +1507,7 @@ u8 (*const gMovementActionFuncs_StopLevitate[])(struct ObjectEvent *, struct Spr MovementAction_Finish, }; -u8 (*const gMovementActionFuncs_DestroyExtraTaskIfAtTop[])(struct ObjectEvent *, struct Sprite *) = { - MovementAction_DestroyExtraTaskIfAtTop_Step0, +u8 (*const gMovementActionFuncs_StopLevitateAtTop[])(struct ObjectEvent *, struct Sprite *) = { + MovementAction_StopLevitateAtTop_Step0, MovementAction_Finish, }; diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 746642e15..75e4a5cd8 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -32,31 +32,37 @@ // this file was known as evobjmv.c in Game Freak's original source +// Sprite data used throughout +#define sObjEventId data[0] +#define sTypeFuncId data[1] // Index into corresponding gMovementTypeFuncs_* table +#define sActionFuncId data[2] // Index into corresponding gMovementActionFuncs_* table + + #define movement_type_def(setup, table) \ static u8 setup##_callback(struct ObjectEvent *, struct Sprite *);\ void setup(struct Sprite *sprite)\ {\ - UpdateObjectEventCurrentMovement(&gObjectEvents[sprite->data[0]], sprite, setup##_callback);\ + UpdateObjectEventCurrentMovement(&gObjectEvents[sprite->sObjEventId], sprite, setup##_callback);\ }\ static u8 setup##_callback(struct ObjectEvent *objectEvent, struct Sprite *sprite)\ {\ - return table[sprite->data[1]](objectEvent, sprite);\ + return table[sprite->sTypeFuncId](objectEvent, sprite);\ } #define movement_type_empty_callback(setup) \ static u8 setup##_callback(struct ObjectEvent *, struct Sprite *);\ void setup(struct Sprite *sprite)\ {\ - UpdateObjectEventCurrentMovement(&gObjectEvents[sprite->data[0]], sprite, setup##_callback);\ + UpdateObjectEventCurrentMovement(&gObjectEvents[sprite->sObjEventId], sprite, setup##_callback);\ }\ static u8 setup##_callback(struct ObjectEvent *objectEvent, struct Sprite *sprite)\ {\ return 0;\ } -EWRAM_DATA u8 sCurrentReflectionType = 0; -EWRAM_DATA u16 sCurrentSpecialObjectPaletteTag = 0; -EWRAM_DATA struct LockedAnimObjectEvents *gLockedAnimObjectEvents = {0}; +static EWRAM_DATA u8 sCurrentReflectionType = 0; +static EWRAM_DATA u16 sCurrentSpecialObjectPaletteTag = 0; +static EWRAM_DATA struct LockedAnimObjectEvents *sLockedAnimObjectEvents = {0}; static void MoveCoordsInDirection(u32, s16 *, s16 *, s16, s16); static bool8 ObjectEventExecSingleMovementAction(struct ObjectEvent *, struct Sprite *); @@ -70,8 +76,8 @@ static void UpdateObjectEventSpriteAnimPause(struct ObjectEvent *, struct Sprite static bool8 IsCoordOutsideObjectEventMovementRange(struct ObjectEvent *, s16, s16); static bool8 IsMetatileDirectionallyImpassable(struct ObjectEvent *, s16, s16, u8); static bool8 DoesObjectCollideWithObjectAt(struct ObjectEvent *, s16, s16); -static void sub_8096530(struct ObjectEvent *, struct Sprite *); -static void UpdateObjEventSpriteVisibility(struct ObjectEvent *, struct Sprite *); +static void UpdateObjectEventOffscreen(struct ObjectEvent *, struct Sprite *); +static void UpdateObjectEventSpriteVisibility(struct ObjectEvent *, struct Sprite *); static void ObjectEventUpdateMetatileBehaviors(struct ObjectEvent*); static void GetGroundEffectFlags_Reflection(struct ObjectEvent*, u32*); static void GetGroundEffectFlags_TallGrassOnSpawn(struct ObjectEvent*, u32*); @@ -115,14 +121,14 @@ static void GetObjectEventMovingCameraOffset(s16 *, s16 *); static struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8, u8, u8); static void LoadObjectEventPalette(u16); static void RemoveObjectEventIfOutsideView(struct ObjectEvent *); -static void sub_808E1B8(u8, s16, s16); +static void SpawnObjectEventOnReturnToField(u8, s16, s16); static void SetPlayerAvatarObjectEventIdAndObjectId(u8, u8); -static void sub_808E38C(struct ObjectEvent *); -static u8 sub_808E8F4(const struct SpritePalette *); +static void ResetObjectEventFldEffData(struct ObjectEvent *); +static u8 LoadSpritePaletteIfTagExists(const struct SpritePalette *); static u8 FindObjectEventPaletteIndexByTag(u16); -static void sub_808EAB0(u16, u8); +static void _PatchObjectPalette(u16, u8); static bool8 ObjectEventDoesZCoordMatch(struct ObjectEvent *, u8); -static void ObjectCB_CameraObject(struct Sprite *); +static void SpriteCB_CameraObject(struct Sprite *); static void CameraObject_0(struct Sprite *); static void CameraObject_1(struct Sprite *); static void CameraObject_2(struct Sprite *); @@ -133,14 +139,30 @@ static void oamt_npc_ministep_reset(struct Sprite *, u8, u8); static void InitSpriteForFigure8Anim(struct Sprite *sprite); static bool8 AnimateSpriteInFigure8(struct Sprite *sprite); static void UpdateObjectEventSprite(struct Sprite *); +static void DoShadowFieldEffect(struct ObjectEvent *); +static void SetJumpSpriteData(struct Sprite *, u8, u8, u8); +static void SetWalkSlowSpriteData(struct Sprite *sprite, u8 direction); +static bool8 UpdateWalkSlowAnim(struct Sprite *sprite); +static u8 DoJumpSpriteMovement(struct Sprite *sprite); +static u8 DoJumpSpecialSpriteMovement(struct Sprite *sprite); +static void CreateLevitateMovementTask(struct ObjectEvent *); +static void DestroyLevitateMovementTask(u8); static const struct SpriteFrameImage sPicTable_PechaBerryTree[]; 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}; +static const struct SpriteTemplate sCameraSpriteTemplate = { + .tileTag = 0, + .paletteTag = 0xFFFF, + .oam = &gDummyOamData, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_CameraObject +}; -void (*const gCameraObjectFuncs[])(struct Sprite *) = { +static void (*const sCameraObjectFuncs[])(struct Sprite *) = { CameraObject_0, CameraObject_1, CameraObject_2, @@ -671,13 +693,13 @@ static const u16 *const sObjectPaletteTagSets[] = { #include "data/object_events/berry_tree_graphics_tables.h" #include "data/field_effects/field_effect_objects.h" -const s16 gMovementDelaysMedium[] = {32, 64, 96, 128}; -const s16 gMovementDelaysLong[] = {32, 64, 128, 192}; -const s16 gMovementDelaysShort[] = {32, 48, 64, 80}; +static const s16 sMovementDelaysMedium[] = {32, 64, 96, 128}; +static const s16 sMovementDelaysLong[] = {32, 64, 128, 192}; // Unused +static const s16 sMovementDelaysShort[] = {32, 48, 64, 80}; #include "data/object_events/movement_type_func_tables.h" -const u8 gFaceDirectionAnimNums[] = { +static const u8 sFaceDirectionAnimNums[] = { [DIR_NONE] = 0, [DIR_SOUTH] = 0, [DIR_NORTH] = 1, @@ -688,7 +710,7 @@ const u8 gFaceDirectionAnimNums[] = { [DIR_NORTHWEST] = 1, [DIR_NORTHEAST] = 1, }; -const u8 gMoveDirectionAnimNums[] = { +static const u8 sMoveDirectionAnimNums[] = { [DIR_NONE] = 4, [DIR_SOUTH] = 4, [DIR_NORTH] = 5, @@ -699,7 +721,7 @@ const u8 gMoveDirectionAnimNums[] = { [DIR_NORTHWEST] = 5, [DIR_NORTHEAST] = 5, }; -const u8 gMoveDirectionFastAnimNums[] = { +static const u8 sMoveDirectionFastAnimNums[] = { [DIR_NONE] = 8, [DIR_SOUTH] = 8, [DIR_NORTH] = 9, @@ -710,7 +732,7 @@ const u8 gMoveDirectionFastAnimNums[] = { [DIR_NORTHWEST] = 9, [DIR_NORTHEAST] = 9, }; -const u8 gMoveDirectionFasterAnimNums[] = { +static const u8 sMoveDirectionFasterAnimNums[] = { [DIR_NONE] = 12, [DIR_SOUTH] = 12, [DIR_NORTH] = 13, @@ -721,7 +743,7 @@ const u8 gMoveDirectionFasterAnimNums[] = { [DIR_NORTHWEST] = 13, [DIR_NORTHEAST] = 13, }; -const u8 gMoveDirectionFastestAnimNums[] = { +static const u8 sMoveDirectionFastestAnimNums[] = { [DIR_NONE] = 16, [DIR_SOUTH] = 16, [DIR_NORTH] = 17, @@ -732,7 +754,7 @@ const u8 gMoveDirectionFastestAnimNums[] = { [DIR_NORTHWEST] = 17, [DIR_NORTHEAST] = 17, }; -const u8 gJumpSpecialDirectionAnimNums[] = { // used for jumping onto surf mon +static const u8 sJumpSpecialDirectionAnimNums[] = { // used for jumping onto surf mon [DIR_NONE] = 20, [DIR_SOUTH] = 20, [DIR_NORTH] = 21, @@ -743,7 +765,7 @@ const u8 gJumpSpecialDirectionAnimNums[] = { // used for jumping onto surf mon [DIR_NORTHWEST] = 21, [DIR_NORTHEAST] = 21, }; -const u8 gAcroWheelieDirectionAnimNums[] = { +static const u8 sAcroWheelieDirectionAnimNums[] = { [DIR_NONE] = 20, [DIR_SOUTH] = 20, [DIR_NORTH] = 21, @@ -754,7 +776,7 @@ const u8 gAcroWheelieDirectionAnimNums[] = { [DIR_NORTHWEST] = 21, [DIR_NORTHEAST] = 21, }; -const u8 gUnrefAnimNums_08375633[] = { +static const u8 sAcroUnusedDirectionAnimNums[] = { [DIR_NONE] = 24, [DIR_SOUTH] = 24, [DIR_NORTH] = 25, @@ -765,7 +787,7 @@ const u8 gUnrefAnimNums_08375633[] = { [DIR_NORTHWEST] = 25, [DIR_NORTHEAST] = 25, }; -const u8 gAcroEndWheelieDirectionAnimNums[] = { +static const u8 sAcroEndWheelieDirectionAnimNums[] = { [DIR_NONE] = 28, [DIR_SOUTH] = 28, [DIR_NORTH] = 29, @@ -776,7 +798,7 @@ const u8 gAcroEndWheelieDirectionAnimNums[] = { [DIR_NORTHWEST] = 29, [DIR_NORTHEAST] = 29, }; -const u8 gAcroUnusedActionDirectionAnimNums[] = { +static const u8 sAcroUnusedActionDirectionAnimNums[] = { [DIR_NONE] = 32, [DIR_SOUTH] = 32, [DIR_NORTH] = 33, @@ -787,7 +809,7 @@ const u8 gAcroUnusedActionDirectionAnimNums[] = { [DIR_NORTHWEST] = 33, [DIR_NORTHEAST] = 33, }; -const u8 gAcroWheeliePedalDirectionAnimNums[] = { +static const u8 sAcroWheeliePedalDirectionAnimNums[] = { [DIR_NONE] = 36, [DIR_SOUTH] = 36, [DIR_NORTH] = 37, @@ -798,7 +820,7 @@ const u8 gAcroWheeliePedalDirectionAnimNums[] = { [DIR_NORTHWEST] = 37, [DIR_NORTHEAST] = 37, }; -const u8 gFishingDirectionAnimNums[] = { +static const u8 sFishingDirectionAnimNums[] = { [DIR_NONE] = 0, [DIR_SOUTH] = 0, [DIR_NORTH] = 1, @@ -809,7 +831,7 @@ const u8 gFishingDirectionAnimNums[] = { [DIR_NORTHWEST] = 1, [DIR_NORTHEAST] = 1, }; -const u8 gFishingNoCatchDirectionAnimNums[] = { +static const u8 sFishingNoCatchDirectionAnimNums[] = { [DIR_NONE] = 4, [DIR_SOUTH] = 4, [DIR_NORTH] = 5, @@ -820,7 +842,7 @@ const u8 gFishingNoCatchDirectionAnimNums[] = { [DIR_NORTHWEST] = 5, [DIR_NORTHEAST] = 5, }; -const u8 gFishingBiteDirectionAnimNums[] = { +static const u8 sFishingBiteDirectionAnimNums[] = { [DIR_NONE] = 8, [DIR_SOUTH] = 8, [DIR_NORTH] = 9, @@ -831,7 +853,7 @@ const u8 gFishingBiteDirectionAnimNums[] = { [DIR_NORTHWEST] = 9, [DIR_NORTHEAST] = 9, }; -const u8 gRunningDirectionAnimNums[] = { +static const u8 sRunningDirectionAnimNums[] = { [DIR_NONE] = 20, [DIR_SOUTH] = 20, [DIR_NORTH] = 21, @@ -1071,7 +1093,7 @@ const u8 gAcroEndWheelieMoveDirectionMovementActions[] = { MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT, }; -const u8 gOppositeDirections[] = { +static const u8 sOppositeDirections[] = { DIR_NORTH, DIR_SOUTH, DIR_EAST, @@ -1375,7 +1397,7 @@ static u8 TrySetupObjectEventSprite(struct ObjectEventTemplate *objectEventTempl else if (paletteSlot >= 16) { paletteSlot -= 16; - sub_808EAB0(graphicsInfo->paletteTag, paletteSlot); + _PatchObjectPalette(graphicsInfo->paletteTag, paletteSlot); } if (objectEvent->movementType == MOVEMENT_TYPE_INVISIBLE) @@ -1390,14 +1412,14 @@ static u8 TrySetupObjectEventSprite(struct ObjectEventTemplate *objectEventTempl } sprite = &gSprites[spriteId]; - sub_8092FF0(objectEvent->currentCoords.x + cameraX, objectEvent->currentCoords.y + cameraY, &sprite->pos1.x, &sprite->pos1.y); + GetMapCoordsFromSpritePos(objectEvent->currentCoords.x + cameraX, objectEvent->currentCoords.y + cameraY, &sprite->pos1.x, &sprite->pos1.y); sprite->centerToCornerVecX = -(graphicsInfo->width >> 1); sprite->centerToCornerVecY = -(graphicsInfo->height >> 1); sprite->pos1.x += 8; sprite->pos1.y += 16 + sprite->centerToCornerVecY; sprite->oam.paletteNum = paletteSlot; sprite->coordOffsetEnabled = TRUE; - sprite->data[0] = objectEventId; + sprite->sObjEventId = objectEventId; objectEvent->spriteId = spriteId; objectEvent->inanimate = graphicsInfo->inanimate; if (!objectEvent->inanimate) @@ -1524,7 +1546,7 @@ u8 AddPseudoObjectEvent(u16 graphicsId, void (*callback)(struct Sprite *), s16 x // Used to create sprite object events instead of a full object event // Used when resources are limiting, e.g. for the audience in contests or group members in Union Room -u8 CreateObjectSprite(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction) +u8 CreateObjectSprite(u8 graphicsId, u8 objectEventId, s16 x, s16 y, u8 z, u8 direction) { u8 spriteId; struct Sprite *sprite; @@ -1551,7 +1573,7 @@ u8 CreateObjectSprite(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction) sprite->oam.paletteNum -= 16; } sprite->coordOffsetEnabled = TRUE; - sprite->data[0] = a1; + sprite->sObjEventId = objectEventId; sprite->data[1] = z; if (graphicsInfo->paletteSlot == 10) { @@ -1559,7 +1581,7 @@ u8 CreateObjectSprite(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction) } else if (graphicsInfo->paletteSlot >= 16) { - sub_808EAB0(graphicsInfo->paletteTag, graphicsInfo->paletteSlot | 0xf0); + _PatchObjectPalette(graphicsInfo->paletteTag, graphicsInfo->paletteSlot | 0xf0); } if (subspriteTables != NULL) { @@ -1586,17 +1608,11 @@ void TrySpawnObjectEvents(s16 cameraX, s16 cameraY) s16 bottom = gSaveBlock1Ptr->pos.y + 16; if (InBattlePyramid()) - { objectCount = GetNumBattlePyramidObjectEvents(); - } else if (InTrainerHill()) - { objectCount = 2; - } else - { objectCount = gMapHeader.events->objectEventCount; - } for (i = 0; i < objectCount; i++) { @@ -1649,7 +1665,7 @@ static void RemoveObjectEventIfOutsideView(struct ObjectEvent *objectEvent) RemoveObjectEvent(objectEvent); } -void sub_808E16C(s16 x, s16 y) +void SpawnObjectEventsOnReturnToField(s16 x, s16 y) { u8 i; @@ -1657,16 +1673,14 @@ void sub_808E16C(s16 x, s16 y) for (i = 0; i < OBJECT_EVENTS_COUNT; i++) { if (gObjectEvents[i].active) - { - sub_808E1B8(i, x, y); - } + SpawnObjectEventOnReturnToField(i, x, y); } CreateReflectionEffectSprites(); } -static void sub_808E1B8(u8 objectEventId, s16 x, s16 y) +static void SpawnObjectEventOnReturnToField(u8 objectEventId, s16 x, s16 y) { - u8 spriteId; + u8 i; u8 paletteSlot; struct Sprite *sprite; struct ObjectEvent *objectEvent; @@ -1675,15 +1689,11 @@ static void sub_808E1B8(u8 objectEventId, s16 x, s16 y) const struct SubspriteTable *subspriteTables; const struct ObjectEventGraphicsInfo *graphicsInfo; -#define i spriteId for (i = 0; i < ARRAY_COUNT(gLinkPlayerObjectEvents); i++) { if (gLinkPlayerObjectEvents[i].active && objectEventId == gLinkPlayerObjectEvents[i].objEventId) - { return; - } } -#undef i objectEvent = &gObjectEvents[objectEventId]; subspriteTables = NULL; @@ -1691,6 +1701,7 @@ static void sub_808E1B8(u8 objectEventId, s16 x, s16 y) spriteFrameImage.size = graphicsInfo->size; MakeObjectTemplateFromObjectEventGraphicsInfoWithCallbackIndex(objectEvent->graphicsId, objectEvent->movementType, &spriteTemplate, &subspriteTables); spriteTemplate.images = &spriteFrameImage; + *(u16 *)&spriteTemplate.paletteTag = 0xFFFF; paletteSlot = graphicsInfo->paletteSlot; if (paletteSlot == 0) @@ -1704,14 +1715,15 @@ static void sub_808E1B8(u8 objectEventId, s16 x, s16 y) else if (paletteSlot >= 16) { paletteSlot -= 16; - sub_808EAB0(graphicsInfo->paletteTag, paletteSlot); + _PatchObjectPalette(graphicsInfo->paletteTag, paletteSlot); } *(u16 *)&spriteTemplate.paletteTag = 0xFFFF; - spriteId = CreateSprite(&spriteTemplate, 0, 0, 0); - if (spriteId != MAX_SPRITES) + + i = CreateSprite(&spriteTemplate, 0, 0, 0); + if (i != MAX_SPRITES) { - sprite = &gSprites[spriteId]; - sub_8092FF0(x + objectEvent->currentCoords.x, y + objectEvent->currentCoords.y, &sprite->pos1.x, &sprite->pos1.y); + sprite = &gSprites[i]; + GetMapCoordsFromSpritePos(x + objectEvent->currentCoords.x, y + objectEvent->currentCoords.y, &sprite->pos1.x, &sprite->pos1.y); sprite->centerToCornerVecX = -(graphicsInfo->width >> 1); sprite->centerToCornerVecY = -(graphicsInfo->height >> 1); sprite->pos1.x += 8; @@ -1719,27 +1731,25 @@ static void sub_808E1B8(u8 objectEventId, s16 x, s16 y) sprite->images = graphicsInfo->images; if (objectEvent->movementType == MOVEMENT_TYPE_PLAYER) { - SetPlayerAvatarObjectEventIdAndObjectId(objectEventId, spriteId); + SetPlayerAvatarObjectEventIdAndObjectId(objectEventId, i); objectEvent->warpArrowSpriteId = CreateWarpArrowSprite(); } if (subspriteTables != NULL) - { SetSubspriteTables(sprite, subspriteTables); - } + sprite->oam.paletteNum = paletteSlot; sprite->coordOffsetEnabled = TRUE; - sprite->data[0] = objectEventId; - objectEvent->spriteId = spriteId; + sprite->sObjEventId = objectEventId; + objectEvent->spriteId = i; if (!objectEvent->inanimate && objectEvent->movementType != MOVEMENT_TYPE_PLAYER) - { StartSpriteAnim(sprite, GetFaceDirectionAnimNum(objectEvent->facingDirection)); - } - sub_808E38C(objectEvent); + + ResetObjectEventFldEffData(objectEvent); SetObjectSubpriorityByZCoord(objectEvent->previousElevation, sprite, 1); } } -static void sub_808E38C(struct ObjectEvent *objectEvent) +static void ResetObjectEventFldEffData(struct ObjectEvent *objectEvent) { objectEvent->singleMovementActive = FALSE; objectEvent->triggerGroundEffectsOnMove = TRUE; @@ -1780,7 +1790,7 @@ void ObjectEventSetGraphicsId(struct ObjectEvent *objectEvent, u8 graphicsId) else if (paletteSlot >= 16) { paletteSlot -= 16; - sub_808EAB0(graphicsInfo->paletteTag, paletteSlot); + _PatchObjectPalette(graphicsInfo->paletteTag, paletteSlot); } sprite->oam.shape = graphicsInfo->oam->shape; sprite->oam.size = graphicsInfo->oam->size; @@ -1907,7 +1917,7 @@ void ObjectEventGetLocalIdAndMap(struct ObjectEvent *objectEvent, void *localId, *(u8*)(mapGroup) = objectEvent->mapGroup; } -void sub_808E75C(s16 x, s16 y) +void AllowObjectAtPosTriggerGroundEffects(s16 x, s16 y) { u8 objectEventId; struct ObjectEvent *objectEvent; @@ -1972,27 +1982,23 @@ static void LoadObjectEventPalette(u16 paletteTag) u16 i = FindObjectEventPaletteIndexByTag(paletteTag); if (i != OBJ_EVENT_PAL_TAG_NONE) // always true - { - sub_808E8F4(&sObjectEventSpritePalettes[i]); - } + LoadSpritePaletteIfTagExists(&sObjectEventSpritePalettes[i]); } -void Unused_LoadObjectEventPaletteSet(u16 *paletteTags) +// Unused +static void LoadObjectEventPaletteSet(u16 *paletteTags) { u8 i; for (i = 0; paletteTags[i] != OBJ_EVENT_PAL_TAG_NONE; i++) - { LoadObjectEventPalette(paletteTags[i]); - } } -static u8 sub_808E8F4(const struct SpritePalette *spritePalette) +static u8 LoadSpritePaletteIfTagExists(const struct SpritePalette *spritePalette) { if (IndexOfSpritePaletteTag(spritePalette->tag) != 0xFF) - { return 0xFF; - } + return LoadSpritePalette(spritePalette); } @@ -2058,12 +2064,13 @@ void LoadSpecialObjectReflectionPalette(u16 tag, u8 slot) } } -static void sub_808EAB0(u16 tag, u8 slot) +static void _PatchObjectPalette(u16 tag, u8 slot) { PatchObjectPalette(tag, slot); } -void unref_sub_808EAC4(struct ObjectEvent *objectEvent, s16 x, s16 y) +// Unused +static void IncrementObjectEventCoords(struct ObjectEvent *objectEvent, s16 x, s16 y) { objectEvent->previousCoords.x = objectEvent->currentCoords.x; objectEvent->previousCoords.y = objectEvent->currentCoords.y; @@ -2100,7 +2107,7 @@ void MoveObjectEventToMapCoords(struct ObjectEvent *objectEvent, s16 x, s16 y) sprite->centerToCornerVecY = -(graphicsInfo->height >> 1); sprite->pos1.x += 8; sprite->pos1.y += 16 + sprite->centerToCornerVecY; - sub_808E38C(objectEvent); + ResetObjectEventFldEffData(objectEvent); if (objectEvent->trackedByCamera) CameraObjectReset1(); } @@ -2179,36 +2186,39 @@ void UpdateObjectEventsForCameraUpdate(s16 x, s16 y) RemoveObjectEventsOutsideView(); } +#define sLinkedSpriteId data[0] +#define sState data[1] + u8 AddCameraObject(u8 linkedSpriteId) { - u8 spriteId = CreateSprite(&gCameraSpriteTemplate, 0, 0, 4); + u8 spriteId = CreateSprite(&sCameraSpriteTemplate, 0, 0, 4); gSprites[spriteId].invisible = TRUE; - gSprites[spriteId].data[0] = linkedSpriteId; + gSprites[spriteId].sLinkedSpriteId = linkedSpriteId; return spriteId; } -static void ObjectCB_CameraObject(struct Sprite *sprite) +static void SpriteCB_CameraObject(struct Sprite *sprite) { - void (*callbacks[ARRAY_COUNT(gCameraObjectFuncs)])(struct Sprite *); + void (*callbacks[ARRAY_COUNT(sCameraObjectFuncs)])(struct Sprite *); - memcpy(callbacks, gCameraObjectFuncs, sizeof gCameraObjectFuncs); - callbacks[sprite->data[1]](sprite); + memcpy(callbacks, sCameraObjectFuncs, sizeof sCameraObjectFuncs); + callbacks[sprite->sState](sprite); } static void CameraObject_0(struct Sprite *sprite) { - sprite->pos1.x = gSprites[sprite->data[0]].pos1.x; - sprite->pos1.y = gSprites[sprite->data[0]].pos1.y; + sprite->pos1.x = gSprites[sprite->sLinkedSpriteId].pos1.x; + sprite->pos1.y = gSprites[sprite->sLinkedSpriteId].pos1.y; sprite->invisible = TRUE; - sprite->data[1] = 1; + sprite->sState = 1; CameraObject_1(sprite); } static void CameraObject_1(struct Sprite *sprite) { - s16 x = gSprites[sprite->data[0]].pos1.x; - s16 y = gSprites[sprite->data[0]].pos1.y; + s16 x = gSprites[sprite->sLinkedSpriteId].pos1.x; + s16 y = gSprites[sprite->sLinkedSpriteId].pos1.y; sprite->data[2] = x - sprite->pos1.x; sprite->data[3] = y - sprite->pos1.y; @@ -2218,75 +2228,74 @@ static void CameraObject_1(struct Sprite *sprite) static void CameraObject_2(struct Sprite *sprite) { - sprite->pos1.x = gSprites[sprite->data[0]].pos1.x; - sprite->pos1.y = gSprites[sprite->data[0]].pos1.y; + sprite->pos1.x = gSprites[sprite->sLinkedSpriteId].pos1.x; + sprite->pos1.y = gSprites[sprite->sLinkedSpriteId].pos1.y; sprite->data[2] = 0; sprite->data[3] = 0; } -static struct Sprite *FindCameraObject(void) +static struct Sprite *FindCameraSprite(void) { u8 i; for (i = 0; i < MAX_SPRITES; i++) { - if (gSprites[i].inUse && gSprites[i].callback == ObjectCB_CameraObject) - { + if (gSprites[i].inUse && gSprites[i].callback == SpriteCB_CameraObject) return &gSprites[i]; - } } return NULL; } void CameraObjectReset1(void) { - struct Sprite *cameraObject; + struct Sprite *camera; - cameraObject = FindCameraObject(); - if (cameraObject != NULL) + camera = FindCameraSprite(); + if (camera != NULL) { - cameraObject->data[1] = 0; - cameraObject->callback(cameraObject); + camera->sState = 0; + camera->callback(camera); } } -void CameraObjectSetFollowedObjectId(u8 objectId) +void CameraObjectSetFollowedSpriteId(u8 spriteId) { - struct Sprite *cameraObject; + struct Sprite *camera; - cameraObject = FindCameraObject(); - if (cameraObject != NULL) + camera = FindCameraSprite(); + if (camera != NULL) { - cameraObject->data[0] = objectId; + camera->sLinkedSpriteId = spriteId; CameraObjectReset1(); } } -u8 CameraObjectGetFollowedObjectId(void) +// Unused +static u8 CameraObjectGetFollowedSpriteId(void) { - struct Sprite *cameraObject; + struct Sprite *camera; - cameraObject = FindCameraObject(); - if (cameraObject == NULL) + camera = FindCameraSprite(); + if (camera == NULL) { return MAX_SPRITES; } - return cameraObject->data[0]; + return camera->sLinkedSpriteId; } void CameraObjectReset2(void) { // UB: Possible null dereference #ifdef UBFIX - struct Sprite *cameraObject; + struct Sprite *camera; - cameraObject = FindCameraObject(); - if (cameraObject != NULL) + camera = FindCameraSprite(); + if (camera != NULL) { - cameraObject->data[1] = 2; + camera->sState = 2; } #else - FindCameraObject()->data[1] = 2; + FindCameraSprite()->sState = 2; #endif // UBFIX } @@ -2547,14 +2556,14 @@ movement_type_def(MovementType_WanderAround, gMovementTypeFuncs_WanderAround) bool8 MovementType_WanderAround_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_WanderAround_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -2564,8 +2573,8 @@ bool8 MovementType_WanderAround_Step2(struct ObjectEvent *objectEvent, struct Sp { return FALSE; } - SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); - sprite->data[1] = 3; + SetMovementDelay(sprite, sMovementDelaysMedium[Random() & 3]); + sprite->sTypeFuncId = 3; return TRUE; } @@ -2573,7 +2582,7 @@ bool8 MovementType_WanderAround_Step3(struct ObjectEvent *objectEvent, struct Sp { if (WaitForMovementDelay(sprite)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -2587,9 +2596,9 @@ bool8 MovementType_WanderAround_Step4(struct ObjectEvent *objectEvent, struct Sp memcpy(directions, gStandardDirections, sizeof directions); chosenDirection = directions[Random() & 3]; SetObjectEventDirection(objectEvent, chosenDirection); - sprite->data[1] = 5; + sprite->sTypeFuncId = 5; if (GetCollisionInDirection(objectEvent, chosenDirection)) - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -2598,7 +2607,7 @@ bool8 MovementType_WanderAround_Step5(struct ObjectEvent *objectEvent, struct Sp { ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkNormalMovementAction(objectEvent->movementDirection)); objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 6; + sprite->sTypeFuncId = 6; return TRUE; } @@ -2607,7 +2616,7 @@ bool8 MovementType_WanderAround_Step6(struct ObjectEvent *objectEvent, struct Sp if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; } return FALSE; } @@ -2653,17 +2662,13 @@ u8 GetVectorDirection(s16 dx, s16 dy, s16 absdx, s16 absdy) { direction = DIR_EAST; if (dx < 0) - { direction = DIR_WEST; - } } else { direction = DIR_SOUTH; if (dy < 0) - { direction = DIR_NORTH; - } } return direction; } @@ -2674,9 +2679,7 @@ u8 GetLimitedVectorDirection_SouthNorth(s16 dx, s16 dy, s16 absdx, s16 absdy) direction = DIR_SOUTH; if (dy < 0) - { direction = DIR_NORTH; - } return direction; } @@ -2686,9 +2689,7 @@ u8 GetLimitedVectorDirection_WestEast(s16 dx, s16 dy, s16 absdx, s16 absdy) direction = DIR_EAST; if (dx < 0) - { direction = DIR_WEST; - } return direction; } @@ -2701,17 +2702,13 @@ u8 GetLimitedVectorDirection_WestNorth(s16 dx, s16 dy, s16 absdx, s16 absdy) { direction = GetLimitedVectorDirection_WestEast(dx, dy, absdx, absdy); if (direction == DIR_EAST) - { direction = DIR_NORTH; - } } else if (direction == DIR_EAST) { direction = GetLimitedVectorDirection_SouthNorth(dx, dy, absdx, absdy); if (direction == DIR_SOUTH) - { direction = DIR_NORTH; - } } return direction; } @@ -2725,17 +2722,13 @@ u8 GetLimitedVectorDirection_EastNorth(s16 dx, s16 dy, s16 absdx, s16 absdy) { direction = GetLimitedVectorDirection_WestEast(dx, dy, absdx, absdy); if (direction == DIR_WEST) - { direction = DIR_NORTH; - } } else if (direction == DIR_WEST) { direction = GetLimitedVectorDirection_SouthNorth(dx, dy, absdx, absdy); if (direction == DIR_SOUTH) - { direction = DIR_NORTH; - } } return direction; } @@ -2749,17 +2742,13 @@ u8 GetLimitedVectorDirection_WestSouth(s16 dx, s16 dy, s16 absdx, s16 absdy) { direction = GetLimitedVectorDirection_WestEast(dx, dy, absdx, absdy); if (direction == DIR_EAST) - { direction = DIR_SOUTH; - } } else if (direction == DIR_EAST) { direction = GetLimitedVectorDirection_SouthNorth(dx, dy, absdx, absdy); if (direction == DIR_NORTH) - { direction = DIR_SOUTH; - } } return direction; } @@ -2773,17 +2762,13 @@ u8 GetLimitedVectorDirection_EastSouth(s16 dx, s16 dy, s16 absdx, s16 absdy) { direction = GetLimitedVectorDirection_WestEast(dx, dy, absdx, absdy); if (direction == DIR_WEST) - { direction = DIR_SOUTH; - } } else if (direction == DIR_WEST) { direction = GetLimitedVectorDirection_SouthNorth(dx, dy, absdx, absdy); if (direction == DIR_NORTH) - { direction = DIR_SOUTH; - } } return direction; } @@ -2794,9 +2779,7 @@ u8 GetLimitedVectorDirection_SouthNorthWest(s16 dx, s16 dy, s16 absdx, s16 absdy direction = GetVectorDirection(dx, dy, absdx, absdy); if (direction == DIR_EAST) - { direction = GetLimitedVectorDirection_SouthNorth(dx, dy, absdx, absdy); - } return direction; } @@ -2806,9 +2789,7 @@ u8 GetLimitedVectorDirection_SouthNorthEast(s16 dx, s16 dy, s16 absdx, s16 absdy direction = GetVectorDirection(dx, dy, absdx, absdy); if (direction == DIR_WEST) - { direction = GetLimitedVectorDirection_SouthNorth(dx, dy, absdx, absdy); - } return direction; } @@ -2818,9 +2799,7 @@ u8 GetLimitedVectorDirection_NorthWestEast(s16 dx, s16 dy, s16 absdx, s16 absdy) direction = GetVectorDirection(dx, dy, absdx, absdy); if (direction == DIR_SOUTH) - { direction = GetLimitedVectorDirection_WestEast(dx, dy, absdx, absdy); - } return direction; } @@ -2830,9 +2809,7 @@ u8 GetLimitedVectorDirection_SouthWestEast(s16 dx, s16 dy, s16 absdx, s16 absdy) direction = GetVectorDirection(dx, dy, absdx, absdy); if (direction == DIR_NORTH) - { direction = GetLimitedVectorDirection_WestEast(dx, dy, absdx, absdy); - } return direction; } @@ -2842,22 +2819,19 @@ u8 TryGetTrainerEncounterDirection(struct ObjectEvent *objectEvent, u8 movementT s16 absdx, absdy; if (!ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) - { - return 0; - } + return DIR_NONE; + PlayerGetDestCoords(&dx, &dy); dx -= objectEvent->currentCoords.x; dy -= objectEvent->currentCoords.y; absdx = dx; absdy = dy; + if (absdx < 0) - { absdx = -absdx; - } if (absdy < 0) - { absdy = -absdy; - } + return gGetVectorDirectionFuncs[movementType](dx, dy, absdx, absdy); } @@ -2866,14 +2840,14 @@ movement_type_def(MovementType_LookAround, gMovementTypeFuncs_LookAround) bool8 MovementType_LookAround_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_LookAround_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -2881,9 +2855,9 @@ bool8 MovementType_LookAround_Step2(struct ObjectEvent *objectEvent, struct Spri { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); + SetMovementDelay(sprite, sMovementDelaysMedium[Random() & 3]); objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -2892,7 +2866,7 @@ bool8 MovementType_LookAround_Step3(struct ObjectEvent *objectEvent, struct Spri { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -2908,7 +2882,7 @@ bool8 MovementType_LookAround_Step4(struct ObjectEvent *objectEvent, struct Spri direction = directions[Random() & 3]; SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -2917,25 +2891,24 @@ movement_type_def(MovementType_WanderUpAndDown, gMovementTypeFuncs_WanderUpAndDo bool8 MovementType_WanderUpAndDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_WanderUpAndDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } bool8 MovementType_WanderUpAndDown_Step2(struct ObjectEvent *objectEvent, struct Sprite *sprite) { if (!ObjectEventExecSingleMovementAction(objectEvent, sprite)) - { return FALSE; - } - SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); - sprite->data[1] = 3; + + SetMovementDelay(sprite, sMovementDelaysMedium[Random() & 3]); + sprite->sTypeFuncId = 3; return TRUE; } @@ -2943,7 +2916,7 @@ bool8 MovementType_WanderUpAndDown_Step3(struct ObjectEvent *objectEvent, struct { if (WaitForMovementDelay(sprite)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -2956,9 +2929,9 @@ bool8 MovementType_WanderUpAndDown_Step4(struct ObjectEvent *objectEvent, struct memcpy(directions, gUpAndDownDirections, sizeof directions); direction = directions[Random() & 1]; SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 5; + sprite->sTypeFuncId = 5; if (GetCollisionInDirection(objectEvent, direction)) - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -2967,7 +2940,7 @@ bool8 MovementType_WanderUpAndDown_Step5(struct ObjectEvent *objectEvent, struct { ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkNormalMovementAction(objectEvent->movementDirection)); objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 6; + sprite->sTypeFuncId = 6; return TRUE; } @@ -2976,7 +2949,7 @@ bool8 MovementType_WanderUpAndDown_Step6(struct ObjectEvent *objectEvent, struct if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; } return FALSE; } @@ -2986,25 +2959,24 @@ movement_type_def(MovementType_WanderLeftAndRight, gMovementTypeFuncs_WanderLeft bool8 MovementType_WanderLeftAndRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_WanderLeftAndRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } bool8 MovementType_WanderLeftAndRight_Step2(struct ObjectEvent *objectEvent, struct Sprite *sprite) { if (!ObjectEventExecSingleMovementAction(objectEvent, sprite)) - { return FALSE; - } - SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); - sprite->data[1] = 3; + + SetMovementDelay(sprite, sMovementDelaysMedium[Random() & 3]); + sprite->sTypeFuncId = 3; return TRUE; } @@ -3012,7 +2984,7 @@ bool8 MovementType_WanderLeftAndRight_Step3(struct ObjectEvent *objectEvent, str { if (WaitForMovementDelay(sprite)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -3025,9 +2997,9 @@ bool8 MovementType_WanderLeftAndRight_Step4(struct ObjectEvent *objectEvent, str memcpy(directions, gLeftAndRightDirections, sizeof directions); direction = directions[Random() & 1]; SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 5; + sprite->sTypeFuncId = 5; if (GetCollisionInDirection(objectEvent, direction)) - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3036,7 +3008,7 @@ bool8 MovementType_WanderLeftAndRight_Step5(struct ObjectEvent *objectEvent, str { ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkNormalMovementAction(objectEvent->movementDirection)); objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 6; + sprite->sTypeFuncId = 6; return TRUE; } @@ -3045,7 +3017,7 @@ bool8 MovementType_WanderLeftAndRight_Step6(struct ObjectEvent *objectEvent, str if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; } return FALSE; } @@ -3056,7 +3028,7 @@ bool8 MovementType_FaceDirection_Step0(struct ObjectEvent *objectEvent, struct S { ClearObjectEventMovement(objectEvent, sprite); ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3064,7 +3036,7 @@ bool8 MovementType_FaceDirection_Step1(struct ObjectEvent *objectEvent, struct S { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } return FALSE; @@ -3087,8 +3059,6 @@ enum { BERRYTREEFUNC_SPARKLE_END, }; -#define sObjEventId data[0] -#define sFuncId data[1] #define sTimer data[2] #define sBerryTreeFlags data[7] @@ -3110,7 +3080,7 @@ void MovementType_BerryTreeGrowth(struct Sprite *sprite) } static bool8 ObjectEventCB2_BerryTree(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - return gMovementTypeFuncs_BerryTreeGrowth[sprite->sFuncId](objectEvent, sprite); + return gMovementTypeFuncs_BerryTreeGrowth[sprite->sTypeFuncId](objectEvent, sprite); } // BERRYTREEFUNC_NORMAL @@ -3139,12 +3109,12 @@ bool8 MovementType_BerryTreeGrowth_Normal(struct ObjectEvent *objectEvent, struc berryStage--; if (sprite->animNum != berryStage) { - sprite->sFuncId = BERRYTREEFUNC_SPARKLE_START; + sprite->sTypeFuncId = BERRYTREEFUNC_SPARKLE_START; return TRUE; } SetBerryTreeGraphics(objectEvent, sprite); ObjectEventSetSingleMovement(objectEvent, sprite, MOVEMENT_ACTION_START_ANIM_IN_DIRECTION); - sprite->sFuncId = BERRYTREEFUNC_MOVE; + sprite->sTypeFuncId = BERRYTREEFUNC_MOVE; return TRUE; } @@ -3153,7 +3123,7 @@ bool8 MovementType_BerryTreeGrowth_Move(struct ObjectEvent *objectEvent, struct { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - sprite->sFuncId = BERRYTREEFUNC_NORMAL; + sprite->sTypeFuncId = BERRYTREEFUNC_NORMAL; return TRUE; } return FALSE; @@ -3163,7 +3133,7 @@ bool8 MovementType_BerryTreeGrowth_Move(struct ObjectEvent *objectEvent, struct bool8 MovementType_BerryTreeGrowth_SparkleStart(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->singleMovementActive = TRUE; - sprite->sFuncId = BERRYTREEFUNC_SPARKLE; + sprite->sTypeFuncId = BERRYTREEFUNC_SPARKLE; sprite->sTimer = 0; sprite->sBerryTreeFlags |= BERRY_FLAG_SPARKLING; gFieldEffectArguments[0] = objectEvent->currentCoords.x; @@ -3183,7 +3153,7 @@ bool8 MovementType_BerryTreeGrowth_Sparkle(struct ObjectEvent *objectEvent, stru if (sprite->sTimer > 64) { SetBerryTreeGraphics(objectEvent, sprite); - sprite->sFuncId = BERRYTREEFUNC_SPARKLE_END; + sprite->sTypeFuncId = BERRYTREEFUNC_SPARKLE_END; sprite->sTimer = 0; return TRUE; } @@ -3198,7 +3168,7 @@ bool8 MovementType_BerryTreeGrowth_SparkleEnd(struct ObjectEvent *objectEvent, s sprite->animPaused = TRUE; if (sprite->sTimer > 64) { - sprite->sFuncId = BERRYTREEFUNC_NORMAL; + sprite->sTypeFuncId = BERRYTREEFUNC_NORMAL; sprite->sBerryTreeFlags &= ~BERRY_FLAG_SPARKLING; return TRUE; } @@ -3210,14 +3180,14 @@ movement_type_def(MovementType_FaceDownAndUp, gMovementTypeFuncs_FaceDownAndUp) bool8 MovementType_FaceDownAndUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_FaceDownAndUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -3225,9 +3195,9 @@ bool8 MovementType_FaceDownAndUp_Step2(struct ObjectEvent *objectEvent, struct S { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); + SetMovementDelay(sprite, sMovementDelaysMedium[Random() & 3]); objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -3236,7 +3206,7 @@ bool8 MovementType_FaceDownAndUp_Step3(struct ObjectEvent *objectEvent, struct S { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -3253,7 +3223,7 @@ bool8 MovementType_FaceDownAndUp_Step4(struct ObjectEvent *objectEvent, struct S direction = directions[Random() & 1]; } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3262,14 +3232,14 @@ movement_type_def(MovementType_FaceLeftAndRight, gMovementTypeFuncs_FaceLeftAndR bool8 MovementType_FaceLeftAndRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_FaceLeftAndRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -3277,9 +3247,9 @@ bool8 MovementType_FaceLeftAndRight_Step2(struct ObjectEvent *objectEvent, struc { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); + SetMovementDelay(sprite, sMovementDelaysMedium[Random() & 3]); objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -3288,7 +3258,7 @@ bool8 MovementType_FaceLeftAndRight_Step3(struct ObjectEvent *objectEvent, struc { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -3305,7 +3275,7 @@ bool8 MovementType_FaceLeftAndRight_Step4(struct ObjectEvent *objectEvent, struc direction = directions[Random() & 1]; } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3314,14 +3284,14 @@ movement_type_def(MovementType_FaceUpAndLeft, gMovementTypeFuncs_FaceUpAndLeft) bool8 MovementType_FaceUpAndLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_FaceUpAndLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -3329,9 +3299,9 @@ bool8 MovementType_FaceUpAndLeft_Step2(struct ObjectEvent *objectEvent, struct S { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + SetMovementDelay(sprite, sMovementDelaysShort[Random() & 3]); objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -3340,7 +3310,7 @@ bool8 MovementType_FaceUpAndLeft_Step3(struct ObjectEvent *objectEvent, struct S { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -3357,7 +3327,7 @@ bool8 MovementType_FaceUpAndLeft_Step4(struct ObjectEvent *objectEvent, struct S direction = directions[Random() & 1]; } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3366,14 +3336,14 @@ movement_type_def(MovementType_FaceUpAndRight, gMovementTypeFuncs_FaceUpAndRight bool8 MovementType_FaceUpAndRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_FaceUpAndRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -3381,9 +3351,9 @@ bool8 MovementType_FaceUpAndRight_Step2(struct ObjectEvent *objectEvent, struct { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + SetMovementDelay(sprite, sMovementDelaysShort[Random() & 3]); objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -3392,7 +3362,7 @@ bool8 MovementType_FaceUpAndRight_Step3(struct ObjectEvent *objectEvent, struct { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -3409,7 +3379,7 @@ bool8 MovementType_FaceUpAndRight_Step4(struct ObjectEvent *objectEvent, struct direction = directions[Random() & 1]; } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3418,14 +3388,14 @@ movement_type_def(MovementType_FaceDownAndLeft, gMovementTypeFuncs_FaceDownAndLe bool8 MovementType_FaceDownAndLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_FaceDownAndLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -3433,9 +3403,9 @@ bool8 MovementType_FaceDownAndLeft_Step2(struct ObjectEvent *objectEvent, struct { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + SetMovementDelay(sprite, sMovementDelaysShort[Random() & 3]); objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -3444,7 +3414,7 @@ bool8 MovementType_FaceDownAndLeft_Step3(struct ObjectEvent *objectEvent, struct { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -3461,7 +3431,7 @@ bool8 MovementType_FaceDownAndLeft_Step4(struct ObjectEvent *objectEvent, struct direction = directions[Random() & 1]; } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3470,14 +3440,14 @@ movement_type_def(MovementType_FaceDownAndRight, gMovementTypeFuncs_FaceDownAndR bool8 MovementType_FaceDownAndRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_FaceDownAndRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -3485,9 +3455,9 @@ bool8 MovementType_FaceDownAndRight_Step2(struct ObjectEvent *objectEvent, struc { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + SetMovementDelay(sprite, sMovementDelaysShort[Random() & 3]); objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -3496,7 +3466,7 @@ bool8 MovementType_FaceDownAndRight_Step3(struct ObjectEvent *objectEvent, struc { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -3513,7 +3483,7 @@ bool8 MovementType_FaceDownAndRight_Step4(struct ObjectEvent *objectEvent, struc direction = directions[Random() & 1]; } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3522,14 +3492,14 @@ movement_type_def(MovementType_FaceDownUpAndLeft, gMovementTypeFuncs_FaceDownUpA bool8 MovementType_FaceDownUpAndLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_FaceDownUpAndLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -3537,9 +3507,9 @@ bool8 MovementType_FaceDownUpAndLeft_Step2(struct ObjectEvent *objectEvent, stru { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + SetMovementDelay(sprite, sMovementDelaysShort[Random() & 3]); objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -3548,7 +3518,7 @@ bool8 MovementType_FaceDownUpAndLeft_Step3(struct ObjectEvent *objectEvent, stru { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -3565,7 +3535,7 @@ bool8 MovementType_FaceDownUpAndLeft_Step4(struct ObjectEvent *objectEvent, stru direction = directions[Random() & 3]; } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3574,14 +3544,14 @@ movement_type_def(MovementType_FaceDownUpAndRight, gMovementTypeFuncs_FaceDownUp bool8 MovementType_FaceDownUpAndRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_FaceDownUpAndRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -3589,9 +3559,9 @@ bool8 MovementType_FaceDownUpAndRight_Step2(struct ObjectEvent *objectEvent, str { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + SetMovementDelay(sprite, sMovementDelaysShort[Random() & 3]); objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -3600,7 +3570,7 @@ bool8 MovementType_FaceDownUpAndRight_Step3(struct ObjectEvent *objectEvent, str { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -3617,7 +3587,7 @@ bool8 MovementType_FaceDownUpAndRight_Step4(struct ObjectEvent *objectEvent, str direction = directions[Random() & 3]; } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3626,14 +3596,14 @@ movement_type_def(MovementType_FaceUpRightAndLeft, gMovementTypeFuncs_FaceUpLeft bool8 MovementType_FaceUpLeftAndRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_FaceUpLeftAndRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -3641,9 +3611,9 @@ bool8 MovementType_FaceUpLeftAndRight_Step2(struct ObjectEvent *objectEvent, str { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + SetMovementDelay(sprite, sMovementDelaysShort[Random() & 3]); objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -3652,7 +3622,7 @@ bool8 MovementType_FaceUpLeftAndRight_Step3(struct ObjectEvent *objectEvent, str { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -3669,7 +3639,7 @@ bool8 MovementType_FaceUpLeftAndRight_Step4(struct ObjectEvent *objectEvent, str direction = directions[Random() & 3]; } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3678,14 +3648,14 @@ movement_type_def(MovementType_FaceDownRightAndLeft, gMovementTypeFuncs_FaceDown bool8 MovementType_FaceDownLeftAndRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_FaceDownLeftAndRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -3693,9 +3663,9 @@ bool8 MovementType_FaceDownLeftAndRight_Step2(struct ObjectEvent *objectEvent, s { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); + SetMovementDelay(sprite, sMovementDelaysShort[Random() & 3]); objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -3704,7 +3674,7 @@ bool8 MovementType_FaceDownLeftAndRight_Step3(struct ObjectEvent *objectEvent, s { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 4; + sprite->sTypeFuncId = 4; return TRUE; } return FALSE; @@ -3721,7 +3691,7 @@ bool8 MovementType_FaceDownLeftAndRight_Step4(struct ObjectEvent *objectEvent, s direction = directions[Random() & 3]; } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3731,7 +3701,7 @@ bool8 MovementType_RotateCounterclockwise_Step0(struct ObjectEvent *objectEvent, { ClearObjectEventMovement(objectEvent, sprite); ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3740,7 +3710,7 @@ bool8 MovementType_RotateCounterclockwise_Step1(struct ObjectEvent *objectEvent, if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, 48); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; } return FALSE; } @@ -3749,7 +3719,7 @@ bool8 MovementType_RotateCounterclockwise_Step2(struct ObjectEvent *objectEvent, { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -3765,7 +3735,7 @@ bool8 MovementType_RotateCounterclockwise_Step3(struct ObjectEvent *objectEvent, direction = directions[objectEvent->facingDirection]; } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 0; + sprite->sTypeFuncId = 0; return TRUE; } @@ -3775,7 +3745,7 @@ bool8 MovementType_RotateClockwise_Step0(struct ObjectEvent *objectEvent, struct { ClearObjectEventMovement(objectEvent, sprite); ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3784,7 +3754,7 @@ bool8 MovementType_RotateClockwise_Step1(struct ObjectEvent *objectEvent, struct if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, 48); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; } return FALSE; } @@ -3793,7 +3763,7 @@ bool8 MovementType_RotateClockwise_Step2(struct ObjectEvent *objectEvent, struct { if (WaitForMovementDelay(sprite) || ObjectEventIsTrainerAndCloseToPlayer(objectEvent)) { - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; } return FALSE; } @@ -3809,7 +3779,7 @@ bool8 MovementType_RotateClockwise_Step3(struct ObjectEvent *objectEvent, struct direction = directions[objectEvent->facingDirection]; } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 0; + sprite->sTypeFuncId = 0; return TRUE; } @@ -3818,7 +3788,7 @@ movement_type_def(MovementType_WalkBackAndForth, gMovementTypeFuncs_WalkBackAndF bool8 MovementType_WalkBackAndForth_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3832,7 +3802,7 @@ bool8 MovementType_WalkBackAndForth_Step1(struct ObjectEvent *objectEvent, struc direction = GetOppositeDirection(direction); } SetObjectEventDirection(objectEvent, direction); - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -3861,7 +3831,7 @@ bool8 MovementType_WalkBackAndForth_Step2(struct ObjectEvent *objectEvent, struc ObjectEventSetSingleMovement(objectEvent, sprite, movementActionId); objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 3; + sprite->sTypeFuncId = 3; return TRUE; } @@ -3870,7 +3840,7 @@ bool8 MovementType_WalkBackAndForth_Step3(struct ObjectEvent *objectEvent, struc if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; } return FALSE; } @@ -3878,7 +3848,7 @@ bool8 MovementType_WalkBackAndForth_Step3(struct ObjectEvent *objectEvent, struc bool8 MovementType_WalkSequence_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ClearObjectEventMovement(objectEvent, sprite); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -3906,7 +3876,7 @@ bool8 MoveNextDirectionInSequence(struct ObjectEvent *objectEvent, struct Sprite ObjectEventSetSingleMovement(objectEvent, sprite, movementActionId); objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -3915,7 +3885,7 @@ bool8 MovementType_WalkSequence_Step2(struct ObjectEvent *objectEvent, struct Sp if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; } return FALSE; } @@ -4241,7 +4211,7 @@ bool8 MovementType_CopyPlayer_Step0(struct ObjectEvent *objectEvent, struct Spri { objectEvent->directionSequenceIndex = GetPlayerFacingDirection(); } - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -4259,7 +4229,7 @@ bool8 MovementType_CopyPlayer_Step2(struct ObjectEvent *objectEvent, struct Spri if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { objectEvent->singleMovementActive = FALSE; - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; } return FALSE; } @@ -4273,7 +4243,7 @@ bool8 CopyablePlayerMovement_FaceDirection(struct ObjectEvent *objectEvent, stru { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(state_to_direction(gInitialMovementTypeFacingDirections[objectEvent->movementType], objectEvent->directionSequenceIndex, playerDirection))); objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -4294,7 +4264,7 @@ bool8 CopyablePlayerMovement_GoSpeed0(struct ObjectEvent *objectEvent, struct Sp ObjectEventMoveDestCoords(objectEvent, direction, &x, &y); ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } } @@ -4309,7 +4279,7 @@ bool8 CopyablePlayerMovement_GoSpeed0(struct ObjectEvent *objectEvent, struct Sp ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); } objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -4328,7 +4298,7 @@ bool8 CopyablePlayerMovement_GoSpeed1(struct ObjectEvent *objectEvent, struct Sp ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); } objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -4347,7 +4317,7 @@ bool8 CopyablePlayerMovement_GoSpeed2(struct ObjectEvent *objectEvent, struct Sp ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); } objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -4366,7 +4336,7 @@ bool8 CopyablePlayerMovement_Slide(struct ObjectEvent *objectEvent, struct Sprit ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); } objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -4378,7 +4348,7 @@ bool8 cph_IM_DIFFERENT(struct ObjectEvent *objectEvent, struct Sprite *sprite, u direction = state_to_direction(gInitialMovementTypeFacingDirections[objectEvent->movementType], objectEvent->directionSequenceIndex, direction); ObjectEventSetSingleMovement(objectEvent, sprite, GetJumpInPlaceMovementAction(direction)); objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -4397,7 +4367,7 @@ bool8 CopyablePlayerMovement_GoSpeed4(struct ObjectEvent *objectEvent, struct Sp ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); } objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -4418,7 +4388,7 @@ bool8 CopyablePlayerMovement_Jump(struct ObjectEvent *objectEvent, struct Sprite ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); } objectEvent->singleMovementActive = TRUE; - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } @@ -4437,7 +4407,7 @@ void MovementType_TreeDisguise(struct Sprite *sprite) { struct ObjectEvent *objectEvent; - objectEvent = &gObjectEvents[sprite->data[0]]; + objectEvent = &gObjectEvents[sprite->sObjEventId]; if (objectEvent->directionSequenceIndex == 0 || (objectEvent->directionSequenceIndex == 1 && !sprite->data[7])) { ObjectEventGetLocalIdAndMap(objectEvent, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]); @@ -4445,7 +4415,7 @@ void MovementType_TreeDisguise(struct Sprite *sprite) objectEvent->directionSequenceIndex = 1; sprite->data[7]++; } - UpdateObjectEventCurrentMovement(&gObjectEvents[sprite->data[0]], sprite, MovementType_Disguise_Callback); + UpdateObjectEventCurrentMovement(&gObjectEvents[sprite->sObjEventId], sprite, MovementType_Disguise_Callback); } static bool8 MovementType_Disguise_Callback(struct ObjectEvent *objectEvent, struct Sprite *sprite) @@ -4458,7 +4428,7 @@ void MovementType_MountainDisguise(struct Sprite *sprite) { struct ObjectEvent *objectEvent; - objectEvent = &gObjectEvents[sprite->data[0]]; + objectEvent = &gObjectEvents[sprite->sObjEventId]; if (objectEvent->directionSequenceIndex == 0 || (objectEvent->directionSequenceIndex == 1 && !sprite->data[7])) { ObjectEventGetLocalIdAndMap(objectEvent, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]); @@ -4466,24 +4436,24 @@ void MovementType_MountainDisguise(struct Sprite *sprite) objectEvent->directionSequenceIndex = 1; sprite->data[7]++; } - UpdateObjectEventCurrentMovement(&gObjectEvents[sprite->data[0]], sprite, MovementType_Disguise_Callback); + UpdateObjectEventCurrentMovement(&gObjectEvents[sprite->sObjEventId], sprite, MovementType_Disguise_Callback); } void MovementType_Buried(struct Sprite *sprite) { if (!sprite->data[7]) { - gObjectEvents[sprite->data[0]].fixedPriority = TRUE; + gObjectEvents[sprite->sObjEventId].fixedPriority = TRUE; sprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY; sprite->oam.priority = 3; sprite->data[7]++; } - UpdateObjectEventCurrentMovement(&gObjectEvents[sprite->data[0]], sprite, MovementType_Buried_Callback); + UpdateObjectEventCurrentMovement(&gObjectEvents[sprite->sObjEventId], sprite, MovementType_Buried_Callback); } static bool8 MovementType_Buried_Callback(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - return gMovementTypeFuncs_Buried[sprite->data[1]](objectEvent, sprite); + return gMovementTypeFuncs_Buried[sprite->sTypeFuncId](objectEvent, sprite); } bool8 MovementType_Buried_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) @@ -4496,7 +4466,7 @@ bool8 MovementType_MoveInPlace_Step1(struct ObjectEvent *objectEvent, struct Spr { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - sprite->data[1] = 0; + sprite->sTypeFuncId = 0; } return FALSE; } @@ -4507,7 +4477,7 @@ bool8 MovementType_WalkInPlace_Step0(struct ObjectEvent *objectEvent, struct Spr { ClearObjectEventMovement(objectEvent, sprite); ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkInPlaceNormalMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -4517,7 +4487,7 @@ bool8 MovementType_WalkSlowlyInPlace_Step0(struct ObjectEvent *objectEvent, stru { ClearObjectEventMovement(objectEvent, sprite); ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkInPlaceSlowMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -4527,7 +4497,7 @@ bool8 MovementType_JogInPlace_Step0(struct ObjectEvent *objectEvent, struct Spri { ClearObjectEventMovement(objectEvent, sprite); ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkInPlaceFastMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -4537,7 +4507,7 @@ bool8 MovementType_RunInPlace_Step0(struct ObjectEvent *objectEvent, struct Spri { ClearObjectEventMovement(objectEvent, sprite); ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkInPlaceFastestMovementAction(objectEvent->facingDirection)); - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } @@ -4548,14 +4518,14 @@ bool8 MovementType_Invisible_Step0(struct ObjectEvent *objectEvent, struct Sprit ClearObjectEventMovement(objectEvent, sprite); ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(objectEvent->facingDirection)); objectEvent->invisible = TRUE; - sprite->data[1] = 1; + sprite->sTypeFuncId = 1; return TRUE; } bool8 MovementType_Invisible_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - sprite->data[1] = 2; + sprite->sTypeFuncId = 2; return TRUE; } return FALSE; @@ -4573,82 +4543,82 @@ static void ClearObjectEventMovement(struct ObjectEvent *objectEvent, struct Spr objectEvent->heldMovementActive = FALSE; objectEvent->heldMovementFinished = FALSE; objectEvent->movementActionId = 0xFF; - sprite->data[1] = 0; + sprite->sTypeFuncId = 0; } u8 GetFaceDirectionAnimNum(u8 direction) { - return gFaceDirectionAnimNums[direction]; + return sFaceDirectionAnimNums[direction]; } u8 GetMoveDirectionAnimNum(u8 direction) { - return gMoveDirectionAnimNums[direction]; + return sMoveDirectionAnimNums[direction]; } u8 GetMoveDirectionFastAnimNum(u8 direction) { - return gMoveDirectionFastAnimNums[direction]; + return sMoveDirectionFastAnimNums[direction]; } u8 GetMoveDirectionFasterAnimNum(u8 direction) { - return gMoveDirectionFasterAnimNums[direction]; + return sMoveDirectionFasterAnimNums[direction]; } u8 GetMoveDirectionFastestAnimNum(u8 direction) { - return gMoveDirectionFastestAnimNums[direction]; + return sMoveDirectionFastestAnimNums[direction]; } u8 GetJumpSpecialDirectionAnimNum(u8 direction) { - return gJumpSpecialDirectionAnimNums[direction]; + return sJumpSpecialDirectionAnimNums[direction]; } u8 GetAcroWheelieDirectionAnimNum(u8 direction) { - return gAcroWheelieDirectionAnimNums[direction]; + return sAcroWheelieDirectionAnimNums[direction]; } -u8 Unref_GetAnimNums_08375633(u8 direction) +u8 GetAcroUnusedDirectionAnimNum(u8 direction) { - return gUnrefAnimNums_08375633[direction]; + return sAcroUnusedDirectionAnimNums[direction]; } u8 GetAcroEndWheelieDirectionAnimNum(u8 direction) { - return gAcroEndWheelieDirectionAnimNums[direction]; + return sAcroEndWheelieDirectionAnimNums[direction]; } u8 GetAcroUnusedActionDirectionAnimNum(u8 direction) { - return gAcroUnusedActionDirectionAnimNums[direction]; + return sAcroUnusedActionDirectionAnimNums[direction]; } u8 GetAcroWheeliePedalDirectionAnimNum(u8 direction) { - return gAcroWheeliePedalDirectionAnimNums[direction]; + return sAcroWheeliePedalDirectionAnimNums[direction]; } u8 GetFishingDirectionAnimNum(u8 direction) { - return gFishingDirectionAnimNums[direction]; + return sFishingDirectionAnimNums[direction]; } u8 GetFishingNoCatchDirectionAnimNum(u8 direction) { - return gFishingNoCatchDirectionAnimNums[direction]; + return sFishingNoCatchDirectionAnimNums[direction]; } u8 GetFishingBiteDirectionAnimNum(u8 direction) { - return gFishingBiteDirectionAnimNums[direction]; + return sFishingBiteDirectionAnimNums[direction]; } u8 GetRunningDirectionAnimNum(u8 direction) { - return gRunningDirectionAnimNums[direction]; + return sRunningDirectionAnimNums[direction]; } static const struct UnkStruct_085094AC *sub_8092A4C(const union AnimCmd *const *anims) @@ -4658,9 +4628,7 @@ static const struct UnkStruct_085094AC *sub_8092A4C(const union AnimCmd *const * for (retval = gUnknown_085094AC; retval->anims != NULL; retval++) { if (retval->anims == anims) - { return retval; - } } return NULL; } @@ -4710,22 +4678,17 @@ void obj_npc_animation_step(struct ObjectEvent *objectEvent, struct Sprite *spri } } -// file boundary? - -u8 GetDirectionToFace(s16 x1, s16 y1, s16 x2, s16 y2) +u8 GetDirectionToFace(s16 x, s16 y, s16 targetX, s16 targetY) { - if (x1 > x2) - { + if (x > targetX) return DIR_WEST; - } - if (x1 < x2) - { + + if (x < targetX) return DIR_EAST; - } - if (y1 > y2) - { + + if (y > targetY) return DIR_NORTH; - } + return DIR_SOUTH; } @@ -4735,7 +4698,7 @@ void SetTrainerMovementType(struct ObjectEvent *objectEvent, u8 movementType) objectEvent->directionSequenceIndex = 0; objectEvent->playerCopyableMovement = 0; gSprites[objectEvent->spriteId].callback = sMovementTypeCallbacks[movementType]; - gSprites[objectEvent->spriteId].data[1] = 0; + gSprites[objectEvent->spriteId].sTypeFuncId = 0; } u8 GetTrainerFacingDirectionMovementType(u8 direction) @@ -4745,10 +4708,8 @@ u8 GetTrainerFacingDirectionMovementType(u8 direction) static u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction) { - s16 x; - s16 y; - x = objectEvent->currentCoords.x; - y = objectEvent->currentCoords.y; + s16 x = objectEvent->currentCoords.x; + s16 y = objectEvent->currentCoords.y; MoveCoords(direction, &x, &y); return GetCollisionAtCoords(objectEvent, x, y, direction); } @@ -4795,19 +4756,17 @@ static bool8 IsCoordOutsideObjectEventMovementRange(struct ObjectEvent *objectEv { left = objectEvent->initialCoords.x - objectEvent->rangeX; right = objectEvent->initialCoords.x + objectEvent->rangeX; + if (left > x || right < x) - { return TRUE; - } } if (objectEvent->rangeY != 0) { top = objectEvent->initialCoords.y - objectEvent->rangeY; bottom = objectEvent->initialCoords.y + objectEvent->rangeY; + if (top > y || bottom < y) - { return TRUE; - } } return FALSE; } @@ -4867,13 +4826,17 @@ void SetBerryTreeJustPicked(u8 localId, u8 mapNum, u8 mapGroup) } } +#undef sTimer +#undef sBerryTreeFlags + void MoveCoords(u8 direction, s16 *x, s16 *y) { *x += sDirectionToVectors[direction].x; *y += sDirectionToVectors[direction].y; } -void sub_8092F60(u8 direction, s16 *x, s16 *y) +// Unused +static void MoveCoordsInMapCoordIncrement(u8 direction, s16 *x, s16 *y) { *x += sDirectionToVectors[direction].x << 4; *y += sDirectionToVectors[direction].y << 4; @@ -4894,7 +4857,7 @@ static void MoveCoordsInDirection(u32 dir, s16 *x, s16 *y, s16 deltaX, s16 delta *y -= dy2; } -void sub_8092FF0(s16 x, s16 y, s16 *destX, s16 *destY) +void GetMapCoordsFromSpritePos(s16 x, s16 y, s16 *destX, s16 *destY) { *destX = (x - gSaveBlock1Ptr->pos.x) << 4; *destY = (y - gSaveBlock1Ptr->pos.y) << 4; @@ -4933,22 +4896,18 @@ static void GetObjectEventMovingCameraOffset(s16 *x, s16 *y) { *x = 0; *y = 0; + if (gFieldCamera.x > 0) - { (*x)++; - } + if (gFieldCamera.x < 0) - { - (*x) --; - } + (*x)--; + if (gFieldCamera.y > 0) - { (*y)++; - } + if (gFieldCamera.y < 0) - { - (*y) --; - } + (*y)--; } void ObjectEventMoveDestCoords(struct ObjectEvent *objectEvent, u32 direction, s16 *x, s16 *y) @@ -4984,7 +4943,7 @@ bool8 ObjectEventSetHeldMovement(struct ObjectEvent *objectEvent, u8 movementAct objectEvent->movementActionId = movementActionId; objectEvent->heldMovementActive = TRUE; objectEvent->heldMovementFinished = FALSE; - gSprites[objectEvent->spriteId].data[2] = 0; + gSprites[objectEvent->spriteId].sActionFuncId = 0; return FALSE; } @@ -5005,8 +4964,8 @@ void ObjectEventClearHeldMovement(struct ObjectEvent *objectEvent) objectEvent->movementActionId = 0xFF; objectEvent->heldMovementActive = FALSE; objectEvent->heldMovementFinished = FALSE; - gSprites[objectEvent->spriteId].data[1] = 0; - gSprites[objectEvent->spriteId].data[2] = 0; + gSprites[objectEvent->spriteId].sTypeFuncId = 0; + gSprites[objectEvent->spriteId].sActionFuncId = 0; } u8 ObjectEventCheckHeldMovementStatus(struct ObjectEvent *objectEvent) @@ -5031,7 +4990,7 @@ u8 ObjectEventGetHeldMovementActionId(struct ObjectEvent *objectEvent) if (objectEvent->heldMovementActive) return objectEvent->movementActionId; - return 0xFF; + return MOVEMENT_ACTION_NONE; } void UpdateObjectEventCurrentMovement(struct ObjectEvent *objectEvent, struct Sprite *sprite, bool8 (*callback)(struct ObjectEvent *, struct Sprite *)) @@ -5100,10 +5059,10 @@ dirn_to_anim(GetAcroEndWheelieMoveDirectionMovementAction, gAcroEndWheelieMoveDi u8 GetOppositeDirection(u8 direction) { - u8 directions[sizeof gOppositeDirections]; + u8 directions[sizeof sOppositeDirections]; - memcpy(directions, gOppositeDirections, sizeof gOppositeDirections); - if (direction < 1 || direction > (sizeof gOppositeDirections)) + memcpy(directions, sOppositeDirections, sizeof sOppositeDirections); + if (direction <= DIR_NONE || direction > (sizeof sOppositeDirections)) { return direction; } @@ -5133,7 +5092,7 @@ static u32 state_to_direction(u8 a0, u32 a1, u32 a2) static void ObjectEventExecHeldMovementAction(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (gMovementActionFuncs[objectEvent->movementActionId][sprite->data[2]](objectEvent, sprite)) + if (gMovementActionFuncs[objectEvent->movementActionId][sprite->sActionFuncId](objectEvent, sprite)) { objectEvent->heldMovementFinished = TRUE; } @@ -5141,10 +5100,10 @@ static void ObjectEventExecHeldMovementAction(struct ObjectEvent *objectEvent, s static bool8 ObjectEventExecSingleMovementAction(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (gMovementActionFuncs[objectEvent->movementActionId][sprite->data[2]](objectEvent, sprite)) + if (gMovementActionFuncs[objectEvent->movementActionId][sprite->sActionFuncId](objectEvent, sprite)) { objectEvent->movementActionId = 0xFF; - sprite->data[2] = 0; + sprite->sActionFuncId = 0; return TRUE; } return FALSE; @@ -5153,7 +5112,7 @@ static bool8 ObjectEventExecSingleMovementAction(struct ObjectEvent *objectEvent static void ObjectEventSetSingleMovement(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 animId) { objectEvent->movementActionId = animId; - sprite->data[2] = 0; + sprite->sActionFuncId = 0; } static void FaceDirection(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) @@ -5162,7 +5121,7 @@ static void FaceDirection(struct ObjectEvent *objectEvent, struct Sprite *sprite ShiftStillObjectEventCoords(objectEvent); obj_npc_animation_step(objectEvent, sprite, GetMoveDirectionAnimNum(objectEvent->facingDirection)); sprite->animPaused = TRUE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; } bool8 MovementAction_FaceDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) @@ -5201,30 +5160,30 @@ void npc_apply_direction(struct ObjectEvent *objectEvent, struct Sprite *sprite, ShiftObjectEventCoords(objectEvent, x, y); oamt_npc_ministep_reset(sprite, direction, speed); sprite->animPaused = FALSE; - if (gLockedAnimObjectEvents != NULL && FindLockedObjectEventIndex(objectEvent) != OBJECT_EVENTS_COUNT) + if (sLockedAnimObjectEvents != NULL && FindLockedObjectEventIndex(objectEvent) != OBJECT_EVENTS_COUNT) { sprite->animPaused = TRUE; } objectEvent->triggerGroundEffectsOnMove = TRUE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; } -void do_go_anim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) +static void InitMovementNormal(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) { - u8 (*functions[ARRAY_COUNT(gUnknown_0850DEE8)])(u8); + u8 (*functions[ARRAY_COUNT(sDirectionAnimFuncsBySpeed)])(u8); - memcpy(functions, gUnknown_0850DEE8, sizeof gUnknown_0850DEE8); + memcpy(functions, sDirectionAnimFuncsBySpeed, sizeof sDirectionAnimFuncsBySpeed); npc_apply_direction(objectEvent, sprite, direction, speed); npc_apply_anim_looping(objectEvent, sprite, functions[speed](objectEvent->facingDirection)); } -void StartRunningAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) +static void StartRunningAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) { npc_apply_direction(objectEvent, sprite, direction, 1); npc_apply_anim_looping(objectEvent, sprite, GetRunningDirectionAnimNum(objectEvent->facingDirection)); } -bool8 npc_obj_ministep_stop_on_arrival(struct ObjectEvent *objectEvent, struct Sprite *sprite) +static bool8 UpdateMovementNormal(struct ObjectEvent *objectEvent, struct Sprite *sprite) { if (obj_npc_ministep(sprite)) { @@ -5236,7 +5195,7 @@ bool8 npc_obj_ministep_stop_on_arrival(struct ObjectEvent *objectEvent, struct S return FALSE; } -void sub_8093AF0(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) +static void InitNpcForWalkSlow(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) { s16 x; s16 y; @@ -5246,21 +5205,21 @@ void sub_8093AF0(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 dire SetObjectEventDirection(objectEvent, direction); MoveCoords(direction, &x, &y); ShiftObjectEventCoords(objectEvent, x, y); - sub_80976DC(sprite, direction); + SetWalkSlowSpriteData(sprite, direction); sprite->animPaused = FALSE; objectEvent->triggerGroundEffectsOnMove = TRUE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; } -void sub_8093B60(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) +static void InitWalkSlow(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) { - sub_8093AF0(objectEvent, sprite, direction); + InitNpcForWalkSlow(objectEvent, sprite, direction); npc_apply_anim_looping(objectEvent, sprite, GetMoveDirectionAnimNum(objectEvent->facingDirection)); } -bool8 an_walk_any_2(struct ObjectEvent *objectEvent, struct Sprite *sprite) +static bool8 UpdateWalkSlow(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80976EC(sprite)) + if (UpdateWalkSlowAnim(sprite)) { ShiftStillObjectEventCoords(objectEvent); objectEvent->triggerGroundEffectsOnStop = TRUE; @@ -5272,15 +5231,15 @@ bool8 an_walk_any_2(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_WalkSlowDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8093B60(objectEvent, sprite, DIR_NORTHWEST); + InitWalkSlow(objectEvent, sprite, DIR_NORTHWEST); return MovementAction_WalkSlowDiagonalUpLeft_Step1(objectEvent, sprite); } bool8 MovementAction_WalkSlowDiagonalUpLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (an_walk_any_2(objectEvent, sprite)) + if (UpdateWalkSlow(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5288,15 +5247,15 @@ bool8 MovementAction_WalkSlowDiagonalUpLeft_Step1(struct ObjectEvent *objectEven bool8 MovementAction_WalkSlowDiagonalUpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8093B60(objectEvent, sprite, DIR_NORTHEAST); + InitWalkSlow(objectEvent, sprite, DIR_NORTHEAST); return MovementAction_WalkSlowDiagonalUpRight_Step1(objectEvent, sprite); } bool8 MovementAction_WalkSlowDiagonalUpRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (an_walk_any_2(objectEvent, sprite)) + if (UpdateWalkSlow(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5304,15 +5263,15 @@ bool8 MovementAction_WalkSlowDiagonalUpRight_Step1(struct ObjectEvent *objectEve bool8 MovementAction_WalkSlowDiagonalDownLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8093B60(objectEvent, sprite, DIR_SOUTHWEST); + InitWalkSlow(objectEvent, sprite, DIR_SOUTHWEST); return MovementAction_WalkSlowDiagonalDownLeft_Step1(objectEvent, sprite); } bool8 MovementAction_WalkSlowDiagonalDownLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (an_walk_any_2(objectEvent, sprite)) + if (UpdateWalkSlow(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5320,15 +5279,15 @@ bool8 MovementAction_WalkSlowDiagonalDownLeft_Step1(struct ObjectEvent *objectEv bool8 MovementAction_WalkSlowDiagonalDownRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8093B60(objectEvent, sprite, DIR_SOUTHEAST); + InitWalkSlow(objectEvent, sprite, DIR_SOUTHEAST); return MovementAction_WalkSlowDiagonalDownRight_Step1(objectEvent, sprite); } bool8 MovementAction_WalkSlowDiagonalDownRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (an_walk_any_2(objectEvent, sprite)) + if (UpdateWalkSlow(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5336,15 +5295,15 @@ bool8 MovementAction_WalkSlowDiagonalDownRight_Step1(struct ObjectEvent *objectE bool8 MovementAction_WalkSlowDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8093B60(objectEvent, sprite, DIR_SOUTH); + InitWalkSlow(objectEvent, sprite, DIR_SOUTH); return MovementAction_WalkSlowDown_Step1(objectEvent, sprite); } bool8 MovementAction_WalkSlowDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (an_walk_any_2(objectEvent, sprite)) + if (UpdateWalkSlow(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5352,15 +5311,15 @@ bool8 MovementAction_WalkSlowDown_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkSlowUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8093B60(objectEvent, sprite, DIR_NORTH); + InitWalkSlow(objectEvent, sprite, DIR_NORTH); return MovementAction_WalkSlowUp_Step1(objectEvent, sprite); } bool8 MovementAction_WalkSlowUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (an_walk_any_2(objectEvent, sprite)) + if (UpdateWalkSlow(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5368,15 +5327,15 @@ bool8 MovementAction_WalkSlowUp_Step1(struct ObjectEvent *objectEvent, struct Sp bool8 MovementAction_WalkSlowLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8093B60(objectEvent, sprite, DIR_WEST); + InitWalkSlow(objectEvent, sprite, DIR_WEST); return MovementAction_WalkSlowLeft_Step1(objectEvent, sprite); } bool8 MovementAction_WalkSlowLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (an_walk_any_2(objectEvent, sprite)) + if (UpdateWalkSlow(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5384,15 +5343,15 @@ bool8 MovementAction_WalkSlowLeft_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkSlowRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8093B60(objectEvent, sprite, DIR_EAST); + InitWalkSlow(objectEvent, sprite, DIR_EAST); return MovementAction_WalkSlowRight_Step1(objectEvent, sprite); } bool8 MovementAction_WalkSlowRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (an_walk_any_2(objectEvent, sprite)) + if (UpdateWalkSlow(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5400,15 +5359,15 @@ bool8 MovementAction_WalkSlowRight_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkNormalDiagonalUpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_NORTHWEST, 0); + InitMovementNormal(objectEvent, sprite, DIR_NORTHWEST, 0); return MovementAction_WalkNormalDiagonalUpLeft_Step1(objectEvent, sprite); } bool8 MovementAction_WalkNormalDiagonalUpLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5416,15 +5375,15 @@ bool8 MovementAction_WalkNormalDiagonalUpLeft_Step1(struct ObjectEvent *objectEv bool8 MovementAction_WalkNormalDiagonalUpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_NORTHEAST, 0); + InitMovementNormal(objectEvent, sprite, DIR_NORTHEAST, 0); return MovementAction_WalkNormalDiagonalUpRight_Step1(objectEvent, sprite); } bool8 MovementAction_WalkNormalDiagonalUpRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5432,15 +5391,15 @@ bool8 MovementAction_WalkNormalDiagonalUpRight_Step1(struct ObjectEvent *objectE bool8 MovementAction_WalkNormalDiagonalDownLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_SOUTHWEST, 0); + InitMovementNormal(objectEvent, sprite, DIR_SOUTHWEST, 0); return MovementAction_WalkNormalDiagonalDownLeft_Step1(objectEvent, sprite); } bool8 MovementAction_WalkNormalDiagonalDownLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5448,15 +5407,15 @@ bool8 MovementAction_WalkNormalDiagonalDownLeft_Step1(struct ObjectEvent *object bool8 MovementAction_WalkNormalDiagonalDownRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_SOUTHEAST, 0); + InitMovementNormal(objectEvent, sprite, DIR_SOUTHEAST, 0); return MovementAction_WalkNormalDiagonalDownRight_Step1(objectEvent, sprite); } bool8 MovementAction_WalkNormalDiagonalDownRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5464,15 +5423,15 @@ bool8 MovementAction_WalkNormalDiagonalDownRight_Step1(struct ObjectEvent *objec bool8 MovementAction_WalkNormalDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_SOUTH, 0); + InitMovementNormal(objectEvent, sprite, DIR_SOUTH, 0); return MovementAction_WalkNormalDown_Step1(objectEvent, sprite); } bool8 MovementAction_WalkNormalDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5480,15 +5439,15 @@ bool8 MovementAction_WalkNormalDown_Step1(struct ObjectEvent *objectEvent, struc bool8 MovementAction_WalkNormalUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_NORTH, 0); + InitMovementNormal(objectEvent, sprite, DIR_NORTH, 0); return MovementAction_WalkNormalUp_Step1(objectEvent, sprite); } bool8 MovementAction_WalkNormalUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5496,15 +5455,15 @@ bool8 MovementAction_WalkNormalUp_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkNormalLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_WEST, 0); + InitMovementNormal(objectEvent, sprite, DIR_WEST, 0); return MovementAction_WalkNormalLeft_Step1(objectEvent, sprite); } bool8 MovementAction_WalkNormalLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5512,21 +5471,30 @@ bool8 MovementAction_WalkNormalLeft_Step1(struct ObjectEvent *objectEvent, struc bool8 MovementAction_WalkNormalRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_EAST, 0); + InitMovementNormal(objectEvent, sprite, DIR_EAST, 0); return MovementAction_WalkNormalRight_Step1(objectEvent, sprite); } bool8 MovementAction_WalkNormalRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; } -void sub_8093FC4(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed, u8 a5) +#define JUMP_HALFWAY 1 +#define JUMP_FINISHED ((u8)-1) + +enum { + JUMP_TYPE_HIGH, + JUMP_TYPE_LOW, + JUMP_TYPE_NORMAL, +}; + +static void InitJump(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed, u8 type) { s16 displacements[ARRAY_COUNT(gUnknown_0850DFBC)]; s16 x; @@ -5538,21 +5506,21 @@ void sub_8093FC4(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 dire SetObjectEventDirection(objectEvent, direction); MoveCoordsInDirection(direction, &x, &y, displacements[speed], displacements[speed]); ShiftObjectEventCoords(objectEvent, objectEvent->currentCoords.x + x, objectEvent->currentCoords.y + y); - sub_809783C(sprite, direction, speed, a5); - sprite->data[2] = 1; - sprite->animPaused = 0; - objectEvent->triggerGroundEffectsOnMove = 1; - objectEvent->disableCoveringGroundEffects = 1; + SetJumpSpriteData(sprite, direction, speed, type); + sprite->sActionFuncId = 1; + sprite->animPaused = FALSE; + objectEvent->triggerGroundEffectsOnMove = TRUE; + objectEvent->disableCoveringGroundEffects = TRUE; } -void maybe_shadow_1(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed, u8 a4) +static void InitJumpRegular(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed, u8 type) { - sub_8093FC4(objectEvent, sprite, direction, speed, a4); + InitJump(objectEvent, sprite, direction, speed, type); npc_apply_anim_looping(objectEvent, sprite, GetMoveDirectionAnimNum(objectEvent->facingDirection)); DoShadowFieldEffect(objectEvent); } -u8 sub_80940C4(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 callback(struct Sprite *)) +static u8 UpdateJumpAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 callback(struct Sprite *)) { s16 displacements[ARRAY_COUNT(gUnknown_0850DFC2)]; s16 x; @@ -5561,7 +5529,7 @@ u8 sub_80940C4(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 callba memcpy(displacements, gUnknown_0850DFC2, sizeof gUnknown_0850DFC2); result = callback(sprite); - if (result == 1 && displacements[sprite->data[4]] != 0) + if (result == JUMP_HALFWAY && displacements[sprite->data[4]] != 0) { x = 0; y = 0; @@ -5570,7 +5538,7 @@ u8 sub_80940C4(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 callba objectEvent->triggerGroundEffectsOnMove = TRUE; objectEvent->disableCoveringGroundEffects = TRUE; } - else if (result == 0xFF) + else if (result == JUMP_FINISHED) { ShiftStillObjectEventCoords(objectEvent); objectEvent->triggerGroundEffectsOnStop = TRUE; @@ -5580,41 +5548,39 @@ u8 sub_80940C4(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 callba return result; } -u8 sub_8094188(struct ObjectEvent *objectEvent, struct Sprite *sprite) +static u8 DoJumpAnimStep(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - return sub_80940C4(objectEvent, sprite, sub_809785C); + return UpdateJumpAnim(objectEvent, sprite, DoJumpSpriteMovement); } -u8 sub_809419C(struct ObjectEvent *objectEvent, struct Sprite *sprite) +static u8 DoJumpSpecialAnimStep(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - return sub_80940C4(objectEvent, sprite, sub_80978E4); + return UpdateJumpAnim(objectEvent, sprite, DoJumpSpecialSpriteMovement); } -bool8 sub_80941B0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +static bool8 DoJumpAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_8094188(objectEvent, sprite) == 0xFF) - { + if (DoJumpAnimStep(objectEvent, sprite) == JUMP_FINISHED) return TRUE; - } + return FALSE; } -bool8 sub_80941C8(struct ObjectEvent *objectEvent, struct Sprite *sprite) +static bool8 DoJumpSpecialAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_809419C(objectEvent, sprite) == 0xFF) - { + if (DoJumpSpecialAnimStep(objectEvent, sprite) == JUMP_FINISHED) return TRUE; - } + return FALSE; } -bool8 sub_80941E0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +static bool8 DoJumpInPlaceAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - switch (sub_8094188(objectEvent, sprite)) + switch (DoJumpAnimStep(objectEvent, sprite)) { - case 255: + case JUMP_FINISHED: return TRUE; - case 1: + case JUMP_HALFWAY: SetObjectEventDirection(objectEvent, GetOppositeDirection(objectEvent->movementDirection)); obj_npc_animation_step(objectEvent, sprite, GetMoveDirectionAnimNum(objectEvent->facingDirection)); default: @@ -5624,16 +5590,16 @@ bool8 sub_80941E0(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_Jump2Down_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_SOUTH, 2, 0); + InitJumpRegular(objectEvent, sprite, DIR_SOUTH, 2, JUMP_TYPE_HIGH); return MovementAction_Jump2Down_Step1(objectEvent, sprite); } bool8 MovementAction_Jump2Down_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5641,16 +5607,16 @@ bool8 MovementAction_Jump2Down_Step1(struct ObjectEvent *objectEvent, struct Spr bool8 MovementAction_Jump2Up_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_NORTH, 2, 0); + InitJumpRegular(objectEvent, sprite, DIR_NORTH, 2, JUMP_TYPE_HIGH); return MovementAction_Jump2Up_Step1(objectEvent, sprite); } bool8 MovementAction_Jump2Up_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5658,16 +5624,16 @@ bool8 MovementAction_Jump2Up_Step1(struct ObjectEvent *objectEvent, struct Sprit bool8 MovementAction_Jump2Left_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_WEST, 2, 0); + InitJumpRegular(objectEvent, sprite, DIR_WEST, 2, JUMP_TYPE_HIGH); return MovementAction_Jump2Left_Step1(objectEvent, sprite); } bool8 MovementAction_Jump2Left_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5675,33 +5641,32 @@ bool8 MovementAction_Jump2Left_Step1(struct ObjectEvent *objectEvent, struct Spr bool8 MovementAction_Jump2Right_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_EAST, 2, 0); + InitJumpRegular(objectEvent, sprite, DIR_EAST, 2, JUMP_TYPE_HIGH); return MovementAction_Jump2Right_Step1(objectEvent, sprite); } bool8 MovementAction_Jump2Right_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; } - -void sub_8094390(struct Sprite *sprite, u16 duration) +static void InitMovementDelay(struct Sprite *sprite, u16 duration) { - sprite->data[2] = 1; + sprite->sActionFuncId = 1; sprite->data[3] = duration; } bool8 MovementAction_Delay_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (-- sprite->data[3] == 0) + if (--sprite->data[3] == 0) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5709,45 +5674,45 @@ bool8 MovementAction_Delay_Step1(struct ObjectEvent *objectEvent, struct Sprite bool8 MovementAction_Delay1_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094390(sprite, 1); + InitMovementDelay(sprite, 1); return MovementAction_Delay_Step1(objectEvent, sprite); } bool8 MovementAction_Delay2_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094390(sprite, 2); + InitMovementDelay(sprite, 2); return MovementAction_Delay_Step1(objectEvent, sprite); } bool8 MovementAction_Delay4_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094390(sprite, 4); + InitMovementDelay(sprite, 4); return MovementAction_Delay_Step1(objectEvent, sprite); } bool8 MovementAction_Delay8_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094390(sprite, 8); + InitMovementDelay(sprite, 8); return MovementAction_Delay_Step1(objectEvent, sprite); } bool8 MovementAction_Delay16_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094390(sprite, 16); + InitMovementDelay(sprite, 16); return MovementAction_Delay_Step1(objectEvent, sprite); } bool8 MovementAction_WalkFastDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_SOUTH, 1); + InitMovementNormal(objectEvent, sprite, DIR_SOUTH, 1); return MovementAction_WalkFastDown_Step1(objectEvent, sprite); } bool8 MovementAction_WalkFastDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5755,15 +5720,15 @@ bool8 MovementAction_WalkFastDown_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkFastUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_NORTH, 1); + InitMovementNormal(objectEvent, sprite, DIR_NORTH, 1); return MovementAction_WalkFastUp_Step1(objectEvent, sprite); } bool8 MovementAction_WalkFastUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5771,15 +5736,15 @@ bool8 MovementAction_WalkFastUp_Step1(struct ObjectEvent *objectEvent, struct Sp bool8 MovementAction_WalkFastLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_WEST, 1); + InitMovementNormal(objectEvent, sprite, DIR_WEST, 1); return MovementAction_WalkFastLeft_Step1(objectEvent, sprite); } bool8 MovementAction_WalkFastLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5787,27 +5752,27 @@ bool8 MovementAction_WalkFastLeft_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkFastRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_EAST, 1); + InitMovementNormal(objectEvent, sprite, DIR_EAST, 1); return MovementAction_WalkFastRight_Step1(objectEvent, sprite); } bool8 MovementAction_WalkFastRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; } -void sub_8094554(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 animNum, u16 duration) +static void InitMoveInPlace(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 animNum, u16 duration) { SetObjectEventDirection(objectEvent, direction); npc_apply_anim_looping(objectEvent, sprite, animNum); sprite->animPaused = FALSE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; sprite->data[3] = duration; } @@ -5815,7 +5780,7 @@ bool8 MovementAction_WalkInPlace_Step1(struct ObjectEvent *objectEvent, struct S { if (-- sprite->data[3] == 0) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; sprite->animPaused = TRUE; return TRUE; } @@ -5833,111 +5798,111 @@ bool8 MovementAction_WalkInPlaceSlow_Step1(struct ObjectEvent *objectEvent, stru bool8 MovementAction_WalkInPlaceSlowDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_SOUTH, GetMoveDirectionAnimNum(DIR_SOUTH), 32); + InitMoveInPlace(objectEvent, sprite, DIR_SOUTH, GetMoveDirectionAnimNum(DIR_SOUTH), 32); return MovementAction_WalkInPlaceSlow_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceSlowUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_NORTH, GetMoveDirectionAnimNum(DIR_NORTH), 32); + InitMoveInPlace(objectEvent, sprite, DIR_NORTH, GetMoveDirectionAnimNum(DIR_NORTH), 32); return MovementAction_WalkInPlaceSlow_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceSlowLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_WEST, GetMoveDirectionAnimNum(DIR_WEST), 32); + InitMoveInPlace(objectEvent, sprite, DIR_WEST, GetMoveDirectionAnimNum(DIR_WEST), 32); return MovementAction_WalkInPlaceSlow_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceSlowRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_EAST, GetMoveDirectionAnimNum(DIR_EAST), 32); + InitMoveInPlace(objectEvent, sprite, DIR_EAST, GetMoveDirectionAnimNum(DIR_EAST), 32); return MovementAction_WalkInPlaceSlow_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceNormalDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_SOUTH, GetMoveDirectionAnimNum(DIR_SOUTH), 16); + InitMoveInPlace(objectEvent, sprite, DIR_SOUTH, GetMoveDirectionAnimNum(DIR_SOUTH), 16); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceNormalUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_NORTH, GetMoveDirectionAnimNum(DIR_NORTH), 16); + InitMoveInPlace(objectEvent, sprite, DIR_NORTH, GetMoveDirectionAnimNum(DIR_NORTH), 16); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceNormalLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_WEST, GetMoveDirectionAnimNum(DIR_WEST), 16); + InitMoveInPlace(objectEvent, sprite, DIR_WEST, GetMoveDirectionAnimNum(DIR_WEST), 16); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceNormalRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_EAST, GetMoveDirectionAnimNum(DIR_EAST), 16); + InitMoveInPlace(objectEvent, sprite, DIR_EAST, GetMoveDirectionAnimNum(DIR_EAST), 16); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceFastDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_SOUTH, GetMoveDirectionFastAnimNum(DIR_SOUTH), 8); + InitMoveInPlace(objectEvent, sprite, DIR_SOUTH, GetMoveDirectionFastAnimNum(DIR_SOUTH), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceFastUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_NORTH, GetMoveDirectionFastAnimNum(DIR_NORTH), 8); + InitMoveInPlace(objectEvent, sprite, DIR_NORTH, GetMoveDirectionFastAnimNum(DIR_NORTH), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceFastLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_WEST, GetMoveDirectionFastAnimNum(DIR_WEST), 8); + InitMoveInPlace(objectEvent, sprite, DIR_WEST, GetMoveDirectionFastAnimNum(DIR_WEST), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceFastRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_EAST, GetMoveDirectionFastAnimNum(DIR_EAST), 8); + InitMoveInPlace(objectEvent, sprite, DIR_EAST, GetMoveDirectionFastAnimNum(DIR_EAST), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceFastestDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_SOUTH, GetMoveDirectionFasterAnimNum(DIR_SOUTH), 4); + InitMoveInPlace(objectEvent, sprite, DIR_SOUTH, GetMoveDirectionFasterAnimNum(DIR_SOUTH), 4); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceFastestUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_NORTH, GetMoveDirectionFasterAnimNum(DIR_NORTH), 4); + InitMoveInPlace(objectEvent, sprite, DIR_NORTH, GetMoveDirectionFasterAnimNum(DIR_NORTH), 4); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceFastestLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_WEST, GetMoveDirectionFasterAnimNum(DIR_WEST), 4); + InitMoveInPlace(objectEvent, sprite, DIR_WEST, GetMoveDirectionFasterAnimNum(DIR_WEST), 4); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_WalkInPlaceFastestRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_EAST, GetMoveDirectionFasterAnimNum(DIR_EAST), 4); + InitMoveInPlace(objectEvent, sprite, DIR_EAST, GetMoveDirectionFasterAnimNum(DIR_EAST), 4); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_RideWaterCurrentDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_SOUTH, 2); + InitMovementNormal(objectEvent, sprite, DIR_SOUTH, 2); return MovementAction_RideWaterCurrentDown_Step1(objectEvent, sprite); } bool8 MovementAction_RideWaterCurrentDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5945,15 +5910,15 @@ bool8 MovementAction_RideWaterCurrentDown_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_RideWaterCurrentUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_NORTH, 2); + InitMovementNormal(objectEvent, sprite, DIR_NORTH, 2); return MovementAction_RideWaterCurrentUp_Step1(objectEvent, sprite); } bool8 MovementAction_RideWaterCurrentUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5961,15 +5926,15 @@ bool8 MovementAction_RideWaterCurrentUp_Step1(struct ObjectEvent *objectEvent, s bool8 MovementAction_RideWaterCurrentLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_WEST, 2); + InitMovementNormal(objectEvent, sprite, DIR_WEST, 2); return MovementAction_RideWaterCurrentLeft_Step1(objectEvent, sprite); } bool8 MovementAction_RideWaterCurrentLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5977,15 +5942,15 @@ bool8 MovementAction_RideWaterCurrentLeft_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_RideWaterCurrentRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_EAST, 2); + InitMovementNormal(objectEvent, sprite, DIR_EAST, 2); return MovementAction_RideWaterCurrentRight_Step1(objectEvent, sprite); } bool8 MovementAction_RideWaterCurrentRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -5993,15 +5958,15 @@ bool8 MovementAction_RideWaterCurrentRight_Step1(struct ObjectEvent *objectEvent bool8 MovementAction_WalkFastestDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_SOUTH, 3); + InitMovementNormal(objectEvent, sprite, DIR_SOUTH, 3); return MovementAction_WalkFastestDown_Step1(objectEvent, sprite); } bool8 MovementAction_WalkFastestDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6009,15 +5974,15 @@ bool8 MovementAction_WalkFastestDown_Step1(struct ObjectEvent *objectEvent, stru bool8 MovementAction_WalkFastestUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_NORTH, 3); + InitMovementNormal(objectEvent, sprite, DIR_NORTH, 3); return MovementAction_WalkFastestUp_Step1(objectEvent, sprite); } bool8 MovementAction_WalkFastestUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6025,15 +5990,15 @@ bool8 MovementAction_WalkFastestUp_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_WalkFastestLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_WEST, 3); + InitMovementNormal(objectEvent, sprite, DIR_WEST, 3); return MovementAction_WalkFastestLeft_Step1(objectEvent, sprite); } bool8 MovementAction_WalkFastestLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6041,15 +6006,15 @@ bool8 MovementAction_WalkFastestLeft_Step1(struct ObjectEvent *objectEvent, stru bool8 MovementAction_WalkFastestRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_EAST, 3); + InitMovementNormal(objectEvent, sprite, DIR_EAST, 3); return MovementAction_WalkFastestRight_Step1(objectEvent, sprite); } bool8 MovementAction_WalkFastestRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6057,15 +6022,15 @@ bool8 MovementAction_WalkFastestRight_Step1(struct ObjectEvent *objectEvent, str bool8 MovementAction_SlideDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_SOUTH, 4); + InitMovementNormal(objectEvent, sprite, DIR_SOUTH, 4); return MovementAction_SlideDown_Step1(objectEvent, sprite); } bool8 MovementAction_SlideDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6073,15 +6038,15 @@ bool8 MovementAction_SlideDown_Step1(struct ObjectEvent *objectEvent, struct Spr bool8 MovementAction_SlideUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_NORTH, 4); + InitMovementNormal(objectEvent, sprite, DIR_NORTH, 4); return MovementAction_SlideUp_Step1(objectEvent, sprite); } bool8 MovementAction_SlideUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6089,15 +6054,15 @@ bool8 MovementAction_SlideUp_Step1(struct ObjectEvent *objectEvent, struct Sprit bool8 MovementAction_SlideLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_WEST, 4); + InitMovementNormal(objectEvent, sprite, DIR_WEST, 4); return MovementAction_SlideLeft_Step1(objectEvent, sprite); } bool8 MovementAction_SlideLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6105,15 +6070,15 @@ bool8 MovementAction_SlideLeft_Step1(struct ObjectEvent *objectEvent, struct Spr bool8 MovementAction_SlideRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_EAST, 4); + InitMovementNormal(objectEvent, sprite, DIR_EAST, 4); return MovementAction_SlideRight_Step1(objectEvent, sprite); } bool8 MovementAction_SlideRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6127,9 +6092,9 @@ bool8 MovementAction_PlayerRunDown_Step0(struct ObjectEvent *objectEvent, struct bool8 MovementAction_PlayerRunDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6143,9 +6108,9 @@ bool8 MovementAction_PlayerRunUp_Step0(struct ObjectEvent *objectEvent, struct S bool8 MovementAction_PlayerRunUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6159,9 +6124,9 @@ bool8 MovementAction_PlayerRunLeft_Step0(struct ObjectEvent *objectEvent, struct bool8 MovementAction_PlayerRunLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6175,9 +6140,9 @@ bool8 MovementAction_PlayerRunRight_Step0(struct ObjectEvent *objectEvent, struc bool8 MovementAction_PlayerRunRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6187,7 +6152,7 @@ void StartSpriteAnimInDirection(struct ObjectEvent *objectEvent, struct Sprite * { SetAndStartSpriteAnim(sprite, animNum, 0); SetObjectEventDirection(objectEvent, direction); - sprite->data[2] = 1; + sprite->sActionFuncId = 1; } bool8 MovementAction_StartAnimInDirection_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) @@ -6200,29 +6165,29 @@ bool8 MovementAction_WaitSpriteAnim(struct ObjectEvent *objectEvent, struct Spri { if (SpriteAnimEnded(sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; } -void sub_8094DE4(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) +static void InitJumpSpecial(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) { - sub_8093FC4(objectEvent, sprite, direction, 1, 0); + InitJump(objectEvent, sprite, direction, 1, JUMP_TYPE_HIGH); StartSpriteAnim(sprite, GetJumpSpecialDirectionAnimNum(direction)); } bool8 MovementAction_JumpSpecialDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094DE4(objectEvent, sprite, DIR_SOUTH); + InitJumpSpecial(objectEvent, sprite, DIR_SOUTH); return MovementAction_JumpSpecialDown_Step1(objectEvent, sprite); } bool8 MovementAction_JumpSpecialDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941C8(objectEvent, sprite)) + if (DoJumpSpecialAnim(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; objectEvent->landingJump = FALSE; return TRUE; } @@ -6231,15 +6196,15 @@ bool8 MovementAction_JumpSpecialDown_Step1(struct ObjectEvent *objectEvent, stru bool8 MovementAction_JumpSpecialUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094DE4(objectEvent, sprite, DIR_NORTH); + InitJumpSpecial(objectEvent, sprite, DIR_NORTH); return MovementAction_JumpSpecialUp_Step1(objectEvent, sprite); } bool8 MovementAction_JumpSpecialUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941C8(objectEvent, sprite)) + if (DoJumpSpecialAnim(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; objectEvent->landingJump = FALSE; return TRUE; } @@ -6248,15 +6213,15 @@ bool8 MovementAction_JumpSpecialUp_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_JumpSpecialLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094DE4(objectEvent, sprite, DIR_WEST); + InitJumpSpecial(objectEvent, sprite, DIR_WEST); return MovementAction_JumpSpecialLeft_Step1(objectEvent, sprite); } bool8 MovementAction_JumpSpecialLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941C8(objectEvent, sprite)) + if (DoJumpSpecialAnim(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; objectEvent->landingJump = FALSE; return TRUE; } @@ -6265,15 +6230,15 @@ bool8 MovementAction_JumpSpecialLeft_Step1(struct ObjectEvent *objectEvent, stru bool8 MovementAction_JumpSpecialRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094DE4(objectEvent, sprite, DIR_EAST); + InitJumpSpecial(objectEvent, sprite, DIR_EAST); return MovementAction_JumpSpecialRight_Step1(objectEvent, sprite); } bool8 MovementAction_JumpSpecialRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941C8(objectEvent, sprite)) + if (DoJumpSpecialAnim(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; objectEvent->landingJump = FALSE; return TRUE; } @@ -6288,7 +6253,7 @@ bool8 MovementAction_FacePlayer_Step0(struct ObjectEvent *objectEvent, struct Sp { FaceDirection(objectEvent, sprite, GetDirectionToFace(objectEvent->currentCoords.x, objectEvent->currentCoords.y, gObjectEvents[playerObjectId].currentCoords.x, gObjectEvents[playerObjectId].currentCoords.y)); } - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } @@ -6300,36 +6265,36 @@ bool8 MovementAction_FaceAwayPlayer_Step0(struct ObjectEvent *objectEvent, struc { FaceDirection(objectEvent, sprite, GetOppositeDirection(GetDirectionToFace(objectEvent->currentCoords.x, objectEvent->currentCoords.y, gObjectEvents[playerObjectId].currentCoords.x, gObjectEvents[playerObjectId].currentCoords.y))); } - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } bool8 MovementAction_LockFacingDirection_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->facingDirectionLocked = TRUE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } bool8 MovementAction_UnlockFacingDirection_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->facingDirectionLocked = FALSE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } bool8 MovementAction_JumpDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_SOUTH, 1, 2); + InitJumpRegular(objectEvent, sprite, DIR_SOUTH, 1, JUMP_TYPE_NORMAL); return MovementAction_JumpDown_Step1(objectEvent, sprite); } bool8 MovementAction_JumpDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = 0; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6337,16 +6302,16 @@ bool8 MovementAction_JumpDown_Step1(struct ObjectEvent *objectEvent, struct Spri bool8 MovementAction_JumpUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_NORTH, 1, 2); + InitJumpRegular(objectEvent, sprite, DIR_NORTH, 1, JUMP_TYPE_NORMAL); return MovementAction_JumpUp_Step1(objectEvent, sprite); } bool8 MovementAction_JumpUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = 0; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6354,16 +6319,16 @@ bool8 MovementAction_JumpUp_Step1(struct ObjectEvent *objectEvent, struct Sprite bool8 MovementAction_JumpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_WEST, 1, 2); + InitJumpRegular(objectEvent, sprite, DIR_WEST, 1, JUMP_TYPE_NORMAL); return MovementAction_JumpLeft_Step1(objectEvent, sprite); } bool8 MovementAction_JumpLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = 0; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6371,16 +6336,16 @@ bool8 MovementAction_JumpLeft_Step1(struct ObjectEvent *objectEvent, struct Spri bool8 MovementAction_JumpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_EAST, 1, 2); + InitJumpRegular(objectEvent, sprite, DIR_EAST, 1, JUMP_TYPE_NORMAL); return MovementAction_JumpRight_Step1(objectEvent, sprite); } bool8 MovementAction_JumpRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = 0; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6388,16 +6353,16 @@ bool8 MovementAction_JumpRight_Step1(struct ObjectEvent *objectEvent, struct Spr bool8 MovementAction_JumpInPlaceDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_SOUTH, 0, 0); + InitJumpRegular(objectEvent, sprite, DIR_SOUTH, 0, JUMP_TYPE_HIGH); return MovementAction_JumpInPlaceDown_Step1(objectEvent, sprite); } bool8 MovementAction_JumpInPlaceDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = 0; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6405,16 +6370,16 @@ bool8 MovementAction_JumpInPlaceDown_Step1(struct ObjectEvent *objectEvent, stru bool8 MovementAction_JumpInPlaceUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_NORTH, 0, 0); + InitJumpRegular(objectEvent, sprite, DIR_NORTH, 0, JUMP_TYPE_HIGH); return MovementAction_JumpInPlaceUp_Step1(objectEvent, sprite); } bool8 MovementAction_JumpInPlaceUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = 0; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6422,16 +6387,16 @@ bool8 MovementAction_JumpInPlaceUp_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_JumpInPlaceLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_WEST, 0, 0); + InitJumpRegular(objectEvent, sprite, DIR_WEST, 0, JUMP_TYPE_HIGH); return MovementAction_JumpInPlaceLeft_Step1(objectEvent, sprite); } bool8 MovementAction_JumpInPlaceLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = 0; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6439,16 +6404,16 @@ bool8 MovementAction_JumpInPlaceLeft_Step1(struct ObjectEvent *objectEvent, stru bool8 MovementAction_JumpInPlaceRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_EAST, 0, 0); + InitJumpRegular(objectEvent, sprite, DIR_EAST, 0, JUMP_TYPE_HIGH); return MovementAction_JumpInPlaceRight_Step1(objectEvent, sprite); } bool8 MovementAction_JumpInPlaceRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = 0; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6456,16 +6421,16 @@ bool8 MovementAction_JumpInPlaceRight_Step1(struct ObjectEvent *objectEvent, str bool8 MovementAction_JumpInPlaceDownUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_SOUTH, 0, 2); + InitJumpRegular(objectEvent, sprite, DIR_SOUTH, 0, JUMP_TYPE_NORMAL); return MovementAction_JumpInPlaceDownUp_Step1(objectEvent, sprite); } bool8 MovementAction_JumpInPlaceDownUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941E0(objectEvent, sprite)) + if (DoJumpInPlaceAnim(objectEvent, sprite)) { objectEvent->hasShadow = 0; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6473,16 +6438,16 @@ bool8 MovementAction_JumpInPlaceDownUp_Step1(struct ObjectEvent *objectEvent, st bool8 MovementAction_JumpInPlaceUpDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_NORTH, 0, 2); + InitJumpRegular(objectEvent, sprite, DIR_NORTH, 0, JUMP_TYPE_NORMAL); return MovementAction_JumpInPlaceUpDown_Step1(objectEvent, sprite); } bool8 MovementAction_JumpInPlaceUpDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941E0(objectEvent, sprite)) + if (DoJumpInPlaceAnim(objectEvent, sprite)) { objectEvent->hasShadow = 0; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6490,16 +6455,16 @@ bool8 MovementAction_JumpInPlaceUpDown_Step1(struct ObjectEvent *objectEvent, st bool8 MovementAction_JumpInPlaceLeftRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_WEST, 0, 2); + InitJumpRegular(objectEvent, sprite, DIR_WEST, 0, JUMP_TYPE_NORMAL); return MovementAction_JumpInPlaceLeftRight_Step1(objectEvent, sprite); } bool8 MovementAction_JumpInPlaceLeftRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941E0(objectEvent, sprite)) + if (DoJumpInPlaceAnim(objectEvent, sprite)) { objectEvent->hasShadow = 0; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6507,16 +6472,16 @@ bool8 MovementAction_JumpInPlaceLeftRight_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_JumpInPlaceRightLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - maybe_shadow_1(objectEvent, sprite, DIR_EAST, 0, 2); + InitJumpRegular(objectEvent, sprite, DIR_EAST, 0, JUMP_TYPE_NORMAL); return MovementAction_JumpInPlaceRightLeft_Step1(objectEvent, sprite); } bool8 MovementAction_JumpInPlaceRightLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941E0(objectEvent, sprite)) + if (DoJumpInPlaceAnim(objectEvent, sprite)) { objectEvent->hasShadow = 0; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6537,42 +6502,42 @@ bool8 MovementAction_NurseJoyBowDown_Step0(struct ObjectEvent *objectEvent, stru bool8 MovementAction_EnableJumpLandingGroundEffect_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->disableJumpLandingGroundEffect = FALSE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } bool8 MovementAction_DisableJumpLandingGroundEffect_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->disableJumpLandingGroundEffect = TRUE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } bool8 MovementAction_DisableAnimation_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->inanimate = TRUE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } bool8 MovementAction_RestoreAnimation_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->inanimate = GetObjectEventGraphicsInfo(objectEvent->graphicsId)->inanimate; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } bool8 MovementAction_SetInvisible_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->invisible = TRUE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } bool8 MovementAction_SetVisible_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->invisible = FALSE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } @@ -6580,7 +6545,7 @@ bool8 MovementAction_EmoteExclamationMark_Step0(struct ObjectEvent *objectEvent, { ObjectEventGetLocalIdAndMap(objectEvent, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]); FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON); - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } @@ -6588,7 +6553,7 @@ bool8 MovementAction_EmoteQuestionMark_Step0(struct ObjectEvent *objectEvent, st { ObjectEventGetLocalIdAndMap(objectEvent, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]); FieldEffectStart(FLDEFF_QUESTION_MARK_ICON); - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } @@ -6596,7 +6561,7 @@ bool8 MovementAction_EmoteHeart_Step0(struct ObjectEvent *objectEvent, struct Sp { ObjectEventGetLocalIdAndMap(objectEvent, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]); FieldEffectStart(FLDEFF_HEART_ICON); - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } @@ -6609,11 +6574,11 @@ bool8 MovementAction_RevealTrainer_Step0(struct ObjectEvent *objectEvent, struct } if (objectEvent->movementType != MOVEMENT_TYPE_TREE_DISGUISE && objectEvent->movementType != MOVEMENT_TYPE_MOUNTAIN_DISGUISE) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } sub_8155D78(objectEvent); - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return MovementAction_RevealTrainer_Step1(objectEvent, sprite); } @@ -6621,7 +6586,7 @@ bool8 MovementAction_RevealTrainer_Step1(struct ObjectEvent *objectEvent, struct { if (sub_8155DA0(objectEvent)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6630,7 +6595,7 @@ bool8 MovementAction_RevealTrainer_Step1(struct ObjectEvent *objectEvent, struct bool8 MovementAction_RockSmashBreak_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { SetAndStartSpriteAnim(sprite, 1, 0); - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return FALSE; } @@ -6639,7 +6604,7 @@ bool8 MovementAction_RockSmashBreak_Step1(struct ObjectEvent *objectEvent, struc if (SpriteAnimEnded(sprite)) { SetMovementDelay(sprite, 32); - sprite->data[2] = 2; + sprite->sActionFuncId = 2; } return FALSE; } @@ -6650,7 +6615,7 @@ bool8 MovementAction_RockSmashBreak_Step2(struct ObjectEvent *objectEvent, struc if (WaitForMovementDelay(sprite)) { objectEvent->invisible = TRUE; - sprite->data[2] = 3; + sprite->sActionFuncId = 3; } return FALSE; } @@ -6658,7 +6623,7 @@ bool8 MovementAction_RockSmashBreak_Step2(struct ObjectEvent *objectEvent, struc bool8 MovementAction_CutTree_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { SetAndStartSpriteAnim(sprite, 1, 0); - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return FALSE; } @@ -6667,7 +6632,7 @@ bool8 MovementAction_CutTree_Step1(struct ObjectEvent *objectEvent, struct Sprit if (SpriteAnimEnded(sprite)) { SetMovementDelay(sprite, 32); - sprite->data[2] = 2; + sprite->sActionFuncId = 2; } return FALSE; } @@ -6678,7 +6643,7 @@ bool8 MovementAction_CutTree_Step2(struct ObjectEvent *objectEvent, struct Sprit if (WaitForMovementDelay(sprite)) { objectEvent->invisible = TRUE; - sprite->data[2] = 3; + sprite->sActionFuncId = 3; } return FALSE; } @@ -6686,14 +6651,14 @@ bool8 MovementAction_CutTree_Step2(struct ObjectEvent *objectEvent, struct Sprit bool8 MovementAction_SetFixedPriority_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->fixedPriority = TRUE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } bool8 MovementAction_ClearFixedPriority_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { objectEvent->fixedPriority = FALSE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } @@ -6728,7 +6693,7 @@ bool8 MovementAction_ShowReflection_Step0(struct ObjectEvent *objectEvent, struc bool8 MovementAction_WalkDownStartAffine_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8093B60(objectEvent, sprite, DIR_SOUTH); + InitWalkSlow(objectEvent, sprite, DIR_SOUTH); sprite->affineAnimPaused = FALSE; StartSpriteAffineAnimIfDifferent(sprite, 0); return MovementAction_WalkDownStartAffine_Step1(objectEvent, sprite); @@ -6736,10 +6701,10 @@ bool8 MovementAction_WalkDownStartAffine_Step0(struct ObjectEvent *objectEvent, bool8 MovementAction_WalkDownStartAffine_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (an_walk_any_2(objectEvent, sprite)) + if (UpdateWalkSlow(objectEvent, sprite)) { sprite->affineAnimPaused = TRUE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6747,7 +6712,7 @@ bool8 MovementAction_WalkDownStartAffine_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_WalkDownAffine_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8093B60(objectEvent, sprite, DIR_SOUTH); + InitWalkSlow(objectEvent, sprite, DIR_SOUTH); sprite->affineAnimPaused = FALSE; ChangeSpriteAffineAnimIfDifferent(sprite, 1); return MovementAction_WalkDownAffine_Step1(objectEvent, sprite); @@ -6755,10 +6720,10 @@ bool8 MovementAction_WalkDownAffine_Step0(struct ObjectEvent *objectEvent, struc bool8 MovementAction_WalkDownAffine_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (an_walk_any_2(objectEvent, sprite)) + if (UpdateWalkSlow(objectEvent, sprite)) { sprite->affineAnimPaused = TRUE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6766,7 +6731,7 @@ bool8 MovementAction_WalkDownAffine_Step1(struct ObjectEvent *objectEvent, struc bool8 MovementAction_WalkLeftAffine_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_WEST, 1); + InitMovementNormal(objectEvent, sprite, DIR_WEST, 1); sprite->affineAnimPaused = FALSE; ChangeSpriteAffineAnimIfDifferent(sprite, 2); return MovementAction_WalkLeftAffine_Step1(objectEvent, sprite); @@ -6774,10 +6739,10 @@ bool8 MovementAction_WalkLeftAffine_Step0(struct ObjectEvent *objectEvent, struc bool8 MovementAction_WalkLeftAffine_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { sprite->affineAnimPaused = TRUE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6785,7 +6750,7 @@ bool8 MovementAction_WalkLeftAffine_Step1(struct ObjectEvent *objectEvent, struc bool8 MovementAction_WalkRightAffine_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - do_go_anim(objectEvent, sprite, DIR_EAST, 1); + InitMovementNormal(objectEvent, sprite, DIR_EAST, 1); sprite->affineAnimPaused = FALSE; ChangeSpriteAffineAnimIfDifferent(sprite, 3); return MovementAction_WalkRightAffine_Step1(objectEvent, sprite); @@ -6793,45 +6758,45 @@ bool8 MovementAction_WalkRightAffine_Step0(struct ObjectEvent *objectEvent, stru bool8 MovementAction_WalkRightAffine_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { sprite->affineAnimPaused = TRUE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; } -static void sub_80958C0(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) +static void AcroWheelieFaceDirection(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) { SetObjectEventDirection(objectEvent, direction); ShiftStillObjectEventCoords(objectEvent); obj_npc_animation_step(objectEvent, sprite, GetAcroWheeliePedalDirectionAnimNum(direction)); sprite->animPaused = TRUE; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; } bool8 MovementAction_AcroWheelieFaceDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80958C0(objectEvent, sprite, DIR_SOUTH); + AcroWheelieFaceDirection(objectEvent, sprite, DIR_SOUTH); return TRUE; } bool8 MovementAction_AcroWheelieFaceUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80958C0(objectEvent, sprite, DIR_NORTH); + AcroWheelieFaceDirection(objectEvent, sprite, DIR_NORTH); return TRUE; } bool8 MovementAction_AcroWheelieFaceLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80958C0(objectEvent, sprite, DIR_WEST); + AcroWheelieFaceDirection(objectEvent, sprite, DIR_WEST); return TRUE; } bool8 MovementAction_AcroWheelieFaceRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80958C0(objectEvent, sprite, DIR_EAST); + AcroWheelieFaceDirection(objectEvent, sprite, DIR_EAST); return TRUE; } @@ -6928,7 +6893,7 @@ bool8 DoFigure8Anim(struct ObjectEvent *objectEvent, struct Sprite *sprite) bool8 MovementAction_Figure8_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { InitFigure8Anim(objectEvent, sprite); - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return MovementAction_Figure8_Step1(objectEvent, sprite); } @@ -6936,31 +6901,31 @@ bool8 MovementAction_Figure8_Step1(struct ObjectEvent *objectEvent, struct Sprit { if (DoFigure8Anim(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; } -void sub_8095B84(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed, u8 a4) +static void InitAcroWheelieJump(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed, u8 type) { - sub_8093FC4(objectEvent, sprite, direction, speed, a4); + InitJump(objectEvent, sprite, direction, speed, type); StartSpriteAnimIfDifferent(sprite, GetAcroWheelieDirectionAnimNum(direction)); DoShadowFieldEffect(objectEvent); } bool8 MovementAction_AcroWheelieHopFaceDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_SOUTH, 0, 1); + InitAcroWheelieJump(objectEvent, sprite, DIR_SOUTH, 0, JUMP_TYPE_LOW); return MovementAction_AcroWheelieHopFaceDown_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieHopFaceDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6968,16 +6933,16 @@ bool8 MovementAction_AcroWheelieHopFaceDown_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroWheelieHopFaceUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_NORTH, 0, 1); + InitAcroWheelieJump(objectEvent, sprite, DIR_NORTH, 0, JUMP_TYPE_LOW); return MovementAction_AcroWheelieHopFaceUp_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieHopFaceUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -6985,16 +6950,16 @@ bool8 MovementAction_AcroWheelieHopFaceUp_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieHopFaceLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_WEST, 0, 1); + InitAcroWheelieJump(objectEvent, sprite, DIR_WEST, 0, JUMP_TYPE_LOW); return MovementAction_AcroWheelieHopFaceLeft_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieHopFaceLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7002,16 +6967,16 @@ bool8 MovementAction_AcroWheelieHopFaceLeft_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroWheelieHopFaceRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_EAST, 0, 1); + InitAcroWheelieJump(objectEvent, sprite, DIR_EAST, 0, JUMP_TYPE_LOW); return MovementAction_AcroWheelieHopFaceRight_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieHopFaceRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7019,16 +6984,16 @@ bool8 MovementAction_AcroWheelieHopFaceRight_Step1(struct ObjectEvent *objectEve bool8 MovementAction_AcroWheelieHopDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_SOUTH, 1, 1); + InitAcroWheelieJump(objectEvent, sprite, DIR_SOUTH, 1, JUMP_TYPE_LOW); return MovementAction_AcroWheelieHopDown_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieHopDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7036,16 +7001,16 @@ bool8 MovementAction_AcroWheelieHopDown_Step1(struct ObjectEvent *objectEvent, s bool8 MovementAction_AcroWheelieHopUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_NORTH, 1, 1); + InitAcroWheelieJump(objectEvent, sprite, DIR_NORTH, 1, JUMP_TYPE_LOW); return MovementAction_AcroWheelieHopUp_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieHopUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7053,16 +7018,16 @@ bool8 MovementAction_AcroWheelieHopUp_Step1(struct ObjectEvent *objectEvent, str bool8 MovementAction_AcroWheelieHopLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_WEST, 1, 1); + InitAcroWheelieJump(objectEvent, sprite, DIR_WEST, 1, JUMP_TYPE_LOW); return MovementAction_AcroWheelieHopLeft_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieHopLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7070,16 +7035,16 @@ bool8 MovementAction_AcroWheelieHopLeft_Step1(struct ObjectEvent *objectEvent, s bool8 MovementAction_AcroWheelieHopRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_EAST, 1, 1); + InitAcroWheelieJump(objectEvent, sprite, DIR_EAST, 1, JUMP_TYPE_LOW); return MovementAction_AcroWheelieHopRight_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieHopRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7087,16 +7052,16 @@ bool8 MovementAction_AcroWheelieHopRight_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieJumpDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_SOUTH, 2, 0); + InitAcroWheelieJump(objectEvent, sprite, DIR_SOUTH, 2, JUMP_TYPE_HIGH); return MovementAction_AcroWheelieJumpDown_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieJumpDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7104,16 +7069,16 @@ bool8 MovementAction_AcroWheelieJumpDown_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieJumpUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_NORTH, 2, 0); + InitAcroWheelieJump(objectEvent, sprite, DIR_NORTH, 2, JUMP_TYPE_HIGH); return MovementAction_AcroWheelieJumpUp_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieJumpUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7121,16 +7086,16 @@ bool8 MovementAction_AcroWheelieJumpUp_Step1(struct ObjectEvent *objectEvent, st bool8 MovementAction_AcroWheelieJumpLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_WEST, 2, 0); + InitAcroWheelieJump(objectEvent, sprite, DIR_WEST, 2, JUMP_TYPE_HIGH); return MovementAction_AcroWheelieJumpLeft_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieJumpLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7138,16 +7103,16 @@ bool8 MovementAction_AcroWheelieJumpLeft_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieJumpRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8095B84(objectEvent, sprite, DIR_EAST, 2, 0); + InitAcroWheelieJump(objectEvent, sprite, DIR_EAST, 2, JUMP_TYPE_HIGH); return MovementAction_AcroWheelieJumpRight_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieJumpRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_80941B0(objectEvent, sprite)) + if (DoJumpAnim(objectEvent, sprite)) { objectEvent->hasShadow = FALSE; - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7155,29 +7120,29 @@ bool8 MovementAction_AcroWheelieJumpRight_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieInPlaceDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_SOUTH, GetAcroWheeliePedalDirectionAnimNum(DIR_SOUTH), 8); + InitMoveInPlace(objectEvent, sprite, DIR_SOUTH, GetAcroWheeliePedalDirectionAnimNum(DIR_SOUTH), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieInPlaceUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_NORTH, GetAcroWheeliePedalDirectionAnimNum(DIR_NORTH), 8); + InitMoveInPlace(objectEvent, sprite, DIR_NORTH, GetAcroWheeliePedalDirectionAnimNum(DIR_NORTH), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieInPlaceLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_WEST, GetAcroWheeliePedalDirectionAnimNum(DIR_WEST), 8); + InitMoveInPlace(objectEvent, sprite, DIR_WEST, GetAcroWheeliePedalDirectionAnimNum(DIR_WEST), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieInPlaceRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8094554(objectEvent, sprite, DIR_EAST, GetAcroWheeliePedalDirectionAnimNum(DIR_EAST), 8); + InitMoveInPlace(objectEvent, sprite, DIR_EAST, GetAcroWheeliePedalDirectionAnimNum(DIR_EAST), 8); return MovementAction_WalkInPlace_Step1(objectEvent, sprite); } -void sub_80960C8(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) +static void InitAcroPopWheelie(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) { npc_apply_direction(objectEvent, sprite, direction, speed); StartSpriteAnim(sprite, GetAcroWheelieDirectionAnimNum(objectEvent->facingDirection)); @@ -7186,15 +7151,15 @@ void sub_80960C8(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 dire bool8 MovementAction_AcroPopWheelieMoveDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80960C8(objectEvent, sprite, DIR_SOUTH, 1); + InitAcroPopWheelie(objectEvent, sprite, DIR_SOUTH, 1); return MovementAction_AcroPopWheelieMoveDown_Step1(objectEvent, sprite); } bool8 MovementAction_AcroPopWheelieMoveDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7202,15 +7167,15 @@ bool8 MovementAction_AcroPopWheelieMoveDown_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroPopWheelieMoveUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80960C8(objectEvent, sprite, DIR_NORTH, 1); + InitAcroPopWheelie(objectEvent, sprite, DIR_NORTH, 1); return MovementAction_AcroPopWheelieMoveUp_Step1(objectEvent, sprite); } bool8 MovementAction_AcroPopWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7218,15 +7183,15 @@ bool8 MovementAction_AcroPopWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroPopWheelieMoveLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80960C8(objectEvent, sprite, DIR_WEST, 1); + InitAcroPopWheelie(objectEvent, sprite, DIR_WEST, 1); return MovementAction_AcroPopWheelieMoveLeft_Step1(objectEvent, sprite); } bool8 MovementAction_AcroPopWheelieMoveLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7234,21 +7199,21 @@ bool8 MovementAction_AcroPopWheelieMoveLeft_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroPopWheelieMoveRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_80960C8(objectEvent, sprite, DIR_EAST, 1); + InitAcroPopWheelie(objectEvent, sprite, DIR_EAST, 1); return MovementAction_AcroPopWheelieMoveRight_Step1(objectEvent, sprite); } bool8 MovementAction_AcroPopWheelieMoveRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; } -void sub_8096200(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) +static void InitAcroWheelieMove(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) { npc_apply_direction(objectEvent, sprite, direction, speed); npc_apply_anim_looping(objectEvent, sprite, GetAcroWheeliePedalDirectionAnimNum(objectEvent->facingDirection)); @@ -7256,15 +7221,15 @@ void sub_8096200(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 dire bool8 MovementAction_AcroWheelieMoveDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096200(objectEvent, sprite, DIR_SOUTH, 1); + InitAcroWheelieMove(objectEvent, sprite, DIR_SOUTH, 1); return MovementAction_AcroWheelieMoveDown_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieMoveDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7272,15 +7237,15 @@ bool8 MovementAction_AcroWheelieMoveDown_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieMoveUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096200(objectEvent, sprite, DIR_NORTH, 1); + InitAcroWheelieMove(objectEvent, sprite, DIR_NORTH, 1); return MovementAction_AcroWheelieMoveUp_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7288,15 +7253,15 @@ bool8 MovementAction_AcroWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, st bool8 MovementAction_AcroWheelieMoveLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096200(objectEvent, sprite, DIR_WEST, 1); + InitAcroWheelieMove(objectEvent, sprite, DIR_WEST, 1); return MovementAction_AcroWheelieMoveLeft_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieMoveLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7304,21 +7269,21 @@ bool8 MovementAction_AcroWheelieMoveLeft_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroWheelieMoveRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096200(objectEvent, sprite, DIR_EAST, 1); + InitAcroWheelieMove(objectEvent, sprite, DIR_EAST, 1); return MovementAction_AcroWheelieMoveRight_Step1(objectEvent, sprite); } bool8 MovementAction_AcroWheelieMoveRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; } -void sub_8096330(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) +static void InitAcroEndWheelie(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) { npc_apply_direction(objectEvent, sprite, direction, speed); StartSpriteAnim(sprite, GetAcroEndWheelieDirectionAnimNum(objectEvent->facingDirection)); @@ -7327,15 +7292,15 @@ void sub_8096330(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 dire bool8 MovementAction_AcroEndWheelieMoveDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096330(objectEvent, sprite, DIR_SOUTH, 1); + InitAcroEndWheelie(objectEvent, sprite, DIR_SOUTH, 1); return MovementAction_AcroEndWheelieMoveDown_Step1(objectEvent, sprite); } bool8 MovementAction_AcroEndWheelieMoveDown_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7343,15 +7308,15 @@ bool8 MovementAction_AcroEndWheelieMoveDown_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroEndWheelieMoveUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096330(objectEvent, sprite, DIR_NORTH, 1); + InitAcroEndWheelie(objectEvent, sprite, DIR_NORTH, 1); return MovementAction_AcroEndWheelieMoveUp_Step1(objectEvent, sprite); } bool8 MovementAction_AcroEndWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7359,15 +7324,15 @@ bool8 MovementAction_AcroEndWheelieMoveUp_Step1(struct ObjectEvent *objectEvent, bool8 MovementAction_AcroEndWheelieMoveLeft_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096330(objectEvent, sprite, DIR_WEST, 1); + InitAcroEndWheelie(objectEvent, sprite, DIR_WEST, 1); return MovementAction_AcroEndWheelieMoveLeft_Step1(objectEvent, sprite); } bool8 MovementAction_AcroEndWheelieMoveLeft_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7375,15 +7340,15 @@ bool8 MovementAction_AcroEndWheelieMoveLeft_Step1(struct ObjectEvent *objectEven bool8 MovementAction_AcroEndWheelieMoveRight_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096330(objectEvent, sprite, DIR_EAST, 1); + InitAcroEndWheelie(objectEvent, sprite, DIR_EAST, 1); return MovementAction_AcroEndWheelieMoveRight_Step1(objectEvent, sprite); } bool8 MovementAction_AcroEndWheelieMoveRight_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (npc_obj_ministep_stop_on_arrival(objectEvent, sprite)) + if (UpdateMovementNormal(objectEvent, sprite)) { - sprite->data[2] = 2; + sprite->sActionFuncId = 2; return TRUE; } return FALSE; @@ -7392,24 +7357,24 @@ bool8 MovementAction_AcroEndWheelieMoveRight_Step1(struct ObjectEvent *objectEve bool8 MovementAction_Levitate_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { CreateLevitateMovementTask(objectEvent); - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } bool8 MovementAction_StopLevitate_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - DestroyExtraMovementTask(objectEvent->warpArrowSpriteId); + DestroyLevitateMovementTask(objectEvent->warpArrowSpriteId); sprite->pos2.y = 0; - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } -bool8 MovementAction_DestroyExtraTaskIfAtTop_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +bool8 MovementAction_StopLevitateAtTop_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { if (sprite->pos2.y == 0) { - DestroyExtraMovementTask(objectEvent->warpArrowSpriteId); - sprite->data[2] = 1; + DestroyLevitateMovementTask(objectEvent->warpArrowSpriteId); + sprite->sActionFuncId = 1; return TRUE; } return FALSE; @@ -7446,17 +7411,18 @@ static void TryEnableObjectEventAnim(struct ObjectEvent *objectEvent, struct Spr static void UpdateObjectEventVisibility(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sub_8096530(objectEvent, sprite); - UpdateObjEventSpriteVisibility(objectEvent, sprite); + UpdateObjectEventOffscreen(objectEvent, sprite); + UpdateObjectEventSpriteVisibility(objectEvent, sprite); } -static void sub_8096530(struct ObjectEvent *objectEvent, struct Sprite *sprite) +static void UpdateObjectEventOffscreen(struct ObjectEvent *objectEvent, struct Sprite *sprite) { u16 x, y; u16 x2, y2; const struct ObjectEventGraphicsInfo *graphicsInfo; objectEvent->offScreen = FALSE; + graphicsInfo = GetObjectEventGraphicsInfo(objectEvent->graphicsId); if (sprite->coordOffsetEnabled) { @@ -7472,23 +7438,19 @@ static void sub_8096530(struct ObjectEvent *objectEvent, struct Sprite *sprite) x2 += x; y2 = y; y2 += graphicsInfo->height; - if ((s16)x >= 0x100 || (s16)x2 < -0x10) - { + + if ((s16)x >= DISPLAY_WIDTH + 16 || (s16)x2 < -16) objectEvent->offScreen = TRUE; - } - if ((s16)y >= 0xB0 || (s16)y2 < -0x10) - { + + if ((s16)y >= DISPLAY_HEIGHT + 16 || (s16)y2 < -16) objectEvent->offScreen = TRUE; - } } -static void UpdateObjEventSpriteVisibility(struct ObjectEvent *objectEvent, struct Sprite *sprite) +static void UpdateObjectEventSpriteVisibility(struct ObjectEvent *objectEvent, struct Sprite *sprite) { sprite->invisible = FALSE; if (objectEvent->invisible || objectEvent->offScreen) - { sprite->invisible = TRUE; - } } static void GetAllGroundEffectFlags_OnSpawn(struct ObjectEvent *objEvent, u32 *flags) @@ -7772,30 +7734,30 @@ static u8 GetReflectionTypeByMetatileBehavior(u32 behavior) return REFL_TYPE_NONE; } -u8 GetLedgeJumpDirection(s16 x, s16 y, u8 z) +u8 GetLedgeJumpDirection(s16 x, s16 y, u8 direction) { - static bool8 (*const unknown_08376040[])(u8) = { - MetatileBehavior_IsJumpSouth, - MetatileBehavior_IsJumpNorth, - MetatileBehavior_IsJumpWest, - MetatileBehavior_IsJumpEast, + static bool8 (*const ledgeBehaviorFuncs[])(u8) = { + [DIR_SOUTH - 1] = MetatileBehavior_IsJumpSouth, + [DIR_NORTH - 1] = MetatileBehavior_IsJumpNorth, + [DIR_WEST - 1] = MetatileBehavior_IsJumpWest, + [DIR_EAST - 1] = MetatileBehavior_IsJumpEast, }; - u8 b; - u8 index = z; + u8 behavior; + u8 index = direction; - if (index == 0) - return 0; - else if (index > 4) - index -= 4; + if (index == DIR_NONE) + return DIR_NONE; + else if (index > DIR_EAST) + index -= DIR_EAST; index--; - b = MapGridGetMetatileBehaviorAt(x, y); + behavior = MapGridGetMetatileBehaviorAt(x, y); - if (unknown_08376040[index](b) == 1) + if (ledgeBehaviorFuncs[index](behavior) == TRUE) return index + 1; - return 0; + return DIR_NONE; } static void SetObjectEventSpriteOamTableForLongGrass(struct ObjectEvent *objEvent, struct Sprite *sprite) @@ -7824,7 +7786,7 @@ bool8 IsZCoordMismatchAt(u8 z, s16 x, s16 y) mapZ = MapGridGetZCoordAt(x, y); - if (mapZ == 0 || mapZ == 0xF) + if (mapZ == 0 || mapZ == 15) return FALSE; if (mapZ != z) @@ -7833,21 +7795,15 @@ bool8 IsZCoordMismatchAt(u8 z, s16 x, s16 y) return FALSE; } -static const u8 sUnknown_08376050[] = { - 0x73, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x00, 0x00, 0x73 +static const u8 sElevationToSubpriority[] = { + 115, 115, 83, 115, 83, 115, 83, 115, 83, 115, 83, 115, 83, 0, 0, 115 }; -// Each byte corresponds to a sprite priority for an object event. -// This is directly the inverse of gObjectEventPriorities_08376070. -static const u8 sObjectEventPriorities_08376060[] = { +static const u8 sElevationToPriority[] = { 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 0, 0, 2 }; -// Each byte corresponds to a sprite priority for an object event. -// This is the inverse of gObjectEventPriorities_08376060. -// 1 = Above player sprite -// 2 = Below player sprite -static const u8 sObjectEventPriorities_08376070[] = { +static const u8 sElevationToSubspriteTableNum[] = { 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 0, 0, 1, }; @@ -7858,19 +7814,19 @@ void UpdateObjectEventZCoordAndPriority(struct ObjectEvent *objEvent, struct Spr ObjectEventUpdateZCoord(objEvent); - sprite->subspriteTableNum = sObjectEventPriorities_08376070[objEvent->previousElevation]; - sprite->oam.priority = sObjectEventPriorities_08376060[objEvent->previousElevation]; + sprite->subspriteTableNum = sElevationToSubspriteTableNum[objEvent->previousElevation]; + sprite->oam.priority = sElevationToPriority[objEvent->previousElevation]; } static void InitObjectPriorityByZCoord(struct Sprite *sprite, u8 z) { - sprite->subspriteTableNum = sObjectEventPriorities_08376070[z]; - sprite->oam.priority = sObjectEventPriorities_08376060[z]; + sprite->subspriteTableNum = sElevationToSubspriteTableNum[z]; + sprite->oam.priority = sElevationToPriority[z]; } u8 ZCoordToPriority(u8 z) { - return sObjectEventPriorities_08376060[z]; + return sElevationToPriority[z]; } void ObjectEventUpdateZCoord(struct ObjectEvent *objEvent) @@ -7887,14 +7843,14 @@ void ObjectEventUpdateZCoord(struct ObjectEvent *objEvent) objEvent->previousElevation = z; } -void SetObjectSubpriorityByZCoord(u8 a, struct Sprite *sprite, u8 b) +void SetObjectSubpriorityByZCoord(u8 elevation, struct Sprite *sprite, u8 subpriority) { s32 tmp = sprite->centerToCornerVecY; u32 tmpa = *(u16 *)&sprite->pos1.y; u32 tmpb = *(u16 *)&gSpriteCoordOffsetY; s32 tmp2 = (tmpa - tmp) + tmpb; - u16 tmp3 = (0x10 - ((((u32)tmp2 + 8) & 0xFF) >> 4)) * 2; - sprite->subpriority = tmp3 + sUnknown_08376050[a] + b; + u16 tmp3 = (16 - ((((u32)tmp2 + 8) & 0xFF) >> 4)) * 2; + sprite->subpriority = tmp3 + sElevationToSubpriority[elevation] + subpriority; } static void ObjectEventUpdateSubpriority(struct ObjectEvent *objEvent, struct Sprite *sprite) @@ -8412,29 +8368,37 @@ bool8 obj_npc_ministep(struct Sprite *sprite) return TRUE; } -void sub_80976DC(struct Sprite *sprite, u8 direction) +#define sDirection data[3] +#define sTimer data[4] +#define sNumSteps data[5] + +static void SetWalkSlowSpriteData(struct Sprite *sprite, u8 direction) { - sprite->data[3] = direction; - sprite->data[4] = 0; - sprite->data[5] = 0; + sprite->sDirection = direction; + sprite->sTimer = 0; + sprite->sNumSteps = 0; } -bool8 sub_80976EC(struct Sprite *sprite) +static bool8 UpdateWalkSlowAnim(struct Sprite *sprite) { - if (!(sprite->data[4] & 1)) + if (!(sprite->sTimer & 1)) { - Step1(sprite, sprite->data[3]); - sprite->data[5]++; + Step1(sprite, sprite->sDirection); + sprite->sNumSteps++; } - sprite->data[4]++; + sprite->sTimer++; - if (sprite->data[5] > 15) + if (sprite->sNumSteps > 15) return TRUE; else return FALSE; } +#undef sDirection +#undef sTimer +#undef sNumSteps + static const s8 sFigure8XOffsets[FIGURE_8_LENGTH] = { 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, @@ -8512,87 +8476,100 @@ static bool8 AnimateSpriteInFigure8(struct Sprite *sprite) return finished; } -static const s8 gUnknown_0850E802[] = { - -4, -6, -8, -10, -11, -12, -12, -12, -11, -10, -9, -8, -6, -4, 0, 0 +static const s8 sJumpY_High[] = { + -4, -6, -8, -10, -11, -12, -12, -12, + -11, -10, -9, -8, -6, -4, 0, 0 }; -static const s8 gUnknown_0850E812[] = { - 0, -2, -3, -4, -5, -6, -6, -6, -5, -5, -4, -3, -2, 0, 0, 0 +static const s8 sJumpY_Low[] = { + 0, -2, -3, -4, -5, -6, -6, -6, + -5, -5, -4, -3, -2, 0, 0, 0 }; -static const s8 gUnknown_0850E822[] = { - -2, -4, -6, -8, -9, -10, -10, -10, -9, -8, -6, -5, -3, -2, 0, 0 +static const s8 sJumpY_Normal[] = { + -2, -4, -6, -8, -9, -10, -10, -10, + -9, -8, -6, -5, -3, -2, 0, 0 }; -static const s8 *const gUnknown_0850E834[] = { - gUnknown_0850E802, - gUnknown_0850E812, - gUnknown_0850E822 +static const s8 *const sJumpYTable[] = { + [JUMP_TYPE_HIGH] = sJumpY_High, + [JUMP_TYPE_LOW] = sJumpY_Low, + [JUMP_TYPE_NORMAL] = sJumpY_Normal }; -s16 sub_8097820(s16 a1, u8 a2) +static s16 GetJumpY(s16 i, u8 type) { - return gUnknown_0850E834[a2][a1]; + return sJumpYTable[type][i]; } -void sub_809783C(struct Sprite *sprite, u8 a2, u8 a3, u8 a4) +#define sDirection data[3] +#define sSpeed data[4] +#define sJumpType data[5] +#define sTimer data[6] + +static void SetJumpSpriteData(struct Sprite *sprite, u8 direction, u8 speed, u8 type) { - sprite->data[3] = a2; - sprite->data[4] = a3; - sprite->data[5] = a4; - sprite->data[6] = 0; + sprite->sDirection = direction; + sprite->sSpeed = speed; + sprite->sJumpType = type; + sprite->sTimer = 0; } -u8 sub_809785C(struct Sprite *sprite) +static u8 DoJumpSpriteMovement(struct Sprite *sprite) { - s16 v5[] = {16, 16, 32}; - u8 v6[] = {0, 0, 1}; - u8 v2 = 0; + s16 speedToTime[] = {16, 16, 32}; + u8 speedToShift[] = {0, 0, 1}; + u8 result = 0; - if (sprite->data[4]) - Step1(sprite, sprite->data[3]); + if (sprite->sSpeed) + Step1(sprite, sprite->sDirection); - sprite->pos2.y = sub_8097820(sprite->data[6] >> v6[sprite->data[4]], sprite->data[5]); + sprite->pos2.y = GetJumpY(sprite->sTimer >> speedToShift[sprite->sSpeed], sprite->sJumpType); - sprite->data[6]++; + sprite->sTimer++; - if (sprite->data[6] == (v5[sprite->data[4]] >> 1)) - v2 = 1; + if (sprite->sTimer == speedToTime[sprite->sSpeed] >> 1) + result = JUMP_HALFWAY; - if (sprite->data[6] >= v5[sprite->data[4]]) + if (sprite->sTimer >= speedToTime[sprite->sSpeed]) { sprite->pos2.y = 0; - v2 = -1; + result = JUMP_FINISHED; } - return v2; + return result; } -u8 sub_80978E4(struct Sprite *sprite) +static u8 DoJumpSpecialSpriteMovement(struct Sprite *sprite) { - s16 v5[] = {32, 32, 64}; - u8 v6[] = {1, 1, 2}; - u8 v2 = 0; + s16 speedToTime[] = {32, 32, 64}; + u8 speedToShift[] = {1, 1, 2}; + u8 result = 0; - if (sprite->data[4] && !(sprite->data[6] & 1)) - Step1(sprite, sprite->data[3]); + if (sprite->sSpeed && !(sprite->sTimer & 1)) + Step1(sprite, sprite->sDirection); - sprite->pos2.y = sub_8097820(sprite->data[6] >> v6[sprite->data[4]], sprite->data[5]); + sprite->pos2.y = GetJumpY(sprite->sTimer >> speedToShift[sprite->sSpeed], sprite->sJumpType); - sprite->data[6]++; + sprite->sTimer++; - if (sprite->data[6] == (v5[sprite->data[4]] >> 1)) - v2 = 1; + if (sprite->sTimer == speedToTime[sprite->sSpeed] >> 1) + result = JUMP_HALFWAY; - if (sprite->data[6] >= v5[sprite->data[4]]) + if (sprite->sTimer >= speedToTime[sprite->sSpeed]) { sprite->pos2.y = 0; - v2 = -1; + result = JUMP_FINISHED; } - return v2; + return result; } +#undef sDirection +#undef sSpeed +#undef sJumpType +#undef sTimer + static void SetMovementDelay(struct Sprite *sprite, s16 timer) { sprite->data[3] = timer; @@ -8600,9 +8577,7 @@ static void SetMovementDelay(struct Sprite *sprite, s16 timer) static bool8 WaitForMovementDelay(struct Sprite *sprite) { - sprite->data[3]--; - - if (sprite->data[3] == 0) + if (--sprite->data[3] == 0) return TRUE; else return FALSE; @@ -8650,15 +8625,15 @@ void UpdateObjectEventSpriteInvisibility(struct Sprite *sprite, bool8 invisible) sprite->invisible = TRUE; } -#define tInvisible data[2] -#define tAnimNum data[3] -#define tAnimState data[4] +#define sInvisible data[2] +#define sAnimNum data[3] +#define sAnimState data[4] static void UpdateObjectEventSprite(struct Sprite *sprite) { UpdateObjectEventSpritePosition(sprite); SetObjectSubpriorityByZCoord(sprite->data[1], sprite, 1); - UpdateObjectEventSpriteInvisibility(sprite, sprite->tInvisible); + UpdateObjectEventSpriteInvisibility(sprite, sprite->sInvisible); } // Unused @@ -8681,7 +8656,7 @@ static int GetObjectEventSpriteId(u8 objectEventId) // this should return a u8, for (i = 0; i < MAX_SPRITES; i++) { struct Sprite *sprite = &gSprites[i]; - if (sprite->inUse && sprite->callback == UpdateObjectEventSprite && (u8)sprite->data[0] == objectEventId) + if (sprite->inUse && sprite->callback == UpdateObjectEventSprite && (u8)sprite->sObjEventId == objectEventId) return i; } return MAX_SPRITES; @@ -8733,9 +8708,9 @@ void SetObjectEventSpriteInvisibility(u8 objectEventId, bool32 invisible) return; if (invisible) - gSprites[spriteId].tInvisible = TRUE; + gSprites[spriteId].sInvisible = TRUE; else - gSprites[spriteId].tInvisible = FALSE; + gSprites[spriteId].sInvisible = FALSE; } bool32 IsObjectEventSpriteInvisible(u8 objectEventId) @@ -8745,7 +8720,7 @@ bool32 IsObjectEventSpriteInvisible(u8 objectEventId) if (spriteId == MAX_SPRITES) return FALSE; - return (gSprites[spriteId].tInvisible == TRUE); + return (gSprites[spriteId].sInvisible == TRUE); } void SetObjectEventSpriteAnim(u8 objectEventId, u8 animNum) @@ -8754,50 +8729,50 @@ void SetObjectEventSpriteAnim(u8 objectEventId, u8 animNum) if (spriteId != MAX_SPRITES) { - gSprites[spriteId].tAnimNum = animNum; - gSprites[spriteId].tAnimState = 0; + gSprites[spriteId].sAnimNum = animNum; + gSprites[spriteId].sAnimState = 0; } } static void MoveUnionRoomObjectUp(struct Sprite *sprite) { - switch(sprite->tAnimState) + switch(sprite->sAnimState) { case 0: sprite->pos2.y = 0; - sprite->tAnimState++; + sprite->sAnimState++; case 1: sprite->pos2.y -= 8; - if (sprite->pos2.y == -160) + if (sprite->pos2.y == -DISPLAY_HEIGHT) { sprite->pos2.y = 0; - sprite->tInvisible = TRUE; - sprite->tAnimNum = 0; - sprite->tAnimState = 0; + sprite->sInvisible = TRUE; + sprite->sAnimNum = 0; + sprite->sAnimState = 0; } } } static void MoveUnionRoomObjectDown(struct Sprite *sprite) { - switch(sprite->tAnimState) + switch(sprite->sAnimState) { case 0: - sprite->pos2.y = -160; - sprite->tAnimState++; + sprite->pos2.y = -DISPLAY_HEIGHT; + sprite->sAnimState++; case 1: sprite->pos2.y += 8; if(sprite->pos2.y == 0) { - sprite->tAnimNum = 0; - sprite->tAnimState = 0; + sprite->sAnimNum = 0; + sprite->sAnimState = 0; } } } static void UpdateObjectEventSpritePosition(struct Sprite *sprite) { - switch(sprite->tAnimNum) + switch(sprite->sAnimNum) { case UNION_ROOM_SPAWN_IN: MoveUnionRoomObjectDown(sprite); @@ -8808,7 +8783,7 @@ static void UpdateObjectEventSpritePosition(struct Sprite *sprite) case 0: break; default: - sprite->tAnimNum = 0; + sprite->sAnimNum = 0; break; } } @@ -8820,7 +8795,7 @@ bool32 IsObjectEventSpriteAnimating(u8 objectEventId) if (spriteId == MAX_SPRITES) return FALSE; - if (gSprites[spriteId].tAnimNum != 0) + if (gSprites[spriteId].sAnimNum != 0) return TRUE; return FALSE; @@ -8832,11 +8807,11 @@ u32 StartFieldEffectForObjectEvent(u8 fieldEffectId, struct ObjectEvent *objectE return FieldEffectStart(fieldEffectId); } -void DoShadowFieldEffect(struct ObjectEvent *objectEvent) +static void DoShadowFieldEffect(struct ObjectEvent *objectEvent) { if (!objectEvent->hasShadow) { - objectEvent->hasShadow = 1; + objectEvent->hasShadow = TRUE; StartFieldEffectForObjectEvent(FLDEFF_SHADOW, objectEvent); } } @@ -8876,11 +8851,11 @@ u8 (*const gMovementActionFuncs_FlyDown[])(struct ObjectEvent *, struct Sprite * u8 MovementAction_StoreAndLockAnim_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { bool32 ableToStore = FALSE; - if (gLockedAnimObjectEvents == NULL) + if (sLockedAnimObjectEvents == NULL) { - gLockedAnimObjectEvents = AllocZeroed(sizeof(struct LockedAnimObjectEvents)); - gLockedAnimObjectEvents->objectEventIds[0] = objectEvent->localId; - gLockedAnimObjectEvents->count = 1; + sLockedAnimObjectEvents = AllocZeroed(sizeof(struct LockedAnimObjectEvents)); + sLockedAnimObjectEvents->objectEventIds[0] = objectEvent->localId; + sLockedAnimObjectEvents->count = 1; ableToStore = TRUE; } else @@ -8890,10 +8865,10 @@ u8 MovementAction_StoreAndLockAnim_Step0(struct ObjectEvent *objectEvent, struct bool32 found; for (firstFreeSlot = 16, found = FALSE, i = 0; i < 16; i++) { - if (firstFreeSlot == 16 && gLockedAnimObjectEvents->objectEventIds[i] == 0) + if (firstFreeSlot == 16 && sLockedAnimObjectEvents->objectEventIds[i] == 0) firstFreeSlot = i; - if (gLockedAnimObjectEvents->objectEventIds[i] == objectEvent->localId) + if (sLockedAnimObjectEvents->objectEventIds[i] == objectEvent->localId) { found = TRUE; break; @@ -8902,8 +8877,8 @@ u8 MovementAction_StoreAndLockAnim_Step0(struct ObjectEvent *objectEvent, struct if (!found && firstFreeSlot != 16) { - gLockedAnimObjectEvents->objectEventIds[firstFreeSlot] = objectEvent->localId; - gLockedAnimObjectEvents->count++; + sLockedAnimObjectEvents->objectEventIds[firstFreeSlot] = objectEvent->localId; + sLockedAnimObjectEvents->count++; ableToStore = TRUE; } } @@ -8914,7 +8889,7 @@ u8 MovementAction_StoreAndLockAnim_Step0(struct ObjectEvent *objectEvent, struct objectEvent->facingDirectionLocked = TRUE; } - sprite->data[2] = 1; + sprite->sActionFuncId = 1; return TRUE; } @@ -8923,19 +8898,19 @@ u8 MovementAction_FreeAndUnlockAnim_Step0(struct ObjectEvent *objectEvent, struc bool32 ableToStore; u8 index; - sprite->data[2] = 1; - if (gLockedAnimObjectEvents != NULL) + sprite->sActionFuncId = 1; + if (sLockedAnimObjectEvents != NULL) { ableToStore = FALSE; index = FindLockedObjectEventIndex(objectEvent); if (index != 16) { - gLockedAnimObjectEvents->objectEventIds[index] = 0; - gLockedAnimObjectEvents->count--; + sLockedAnimObjectEvents->objectEventIds[index] = 0; + sLockedAnimObjectEvents->count--; ableToStore = TRUE; } - if (gLockedAnimObjectEvents->count == 0) - FREE_AND_SET_NULL(gLockedAnimObjectEvents); + if (sLockedAnimObjectEvents->count == 0) + FREE_AND_SET_NULL(sLockedAnimObjectEvents); if (ableToStore == TRUE) { objectEvent->inanimate = GetObjectEventGraphicsInfo(objectEvent->graphicsId)->inanimate; @@ -8953,13 +8928,13 @@ u8 FindLockedObjectEventIndex(struct ObjectEvent *objectEvent) for (i = 0; i < OBJECT_EVENTS_COUNT; i++) { - if (gLockedAnimObjectEvents->objectEventIds[i] == objectEvent->localId) + if (sLockedAnimObjectEvents->objectEventIds[i] == objectEvent->localId) return i; } return OBJECT_EVENTS_COUNT; } -void CreateLevitateMovementTask(struct ObjectEvent *objectEvent) +static void CreateLevitateMovementTask(struct ObjectEvent *objectEvent) { u8 taskId = CreateTask(ApplyLevitateMovement, 0xFF); struct Task *task = &gTasks[taskId]; @@ -8978,16 +8953,16 @@ static void ApplyLevitateMovement(u8 taskId) LoadWordFromTwoHalfwords(&task->data[0], (u32 *)&objectEvent); // load the map object pointer. sprite = &gSprites[objectEvent->spriteId]; - if(!(task->data[2] & 0x3)) + if(!(task->data[2] & 3)) sprite->pos2.y += task->data[3]; - if(!(task->data[2] & 0xF)) + if(!(task->data[2] & 15)) task->data[3] = -task->data[3]; task->data[2]++; } -void DestroyExtraMovementTask(u8 taskId) +static void DestroyLevitateMovementTask(u8 taskId) { struct ObjectEvent *objectEvent; struct Task *task = &gTasks[taskId]; @@ -9012,7 +8987,7 @@ void FreezeObjectEventsExceptTwo(u8 objectEventId1, u8 objectEventId2) u8 MovementAction_FlyUp_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { sprite->pos2.y = 0; - sprite->data[2]++; + sprite->sActionFuncId++; return FALSE; } @@ -9020,15 +8995,15 @@ u8 MovementAction_FlyUp_Step1(struct ObjectEvent *objectEvent, struct Sprite *sp { sprite->pos2.y -= 8; - if(sprite->pos2.y == -160) - sprite->data[2]++; + if(sprite->pos2.y == -DISPLAY_HEIGHT) + sprite->sActionFuncId++; return FALSE; } u8 MovementAction_FlyDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sprite->pos2.y = -160; - sprite->data[2]++; + sprite->pos2.y = -DISPLAY_HEIGHT; + sprite->sActionFuncId++; return FALSE; } @@ -9037,7 +9012,7 @@ u8 MovementAction_FlyDown_Step1(struct ObjectEvent *objectEvent, struct Sprite * sprite->pos2.y += 8; if(!sprite->pos2.y) - sprite->data[2]++; + sprite->sActionFuncId++; return FALSE; } diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 49116b5d3..30eeaadfa 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -1678,18 +1678,27 @@ static void UpdateGrassFieldEffectSubpriority(struct Sprite *sprite, u8 z, u8 of } } -// Unused data. Feel free to remove. -static const u8 sUnusedData[] = -{ - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, - 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, - 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, - 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, - 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, - 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -1, 0, 0, -1, 0, 0, -1, 0, -1, -1, 0, -1, - -1, 0, -1, -1, -1, -1, -1, -1, -1, -2, 0, 0 +// Unused, duplicates of data in event_object_movement.c +static const s8 sFigure8XOffsets[FIGURE_8_LENGTH] = { + 1, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 1, 2, 2, 1, 2, + 2, 1, 2, 2, 1, 2, 1, 1, + 2, 1, 1, 2, 1, 1, 2, 1, + 1, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 1, 0, + 1, 0, 1, 0, 1, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, +}; + +static const s8 sFigure8YOffsets[FIGURE_8_LENGTH] = { + 0, 0, 1, 0, 0, 1, 0, 0, + 1, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 1, + 0, 0, 1, 0, 0, 1, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -1, 0, 0, -1, 0, 0, + -1, 0, -1, -1, 0, -1, -1, 0, + -1, -1, -1, -1, -1, -1, -1, -2, }; diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 94325bf34..9b1f4ceb6 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -722,9 +722,9 @@ static bool8 CanStopSurfing(s16 x, s16 y, u8 direction) } } -static bool8 ShouldJumpLedge(s16 x, s16 y, u8 z) +static bool8 ShouldJumpLedge(s16 x, s16 y, u8 direction) { - if (GetLedgeJumpDirection(x, y, z) != 0) + if (GetLedgeJumpDirection(x, y, direction) != DIR_NONE) return TRUE; else return FALSE; @@ -1192,7 +1192,7 @@ u8 GetPlayerAvatarFlags(void) return gPlayerAvatar.flags; } -u8 GetPlayerAvatarObjectId(void) +u8 GetPlayerAvatarSpriteId(void) { return gPlayerAvatar.spriteId; } diff --git a/src/field_specials.c b/src/field_specials.c index 30503ed8d..df16583ed 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1301,12 +1301,12 @@ void SpawnCameraObject(void) { u8 obj = SpawnSpecialObjectEventParameterized(OBJ_EVENT_GFX_BOY_1, MOVEMENT_TYPE_FACE_DOWN, OBJ_EVENT_ID_CAMERA, gSaveBlock1Ptr->pos.x + 7, gSaveBlock1Ptr->pos.y + 7, 3); gObjectEvents[obj].invisible = TRUE; - CameraObjectSetFollowedObjectId(gObjectEvents[obj].spriteId); + CameraObjectSetFollowedSpriteId(gObjectEvents[obj].spriteId); } void RemoveCameraObject(void) { - CameraObjectSetFollowedObjectId(GetPlayerAvatarObjectId()); + CameraObjectSetFollowedSpriteId(GetPlayerAvatarSpriteId()); RemoveObjectEventByLocalIdAndMap(OBJ_EVENT_ID_CAMERA, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); } diff --git a/src/fldeff_cut.c b/src/fldeff_cut.c index 446633a53..044e25a8f 100644 --- a/src/fldeff_cut.c +++ b/src/fldeff_cut.c @@ -326,7 +326,7 @@ bool8 FldEff_CutGrass(void) y = yAdd + gPlayerFacingPosition.y; SetCutGrassMetatile(x, y); - sub_808E75C(x, y); + AllowObjectAtPosTriggerGroundEffects(x, y); } } diff --git a/src/fldeff_misc.c b/src/fldeff_misc.c index b320f3eb0..914ba2880 100644 --- a/src/fldeff_misc.c +++ b/src/fldeff_misc.c @@ -1298,7 +1298,7 @@ u8 CreateRecordMixingLights(void) else { struct Sprite *sprite = &gSprites[spriteId]; - sub_8092FF0(16, 13, &sprite->pos1.x, &sprite->pos1.y); + GetMapCoordsFromSpritePos(16, 13, &sprite->pos1.x, &sprite->pos1.y); sprite->coordOffsetEnabled = TRUE; sprite->pos1.x += 16; sprite->pos1.y += 2; diff --git a/src/fldeff_sweetscent.c b/src/fldeff_sweetscent.c index 55463440c..e34d19504 100644 --- a/src/fldeff_sweetscent.c +++ b/src/fldeff_sweetscent.c @@ -54,7 +54,7 @@ static void StartSweetScentFieldEffect(void) PlaySE(SE_M_SWEET_SCENT); CpuFastSet(gPlttBufferUnfaded, gPaletteDecompressionBuffer, 0x100); CpuFastSet(gPlttBufferFaded, gPlttBufferUnfaded, 0x100); - BeginNormalPaletteFade(~(1 << (gSprites[GetPlayerAvatarObjectId()].oam.paletteNum + 16)), 4, 0, 8, RGB_RED); + BeginNormalPaletteFade(~(1 << (gSprites[GetPlayerAvatarSpriteId()].oam.paletteNum + 16)), 4, 0, 8, RGB_RED); taskId = CreateTask(TrySweetScentEncounter, 0); gTasks[taskId].data[0] = 0; FieldEffectActiveListRemove(FLDEFF_SWEET_SCENT); @@ -76,7 +76,7 @@ static void TrySweetScentEncounter(u8 taskId) else { gTasks[taskId].func = FailSweetScentEncounter; - BeginNormalPaletteFade(~(1 << (gSprites[GetPlayerAvatarObjectId()].oam.paletteNum + 16)), 4, 8, 0, RGB_RED); + BeginNormalPaletteFade(~(1 << (gSprites[GetPlayerAvatarSpriteId()].oam.paletteNum + 16)), 4, 8, 0, RGB_RED); TryStartMirageTowerPulseBlendEffect(); } } diff --git a/src/overworld.c b/src/overworld.c index 3dda9b665..f2ed5952c 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -111,7 +111,7 @@ static void SpawnLinkPlayers(void); static void SetCameraToTrackGuestPlayer(void); static void ResumeMap(bool32 arg0); static void SetCameraToTrackPlayer(void); -static void sub_8086A68(void); +static void InitObjectEventsReturnToField(void); static void InitViewGraphics(void); static void SetCameraToTrackGuestPlayer_2(void); static void CreateLinkPlayerSprites(void); @@ -1946,7 +1946,7 @@ static bool32 ReturnToFieldLocal(u8 *state) ResetMirageTowerAndSaveBlockPtrs(); sub_80867D8(); ResumeMap(FALSE); - sub_8086A68(); + InitObjectEventsReturnToField(); SetCameraToTrackPlayer(); (*state)++; break; @@ -1982,7 +1982,7 @@ static bool32 ReturnToFieldLink(u8 *state) break; case 2: CreateLinkPlayerSprites(); - sub_8086A68(); + InitObjectEventsReturnToField(); SetCameraToTrackGuestPlayer_2(); (*state)++; break; @@ -2157,9 +2157,9 @@ static void InitObjectEventsLocal(void) TryRunOnWarpIntoMapScript(); } -static void sub_8086A68(void) +static void InitObjectEventsReturnToField(void) { - sub_808E16C(0, 0); + SpawnObjectEventsOnReturnToField(0, 0); RotatingGate_InitPuzzleAndGraphics(); RunOnReturnToFieldMapScript(); } diff --git a/src/rotating_gate.c b/src/rotating_gate.c index 162eb3e6d..22a0b0bdf 100644 --- a/src/rotating_gate.c +++ b/src/rotating_gate.c @@ -754,7 +754,7 @@ static u8 RotatingGate_CreateGate(u8 gateId, s16 deltaX, s16 deltaY) sprite->data[0] = gateId; sprite->coordOffsetEnabled = 1; - sub_8092FF0(x + deltaX, y + deltaY, &sprite->pos1.x, &sprite->pos1.y); + GetMapCoordsFromSpritePos(x + deltaX, y + deltaY, &sprite->pos1.x, &sprite->pos1.y); RotatingGate_HideGatesOutsideViewport(sprite); StartSpriteAffineAnim(sprite, RotatingGate_GetGateOrientation(gateId)); From 8bad478b4999e762eb26cef0a9b6b07891236370 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 14:51:39 -0400 Subject: [PATCH 18/63] Document disguise field effects --- include/field_effect_helpers.h | 4 +- src/event_object_movement.c | 9 ++-- src/field_effect_helpers.c | 77 ++++++++++++++++++---------------- 3 files changed, 48 insertions(+), 42 deletions(-) diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index 9795d96e8..528492d81 100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -17,8 +17,8 @@ u8 StartUnderwaterSurfBlobBobbing(u8 oldSpriteId); void SetSurfBlob_BobState(u8 spriteId, u8 state); void SetSurfBlob_DontSyncAnim(u8 spriteId, bool8 dontSync); void SetSurfBlob_PlayerOffset(u8 spriteId, bool8 hasOffset, s16 offset); -bool8 sub_8155DA0(struct ObjectEvent *); -void sub_8155D78(struct ObjectEvent *); +bool8 UpdateRevealDisguise(struct ObjectEvent *); +void StartRevealDisguise(struct ObjectEvent *); void StartAshFieldEffect(s16, s16, u16, s16); void SetUpReflection(struct ObjectEvent*, struct Sprite*, u8); u32 StartFieldEffectForObjectEvent(u8, struct ObjectEvent*); diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 75e4a5cd8..4f334e827 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -4396,10 +4396,9 @@ movement_type_def(MovementType_CopyPlayerInGrass, gMovementTypeFuncs_CopyPlayerI bool8 MovementType_CopyPlayerInGrass_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (gObjectEvents[gPlayerAvatar.objectEventId].movementActionId == 0xFF || gPlayerAvatar.tileTransitionState == T_TILE_CENTER) - { + if (gObjectEvents[gPlayerAvatar.objectEventId].movementActionId == MOVEMENT_ACTION_NONE || gPlayerAvatar.tileTransitionState == T_TILE_CENTER) return FALSE; - } + return gCopyPlayerMovementFuncs[PlayerGetCopyableMovement()](objectEvent, sprite, GetPlayerMovementDirection(), MetatileBehavior_IsPokeGrass); } @@ -6577,14 +6576,14 @@ bool8 MovementAction_RevealTrainer_Step0(struct ObjectEvent *objectEvent, struct sprite->sActionFuncId = 2; return TRUE; } - sub_8155D78(objectEvent); + StartRevealDisguise(objectEvent); sprite->sActionFuncId = 1; return MovementAction_RevealTrainer_Step1(objectEvent, sprite); } bool8 MovementAction_RevealTrainer_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (sub_8155DA0(objectEvent)) + if (UpdateRevealDisguise(objectEvent)) { sprite->sActionFuncId = 2; return TRUE; diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 30eeaadfa..67a151aaa 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -32,6 +32,9 @@ static void UpdateBobbingEffect(struct ObjectEvent *, struct Sprite *, struct Sp static void SpriteCB_UnderwaterSurfBlob(struct Sprite *); static u32 ShowDisguiseFieldEffect(u8, u8, u8); +// Used by several field effects to determine which of a group it is +#define sFldEff data[1] + #define sReflectionObjEventId data[0] #define sReflectionObjEventLocalId data[1] #define sReflectionVerticalOffset data[2] @@ -360,9 +363,6 @@ void UpdateTallGrassFieldEffect(struct Sprite *sprite) } } -// Sprite data for FLDEFF_JUMP_TALL_GRASS and FLDEFF_JUMP_LONG_GRASS -#define sFldEff data[1] - u32 FldEff_JumpTallGrass(void) { u8 spriteId; @@ -1301,6 +1301,13 @@ u32 FldEff_BerryTreeGrowthSparkle(void) return 0; } +// Sprite data for FLDEFF_TREE_DISGUISE / FLDEFF_MOUNTAIN_DISGUISE / FLDEFF_SAND_DISGUISE +#define sState data[0] +#define sLocalId data[2] +#define sMapNum data[3] +#define sMapGroup data[4] +#define sReadyToEnd data[7] + u32 ShowTreeDisguiseFieldEffect(void) { return ShowDisguiseFieldEffect(FLDEFF_TREE_DISGUISE, FLDEFFOBJ_TREE_DISGUISE, 4); @@ -1332,10 +1339,10 @@ static u32 ShowDisguiseFieldEffect(u8 fldEff, u8 fldEffObj, u8 paletteNum) sprite = &gSprites[spriteId]; sprite->coordOffsetEnabled ++; sprite->oam.paletteNum = paletteNum; - sprite->data[1] = fldEff; - sprite->data[2] = gFieldEffectArguments[0]; - sprite->data[3] = gFieldEffectArguments[1]; - sprite->data[4] = gFieldEffectArguments[2]; + sprite->sFldEff = fldEff; + sprite->sLocalId = gFieldEffectArguments[0]; + sprite->sMapNum = gFieldEffectArguments[1]; + sprite->sMapGroup = gFieldEffectArguments[2]; } return spriteId; } @@ -1346,10 +1353,8 @@ void UpdateDisguiseFieldEffect(struct Sprite *sprite) const struct ObjectEventGraphicsInfo *graphicsInfo; struct Sprite *linkedSprite; - if (TryGetObjectEventIdByLocalIdAndMap(sprite->data[2], sprite->data[3], sprite->data[4], &objectEventId)) - { - FieldEffectStop(sprite, sprite->data[1]); - } + if (TryGetObjectEventIdByLocalIdAndMap(sprite->sLocalId, sprite->sMapNum, sprite->sMapGroup, &objectEventId)) + FieldEffectStop(sprite, sprite->sFldEff); graphicsInfo = GetObjectEventGraphicsInfo(gObjectEvents[objectEventId].graphicsId); linkedSprite = &gSprites[gObjectEvents[objectEventId].spriteId]; @@ -1357,51 +1362,56 @@ void UpdateDisguiseFieldEffect(struct Sprite *sprite) sprite->pos1.x = linkedSprite->pos1.x; sprite->pos1.y = (graphicsInfo->height >> 1) + linkedSprite->pos1.y - 16; sprite->subpriority = linkedSprite->subpriority - 1; - if (sprite->data[0] == 1) + + if (sprite->sState == 1) { - sprite->data[0] ++; + sprite->sState++; StartSpriteAnim(sprite, 1); } - if (sprite->data[0] == 2 && sprite->animEnded) - { - sprite->data[7] = 1; - } - if (sprite->data[0] == 3) - { - FieldEffectStop(sprite, sprite->data[1]); - } + + if (sprite->sState == 2 && sprite->animEnded) + sprite->sReadyToEnd = TRUE; + + if (sprite->sState == 3) + FieldEffectStop(sprite, sprite->sFldEff); } -void sub_8155D78(struct ObjectEvent *objectEvent) +void StartRevealDisguise(struct ObjectEvent *objectEvent) { if (objectEvent->directionSequenceIndex == 1) - { - gSprites[objectEvent->fieldEffectSpriteId].data[0]++; - } + gSprites[objectEvent->fieldEffectSpriteId].sState++; } -bool8 sub_8155DA0(struct ObjectEvent *objectEvent) +bool8 UpdateRevealDisguise(struct ObjectEvent *objectEvent) { struct Sprite *sprite; if (objectEvent->directionSequenceIndex == 2) - { return TRUE; - } + if (objectEvent->directionSequenceIndex == 0) - { return TRUE; - } + sprite = &gSprites[objectEvent->fieldEffectSpriteId]; - if (sprite->data[7]) + if (sprite->sReadyToEnd) { objectEvent->directionSequenceIndex = 2; - sprite->data[0]++; + sprite->sState++; return TRUE; } return FALSE; } +#undef sState +#undef sLocalId +#undef sMapNum +#undef sMapGroup +#undef sReadyToEnd + +// Sprite data for FLDEFF_SPARKLE +#define sFinished data[0] +#define sEndTimer data[1] + u32 FldEff_Sparkle(void) { u8 spriteId; @@ -1418,9 +1428,6 @@ u32 FldEff_Sparkle(void) return 0; } -#define sFinished data[0] -#define sEndTimer data[1] - void UpdateSparkleFieldEffect(struct Sprite *sprite) { if (!sprite->sFinished) From 86a9d94ce1eb7930cb9a59ad8f968388a627c58a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 16:05:43 -0400 Subject: [PATCH 19/63] Document fieldmap --- include/constants/metatile_behaviors.h | 1 + include/fieldmap.h | 7 +- include/global.fieldmap.h | 5 +- src/battle_pike.c | 2 +- src/battle_pyramid.c | 2 +- src/fieldmap.c | 118 ++++++++++++------------- src/save.c | 2 +- src/start_menu.c | 2 +- 8 files changed, 66 insertions(+), 73 deletions(-) diff --git a/include/constants/metatile_behaviors.h b/include/constants/metatile_behaviors.h index 94cb0ffca..5120bd9dc 100755 --- a/include/constants/metatile_behaviors.h +++ b/include/constants/metatile_behaviors.h @@ -241,5 +241,6 @@ #define MB_UNUSED_ED 0xED #define MB_UNUSED_EE 0xEE #define MB_UNUSED_EF 0xEF +#define MB_INVALID 0xFF #endif // GUARD_METATILE_BEHAVIORS diff --git a/include/fieldmap.h b/include/fieldmap.h index 438fb4787..5bcbe20ea 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -20,16 +20,13 @@ void MapGridSetMetatileEntryAt(int, int, u16); void GetCameraCoords(u16*, u16*); bool8 MapGridIsImpassableAt(int, int); int GetMapBorderIdAt(int x, int y); -int CanCameraMoveInDirection(int direction); +bool32 CanCameraMoveInDirection(int direction); u16 GetBehaviorByMetatileId(u16 metatileId); void GetCameraFocusCoords(u16 *x, u16 *y); u8 MapGridGetMetatileLayerTypeAt(int x, int y); u8 MapGridGetZCoordAt(int x, int y); bool8 CameraMove(int deltaX, int deltaY); -struct MapConnection *sub_8088950(u8 direction, int x, int y); -bool8 sub_80889A8(u8 direction, int x, int y, struct MapConnection *connection); -bool8 sub_8088A0C(int x, int src_width, int dest_width, int offset); -void save_serialize_map(void); +void SaveMapView(void); void SetCameraFocusCoords(u16 x, u16 y); void InitMap(void); void InitMapFromSavedGame(void); diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index c4d7be35d..a3d99ee21 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -1,6 +1,7 @@ #ifndef GUARD_GLOBAL_FIELDMAP_H #define GUARD_GLOBAL_FIELDMAP_H +#define METATILE_BEHAVIOR_MASK 0x00FF #define METATILE_COLLISION_MASK 0x0C00 #define METATILE_ID_MASK 0x03FF #define METATILE_ID_UNDEFINED 0x03FF @@ -12,7 +13,9 @@ enum { - CONNECTION_SOUTH = 1, + CONNECTION_INVALID = -1, + CONNECTION_NONE, + CONNECTION_SOUTH, CONNECTION_NORTH, CONNECTION_WEST, CONNECTION_EAST, diff --git a/src/battle_pike.c b/src/battle_pike.c index ed89f5ed9..d889d7cdd 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -711,7 +711,7 @@ static void SavePikeChallenge(void) gSaveBlock2Ptr->frontier.challengeStatus = gSpecialVar_0x8005; VarSet(VAR_TEMP_0, 0); gSaveBlock2Ptr->frontier.challengePaused = TRUE; - save_serialize_map(); + SaveMapView(); TrySavingData(SAVE_LINK); } diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c index ac6d95338..a41a80bbb 100644 --- a/src/battle_pyramid.c +++ b/src/battle_pyramid.c @@ -933,7 +933,7 @@ static void SavePyramidChallenge(void) gSaveBlock2Ptr->frontier.challengeStatus = gSpecialVar_0x8005; VarSet(VAR_TEMP_0, 0); gSaveBlock2Ptr->frontier.challengePaused = TRUE; - save_serialize_map(); + SaveMapView(); TrySavingData(SAVE_LINK); } diff --git a/src/fieldmap.c b/src/fieldmap.c index 2961d2f49..82c085f9f 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -15,6 +15,7 @@ #include "trainer_hill.h" #include "tv.h" #include "constants/rgb.h" +#include "constants/metatile_behaviors.h" struct ConnectionFlags { @@ -43,6 +44,9 @@ static void FillEastConnection(struct MapHeader const *mapHeader, struct MapHead static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader); static void LoadSavedMapView(void); static bool8 SkipCopyingMetatileFromSavedMap(u16* mapMetatilePtr, u16 mapWidth, u8 yMode); +static struct MapConnection *GetIncomingConnection(u8 direction, int x, int y); +static bool8 IsPosInIncomingConnectingMap(u8 direction, int x, int y, struct MapConnection *connection); +static bool8 IsCoordInIncomingConnectingMap(int coord, int srcMax, int destMax, int offset); struct MapHeader const *const GetMapHeaderFromConnection(struct MapConnection *connection) { @@ -149,7 +153,7 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader) } } -static void sub_8087F54(int x, int y, struct MapHeader const *connectedMapHeader, int x2, int y2, int width, int height) +static void FillConnection(int x, int y, struct MapHeader const *connectedMapHeader, int x2, int y2, int width, int height) { int i; u16 *src; @@ -207,7 +211,7 @@ static void FillSouthConnection(struct MapHeader const *mapHeader, struct MapHea } } - sub_8087F54( + FillConnection( x, y, connectedMapHeader, x2, /*y2*/ 0, @@ -255,7 +259,7 @@ static void FillNorthConnection(struct MapHeader const *mapHeader, struct MapHea } } - sub_8087F54( + FillConnection( x, /*y*/ 0, connectedMapHeader, x2, y2, @@ -302,7 +306,7 @@ static void FillWestConnection(struct MapHeader const *mapHeader, struct MapHead } } - sub_8087F54( + FillConnection( /*x*/ 0, y, connectedMapHeader, x2, y2, @@ -347,7 +351,7 @@ static void FillEastConnection(struct MapHeader const *mapHeader, struct MapHead } } - sub_8087F54( + FillConnection( x, y, connectedMapHeader, /*x2*/ 0, y2, @@ -458,7 +462,7 @@ u32 MapGridGetMetatileBehaviorAt(int x, int y) { u16 metatile; metatile = MapGridGetMetatileIdAt(x, y); - return GetBehaviorByMetatileId(metatile) & 0xff; + return GetBehaviorByMetatileId(metatile) & METATILE_BEHAVIOR_MASK; } u8 MapGridGetMetatileLayerTypeAt(int x, int y) @@ -505,11 +509,11 @@ u16 GetBehaviorByMetatileId(u16 metatile) } else { - return 0xFF; + return MB_INVALID; } } -void save_serialize_map(void) +void SaveMapView(void) { int i, j; int x, y; @@ -595,7 +599,7 @@ static void LoadSavedMapView(void) } } -void sub_80885C4(u8 a1) +static void MoveMapViewToBackup(u8 direction) { int width; u16 *mapView; @@ -614,7 +618,7 @@ void sub_80885C4(u8 a1) y0 = gSaveBlock1Ptr->pos.y; x2 = 15; y2 = 14; - switch (a1) + switch (direction) { case CONNECTION_NORTH: y0 += 1; @@ -680,14 +684,14 @@ int GetMapBorderIdAt(int x, int y) } goto success; fail: - return -1; + return CONNECTION_INVALID; success: if (x >= (gBackupMapLayout.width - 8)) { if (!gMapConnectionFlags.east) { - return -1; + return CONNECTION_INVALID; } return CONNECTION_EAST; } @@ -695,7 +699,7 @@ success: { if (!gMapConnectionFlags.west) { - return -1; + return CONNECTION_INVALID; } return CONNECTION_WEST; } @@ -703,7 +707,7 @@ success: { if (!gMapConnectionFlags.south) { - return -1; + return CONNECTION_INVALID; } return CONNECTION_SOUTH; } @@ -711,13 +715,13 @@ success: { if (!gMapConnectionFlags.north) { - return -1; + return CONNECTION_INVALID; } return CONNECTION_NORTH; } else { - return 0; + return CONNECTION_NONE; } } @@ -726,19 +730,19 @@ int GetPostCameraMoveMapBorderId(int x, int y) return GetMapBorderIdAt(gSaveBlock1Ptr->pos.x + 7 + x, gSaveBlock1Ptr->pos.y + 7 + y); } -int CanCameraMoveInDirection(int direction) +bool32 CanCameraMoveInDirection(int direction) { int x, y; x = gSaveBlock1Ptr->pos.x + 7 + gDirectionToVectors[direction].x; y = gSaveBlock1Ptr->pos.y + 7 + gDirectionToVectors[direction].y; if (GetMapBorderIdAt(x, y) == -1) { - return 0; + return FALSE; } - return 1; + return TRUE; } -void sub_80887F8(struct MapConnection *connection, int direction, int x, int y) +static void SetPositionFromConnection(struct MapConnection *connection, int direction, int x, int y) { struct MapHeader const *mapHeader; mapHeader = GetMapHeaderFromConnection(connection); @@ -765,69 +769,57 @@ void sub_80887F8(struct MapConnection *connection, int direction, int x, int y) bool8 CameraMove(int x, int y) { - unsigned int direction; + int direction; struct MapConnection *connection; int old_x, old_y; gCamera.active = FALSE; direction = GetPostCameraMoveMapBorderId(x, y); - if (direction + 1 <= 1) + if (direction == CONNECTION_NONE || direction == CONNECTION_INVALID) { gSaveBlock1Ptr->pos.x += x; gSaveBlock1Ptr->pos.y += y; } else { - save_serialize_map(); + SaveMapView(); ClearMirageTowerPulseBlendEffect(); old_x = gSaveBlock1Ptr->pos.x; old_y = gSaveBlock1Ptr->pos.y; - connection = sub_8088950(direction, gSaveBlock1Ptr->pos.x, gSaveBlock1Ptr->pos.y); - sub_80887F8(connection, direction, x, y); + connection = GetIncomingConnection(direction, gSaveBlock1Ptr->pos.x, gSaveBlock1Ptr->pos.y); + SetPositionFromConnection(connection, direction, x, y); LoadMapFromCameraTransition(connection->mapGroup, connection->mapNum); gCamera.active = TRUE; gCamera.x = old_x - gSaveBlock1Ptr->pos.x; gCamera.y = old_y - gSaveBlock1Ptr->pos.y; gSaveBlock1Ptr->pos.x += x; gSaveBlock1Ptr->pos.y += y; - sub_80885C4(direction); + MoveMapViewToBackup(direction); } return gCamera.active; } -struct MapConnection *sub_8088950(u8 direction, int x, int y) +static struct MapConnection *GetIncomingConnection(u8 direction, int x, int y) { int count; int i; struct MapConnection *connection; const struct MapConnections *connections = gMapHeader.connections; - // UB: Multiple possible null dereferences -#ifdef UBFIX - if (connections != NULL) - { - count = connections->count; - connection = connections->connections; - if (connection != NULL) - { - for (i = 0; i < count; i++, connection++) - { - if (connection->direction == direction && sub_80889A8(direction, x, y, connection) == TRUE) - return connection; - } - } - } -#else + +#ifdef UBFIX // UB: Multiple possible null dereferences + if (connections == NULL || connections->connections == NULL) + return NULL; +#endif count = connections->count; connection = connections->connections; for (i = 0; i < count; i++, connection++) { - if (connection->direction == direction && sub_80889A8(direction, x, y, connection) == TRUE) + if (connection->direction == direction && IsPosInIncomingConnectingMap(direction, x, y, connection) == TRUE) return connection; } -#endif return NULL; } -bool8 sub_80889A8(u8 direction, int x, int y, struct MapConnection *connection) +static bool8 IsPosInIncomingConnectingMap(u8 direction, int x, int y, struct MapConnection *connection) { struct MapHeader const *mapHeader; mapHeader = GetMapHeaderFromConnection(connection); @@ -835,15 +827,15 @@ bool8 sub_80889A8(u8 direction, int x, int y, struct MapConnection *connection) { case CONNECTION_SOUTH: case CONNECTION_NORTH: - return sub_8088A0C(x, gMapHeader.mapLayout->width, mapHeader->mapLayout->width, connection->offset); + return IsCoordInIncomingConnectingMap(x, gMapHeader.mapLayout->width, mapHeader->mapLayout->width, connection->offset); case CONNECTION_WEST: case CONNECTION_EAST: - return sub_8088A0C(y, gMapHeader.mapLayout->height, mapHeader->mapLayout->height, connection->offset); + return IsCoordInIncomingConnectingMap(y, gMapHeader.mapLayout->height, mapHeader->mapLayout->height, connection->offset); } return FALSE; } -bool8 sub_8088A0C(int x, int src_width, int dest_width, int offset) +static bool8 IsCoordInIncomingConnectingMap(int coord, int srcMax, int destMax, int offset) { int offset2; offset2 = offset; @@ -851,24 +843,24 @@ bool8 sub_8088A0C(int x, int src_width, int dest_width, int offset) if (offset2 < 0) offset2 = 0; - if (dest_width + offset < src_width) - src_width = dest_width + offset; + if (destMax + offset < srcMax) + srcMax = destMax + offset; - if (offset2 <= x && x <= src_width) + if (offset2 <= coord && coord <= srcMax) return TRUE; return FALSE; } -int sub_8088A38(int x, int width) +static int IsCoordInConnectingMap(int coord, int max) { - if (x >= 0 && x < width) + if (coord >= 0 && coord < max) return TRUE; return FALSE; } -int sub_8088A4C(struct MapConnection *connection, int x, int y) +static int IsPosInConnectingMap(struct MapConnection *connection, int x, int y) { struct MapHeader const *mapHeader; mapHeader = GetMapHeaderFromConnection(connection); @@ -876,10 +868,10 @@ int sub_8088A4C(struct MapConnection *connection, int x, int y) { case CONNECTION_SOUTH: case CONNECTION_NORTH: - return sub_8088A38(x - connection->offset, mapHeader->mapLayout->width); + return IsCoordInConnectingMap(x - connection->offset, mapHeader->mapLayout->width); case CONNECTION_WEST: case CONNECTION_EAST: - return sub_8088A38(y - connection->offset, mapHeader->mapLayout->height); + return IsCoordInConnectingMap(y - connection->offset, mapHeader->mapLayout->height); } return FALSE; } @@ -909,7 +901,7 @@ struct MapConnection *GetConnectionAtCoords(s16 x, s16 y) { continue; } - if (sub_8088A4C(connection, x - 7, y - 7) == TRUE) + if (IsPosInConnectingMap(connection, x - 7, y - 7) == TRUE) { return connection; } @@ -991,12 +983,12 @@ static void CopyTilesetToVramUsingHeap(struct Tileset const *tileset, u16 numTil } } -void nullsub_3(u16 a0, u16 a1) +static void FieldmapPaletteDummy(u16 offset, u16 size) { } -void nullsub_90(void) +static void FieldmapUnkDummy(void) { } @@ -1011,17 +1003,17 @@ void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u16 size) { LoadPalette(&black, destOffset, 2); LoadPalette(((u16*)tileset->palettes) + 1, destOffset + 1, size - 2); - nullsub_3(destOffset + 1, (size - 2) >> 1); + FieldmapPaletteDummy(destOffset + 1, (size - 2) >> 1); } else if (tileset->isSecondary == TRUE) { LoadPalette(((u16*)tileset->palettes) + (NUM_PALS_IN_PRIMARY * 16), destOffset, size); - nullsub_3(destOffset, size >> 1); + FieldmapPaletteDummy(destOffset, size >> 1); } else { LoadCompressedPalette((u32*)tileset->palettes, destOffset, size); - nullsub_3(destOffset, size >> 1); + FieldmapPaletteDummy(destOffset, size >> 1); } } } diff --git a/src/save.c b/src/save.c index bbf4e7dbe..52301df03 100644 --- a/src/save.c +++ b/src/save.c @@ -913,7 +913,7 @@ void Task_LinkSave(u8 taskId) if (IsLinkTaskFinished()) { if (!tPartialSave) - save_serialize_map(); + SaveMapView(); tState = 3; } break; diff --git a/src/start_menu.c b/src/start_menu.c index 2316b85b6..275c6c032 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -850,7 +850,7 @@ static bool8 BattlePyramidRetireCallback(void) static void InitSave(void) { - save_serialize_map(); + SaveMapView(); sSaveDialogCallback = SaveConfirmSaveCallback; sSavingComplete = FALSE; } From 4a1cfbead245b3cac609b498dfca6b6d238f7f7a Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 16:55:33 -0400 Subject: [PATCH 20/63] Document remaining overworld --- data/scripts/cable_club.inc | 2 +- include/cable_club.h | 1 + include/constants/cable_club.h | 4 + include/event_scripts.h | 2 +- include/global.h | 10 - include/overworld.h | 17 +- src/cable_club.c | 16 +- src/diploma.c | 2 +- src/overworld.c | 343 +++++++++++++++++---------------- src/record_mixing.c | 2 +- 10 files changed, 203 insertions(+), 196 deletions(-) diff --git a/data/scripts/cable_club.inc b/data/scripts/cable_club.inc index 189a97b25..c17f77c0a 100644 --- a/data/scripts/cable_club.inc +++ b/data/scripts/cable_club.inc @@ -889,7 +889,7 @@ RecordCorner_EventScript_AlreadyMixed:: @ 82774E0 closemessage end -EventScript_ConfirmLeaveTradeRoom:: @ 82774EF +EventScript_ConfirmLeaveCableClubRoom:: @ 82774EF msgbox Text_TerminateLinkConfirmation, MSGBOX_YESNO compare VAR_RESULT, YES goto_if_eq EventScript_TerminateLink diff --git a/include/cable_club.h b/include/cable_club.h index a5a6acfa4..c493691c1 100644 --- a/include/cable_club.h +++ b/include/cable_club.h @@ -2,6 +2,7 @@ #define GUARD_CABLE_CLUB_H #include "task.h" +#include "constants/cable_club.h" void CreateTask_EnterCableClubSeat(TaskFunc taskFunc); u8 CreateTask_ReestablishCableClubLink(void); diff --git a/include/constants/cable_club.h b/include/constants/cable_club.h index cbdd049db..3515ffa2c 100644 --- a/include/constants/cable_club.h +++ b/include/constants/cable_club.h @@ -28,4 +28,8 @@ #define LINKUP_FAILED_BATTLE_TOWER 11 #define LINKUP_FOREIGN_GAME 12 +#define CABLE_SEAT_WAITING 0 +#define CABLE_SEAT_SUCCESS 1 +#define CABLE_SEAT_FAILED 2 + #endif //GUARD_CONSTANTS_CABLE_CLUB_H diff --git a/include/event_scripts.h b/include/event_scripts.h index ecb40c266..f5151ce20 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -607,7 +607,7 @@ extern const u8 EventScript_BattleColosseum_2P_PlayerSpot0[]; extern const u8 EventScript_BattleColosseum_2P_PlayerSpot1[]; extern const u8 EventScript_TradeCenter_Chair1[]; extern const u8 EventScript_TradeCenter_Chair0[]; -extern const u8 EventScript_ConfirmLeaveTradeRoom[]; +extern const u8 EventScript_ConfirmLeaveCableClubRoom[]; extern const u8 EventScript_TerminateLink[]; #endif // GUARD_EVENT_SCRIPTS_H diff --git a/include/global.h b/include/global.h index 497fb40b1..18e2bfea7 100644 --- a/include/global.h +++ b/include/global.h @@ -1055,14 +1055,4 @@ struct MapPosition s8 height; }; -struct TradeRoomPlayer -{ - u8 playerId; - u8 isLocalPlayer; - u8 c; - u8 facing; - struct MapPosition pos; - u16 field_C; -}; - #endif // GUARD_GLOBAL_H diff --git a/include/overworld.h b/include/overworld.h index 6efaa6ccb..16c75861c 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -7,17 +7,17 @@ #define LINK_KEY_CODE_DPAD_UP 0x13 #define LINK_KEY_CODE_DPAD_LEFT 0x14 #define LINK_KEY_CODE_DPAD_RIGHT 0x15 -#define LINK_KEY_CODE_UNK_2 0x16 +#define LINK_KEY_CODE_READY 0x16 #define LINK_KEY_CODE_EXIT_ROOM 0x17 #define LINK_KEY_CODE_START_BUTTON 0x18 #define LINK_KEY_CODE_A_BUTTON 0x19 -#define LINK_KEY_CODE_UNK_4 0x1A // I'd guess this is the B button? +#define LINK_KEY_CODE_IDLE 0x1A // These two are a hack to stop user input until link stuff can be // resolved. #define LINK_KEY_CODE_HANDLE_RECV_QUEUE 0x1B #define LINK_KEY_CODE_HANDLE_SEND_QUEUE 0x1C -#define LINK_KEY_CODE_UNK_7 0x1D +#define LINK_KEY_CODE_EXIT_SEAT 0x1D #define LINK_KEY_CODE_UNK_8 0x1E #define MOVEMENT_MODE_FREE 0 @@ -143,15 +143,14 @@ void CB2_ReturnToFieldFromMultiplayer(void); void CB2_ReturnToFieldWithOpenMenu(void); void CB2_ReturnToFieldContinueScript(void); void CB2_ReturnToFieldContinueScriptPlayMapMusic(void); -void sub_80861E8(void); +void CB2_ReturnToFieldFadeFromBlack(void); void CB2_ContinueSavedGame(void); void ResetAllMultiplayerState(void); -u32 sub_8087214(void); -bool32 sub_808727C(void); -u16 sub_8087288(void); -u16 sub_808729C(void); +u32 GetCableClubPartnersReady(void); +u16 SetInCableClubSeat(void); +u16 SetLinkWaitingForScript(void); u16 QueueExitLinkRoomKey(void); -u16 sub_80872C4(void); +u16 SetStartedCableClubActivity(void); bool32 Overworld_LinkRecvQueueLengthMoreThan2(void); bool32 Overworld_RecvKeysFromLinkIsRunning(void); bool32 Overworld_SendKeysToLinkIsRunning(void); diff --git a/src/cable_club.c b/src/cable_club.c index 1d8c6e53d..abe1d5d4d 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -1053,29 +1053,31 @@ static void Task_EnterCableClubSeat(u8 taskId) case 1: if (IsFieldMessageBoxHidden()) { - sub_8087288(); + SetInCableClubSeat(); SetLocalLinkPlayerId(gSpecialVar_0x8005); task->tState = 2; } break; case 2: - switch (sub_8087214()) + switch (GetCableClubPartnersReady()) { - case 0: + case CABLE_SEAT_WAITING: break; - case 1: + case CABLE_SEAT_SUCCESS: + // Partners linked and ready, switch to relevant link function HideFieldMessageBox(); task->tState = 0; - sub_80872C4(); + SetStartedCableClubActivity(); SwitchTaskToFollowupFunc(taskId); break; - case 2: + case CABLE_SEAT_FAILED: task->tState = 3; break; } break; case 3: - sub_808729C(); + // Exit, failure + SetLinkWaitingForScript(); sub_8197AE8(TRUE); DestroyTask(taskId); EnableBothScriptContexts(); diff --git a/src/diploma.c b/src/diploma.c index bf0d5b057..8652430e7 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -121,7 +121,7 @@ static void Task_DiplomaFadeOut(u8 taskId) Free(sDiplomaTilemapPtr); FreeAllWindowBuffers(); DestroyTask(taskId); - SetMainCallback2(sub_80861E8); + SetMainCallback2(CB2_ReturnToFieldFadeFromBlack); } } diff --git a/src/overworld.c b/src/overworld.c index f2ed5952c..600333a47 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -68,10 +68,20 @@ #include "constants/trainer_hill.h" #include "constants/weather.h" -#define PLAYER_TRADING_STATE_IDLE 0x80 -#define PLAYER_TRADING_STATE_BUSY 0x81 -#define PLAYER_TRADING_STATE_UNK_2 0x82 -#define PLAYER_TRADING_STATE_EXITING_ROOM 0x83 +struct CableClubPlayer +{ + u8 playerId; + u8 isLocalPlayer; + u8 movementMode; + u8 facing; + struct MapPosition pos; + u16 metatileBehavior; +}; + +#define PLAYER_LINK_STATE_IDLE 0x80 +#define PLAYER_LINK_STATE_BUSY 0x81 +#define PLAYER_LINK_STATE_READY 0x82 +#define PLAYER_LINK_STATE_EXITING_ROOM 0x83 #define FACING_NONE 0 #define FACING_UP 1 @@ -92,82 +102,82 @@ static void CB2_ReturnToFieldLink(void); static void CB2_LoadMapOnReturnToFieldCableClub(void); static void CB2_LoadMap2(void); static void VBlankCB_Field(void); -static void SpriteCB_LinkPlayer(struct Sprite *sprite); +static void SpriteCB_LinkPlayer(struct Sprite *); static void ChooseAmbientCrySpecies(void); -static void DoMapLoadLoop(u8 *state); -static bool32 LoadMapInStepsLocal(u8 *state, bool32); -static bool32 LoadMapInStepsLink(u8 *state); -static bool32 ReturnToFieldLocal(u8 *state); -static bool32 ReturnToFieldLink(u8 *state); +static void DoMapLoadLoop(u8 *); +static bool32 LoadMapInStepsLocal(u8 *, bool32); +static bool32 LoadMapInStepsLink(u8 *); +static bool32 ReturnToFieldLocal(u8 *); +static bool32 ReturnToFieldLink(u8 *); static void InitObjectEventsLink(void); static void InitObjectEventsLocal(void); static void InitOverworldGraphicsRegisters(void); static u8 GetSpriteForLinkedPlayer(u8); -static u16 KeyInterCB_SendNothing(u32 a1); +static u16 KeyInterCB_SendNothing(u32); static void ResetMirageTowerAndSaveBlockPtrs(void); -static void sub_80867D8(void); +static void ResetScreenForMapLoad(void); static void OffsetCameraFocusByLinkPlayerId(void); static void SpawnLinkPlayers(void); static void SetCameraToTrackGuestPlayer(void); -static void ResumeMap(bool32 arg0); +static void ResumeMap(bool32); static void SetCameraToTrackPlayer(void); static void InitObjectEventsReturnToField(void); static void InitViewGraphics(void); static void SetCameraToTrackGuestPlayer_2(void); static void CreateLinkPlayerSprites(void); static void ClearAllPlayerKeys(void); -static void ResetAllTradingStates(void); +static void ResetAllPlayerLinkStates(void); static void UpdateHeldKeyCode(u16); static void UpdateAllLinkPlayers(u16*, s32); -static u8 FlipVerticalAndClearForced(u8 a1, u8 a2); -static u8 LinkPlayerDetectCollision(u8 selfObjEventId, u8 a2, s16 x, s16 y); -static void CreateLinkPlayerSprite(u8 linkPlayerId, u8 gameVersion); -static void GetLinkPlayerCoords(u8 linkPlayerId, u16 *x, u16 *y); -static u8 GetLinkPlayerFacingDirection(u8 linkPlayerId); -static u8 GetLinkPlayerElevation(u8 linkPlayerId); -static s32 GetLinkPlayerObjectStepTimer(u8 linkPlayerId); -static u8 GetLinkPlayerIdAt(s16 x, s16 y); -static void SetPlayerFacingDirection(u8 linkPlayerId, u8 a2); -static void ZeroObjectEvent(struct ObjectEvent *objEvent); -static void SpawnLinkPlayerObjectEvent(u8 linkPlayerId, s16 x, s16 y, u8 a4); -static void InitLinkPlayerObjectEventPos(struct ObjectEvent *objEvent, s16 x, s16 y); -static void SetLinkPlayerObjectRange(u8 linkPlayerId, u8 a2); -static void DestroyLinkPlayerObject(u8 linkPlayerId); -static u8 GetSpriteForLinkedPlayer(u8 linkPlayerId); +static u8 FlipVerticalAndClearForced(u8, u8); +static u8 LinkPlayerDetectCollision(u8, u8, s16, s16); +static void CreateLinkPlayerSprite(u8, u8); +static void GetLinkPlayerCoords(u8, u16 *, u16 *); +static u8 GetLinkPlayerFacingDirection(u8); +static u8 GetLinkPlayerElevation(u8); +static s32 GetLinkPlayerObjectStepTimer(u8); +static u8 GetLinkPlayerIdAt(s16, s16); +static void SetPlayerFacingDirection(u8, u8); +static void ZeroObjectEvent(struct ObjectEvent *); +static void SpawnLinkPlayerObjectEvent(u8, s16, s16, u8); +static void InitLinkPlayerObjectEventPos(struct ObjectEvent *, s16, s16); +static void SetLinkPlayerObjectRange(u8, u8); +static void DestroyLinkPlayerObject(u8); +static u8 GetSpriteForLinkedPlayer(u8); static void RunTerminateLinkScript(void); static u32 GetLinkSendQueueLength(void); -static void ZeroLinkPlayerObjectEvent(struct LinkPlayerObjectEvent *linkPlayerObjEvent); -static const u8 *TryInteractWithPlayer(struct TradeRoomPlayer *a1); -static u16 GetDirectionForEventScript(const u8 *script); -static void sub_8087510(void); +static void ZeroLinkPlayerObjectEvent(struct LinkPlayerObjectEvent *); +static const u8 *TryInteractWithPlayer(struct CableClubPlayer *); +static u16 GetDirectionForEventScript(const u8 *); +static void InitLinkPlayerQueueScript(void); static void InitLinkRoomStartMenuScript(void); -static void sub_8087530(const u8 *script); -static void CreateConfirmLeaveTradeRoomPrompt(void); -static void InitMenuBasedScript(const u8 *script); -static void LoadTradeRoomPlayer(s32 linkPlayerId, s32 a2, struct TradeRoomPlayer *a3); -static bool32 sub_8087340(struct TradeRoomPlayer *a1); -static bool32 sub_8087340_2(struct TradeRoomPlayer *a1); -static u8 *TryGetTileEventScript(struct TradeRoomPlayer *a1); -static bool32 PlayerIsAtSouthExit(struct TradeRoomPlayer *a1); -static const u8 *TryInteractWithPlayer(struct TradeRoomPlayer *a1); +static void RunInteractLocalPlayerScript(const u8 *); +static void RunConfirmLeaveCableClubScript(void); +static void InitMenuBasedScript(const u8 *); +static void LoadCableClubPlayer(s32, s32, struct CableClubPlayer *); +static bool32 IsCableClubPlayerUnfrozen(struct CableClubPlayer *); +static bool32 CanCableClubPlayerPressStart(struct CableClubPlayer *); +static u8 *TryGetTileEventScript(struct CableClubPlayer *); +static bool32 PlayerIsAtSouthExit(struct CableClubPlayer *); +static const u8 *TryInteractWithPlayer(struct CableClubPlayer *); static u16 KeyInterCB_DeferToRecvQueue(u32); static u16 KeyInterCB_DeferToSendQueue(u32); -static void ResetPlayerHeldKeys(u16 *a1); -static u16 KeyInterCB_SelfIdle(u32 a1); -static u16 KeyInterCB_DeferToEventScript(u32 a1); -static u16 GetDirectionForDpadKey(u16 a1); +static void ResetPlayerHeldKeys(u16 *); +static u16 KeyInterCB_SelfIdle(u32); +static u16 KeyInterCB_DeferToEventScript(u32); +static u16 GetDirectionForDpadKey(u16); static void CB1_UpdateLinkState(void); static void SetKeyInterceptCallback(u16 (*func)(u32)); static void SetFieldVBlankCallback(void); static void FieldClearVBlankHBlankCallbacks(void); static void TransitionMapMusic(void); -static u8 GetAdjustedInitialTransitionFlags(struct InitialPlayerAvatarState *playerStruct, u16 a2, u8 a3); -static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *playerStruct, u8 a2, u16 a3, u8 a4); +static u8 GetAdjustedInitialTransitionFlags(struct InitialPlayerAvatarState *, u16, u8); +static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *, u8, u16, u8); static u16 GetCenterScreenMetatileBehavior(void); // IWRAM bss vars static void *sUnusedOverworldCallback; -static u8 sPlayerTradingStates[MAX_LINK_PLAYERS]; +static u8 sPlayerLinkStates[MAX_LINK_PLAYERS]; // This callback is called with a player's key code. It then returns an // adjusted key code, effectively intercepting the input before anything // can process it. @@ -311,13 +321,13 @@ static const struct ScanlineEffectParams sFlashEffectParams = static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); -static u8 MovementEventModeCB_Normal_2(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); +static u8 MovementEventModeCB_Scripted(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); static u8 (*const gLinkPlayerMovementModes[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) = { - MovementEventModeCB_Normal, // MOVEMENT_MODE_FREE - MovementEventModeCB_Ignored, // MOVEMENT_MODE_FROZEN - MovementEventModeCB_Normal_2, // MOVEMENT_MODE_SCRIPTED + [MOVEMENT_MODE_FREE] = MovementEventModeCB_Normal, + [MOVEMENT_MODE_FROZEN] = MovementEventModeCB_Ignored, + [MOVEMENT_MODE_SCRIPTED] = MovementEventModeCB_Scripted, }; static u8 FacingHandler_DoNothing(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); @@ -411,7 +421,7 @@ static void Overworld_ResetStateAfterWhiteOut(void) } } -static void sub_8084788(void) +static void UpdateMiscOverworldStates(void) { FlagClear(FLAG_SYS_SAFARI_MODE); ChooseAmbientCrySpecies(); @@ -1668,14 +1678,14 @@ void CB2_ReturnToFieldContinueScriptPlayMapMusic(void) CB2_ReturnToField(); } -void sub_80861E8(void) +void CB2_ReturnToFieldFadeFromBlack(void) { FieldClearVBlankHBlankCallbacks(); gFieldCallback = FieldCB_WarpExitFadeFromBlack; CB2_ReturnToField(); } -static void sub_8086204(void) +static void FieldCB_FadeTryShowMapPopup(void) { if (SHOW_MAP_NAME_ENABLED && SecretBaseMapPopupEnabled() == TRUE) ShowMapNamePopup(); @@ -1704,7 +1714,7 @@ void CB2_ContinueSavedGame(void) UnfreezeObjectEvents(); DoTimeBasedEvents(); - sub_8084788(); + UpdateMiscOverworldStates(); if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR) InitBattlePyramidMap(TRUE); else if (trainerHillMapId != 0) @@ -1727,7 +1737,7 @@ void CB2_ContinueSavedGame(void) else { TryPutTodaysRivalTrainerOnAir(); - gFieldCallback = sub_8086204; + gFieldCallback = FieldCB_FadeTryShowMapPopup; SetMainCallback1(CB1_Overworld); CB2_ReturnToField(); } @@ -1796,7 +1806,7 @@ static bool32 LoadMapInStepsLink(u8 *state) ScriptContext1_Init(); ScriptContext2_Disable(); ResetMirageTowerAndSaveBlockPtrs(); - sub_80867D8(); + ResetScreenForMapLoad(); (*state)++; break; case 1: @@ -1877,7 +1887,7 @@ static bool32 LoadMapInStepsLocal(u8 *state, bool32 a2) break; case 1: ResetMirageTowerAndSaveBlockPtrs(); - sub_80867D8(); + ResetScreenForMapLoad(); (*state)++; break; case 2: @@ -1944,7 +1954,7 @@ static bool32 ReturnToFieldLocal(u8 *state) { case 0: ResetMirageTowerAndSaveBlockPtrs(); - sub_80867D8(); + ResetScreenForMapLoad(); ResumeMap(FALSE); InitObjectEventsReturnToField(); SetCameraToTrackPlayer(); @@ -1973,7 +1983,7 @@ static bool32 ReturnToFieldLink(u8 *state) case 0: FieldClearVBlankHBlankCallbacks(); ResetMirageTowerAndSaveBlockPtrs(); - sub_80867D8(); + ResetScreenForMapLoad(); (*state)++; break; case 1: @@ -2054,7 +2064,7 @@ static void ResetMirageTowerAndSaveBlockPtrs(void) MoveSaveBlocks_ResetHeap(); } -static void sub_80867D8(void) +static void ResetScreenForMapLoad(void) { SetGpuReg(REG_OFFSET_DISPCNT, 0); ScanlineEffect_Stop(); @@ -2241,7 +2251,7 @@ static void CB1_UpdateLinkState(void) void ResetAllMultiplayerState(void) { - ResetAllTradingStates(); + ResetAllPlayerLinkStates(); SetKeyInterceptCallback(KeyInterCB_SelfIdle); } @@ -2266,57 +2276,57 @@ static void CheckRfuKeepAliveTimer(void) LinkRfu_FatalError(); } -static void ResetAllTradingStates(void) +static void ResetAllPlayerLinkStates(void) { s32 i; for (i = 0; i < MAX_LINK_PLAYERS; i++) - sPlayerTradingStates[i] = PLAYER_TRADING_STATE_IDLE; + sPlayerLinkStates[i] = PLAYER_LINK_STATE_IDLE; } -// Returns true if all connected players are in tradingState. -static bool32 AreAllPlayersInTradingState(u16 tradingState) +// Returns true if all connected players are in state. +static bool32 AreAllPlayersInLinkState(u16 state) { s32 i; s32 count = gFieldLinkPlayerCount; for (i = 0; i < count; i++) - if (sPlayerTradingStates[i] != tradingState) + if (sPlayerLinkStates[i] != state) return FALSE; return TRUE; } -static bool32 IsAnyPlayerInTradingState(u16 tradingState) +static bool32 IsAnyPlayerInLinkState(u16 state) { s32 i; s32 count = gFieldLinkPlayerCount; for (i = 0; i < count; i++) - if (sPlayerTradingStates[i] == tradingState) + if (sPlayerLinkStates[i] == state) return TRUE; return FALSE; } -static void HandleLinkPlayerKeyInput(u32 playerId, u16 key, struct TradeRoomPlayer *trainer, u16 *forceFacing) +static void HandleLinkPlayerKeyInput(u32 playerId, u16 key, struct CableClubPlayer *trainer, u16 *forceFacing) { const u8 *script; - if (sPlayerTradingStates[playerId] == PLAYER_TRADING_STATE_IDLE) + if (sPlayerLinkStates[playerId] == PLAYER_LINK_STATE_IDLE) { script = TryGetTileEventScript(trainer); if (script) { *forceFacing = GetDirectionForEventScript(script); - sPlayerTradingStates[playerId] = PLAYER_TRADING_STATE_BUSY; + sPlayerLinkStates[playerId] = PLAYER_LINK_STATE_BUSY; if (trainer->isLocalPlayer) { SetKeyInterceptCallback(KeyInterCB_DeferToEventScript); - sub_8087530(script); + RunInteractLocalPlayerScript(script); } return; } - if (IsAnyPlayerInTradingState(PLAYER_TRADING_STATE_EXITING_ROOM) == TRUE) + if (IsAnyPlayerInLinkState(PLAYER_LINK_STATE_EXITING_ROOM) == TRUE) { - sPlayerTradingStates[playerId] = PLAYER_TRADING_STATE_BUSY; + sPlayerLinkStates[playerId] = PLAYER_LINK_STATE_BUSY; if (trainer->isLocalPlayer) { SetKeyInterceptCallback(KeyInterCB_DeferToEventScript); @@ -2328,9 +2338,9 @@ static void HandleLinkPlayerKeyInput(u32 playerId, u16 key, struct TradeRoomPlay switch (key) { case LINK_KEY_CODE_START_BUTTON: - if (sub_8087340_2(trainer)) + if (CanCableClubPlayerPressStart(trainer)) { - sPlayerTradingStates[playerId] = PLAYER_TRADING_STATE_BUSY; + sPlayerLinkStates[playerId] = PLAYER_LINK_STATE_BUSY; if (trainer->isLocalPlayer) { SetKeyInterceptCallback(KeyInterCB_DeferToEventScript); @@ -2341,11 +2351,11 @@ static void HandleLinkPlayerKeyInput(u32 playerId, u16 key, struct TradeRoomPlay case LINK_KEY_CODE_DPAD_DOWN: if (PlayerIsAtSouthExit(trainer) == TRUE) { - sPlayerTradingStates[playerId] = PLAYER_TRADING_STATE_BUSY; + sPlayerLinkStates[playerId] = PLAYER_LINK_STATE_BUSY; if (trainer->isLocalPlayer) { SetKeyInterceptCallback(KeyInterCB_DeferToEventScript); - CreateConfirmLeaveTradeRoomPrompt(); + RunConfirmLeaveCableClubScript(); } } break; @@ -2353,7 +2363,7 @@ static void HandleLinkPlayerKeyInput(u32 playerId, u16 key, struct TradeRoomPlay script = TryInteractWithPlayer(trainer); if (script) { - sPlayerTradingStates[playerId] = PLAYER_TRADING_STATE_BUSY; + sPlayerLinkStates[playerId] = PLAYER_LINK_STATE_BUSY; if (trainer->isLocalPlayer) { SetKeyInterceptCallback(KeyInterCB_DeferToEventScript); @@ -2362,24 +2372,24 @@ static void HandleLinkPlayerKeyInput(u32 playerId, u16 key, struct TradeRoomPlay } break; case LINK_KEY_CODE_HANDLE_RECV_QUEUE: - if (sub_8087340(trainer)) + if (IsCableClubPlayerUnfrozen(trainer)) { - sPlayerTradingStates[playerId] = PLAYER_TRADING_STATE_BUSY; + sPlayerLinkStates[playerId] = PLAYER_LINK_STATE_BUSY; if (trainer->isLocalPlayer) { SetKeyInterceptCallback(KeyInterCB_DeferToRecvQueue); - sub_8087510(); + InitLinkPlayerQueueScript(); } } break; case LINK_KEY_CODE_HANDLE_SEND_QUEUE: - if (sub_8087340(trainer)) + if (IsCableClubPlayerUnfrozen(trainer)) { - sPlayerTradingStates[playerId] = PLAYER_TRADING_STATE_BUSY; + sPlayerLinkStates[playerId] = PLAYER_LINK_STATE_BUSY; if (trainer->isLocalPlayer) { SetKeyInterceptCallback(KeyInterCB_DeferToSendQueue); - sub_8087510(); + InitLinkPlayerQueueScript(); } } break; @@ -2389,35 +2399,35 @@ static void HandleLinkPlayerKeyInput(u32 playerId, u16 key, struct TradeRoomPlay switch (key) { case LINK_KEY_CODE_EXIT_ROOM: - sPlayerTradingStates[playerId] = PLAYER_TRADING_STATE_EXITING_ROOM; + sPlayerLinkStates[playerId] = PLAYER_LINK_STATE_EXITING_ROOM; break; - case LINK_KEY_CODE_UNK_2: - sPlayerTradingStates[playerId] = PLAYER_TRADING_STATE_UNK_2; + case LINK_KEY_CODE_READY: + sPlayerLinkStates[playerId] = PLAYER_LINK_STATE_READY; break; - case LINK_KEY_CODE_UNK_4: - sPlayerTradingStates[playerId] = PLAYER_TRADING_STATE_IDLE; + case LINK_KEY_CODE_IDLE: + sPlayerLinkStates[playerId] = PLAYER_LINK_STATE_IDLE; if (trainer->isLocalPlayer) SetKeyInterceptCallback(KeyInterCB_SelfIdle); break; - case LINK_KEY_CODE_UNK_7: - if (sPlayerTradingStates[playerId] == PLAYER_TRADING_STATE_UNK_2) - sPlayerTradingStates[playerId] = PLAYER_TRADING_STATE_BUSY; + case LINK_KEY_CODE_EXIT_SEAT: + if (sPlayerLinkStates[playerId] == PLAYER_LINK_STATE_READY) + sPlayerLinkStates[playerId] = PLAYER_LINK_STATE_BUSY; break; } } static void UpdateAllLinkPlayers(u16 *keys, s32 selfId) { - struct TradeRoomPlayer trainer; + struct CableClubPlayer trainer; s32 i; for (i = 0; i < MAX_LINK_PLAYERS; i++) { u8 key = keys[i]; u16 setFacing = FACING_NONE; - LoadTradeRoomPlayer(i, selfId, &trainer); + LoadCableClubPlayer(i, selfId, &trainer); HandleLinkPlayerKeyInput(i, key, &trainer, &setFacing); - if (sPlayerTradingStates[i] == PLAYER_TRADING_STATE_IDLE) + if (sPlayerLinkStates[i] == PLAYER_LINK_STATE_IDLE) setFacing = GetDirectionForDpadKey(key); SetPlayerFacingDirection(i, setFacing); } @@ -2504,7 +2514,7 @@ static u16 KeyInterCB_SelfIdle(u32 key) return LINK_KEY_CODE_HANDLE_SEND_QUEUE; } -static u16 sub_80870EC(u32 key) +static u16 KeyInterCB_Idle(u32 key) { CheckRfuKeepAliveTimer(); return LINK_KEY_CODE_EMPTY; @@ -2521,8 +2531,8 @@ static u16 KeyInterCB_DeferToEventScript(u32 key) } else { - retVal = LINK_KEY_CODE_UNK_4; - SetKeyInterceptCallback(sub_80870EC); + retVal = LINK_KEY_CODE_IDLE; + SetKeyInterceptCallback(KeyInterCB_Idle); } return retVal; } @@ -2537,9 +2547,9 @@ static u16 KeyInterCB_DeferToRecvQueue(u32 key) } else { - retVal = LINK_KEY_CODE_UNK_4; + retVal = LINK_KEY_CODE_IDLE; ScriptContext2_Disable(); - SetKeyInterceptCallback(sub_80870EC); + SetKeyInterceptCallback(KeyInterCB_Idle); } return retVal; } @@ -2554,27 +2564,27 @@ static u16 KeyInterCB_DeferToSendQueue(u32 key) } else { - retVal = LINK_KEY_CODE_UNK_4; + retVal = LINK_KEY_CODE_IDLE; ScriptContext2_Disable(); - SetKeyInterceptCallback(sub_80870EC); + SetKeyInterceptCallback(KeyInterCB_Idle); } return retVal; } -static u16 KeyInterCB_DoNothingAndKeepAlive(u32 key) +static u16 KeyInterCB_ExitingSeat(u32 key) { CheckRfuKeepAliveTimer(); return LINK_KEY_CODE_EMPTY; } -static u16 sub_8087170(u32 keyOrPlayerId) +static u16 KeyInterCB_Ready(u32 keyOrPlayerId) { - if (sPlayerTradingStates[keyOrPlayerId] == PLAYER_TRADING_STATE_UNK_2) + if (sPlayerLinkStates[keyOrPlayerId] == PLAYER_LINK_STATE_READY) { if (JOY_NEW(B_BUTTON)) { - SetKeyInterceptCallback(KeyInterCB_DoNothingAndKeepAlive); - return LINK_KEY_CODE_UNK_7; + SetKeyInterceptCallback(KeyInterCB_ExitingSeat); + return LINK_KEY_CODE_EXIT_SEAT; } else { @@ -2588,10 +2598,10 @@ static u16 sub_8087170(u32 keyOrPlayerId) } } -static u16 sub_80871AC(u32 a1) +static u16 KeyInterCB_SetReady(u32 a1) { - SetKeyInterceptCallback(sub_8087170); - return LINK_KEY_CODE_UNK_2; + SetKeyInterceptCallback(KeyInterCB_Ready); + return LINK_KEY_CODE_READY; } static u16 KeyInterCB_SendNothing(u32 key) @@ -2604,9 +2614,9 @@ static u16 KeyInterCB_WaitForPlayersToExit(u32 keyOrPlayerId) // keyOrPlayerId could be any keycode. This callback does no sanity checking // on the size of the key. It's assuming that it is being called from // CB1_UpdateLinkState. - if (sPlayerTradingStates[keyOrPlayerId] != PLAYER_TRADING_STATE_EXITING_ROOM) + if (sPlayerLinkStates[keyOrPlayerId] != PLAYER_LINK_STATE_EXITING_ROOM) CheckRfuKeepAliveTimer(); - if (AreAllPlayersInTradingState(PLAYER_TRADING_STATE_EXITING_ROOM) == TRUE) + if (AreAllPlayersInLinkState(PLAYER_LINK_STATE_EXITING_ROOM) == TRUE) { ScriptContext1_SetupScript(EventScript_DoLinkRoomExit); SetKeyInterceptCallback(KeyInterCB_SendNothing); @@ -2620,37 +2630,38 @@ static u16 KeyInterCB_SendExitRoomKey(u32 key) return LINK_KEY_CODE_EXIT_ROOM; } -// Duplicate function. -static u16 KeyInterCB_SendNothing_2(u32 key) +// Identical to KeyInterCB_SendNothing +static u16 KeyInterCB_InLinkActivity(u32 key) { return LINK_KEY_CODE_EMPTY; } -u32 sub_8087214(void) +u32 GetCableClubPartnersReady(void) { - if (IsAnyPlayerInTradingState(PLAYER_TRADING_STATE_EXITING_ROOM) == TRUE) - return 2; - if (sPlayerKeyInterceptCallback == sub_8087170 && sPlayerTradingStates[gLocalLinkPlayerId] != PLAYER_TRADING_STATE_UNK_2) - return 0; - if (sPlayerKeyInterceptCallback == KeyInterCB_DoNothingAndKeepAlive && sPlayerTradingStates[gLocalLinkPlayerId] == PLAYER_TRADING_STATE_BUSY) - return 2; - if (AreAllPlayersInTradingState(PLAYER_TRADING_STATE_UNK_2) != FALSE) - return 1; + if (IsAnyPlayerInLinkState(PLAYER_LINK_STATE_EXITING_ROOM) == TRUE) + return CABLE_SEAT_FAILED; + if (sPlayerKeyInterceptCallback == KeyInterCB_Ready && sPlayerLinkStates[gLocalLinkPlayerId] != PLAYER_LINK_STATE_READY) + return CABLE_SEAT_WAITING; + if (sPlayerKeyInterceptCallback == KeyInterCB_ExitingSeat && sPlayerLinkStates[gLocalLinkPlayerId] == PLAYER_LINK_STATE_BUSY) + return CABLE_SEAT_FAILED; + if (AreAllPlayersInLinkState(PLAYER_LINK_STATE_READY)) + return CABLE_SEAT_SUCCESS; + return CABLE_SEAT_WAITING; +} + +// Unused +static bool32 IsAnyPlayerExitingCableClub(void) +{ + return IsAnyPlayerInLinkState(PLAYER_LINK_STATE_EXITING_ROOM); +} + +u16 SetInCableClubSeat(void) +{ + SetKeyInterceptCallback(KeyInterCB_SetReady); return 0; } -bool32 sub_808727C(void) -{ - return IsAnyPlayerInTradingState(PLAYER_TRADING_STATE_EXITING_ROOM); -} - -u16 sub_8087288(void) -{ - SetKeyInterceptCallback(sub_80871AC); - return 0; -} - -u16 sub_808729C(void) +u16 SetLinkWaitingForScript(void) { SetKeyInterceptCallback(KeyInterCB_DeferToEventScript); return 0; @@ -2664,58 +2675,58 @@ u16 QueueExitLinkRoomKey(void) return 0; } -u16 sub_80872C4(void) +u16 SetStartedCableClubActivity(void) { - SetKeyInterceptCallback(KeyInterCB_SendNothing_2); + SetKeyInterceptCallback(KeyInterCB_InLinkActivity); return 0; } -static void LoadTradeRoomPlayer(s32 linkPlayerId, s32 myPlayerId, struct TradeRoomPlayer *trainer) +static void LoadCableClubPlayer(s32 linkPlayerId, s32 myPlayerId, struct CableClubPlayer *trainer) { s16 x, y; trainer->playerId = linkPlayerId; trainer->isLocalPlayer = (linkPlayerId == myPlayerId) ? 1 : 0; - trainer->c = gLinkPlayerObjectEvents[linkPlayerId].movementMode; + trainer->movementMode = gLinkPlayerObjectEvents[linkPlayerId].movementMode; trainer->facing = GetLinkPlayerFacingDirection(linkPlayerId); GetLinkPlayerCoords(linkPlayerId, &x, &y); trainer->pos.x = x; trainer->pos.y = y; trainer->pos.height = GetLinkPlayerElevation(linkPlayerId); - trainer->field_C = MapGridGetMetatileBehaviorAt(x, y); + trainer->metatileBehavior = MapGridGetMetatileBehaviorAt(x, y); } -static bool32 sub_8087340(struct TradeRoomPlayer *player) +static bool32 IsCableClubPlayerUnfrozen(struct CableClubPlayer *player) { - u8 v1 = player->c; - if (v1 == MOVEMENT_MODE_SCRIPTED || v1 == MOVEMENT_MODE_FREE) + u8 mode = player->movementMode; + if (mode == MOVEMENT_MODE_SCRIPTED || mode == MOVEMENT_MODE_FREE) return TRUE; else return FALSE; } -// Duplicate function. -static bool32 sub_8087340_2(struct TradeRoomPlayer *player) +// Identical to IsCableClubPlayerUnfrozen +static bool32 CanCableClubPlayerPressStart(struct CableClubPlayer *player) { - u8 v1 = player->c; - if (v1 == MOVEMENT_MODE_SCRIPTED || v1 == MOVEMENT_MODE_FREE) + u8 mode = player->movementMode; + if (mode == MOVEMENT_MODE_SCRIPTED || mode == MOVEMENT_MODE_FREE) return TRUE; else return FALSE; } -static u8 *TryGetTileEventScript(struct TradeRoomPlayer *player) +static u8 *TryGetTileEventScript(struct CableClubPlayer *player) { - if (player->c != MOVEMENT_MODE_SCRIPTED) + if (player->movementMode != MOVEMENT_MODE_SCRIPTED) return FACING_NONE; return GetCoordEventScriptAtMapPosition(&player->pos); } -static bool32 PlayerIsAtSouthExit(struct TradeRoomPlayer *player) +static bool32 PlayerIsAtSouthExit(struct CableClubPlayer *player) { - if (player->c != MOVEMENT_MODE_SCRIPTED && player->c != MOVEMENT_MODE_FREE) + if (player->movementMode != MOVEMENT_MODE_SCRIPTED && player->movementMode != MOVEMENT_MODE_FREE) return FALSE; - else if (!MetatileBehavior_IsSouthArrowWarp(player->field_C)) + else if (!MetatileBehavior_IsSouthArrowWarp(player->metatileBehavior)) return FALSE; else if (player->facing != DIR_SOUTH) return FALSE; @@ -2723,12 +2734,12 @@ static bool32 PlayerIsAtSouthExit(struct TradeRoomPlayer *player) return TRUE; } -static const u8 *TryInteractWithPlayer(struct TradeRoomPlayer *player) +static const u8 *TryInteractWithPlayer(struct CableClubPlayer *player) { struct MapPosition otherPlayerPos; u8 linkPlayerId; - if (player->c != MOVEMENT_MODE_FREE && player->c != MOVEMENT_MODE_SCRIPTED) + if (player->movementMode != MOVEMENT_MODE_FREE && player->movementMode != MOVEMENT_MODE_SCRIPTED) return FACING_NONE; otherPlayerPos = player->pos; @@ -2741,7 +2752,7 @@ static const u8 *TryInteractWithPlayer(struct TradeRoomPlayer *player) { if (!player->isLocalPlayer) return CableClub_EventScript_TooBusyToNotice; - else if (sPlayerTradingStates[linkPlayerId] != PLAYER_TRADING_STATE_IDLE) + else if (sPlayerLinkStates[linkPlayerId] != PLAYER_LINK_STATE_IDLE) return CableClub_EventScript_TooBusyToNotice; else if (!GetLinkTrainerCardColor(linkPlayerId)) return CableClub_EventScript_ReadTrainerCard; @@ -2749,7 +2760,7 @@ static const u8 *TryInteractWithPlayer(struct TradeRoomPlayer *player) return CableClub_EventScript_ReadTrainerCardColored; } - return GetInteractedLinkPlayerScript(&otherPlayerPos, player->field_C, player->facing); + return GetInteractedLinkPlayerScript(&otherPlayerPos, player->metatileBehavior, player->facing); } // This returns which direction to force the player to look when one of @@ -2784,7 +2795,7 @@ static u16 GetDirectionForEventScript(const u8 *script) return FACING_NONE; } -static void sub_8087510(void) +static void InitLinkPlayerQueueScript(void) { ScriptContext2_Enable(); } @@ -2796,17 +2807,17 @@ static void InitLinkRoomStartMenuScript(void) ScriptContext2_Enable(); } -static void sub_8087530(const u8 *script) +static void RunInteractLocalPlayerScript(const u8 *script) { PlaySE(SE_SELECT); ScriptContext1_SetupScript(script); ScriptContext2_Enable(); } -static void CreateConfirmLeaveTradeRoomPrompt(void) +static void RunConfirmLeaveCableClubScript(void) { PlaySE(SE_WIN_OPEN); - ScriptContext1_SetupScript(EventScript_ConfirmLeaveTradeRoom); + ScriptContext1_SetupScript(EventScript_ConfirmLeaveCableClubRoom); ScriptContext2_Enable(); } @@ -3058,8 +3069,8 @@ static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *linkPlayerOb return FACING_UP; } -// Duplicate Function -static u8 MovementEventModeCB_Normal_2(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) +// Identical to MovementEventModeCB_Normal +static u8 MovementEventModeCB_Scripted(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) { return gLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); } diff --git a/src/record_mixing.c b/src/record_mixing.c index bb19fad74..7cc88a54c 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -363,7 +363,7 @@ static void Task_RecordMixing_Main(u8 taskId) { free(sReceivedRecords); free(sSentRecord); - sub_808729C(); + SetLinkWaitingForScript(); if (gWirelessCommType != 0) { CreateTask(Task_ReturnToFieldRecordMixing, 10); From 7d2a94282a809661693db9f3ba6a80a834337baa Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 17:05:38 -0400 Subject: [PATCH 21/63] Label horizontal fog data --- src/field_weather_effect.c | 43 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index e0103c5a3..63043885d 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -1266,10 +1266,9 @@ static void UpdateThunderSound(void) // WEATHER_FOG_HORIZONTAL and WEATHER_UNDERWATER //------------------------------------------------------------------------------ -// unused data -static const u16 unusedData_839AB1C[] = {0, 6, 6, 12, 18, 42, 300, 300}; +static const u16 sUnusedData[] = {0, 6, 6, 12, 18, 42, 300, 300}; -static const struct OamData gOamData_839AB2C = +static const struct OamData sOamData_FogH = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, @@ -1286,61 +1285,61 @@ static const struct OamData gOamData_839AB2C = .affineParam = 0, }; -static const union AnimCmd gSpriteAnim_839AB34[] = +static const union AnimCmd sAnim_FogH_0[] = { ANIMCMD_FRAME(0, 16), ANIMCMD_END, }; -static const union AnimCmd gSpriteAnim_839AB3C[] = +static const union AnimCmd sAnim_FogH_1[] = { ANIMCMD_FRAME(32, 16), ANIMCMD_END, }; -static const union AnimCmd gSpriteAnim_839AB44[] = +static const union AnimCmd sAnim_FogH_2[] = { ANIMCMD_FRAME(64, 16), ANIMCMD_END, }; -static const union AnimCmd gSpriteAnim_839AB4C[] = +static const union AnimCmd sAnim_FogH_3[] = { ANIMCMD_FRAME(96, 16), ANIMCMD_END, }; -static const union AnimCmd gSpriteAnim_839AB54[] = +static const union AnimCmd sAnim_FogH_4[] = { ANIMCMD_FRAME(128, 16), ANIMCMD_END, }; -static const union AnimCmd gSpriteAnim_839AB5C[] = +static const union AnimCmd sAnim_FogH_5[] = { ANIMCMD_FRAME(160, 16), ANIMCMD_END, }; -static const union AnimCmd *const gSpriteAnimTable_839AB64[] = +static const union AnimCmd *const sAnims_FogH[] = { - gSpriteAnim_839AB34, - gSpriteAnim_839AB3C, - gSpriteAnim_839AB44, - gSpriteAnim_839AB4C, - gSpriteAnim_839AB54, - gSpriteAnim_839AB5C, + sAnim_FogH_0, + sAnim_FogH_1, + sAnim_FogH_2, + sAnim_FogH_3, + sAnim_FogH_4, + sAnim_FogH_5, }; -static const union AffineAnimCmd gSpriteAffineAnim_839AB7C[] = +static const union AffineAnimCmd sAffineAnim_FogH[] = { AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0), AFFINEANIMCMD_END, }; -static const union AffineAnimCmd *const gSpriteAffineAnimTable_839AB8C[] = +static const union AffineAnimCmd *const sAffineAnims_FogH[] = { - gSpriteAffineAnim_839AB7C, + sAffineAnim_FogH, }; static void FogHorizontalSpriteCallback(struct Sprite *); @@ -1348,10 +1347,10 @@ static const struct SpriteTemplate sFogHorizontalSpriteTemplate = { .tileTag = GFXTAG_FOG_H, .paletteTag = PALTAG_WEATHER, - .oam = &gOamData_839AB2C, - .anims = gSpriteAnimTable_839AB64, + .oam = &sOamData_FogH, + .anims = sAnims_FogH, .images = NULL, - .affineAnims = gSpriteAffineAnimTable_839AB8C, + .affineAnims = sAffineAnims_FogH, .callback = FogHorizontalSpriteCallback, }; From 0dc7ff89945d471a62659b3d9f21cb7f50f331eb Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 17:17:41 -0400 Subject: [PATCH 22/63] Minor misc field doc --- .../map_popup/{857F444.pal => underwater.pal} | 0 include/field_camera.h | 7 +-- src/battle_transition.c | 2 +- src/field_camera.c | 14 ++--- src/field_screen_effect.c | 12 ++--- src/map_name_popup.c | 52 +++++++++---------- 6 files changed, 39 insertions(+), 48 deletions(-) rename graphics/interface/map_popup/{857F444.pal => underwater.pal} (100%) diff --git a/graphics/interface/map_popup/857F444.pal b/graphics/interface/map_popup/underwater.pal similarity index 100% rename from graphics/interface/map_popup/857F444.pal rename to graphics/interface/map_popup/underwater.pal diff --git a/include/field_camera.h b/include/field_camera.h index 2bed02b20..b245fca84 100644 --- a/include/field_camera.h +++ b/include/field_camera.h @@ -1,8 +1,6 @@ #ifndef GUARD_FIELD_CAMERA_H #define GUARD_FIELD_CAMERA_H -// Exported type declarations - struct CameraObject { void (*callback)(struct CameraObject *); @@ -13,18 +11,15 @@ struct CameraObject s32 y; }; -// Exported RAM declarations extern struct CameraObject gFieldCamera; extern u16 gTotalCameraPixelOffsetX; extern u16 gTotalCameraPixelOffsetY; -// Exported ROM declarations void DrawWholeMapView(void); void CurrentMapDrawMetatileAt(int x, int y); -void sub_8089C08(s16 *a0, s16 *a1); +void GetCameraOffsetWithPan(s16 *a0, s16 *a1); void DrawDoorMetatileAt(int x, int y, u16 *arr); void ResetFieldCamera(void); -void sub_8057A58(void); void ResetCameraUpdateInfo(void); u32 InitCameraUpdateCallback(u8 a); void CameraUpdate(void); diff --git a/src/battle_transition.c b/src/battle_transition.c index 66a4395b9..d47b99c86 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -3675,7 +3675,7 @@ static bool8 Phase1_TransitionAll_Func2(struct Task *task) static void InitTransitionStructVars(void) { memset(sTransitionStructPtr, 0, sizeof(*sTransitionStructPtr)); - sub_8089C08(&sTransitionStructPtr->field_14, &sTransitionStructPtr->field_16); + GetCameraOffsetWithPan(&sTransitionStructPtr->field_14, &sTransitionStructPtr->field_16); } static void VBlankCB_BattleTransition(void) diff --git a/src/field_camera.c b/src/field_camera.c index 699b984ac..a36b6883c 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -39,7 +39,7 @@ static void CameraPanningCB_PanAhead(void); static struct FieldCameraOffset sFieldCameraOffset; static s16 sHorizontalCameraPan; static s16 sVerticalCameraPan; -static bool8 gUnknown_03000E2C; +static bool8 sBikeCameraPanFlag; static void (*sFieldCameraPanningCallback)(void); struct CameraObject gFieldCamera; @@ -89,7 +89,7 @@ void FieldUpdateBgTilemapScroll(void) SetGpuReg(REG_OFFSET_BG3VOFS, r4); } -void sub_8089C08(s16 *x, s16 *y) +void GetCameraOffsetWithPan(s16 *x, s16 *y) { *x = sFieldCameraOffset.xPixelOffset + sHorizontalCameraPan; *y = sFieldCameraOffset.yPixelOffset + sVerticalCameraPan + 8; @@ -450,7 +450,7 @@ void SetCameraPanning(s16 a, s16 b) void InstallCameraPanAheadCallback(void) { sFieldCameraPanningCallback = CameraPanningCB_PanAhead; - gUnknown_03000E2C = FALSE; + sBikeCameraPanFlag = FALSE; sHorizontalCameraPan = 0; sVerticalCameraPan = 32; } @@ -474,16 +474,16 @@ static void CameraPanningCB_PanAhead(void) } else { - // this code is never reached. + // this code is never reached if (gPlayerAvatar.tileTransitionState == T_TILE_TRANSITION) { - gUnknown_03000E2C ^= 1; - if (gUnknown_03000E2C == FALSE) + sBikeCameraPanFlag ^= 1; + if (sBikeCameraPanFlag == FALSE) return; } else { - gUnknown_03000E2C = FALSE; + sBikeCameraPanFlag = FALSE; } var = GetPlayerMovementDirection(); diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index db82d667c..fbe725c0b 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -1087,7 +1087,7 @@ static void LoadOrbEffectPalette(bool8 blueOrb) } } -static bool8 sub_80B02C8(u16 shakeDir) +static bool8 UpdateOrbEffectBlend(u16 shakeDir) { u8 lo = REG_BLDALPHA & 0xFF; u8 hi = REG_BLDALPHA >> 8; @@ -1095,21 +1095,17 @@ static bool8 sub_80B02C8(u16 shakeDir) if (shakeDir != 0) { if (lo) - { lo--; - } } else { - if (hi < 0x10) - { + if (hi < 16) hi++; - } } SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(lo, hi)); - if (lo == 0 && hi == 0x10) + if (lo == 0 && hi == 16) return TRUE; else return FALSE; @@ -1193,7 +1189,7 @@ static void Task_OrbEffect(u8 taskId) { tShakeDelay = 8; tShakeDir ^= 1; - if (sub_80B02C8(tShakeDir) == TRUE) + if (UpdateOrbEffectBlend(tShakeDir) == TRUE) { tState = 5; sub_8199DF0(0, PIXEL_FILL(0), 0, 1); diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 65192fa33..cd92bbac1 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -36,37 +36,37 @@ static void LoadMapNamePopUpWindowBg(void); static EWRAM_DATA u8 sPopupTaskId = 0; // .rodata -static const u8 gMapPopUp_Table[][960] = +static const u8 sMapPopUp_Table[][960] = { - INCBIN_U8("graphics/interface/map_popup/wood.4bpp"), - INCBIN_U8("graphics/interface/map_popup/marble.4bpp"), - INCBIN_U8("graphics/interface/map_popup/stone.4bpp"), - INCBIN_U8("graphics/interface/map_popup/brick.4bpp"), - INCBIN_U8("graphics/interface/map_popup/underwater.4bpp"), - INCBIN_U8("graphics/interface/map_popup/stone2.4bpp"), + [MAPPOPUP_THEME_WOOD] = INCBIN_U8("graphics/interface/map_popup/wood.4bpp"), + [MAPPOPUP_THEME_MARBLE] = INCBIN_U8("graphics/interface/map_popup/marble.4bpp"), + [MAPPOPUP_THEME_STONE] = INCBIN_U8("graphics/interface/map_popup/stone.4bpp"), + [MAPPOPUP_THEME_BRICK] = INCBIN_U8("graphics/interface/map_popup/brick.4bpp"), + [MAPPOPUP_THEME_UNDERWATER] = INCBIN_U8("graphics/interface/map_popup/underwater.4bpp"), + [MAPPOPUP_THEME_STONE2] = INCBIN_U8("graphics/interface/map_popup/stone2.4bpp"), }; -static const u8 gMapPopUp_Outline_Table[][960] = +static const u8 sMapPopUp_OutlineTable[][960] = { - INCBIN_U8("graphics/interface/map_popup/wood_outline.4bpp"), - INCBIN_U8("graphics/interface/map_popup/marble_outline.4bpp"), - INCBIN_U8("graphics/interface/map_popup/stone_outline.4bpp"), - INCBIN_U8("graphics/interface/map_popup/brick_outline.4bpp"), - INCBIN_U8("graphics/interface/map_popup/underwater_outline.4bpp"), - INCBIN_U8("graphics/interface/map_popup/stone2_outline.4bpp"), + [MAPPOPUP_THEME_WOOD] = INCBIN_U8("graphics/interface/map_popup/wood_outline.4bpp"), + [MAPPOPUP_THEME_MARBLE] = INCBIN_U8("graphics/interface/map_popup/marble_outline.4bpp"), + [MAPPOPUP_THEME_STONE] = INCBIN_U8("graphics/interface/map_popup/stone_outline.4bpp"), + [MAPPOPUP_THEME_BRICK] = INCBIN_U8("graphics/interface/map_popup/brick_outline.4bpp"), + [MAPPOPUP_THEME_UNDERWATER] = INCBIN_U8("graphics/interface/map_popup/underwater_outline.4bpp"), + [MAPPOPUP_THEME_STONE2] = INCBIN_U8("graphics/interface/map_popup/stone2_outline.4bpp"), }; -static const u16 gMapPopUp_Palette_Table[][16] = +static const u16 sMapPopUp_PaletteTable[][16] = { - INCBIN_U16("graphics/interface/map_popup/wood.gbapal"), - INCBIN_U16("graphics/interface/map_popup/marble_outline.gbapal"), - INCBIN_U16("graphics/interface/map_popup/stone_outline.gbapal"), - INCBIN_U16("graphics/interface/map_popup/brick_outline.gbapal"), - INCBIN_U16("graphics/interface/map_popup/underwater_outline.gbapal"), - INCBIN_U16("graphics/interface/map_popup/stone2_outline.gbapal"), + [MAPPOPUP_THEME_WOOD] = INCBIN_U16("graphics/interface/map_popup/wood.gbapal"), + [MAPPOPUP_THEME_MARBLE] = INCBIN_U16("graphics/interface/map_popup/marble_outline.gbapal"), + [MAPPOPUP_THEME_STONE] = INCBIN_U16("graphics/interface/map_popup/stone_outline.gbapal"), + [MAPPOPUP_THEME_BRICK] = INCBIN_U16("graphics/interface/map_popup/brick_outline.gbapal"), + [MAPPOPUP_THEME_UNDERWATER] = INCBIN_U16("graphics/interface/map_popup/underwater_outline.gbapal"), + [MAPPOPUP_THEME_STONE2] = INCBIN_U16("graphics/interface/map_popup/stone2_outline.gbapal"), }; -static const u16 gUnknown_0857F444[16] = INCBIN_U16("graphics/interface/map_popup/857F444.gbapal"); +static const u16 sMapPopUp_Palette_Underwater[16] = INCBIN_U16("graphics/interface/map_popup/underwater.gbapal"); static const u8 gRegionMapSectionId_To_PopUpThemeIdMapping[] = { @@ -380,12 +380,12 @@ static void LoadMapNamePopUpWindowBg(void) } popUpThemeId = gRegionMapSectionId_To_PopUpThemeIdMapping[regionMapSectionId]; - LoadBgTiles(GetWindowAttribute(popupWindowId, WINDOW_BG), gMapPopUp_Outline_Table[popUpThemeId], 0x400, 0x21D); + LoadBgTiles(GetWindowAttribute(popupWindowId, WINDOW_BG), sMapPopUp_OutlineTable[popUpThemeId], 0x400, 0x21D); CallWindowFunction(popupWindowId, DrawMapNamePopUpFrame); PutWindowTilemap(popupWindowId); if (gMapHeader.weather == WEATHER_UNDERWATER_BUBBLES) - LoadPalette(&gUnknown_0857F444, 0xE0, 0x20); + LoadPalette(&sMapPopUp_Palette_Underwater, 0xE0, sizeof(sMapPopUp_Palette_Underwater)); else - LoadPalette(gMapPopUp_Palette_Table[popUpThemeId], 0xE0, 0x20); - BlitBitmapToWindow(popupWindowId, gMapPopUp_Table[popUpThemeId], 0, 0, 80, 24); + LoadPalette(sMapPopUp_PaletteTable[popUpThemeId], 0xE0, sizeof(sMapPopUp_PaletteTable[0])); + BlitBitmapToWindow(popupWindowId, sMapPopUp_Table[popUpThemeId], 0, 0, 80, 24); } From d717a635c89e9fc44feb45153c267f3ff38ef497 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Apr 2021 17:55:29 -0400 Subject: [PATCH 23/63] event_object_movement cleanup --- include/event_object_movement.h | 3 +- .../movement_action_func_tables.h | 4 +- src/data/object_events/object_event_anims.h | 3 +- src/event_object_movement.c | 153 +++++++++--------- 4 files changed, 80 insertions(+), 83 deletions(-) diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 9deacfbb7..a935502e6 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -47,7 +47,7 @@ enum ReflectionTypes #define GROUND_EFFECT_FLAG_HOT_SPRINGS (1 << 18) #define GROUND_EFFECT_FLAG_SEAWEED (1 << 19) -struct UnkStruct_085094AC +struct StepAnimTable { const union AnimCmd *const *anims; u8 animPos[4]; @@ -174,7 +174,6 @@ void SetObjectSubpriorityByZCoord(u8, struct Sprite *, u8); bool8 IsZCoordMismatchAt(u8, s16, s16); void UnfreezeObjectEvent(struct ObjectEvent *); u8 FindLockedObjectEventIndex(struct ObjectEvent *); -bool8 obj_npc_ministep(struct Sprite *sprite); void SetAndStartSpriteAnim(struct Sprite *, u8, u8); bool8 SpriteAnimEnded(struct Sprite *); void UnfreezeObjectEvents(void); diff --git a/src/data/object_events/movement_action_func_tables.h b/src/data/object_events/movement_action_func_tables.h index 295bd51fa..4df07be0d 100755 --- a/src/data/object_events/movement_action_func_tables.h +++ b/src/data/object_events/movement_action_func_tables.h @@ -706,8 +706,8 @@ u8 (*const gMovementActionFuncs_WalkNormalRight[])(struct ObjectEvent *, struct MovementAction_PauseSpriteAnim, }; -const s16 gUnknown_0850DFBC[] = {0, 1, 1}; -const s16 gUnknown_0850DFC2[] = {0, 0, 1}; +static const s16 sJumpInitDisplacements[] = {0, 1, 1}; +static const s16 sJumpDisplacements[] = {0, 0, 1}; u8 (*const gMovementActionFuncs_Jump2Down[])(struct ObjectEvent *, struct Sprite *) = { MovementAction_Jump2Down_Step0, diff --git a/src/data/object_events/object_event_anims.h b/src/data/object_events/object_event_anims.h index f3af96f01..93f402258 100755 --- a/src/data/object_events/object_event_anims.h +++ b/src/data/object_events/object_event_anims.h @@ -1143,7 +1143,8 @@ static const union AffineAnimCmd *const sAffineAnimTable_KyogreGroudon[] = { sAffineAnim_KyogreGroudon_DipEast, // Unused }; -const struct UnkStruct_085094AC gUnknown_085094AC[] = { +// For animations with alternating steps +static const struct StepAnimTable sStepAnimTables[] = { { .anims = sAnimTable_QuintyPlump, .animPos = {1, 3, 0, 2}, diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 4f334e827..67f203dcd 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -36,6 +36,8 @@ #define sObjEventId data[0] #define sTypeFuncId data[1] // Index into corresponding gMovementTypeFuncs_* table #define sActionFuncId data[2] // Index into corresponding gMovementActionFuncs_* table +#define sDirection data[3] +#define sSpeed data[4] #define movement_type_def(setup, table) \ @@ -135,7 +137,7 @@ static void CameraObject_2(struct Sprite *); static struct ObjectEventTemplate *FindObjectEventTemplateByLocalId(u8 localId, struct ObjectEventTemplate *templates, u8 count); static void ClearObjectEventMovement(struct ObjectEvent *, struct Sprite *); static void ObjectEventSetSingleMovement(struct ObjectEvent *, struct Sprite *, u8); -static void oamt_npc_ministep_reset(struct Sprite *, u8, u8); +static void SetSpriteDataForNormalStep(struct Sprite *, u8, u8); static void InitSpriteForFigure8Anim(struct Sprite *sprite); static bool8 AnimateSpriteInFigure8(struct Sprite *sprite); static void UpdateObjectEventSprite(struct Sprite *); @@ -147,6 +149,7 @@ static u8 DoJumpSpriteMovement(struct Sprite *sprite); static u8 DoJumpSpecialSpriteMovement(struct Sprite *sprite); static void CreateLevitateMovementTask(struct ObjectEvent *); static void DestroyLevitateMovementTask(u8); +static bool8 NpcTakeStep(struct Sprite *sprite); static const struct SpriteFrameImage sPicTable_PechaBerryTree[]; @@ -4620,58 +4623,53 @@ u8 GetRunningDirectionAnimNum(u8 direction) return sRunningDirectionAnimNums[direction]; } -static const struct UnkStruct_085094AC *sub_8092A4C(const union AnimCmd *const *anims) +static const struct StepAnimTable *GetStepAnimTable(const union AnimCmd *const *anims) { - const struct UnkStruct_085094AC *retval; + const struct StepAnimTable *stepTable; - for (retval = gUnknown_085094AC; retval->anims != NULL; retval++) + for (stepTable = sStepAnimTables; stepTable->anims != NULL; stepTable++) { - if (retval->anims == anims) - return retval; + if (stepTable->anims == anims) + return stepTable; } return NULL; } -void npc_apply_anim_looping(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 animNum) +void SetStepAnimHandleAlternation(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 animNum) { - const struct UnkStruct_085094AC *unk85094AC; + const struct StepAnimTable *stepTable; if (!objectEvent->inanimate) { sprite->animNum = animNum; - unk85094AC = sub_8092A4C(sprite->anims); - if (unk85094AC != NULL) + stepTable = GetStepAnimTable(sprite->anims); + if (stepTable != NULL) { - if (sprite->animCmdIndex == unk85094AC->animPos[0]) - { - sprite->animCmdIndex = unk85094AC->animPos[3]; - } - else if (sprite->animCmdIndex == unk85094AC->animPos[1]) - { - sprite->animCmdIndex = unk85094AC->animPos[2]; - } + if (sprite->animCmdIndex == stepTable->animPos[0]) + sprite->animCmdIndex = stepTable->animPos[3]; + else if (sprite->animCmdIndex == stepTable->animPos[1]) + sprite->animCmdIndex = stepTable->animPos[2]; } SeekSpriteAnim(sprite, sprite->animCmdIndex); } } -void obj_npc_animation_step(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 animNum) +void SetStepAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 animNum) { - const struct UnkStruct_085094AC *unk85094AC; + const struct StepAnimTable *stepTable; if (!objectEvent->inanimate) { u8 animPos; sprite->animNum = animNum; - unk85094AC = sub_8092A4C(sprite->anims); - if (unk85094AC != NULL) + stepTable = GetStepAnimTable(sprite->anims); + if (stepTable != NULL) { - animPos = unk85094AC->animPos[1]; - if (sprite->animCmdIndex <= unk85094AC->animPos[0]) - { - animPos = unk85094AC->animPos[0]; - } + animPos = stepTable->animPos[1]; + if (sprite->animCmdIndex <= stepTable->animPos[0]) + animPos = stepTable->animPos[0]; + SeekSpriteAnim(sprite, animPos); } } @@ -5118,7 +5116,7 @@ static void FaceDirection(struct ObjectEvent *objectEvent, struct Sprite *sprite { SetObjectEventDirection(objectEvent, direction); ShiftStillObjectEventCoords(objectEvent); - obj_npc_animation_step(objectEvent, sprite, GetMoveDirectionAnimNum(objectEvent->facingDirection)); + SetStepAnim(objectEvent, sprite, GetMoveDirectionAnimNum(objectEvent->facingDirection)); sprite->animPaused = TRUE; sprite->sActionFuncId = 1; } @@ -5147,7 +5145,7 @@ bool8 MovementAction_FaceRight_Step0(struct ObjectEvent *objectEvent, struct Spr return TRUE; } -void npc_apply_direction(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) +void InitNpcForMovement(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) { s16 x; s16 y; @@ -5157,12 +5155,12 @@ void npc_apply_direction(struct ObjectEvent *objectEvent, struct Sprite *sprite, SetObjectEventDirection(objectEvent, direction); MoveCoords(direction, &x, &y); ShiftObjectEventCoords(objectEvent, x, y); - oamt_npc_ministep_reset(sprite, direction, speed); + SetSpriteDataForNormalStep(sprite, direction, speed); sprite->animPaused = FALSE; + if (sLockedAnimObjectEvents != NULL && FindLockedObjectEventIndex(objectEvent) != OBJECT_EVENTS_COUNT) - { sprite->animPaused = TRUE; - } + objectEvent->triggerGroundEffectsOnMove = TRUE; sprite->sActionFuncId = 1; } @@ -5172,19 +5170,19 @@ static void InitMovementNormal(struct ObjectEvent *objectEvent, struct Sprite *s u8 (*functions[ARRAY_COUNT(sDirectionAnimFuncsBySpeed)])(u8); memcpy(functions, sDirectionAnimFuncsBySpeed, sizeof sDirectionAnimFuncsBySpeed); - npc_apply_direction(objectEvent, sprite, direction, speed); - npc_apply_anim_looping(objectEvent, sprite, functions[speed](objectEvent->facingDirection)); + InitNpcForMovement(objectEvent, sprite, direction, speed); + SetStepAnimHandleAlternation(objectEvent, sprite, functions[speed](objectEvent->facingDirection)); } static void StartRunningAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) { - npc_apply_direction(objectEvent, sprite, direction, 1); - npc_apply_anim_looping(objectEvent, sprite, GetRunningDirectionAnimNum(objectEvent->facingDirection)); + InitNpcForMovement(objectEvent, sprite, direction, 1); + SetStepAnimHandleAlternation(objectEvent, sprite, GetRunningDirectionAnimNum(objectEvent->facingDirection)); } static bool8 UpdateMovementNormal(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - if (obj_npc_ministep(sprite)) + if (NpcTakeStep(sprite)) { ShiftStillObjectEventCoords(objectEvent); objectEvent->triggerGroundEffectsOnStop = TRUE; @@ -5213,7 +5211,7 @@ static void InitNpcForWalkSlow(struct ObjectEvent *objectEvent, struct Sprite *s static void InitWalkSlow(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction) { InitNpcForWalkSlow(objectEvent, sprite, direction); - npc_apply_anim_looping(objectEvent, sprite, GetMoveDirectionAnimNum(objectEvent->facingDirection)); + SetStepAnimHandleAlternation(objectEvent, sprite, GetMoveDirectionAnimNum(objectEvent->facingDirection)); } static bool8 UpdateWalkSlow(struct ObjectEvent *objectEvent, struct Sprite *sprite) @@ -5495,11 +5493,11 @@ enum { static void InitJump(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed, u8 type) { - s16 displacements[ARRAY_COUNT(gUnknown_0850DFBC)]; + s16 displacements[ARRAY_COUNT(sJumpInitDisplacements)]; s16 x; s16 y; - memcpy(displacements, gUnknown_0850DFBC, sizeof gUnknown_0850DFBC); + memcpy(displacements, sJumpInitDisplacements, sizeof sJumpInitDisplacements); x = 0; y = 0; SetObjectEventDirection(objectEvent, direction); @@ -5515,24 +5513,24 @@ static void InitJump(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 static void InitJumpRegular(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed, u8 type) { InitJump(objectEvent, sprite, direction, speed, type); - npc_apply_anim_looping(objectEvent, sprite, GetMoveDirectionAnimNum(objectEvent->facingDirection)); + SetStepAnimHandleAlternation(objectEvent, sprite, GetMoveDirectionAnimNum(objectEvent->facingDirection)); DoShadowFieldEffect(objectEvent); } static u8 UpdateJumpAnim(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 callback(struct Sprite *)) { - s16 displacements[ARRAY_COUNT(gUnknown_0850DFC2)]; + s16 displacements[ARRAY_COUNT(sJumpDisplacements)]; s16 x; s16 y; u8 result; - memcpy(displacements, gUnknown_0850DFC2, sizeof gUnknown_0850DFC2); + memcpy(displacements, sJumpDisplacements, sizeof sJumpDisplacements); result = callback(sprite); - if (result == JUMP_HALFWAY && displacements[sprite->data[4]] != 0) + if (result == JUMP_HALFWAY && displacements[sprite->sSpeed] != 0) { x = 0; y = 0; - MoveCoordsInDirection(objectEvent->movementDirection, &x, &y, displacements[sprite->data[4]], displacements[sprite->data[4]]); + MoveCoordsInDirection(objectEvent->movementDirection, &x, &y, displacements[sprite->sSpeed], displacements[sprite->sSpeed]); ShiftObjectEventCoords(objectEvent, objectEvent->currentCoords.x + x, objectEvent->currentCoords.y + y); objectEvent->triggerGroundEffectsOnMove = TRUE; objectEvent->disableCoveringGroundEffects = TRUE; @@ -5581,7 +5579,7 @@ static bool8 DoJumpInPlaceAnim(struct ObjectEvent *objectEvent, struct Sprite *s return TRUE; case JUMP_HALFWAY: SetObjectEventDirection(objectEvent, GetOppositeDirection(objectEvent->movementDirection)); - obj_npc_animation_step(objectEvent, sprite, GetMoveDirectionAnimNum(objectEvent->facingDirection)); + SetStepAnim(objectEvent, sprite, GetMoveDirectionAnimNum(objectEvent->facingDirection)); default: return FALSE; } @@ -5769,7 +5767,7 @@ bool8 MovementAction_WalkFastRight_Step1(struct ObjectEvent *objectEvent, struct static void InitMoveInPlace(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 animNum, u16 duration) { SetObjectEventDirection(objectEvent, direction); - npc_apply_anim_looping(objectEvent, sprite, animNum); + SetStepAnimHandleAlternation(objectEvent, sprite, animNum); sprite->animPaused = FALSE; sprite->sActionFuncId = 1; sprite->data[3] = duration; @@ -6770,7 +6768,7 @@ static void AcroWheelieFaceDirection(struct ObjectEvent *objectEvent, struct Spr { SetObjectEventDirection(objectEvent, direction); ShiftStillObjectEventCoords(objectEvent); - obj_npc_animation_step(objectEvent, sprite, GetAcroWheeliePedalDirectionAnimNum(direction)); + SetStepAnim(objectEvent, sprite, GetAcroWheeliePedalDirectionAnimNum(direction)); sprite->animPaused = TRUE; sprite->sActionFuncId = 1; } @@ -7143,7 +7141,7 @@ bool8 MovementAction_AcroWheelieInPlaceRight_Step0(struct ObjectEvent *objectEve static void InitAcroPopWheelie(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) { - npc_apply_direction(objectEvent, sprite, direction, speed); + InitNpcForMovement(objectEvent, sprite, direction, speed); StartSpriteAnim(sprite, GetAcroWheelieDirectionAnimNum(objectEvent->facingDirection)); SeekSpriteAnim(sprite, 0); } @@ -7214,8 +7212,8 @@ bool8 MovementAction_AcroPopWheelieMoveRight_Step1(struct ObjectEvent *objectEve static void InitAcroWheelieMove(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) { - npc_apply_direction(objectEvent, sprite, direction, speed); - npc_apply_anim_looping(objectEvent, sprite, GetAcroWheeliePedalDirectionAnimNum(objectEvent->facingDirection)); + InitNpcForMovement(objectEvent, sprite, direction, speed); + SetStepAnimHandleAlternation(objectEvent, sprite, GetAcroWheeliePedalDirectionAnimNum(objectEvent->facingDirection)); } bool8 MovementAction_AcroWheelieMoveDown_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) @@ -7284,7 +7282,7 @@ bool8 MovementAction_AcroWheelieMoveRight_Step1(struct ObjectEvent *objectEvent, static void InitAcroEndWheelie(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 direction, u8 speed) { - npc_apply_direction(objectEvent, sprite, direction, speed); + InitNpcForMovement(objectEvent, sprite, direction, speed); StartSpriteAnim(sprite, GetAcroEndWheelieDirectionAnimNum(objectEvent->facingDirection)); SeekSpriteAnim(sprite, 0); } @@ -8280,16 +8278,18 @@ static void Step8(struct Sprite *sprite, u8 dir) sprite->pos1.y += 8 * (u16) sDirectionToVectors[dir].y; } -static void oamt_npc_ministep_reset(struct Sprite *sprite, u8 direction, u8 a3) +#define sTimer data[5] + +static void SetSpriteDataForNormalStep(struct Sprite *sprite, u8 direction, u8 speed) { - sprite->data[3] = direction; - sprite->data[4] = a3; - sprite->data[5] = 0; + sprite->sDirection = direction; + sprite->sSpeed = speed; + sprite->sTimer = 0; } typedef void (*SpriteStepFunc)(struct Sprite *sprite, u8 direction); -static const SpriteStepFunc gUnknown_0850E6C4[] = { +static const SpriteStepFunc sStep1Funcs[] = { Step1, Step1, Step1, @@ -8308,7 +8308,7 @@ static const SpriteStepFunc gUnknown_0850E6C4[] = { Step1, }; -static const SpriteStepFunc gUnknown_0850E704[] = { +static const SpriteStepFunc sStep2Funcs[] = { Step2, Step2, Step2, @@ -8319,7 +8319,7 @@ static const SpriteStepFunc gUnknown_0850E704[] = { Step2, }; -static const SpriteStepFunc gUnknown_0850E724[] = { +static const SpriteStepFunc sStep3Funcs[] = { Step2, Step3, Step3, @@ -8328,46 +8328,47 @@ static const SpriteStepFunc gUnknown_0850E724[] = { Step3, }; -static const SpriteStepFunc gUnknown_0850E73C[] = { +static const SpriteStepFunc sStep4Funcs[] = { Step4, Step4, Step4, Step4, }; -static const SpriteStepFunc gUnknown_0850E74C[] = { +static const SpriteStepFunc sStep8Funcs[] = { Step8, Step8, }; -static const SpriteStepFunc *const gUnknown_0850E754[] = { - gUnknown_0850E6C4, - gUnknown_0850E704, - gUnknown_0850E724, - gUnknown_0850E73C, - gUnknown_0850E74C, +static const SpriteStepFunc *const sNpcStepFuncTables[] = { + sStep1Funcs, + sStep2Funcs, + sStep3Funcs, + sStep4Funcs, + sStep8Funcs, }; -static const s16 gUnknown_0850E768[] = { +static const s16 sStepTimes[] = { 16, 8, 6, 4, 2 }; -bool8 obj_npc_ministep(struct Sprite *sprite) +static bool8 NpcTakeStep(struct Sprite *sprite) { - if (sprite->data[5] >= gUnknown_0850E768[sprite->data[4]]) + if (sprite->sTimer >= sStepTimes[sprite->sSpeed]) return FALSE; - gUnknown_0850E754[sprite->data[4]][sprite->data[5]](sprite, sprite->data[3]); + sNpcStepFuncTables[sprite->sSpeed][sprite->sTimer](sprite, sprite->sDirection); - sprite->data[5]++; + sprite->sTimer++; - if (sprite->data[5] < gUnknown_0850E768[sprite->data[4]]) + if (sprite->sTimer < sStepTimes[sprite->sSpeed]) return FALSE; return TRUE; } -#define sDirection data[3] +#undef sTimer + #define sTimer data[4] #define sNumSteps data[5] @@ -8394,7 +8395,6 @@ static bool8 UpdateWalkSlowAnim(struct Sprite *sprite) return FALSE; } -#undef sDirection #undef sTimer #undef sNumSteps @@ -8501,8 +8501,6 @@ static s16 GetJumpY(s16 i, u8 type) return sJumpYTable[type][i]; } -#define sDirection data[3] -#define sSpeed data[4] #define sJumpType data[5] #define sTimer data[6] @@ -8564,7 +8562,6 @@ static u8 DoJumpSpecialSpriteMovement(struct Sprite *sprite) return result; } -#undef sDirection #undef sSpeed #undef sJumpType #undef sTimer From 356e63db033b050db40fb4ea2807b767f5b355da Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 7 Apr 2021 13:26:02 -0400 Subject: [PATCH 24/63] Clean up fieldmap, port frlg macros --- src/fieldmap.c | 209 +++++++++++-------------------------------------- 1 file changed, 45 insertions(+), 164 deletions(-) diff --git a/src/fieldmap.c b/src/fieldmap.c index 82c085f9f..38e0781b7 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -48,6 +48,21 @@ static struct MapConnection *GetIncomingConnection(u8 direction, int x, int y); static bool8 IsPosInIncomingConnectingMap(u8 direction, int x, int y, struct MapConnection *connection); static bool8 IsCoordInIncomingConnectingMap(int coord, int srcMax, int destMax, int offset); +#define MapGridGetBorderTileAt(x, y) ({ \ + u16 block; \ + int i; \ + u16 *border = gMapHeader.mapLayout->border; \ + \ + i = (x + 1) & 1; \ + i += ((y + 1) & 1) * 2; \ + \ + block = gMapHeader.mapLayout->border[i] | METATILE_COLLISION_MASK; \ +}) + +#define AreCoordsWithinMapGridBounds(x, y) (x >= 0 && x < gBackupMapLayout.width && y >= 0 && y < gBackupMapLayout.height) + +#define MapGridGetTileAt(x, y) (AreCoordsWithinMapGridBounds(x, y) ? gBackupMapLayout.map[x + gBackupMapLayout.width * y] : MapGridGetBorderTileAt(x, y)) + struct MapHeader const *const GetMapHeaderFromConnection(struct MapConnection *connection) { return Overworld_GetMapHeaderByGroupAndId(connection->mapGroup, connection->mapNum); @@ -72,13 +87,13 @@ void InitMapFromSavedGame(void) void InitBattlePyramidMap(bool8 setPlayerPosition) { - CpuFastFill(0x03ff03ff, gBackupMapData, sizeof(gBackupMapData)); + CpuFastFill(METATILE_ID_UNDEFINED << 16 | METATILE_ID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData)); GenerateBattlePyramidFloorLayout(gBackupMapData, setPlayerPosition); } void InitTrainerHillMap(void) { - CpuFastFill(0x03ff03ff, gBackupMapData, sizeof(gBackupMapData)); + CpuFastFill(METATILE_ID_UNDEFINED << 16 | METATILE_ID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData)); GenerateTrainerHillFloorLayout(gBackupMapData); } @@ -88,7 +103,7 @@ static void InitMapLayoutData(struct MapHeader *mapHeader) int width; int height; mapLayout = mapHeader->mapLayout; - CpuFastFill16(0x03ff, gBackupMapData, sizeof(gBackupMapData)); + CpuFastFill16(METATILE_ID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData)); gBackupMapLayout.map = gBackupMapData; width = mapLayout->width + 15; gBackupMapLayout.width = width; @@ -134,19 +149,19 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader) { case CONNECTION_SOUTH: FillSouthConnection(mapHeader, cMap, offset); - gMapConnectionFlags.south = 1; + gMapConnectionFlags.south = TRUE; break; case CONNECTION_NORTH: FillNorthConnection(mapHeader, cMap, offset); - gMapConnectionFlags.north = 1; + gMapConnectionFlags.north = TRUE; break; case CONNECTION_WEST: FillWestConnection(mapHeader, cMap, offset); - gMapConnectionFlags.west = 1; + gMapConnectionFlags.west = TRUE; break; case CONNECTION_EAST: FillEastConnection(mapHeader, cMap, offset); - gMapConnectionFlags.east = 1; + gMapConnectionFlags.east = TRUE; break; } } @@ -189,26 +204,18 @@ static void FillSouthConnection(struct MapHeader const *mapHeader, struct MapHea x2 = -x; x += cWidth; if (x < gBackupMapLayout.width) - { width = x; - } else - { width = gBackupMapLayout.width; - } x = 0; } else { x2 = 0; if (x + cWidth < gBackupMapLayout.width) - { width = cWidth; - } else - { width = gBackupMapLayout.width - x; - } } FillConnection( @@ -237,26 +244,18 @@ static void FillNorthConnection(struct MapHeader const *mapHeader, struct MapHea x2 = -x; x += cWidth; if (x < gBackupMapLayout.width) - { width = x; - } else - { width = gBackupMapLayout.width; - } x = 0; } else { x2 = 0; if (x + cWidth < gBackupMapLayout.width) - { width = cWidth; - } else - { width = gBackupMapLayout.width - x; - } } FillConnection( @@ -284,26 +283,18 @@ static void FillWestConnection(struct MapHeader const *mapHeader, struct MapHead { y2 = -y; if (y + cHeight < gBackupMapLayout.height) - { height = y + cHeight; - } else - { height = gBackupMapLayout.height; - } y = 0; } else { y2 = 0; if (y + cHeight < gBackupMapLayout.height) - { height = cHeight; - } else - { height = gBackupMapLayout.height - y; - } } FillConnection( @@ -329,26 +320,18 @@ static void FillEastConnection(struct MapHeader const *mapHeader, struct MapHead { y2 = -y; if (y + cHeight < gBackupMapLayout.height) - { height = y + cHeight; - } else - { height = gBackupMapLayout.height; - } y = 0; } else { y2 = 0; if (y + cHeight < gBackupMapLayout.height) - { height = cHeight; - } else - { height = gBackupMapLayout.height - y; - } } FillConnection( @@ -359,124 +342,52 @@ static void FillEastConnection(struct MapHeader const *mapHeader, struct MapHead } } -union Block -{ - struct - { - u16 block:10; - u16 collision:2; - u16 elevation:4; - } block; - u16 value; -}; - u8 MapGridGetZCoordAt(int x, int y) { - u16 block; - int i; - u16 *border; - - if (x >= 0 && x < gBackupMapLayout.width - && y >= 0 && y < gBackupMapLayout.height) - { - block = gBackupMapLayout.map[x + gBackupMapLayout.width * y]; - } - else - { - border = gMapHeader.mapLayout->border; - i = (x + 1) & 1; - i += ((y + 1) & 1) * 2; - block = gMapHeader.mapLayout->border[i]; - block |= METATILE_COLLISION_MASK; - } + u16 block = MapGridGetTileAt(x, y); if (block == METATILE_ID_UNDEFINED) - { return 0; - } return block >> METATILE_ELEVATION_SHIFT; } -u8 MapGridIsImpassableAt(int x, int y) +bool8 MapGridIsImpassableAt(int x, int y) { - u16 block; - int i; - u16 *border; + u16 block = MapGridGetTileAt(x, y); - if (x >= 0 && x < gBackupMapLayout.width - && y >= 0 && y < gBackupMapLayout.height) - { - block = gBackupMapLayout.map[x + gBackupMapLayout.width * y]; - } - else - { - border = gMapHeader.mapLayout->border; - i = (x + 1) & 1; - i += ((y + 1) & 1) * 2; - block = gMapHeader.mapLayout->border[i]; - block |= METATILE_COLLISION_MASK; - } if (block == METATILE_ID_UNDEFINED) - { - return 1; - } + return TRUE; + return (block & METATILE_COLLISION_MASK) >> METATILE_COLLISION_SHIFT; } u32 MapGridGetMetatileIdAt(int x, int y) { - u16 block; - int i; - int j; - struct MapLayout const *mapLayout; - u16 *border; - u16 block2; + u16 block = MapGridGetTileAt(x, y); - if (x >= 0 && x < gBackupMapLayout.width - && y >= 0 && y < gBackupMapLayout.height) - { - block = gBackupMapLayout.map[x + gBackupMapLayout.width * y]; - } - else - { - mapLayout = gMapHeader.mapLayout; - i = (x + 1) & 1; - i += ((y + 1) & 1) * 2; - block = mapLayout->border[i] | METATILE_COLLISION_MASK; - } if (block == METATILE_ID_UNDEFINED) - { - border = gMapHeader.mapLayout->border; - j = (x + 1) & 1; - j += ((y + 1) & 1) * 2; - block2 = gMapHeader.mapLayout->border[j]; - // This OR is completely pointless. - block2 |= METATILE_COLLISION_MASK; - return block2 & METATILE_ID_MASK; - } + return MapGridGetBorderTileAt(x, y) & METATILE_ID_MASK; + return block & METATILE_ID_MASK; } u32 MapGridGetMetatileBehaviorAt(int x, int y) { - u16 metatile; - metatile = MapGridGetMetatileIdAt(x, y); + u16 metatile = MapGridGetMetatileIdAt(x, y); return GetBehaviorByMetatileId(metatile) & METATILE_BEHAVIOR_MASK; } u8 MapGridGetMetatileLayerTypeAt(int x, int y) { - u16 metatile; - metatile = MapGridGetMetatileIdAt(x, y); + u16 metatile = MapGridGetMetatileIdAt(x, y); return (GetBehaviorByMetatileId(metatile) & METATILE_ELEVATION_MASK) >> METATILE_ELEVATION_SHIFT; } void MapGridSetMetatileIdAt(int x, int y, u16 metatile) { int i; - if (x >= 0 && x < gBackupMapLayout.width - && y >= 0 && y < gBackupMapLayout.height) + if (AreCoordsWithinMapGridBounds(x, y)) { i = x + y * gBackupMapLayout.width; gBackupMapLayout.map[i] = (gBackupMapLayout.map[i] & METATILE_ELEVATION_MASK) | (metatile & ~METATILE_ELEVATION_MASK); @@ -486,8 +397,7 @@ void MapGridSetMetatileIdAt(int x, int y, u16 metatile) void MapGridSetMetatileEntryAt(int x, int y, u16 metatile) { int i; - if (x >= 0 && x < gBackupMapLayout.width - && y >= 0 && y < gBackupMapLayout.height) + if (AreCoordsWithinMapGridBounds(x, y)) { i = x + gBackupMapLayout.width * y; gBackupMapLayout.map[i] = metatile; @@ -526,9 +436,7 @@ void SaveMapView(void) for (i = y; i < y + 14; i++) { for (j = x; j < x + 15; j++) - { *mapView++ = gBackupMapData[width * i + j]; - } } } @@ -660,63 +568,36 @@ int GetMapBorderIdAt(int x, int y) struct MapLayout const *mapLayout; u16 block, block2; int i, j; - if (x >= 0 && x < gBackupMapLayout.width - && y >= 0 && y < gBackupMapLayout.height) - { - i = gBackupMapLayout.width; - i *= y; - block = gBackupMapLayout.map[x + i]; - if (block == METATILE_ID_UNDEFINED) - { - goto fail; - } - } - else - { - mapLayout = gMapHeader.mapLayout; - j = (x + 1) & 1; - j += ((y + 1) & 1) * 2; - block2 = METATILE_COLLISION_MASK | mapLayout->border[j]; - if (block2 == METATILE_ID_UNDEFINED) - { - goto fail; - } - } - goto success; -fail: - return CONNECTION_INVALID; -success: + + if (MapGridGetTileAt(x, y) == METATILE_ID_UNDEFINED) + return CONNECTION_INVALID; if (x >= (gBackupMapLayout.width - 8)) { if (!gMapConnectionFlags.east) - { return CONNECTION_INVALID; - } + return CONNECTION_EAST; } else if (x < 7) { if (!gMapConnectionFlags.west) - { return CONNECTION_INVALID; - } + return CONNECTION_WEST; } else if (y >= (gBackupMapLayout.height - 7)) { if (!gMapConnectionFlags.south) - { return CONNECTION_INVALID; - } + return CONNECTION_SOUTH; } else if (y < 7) { if (!gMapConnectionFlags.north) - { return CONNECTION_INVALID; - } + return CONNECTION_NORTH; } else @@ -735,10 +616,10 @@ bool32 CanCameraMoveInDirection(int direction) int x, y; x = gSaveBlock1Ptr->pos.x + 7 + gDirectionToVectors[direction].x; y = gSaveBlock1Ptr->pos.y + 7 + gDirectionToVectors[direction].y; - if (GetMapBorderIdAt(x, y) == -1) - { + + if (GetMapBorderIdAt(x, y) == CONNECTION_INVALID) return FALSE; - } + return TRUE; } @@ -937,7 +818,7 @@ void GetCameraCoords(u16 *x, u16 *y) void MapGridSetMetatileImpassabilityAt(int x, int y, bool32 impassable) { - if (x >= 0 && x < gBackupMapLayout.width && y >= 0 && y < gBackupMapLayout.height) + if (AreCoordsWithinMapGridBounds(x, y)) { if (impassable) gBackupMapLayout.map[x + gBackupMapLayout.width * y] |= METATILE_COLLISION_MASK; From c95e89e083f4911d41036ecd3b8a744ff59ec8a9 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 7 Apr 2021 13:32:08 -0400 Subject: [PATCH 25/63] Remove old variables --- src/fieldmap.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/fieldmap.c b/src/fieldmap.c index 38e0781b7..e437ea7fc 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -565,10 +565,6 @@ static void MoveMapViewToBackup(u8 direction) int GetMapBorderIdAt(int x, int y) { - struct MapLayout const *mapLayout; - u16 block, block2; - int i, j; - if (MapGridGetTileAt(x, y) == METATILE_ID_UNDEFINED) return CONNECTION_INVALID; From 3e725272fc8b8f2ea825783771d54104d1f25e82 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 9 Apr 2021 22:39:34 -0400 Subject: [PATCH 26/63] standardize "grey" to "gray" --- berry_fix/charmap.txt | 4 +-- berry_fix/payload/charmap.txt | 4 +-- charmap.txt | 4 +-- gflib/text.c | 4 +-- gflib/text.h | 4 +-- src/battle_dome.c | 4 +-- src/battle_factory_screen.c | 4 +-- src/battle_message.c | 4 +-- src/battle_script_commands.c | 2 +- src/berry_blender.c | 8 ++--- src/berry_crush.c | 42 +++++++++++----------- src/credits.c | 4 +-- src/data/party_menu.h | 6 ++-- src/data/trade.h | 10 +++--- src/dodrio_berry_picking.c | 10 +++--- src/easy_chat.c | 4 +-- src/frontier_pass.c | 2 +- src/hall_of_fame.c | 4 +-- src/link.c | 2 +- src/menu.c | 6 ++-- src/menu_specialized.c | 4 +-- src/mevent_801BAAC.c | 4 +-- src/naming_screen.c | 8 ++--- src/party_menu.c | 4 +-- src/pokedex.c | 8 ++--- src/pokemon_jump.c | 6 ++-- src/pokemon_storage_system.c | 8 ++--- src/pokemon_summary_screen.c | 2 +- src/pokenav_conditions_3.c | 4 +-- src/pokenav_main_menu.c | 2 +- src/pokenav_match_call_ui.c | 2 +- src/pokenav_ribbons_1.c | 4 +-- src/pokenav_ribbons_2.c | 8 ++--- src/save_failed_screen.c | 2 +- src/slot_machine.c | 2 +- src/start_menu.c | 4 +-- src/starter_choose.c | 2 +- src/strings.c | 24 ++++++------- src/trainer_card.c | 2 +- src/trainer_hill.c | 2 +- src/union_room.c | 10 +++--- src/union_room_battle.c | 2 +- src/wireless_communication_status_screen.c | 8 ++--- 43 files changed, 127 insertions(+), 127 deletions(-) diff --git a/berry_fix/charmap.txt b/berry_fix/charmap.txt index 09427dc8d..1c143ada4 100644 --- a/berry_fix/charmap.txt +++ b/berry_fix/charmap.txt @@ -434,8 +434,8 @@ RESUME_MUSIC = FC 18 TRANSPARENT = 00 WHITE = 01 -DARK_GREY = 02 -LIGHT_GREY = 03 +DARK_GRAY = 02 +LIGHT_GRAY = 03 RED = 04 LIGHT_RED = 05 GREEN = 06 diff --git a/berry_fix/payload/charmap.txt b/berry_fix/payload/charmap.txt index 09427dc8d..1c143ada4 100644 --- a/berry_fix/payload/charmap.txt +++ b/berry_fix/payload/charmap.txt @@ -434,8 +434,8 @@ RESUME_MUSIC = FC 18 TRANSPARENT = 00 WHITE = 01 -DARK_GREY = 02 -LIGHT_GREY = 03 +DARK_GRAY = 02 +LIGHT_GRAY = 03 RED = 04 LIGHT_RED = 05 GREEN = 06 diff --git a/charmap.txt b/charmap.txt index ca4db0fc7..84e1496f0 100644 --- a/charmap.txt +++ b/charmap.txt @@ -438,8 +438,8 @@ RESUME_MUSIC = FC 18 TRANSPARENT = 00 WHITE = 01 -DARK_GREY = 02 -LIGHT_GREY = 03 +DARK_GRAY = 02 +LIGHT_GRAY = 03 RED = 04 LIGHT_RED = 05 GREEN = 06 diff --git a/gflib/text.c b/gflib/text.c index e456a695d..445a7b1be 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -1416,9 +1416,9 @@ u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str) fgColor = TEXT_COLOR_WHITE; bgColor = TEXT_COLOR_TRANSPARENT; - shadowColor = TEXT_COLOR_LIGHT_GREY; + shadowColor = TEXT_COLOR_LIGHT_GRAY; - GenerateFontHalfRowLookupTable(TEXT_COLOR_WHITE, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_LIGHT_GREY); + GenerateFontHalfRowLookupTable(TEXT_COLOR_WHITE, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_LIGHT_GRAY); strLocal = str; strPos = 0; diff --git a/gflib/text.h b/gflib/text.h index 3e9b4f2ae..5274ad8b5 100644 --- a/gflib/text.h +++ b/gflib/text.h @@ -233,8 +233,8 @@ #define TEXT_COLOR_TRANSPARENT 0x0 #define TEXT_COLOR_WHITE 0x1 -#define TEXT_COLOR_DARK_GREY 0x2 -#define TEXT_COLOR_LIGHT_GREY 0x3 +#define TEXT_COLOR_DARK_GRAY 0x2 +#define TEXT_COLOR_LIGHT_GRAY 0x3 #define TEXT_COLOR_RED 0x4 #define TEXT_COLOR_LIGHT_RED 0x5 #define TEXT_COLOR_GREEN 0x6 diff --git a/src/battle_dome.c b/src/battle_dome.c index 3b22e2926..4e6e6a652 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -5397,7 +5397,7 @@ static void Task_ShowTourneyTree(u8 taskId) { if (DOME_TRAINERS[i].trainerId == TRAINER_PLAYER) { - textPrinter.fgColor = TEXT_COLOR_LIGHT_GREY; + textPrinter.fgColor = TEXT_COLOR_LIGHT_GRAY; textPrinter.shadowColor = TEXT_COLOR_RED; } else @@ -5410,7 +5410,7 @@ static void Task_ShowTourneyTree(u8 taskId) { if (DOME_TRAINERS[i].trainerId == TRAINER_PLAYER) { - textPrinter.fgColor = TEXT_COLOR_LIGHT_GREY; + textPrinter.fgColor = TEXT_COLOR_LIGHT_GRAY; textPrinter.shadowColor = TEXT_COLOR_RED; } else diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 7b0af774a..5be53a8b3 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -402,7 +402,7 @@ static const struct WindowTemplate sSelect_WindowTemplates[] = }; static const u16 sSelectText_Pal[] = INCBIN_U16("graphics/battle_frontier/factory_screen/text.gbapal"); -static const u8 sMenuOptionTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_TRANSPARENT}; +static const u8 sMenuOptionTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_TRANSPARENT}; static const u8 sSpeciesNameTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_RED, TEXT_COLOR_TRANSPARENT}; static const struct OamData sOam_Select_Pokeball = @@ -1024,7 +1024,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = }; static const u16 sSwapText_Pal[] = INCBIN_U16("graphics/battle_frontier/factory_screen/text.gbapal"); // Identical to sSelectText_Pal -static const u8 sSwapMenuOptionsTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_TRANSPARENT}; +static const u8 sSwapMenuOptionsTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_TRANSPARENT}; static const u8 sSwapSpeciesNameTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_RED, TEXT_COLOR_TRANSPARENT}; #define SWAPACTION_MON 1 diff --git a/src/battle_message.c b/src/battle_message.c index 46444a8fa..219a33bb9 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1222,8 +1222,8 @@ const u8 * const gStatNamesTable2[] = sText_SpDef, sText_Defense, sText_Speed }; -const u8 gText_SafariBalls[] = _("{HIGHLIGHT DARK_GREY}SAFARI BALLS"); -const u8 gText_SafariBallLeft[] = _("{HIGHLIGHT DARK_GREY}Left: $" "{HIGHLIGHT DARK_GREY}"); +const u8 gText_SafariBalls[] = _("{HIGHLIGHT DARK_GRAY}SAFARI BALLS"); +const u8 gText_SafariBallLeft[] = _("{HIGHLIGHT DARK_GRAY}Left: $" "{HIGHLIGHT DARK_GRAY}"); const u8 gText_Sleep[] = _("sleep"); const u8 gText_Poison[] = _("poison"); const u8 gText_Burn[] = _("burn"); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 84f8efaa8..8f89a02b3 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6033,7 +6033,7 @@ static void PutLevelAndGenderOnLvlUpBox(void) printerTemplate.unk = 0; printerTemplate.fgColor = TEXT_COLOR_WHITE; printerTemplate.bgColor = TEXT_COLOR_TRANSPARENT; - printerTemplate.shadowColor = TEXT_COLOR_DARK_GREY; + printerTemplate.shadowColor = TEXT_COLOR_DARK_GRAY; AddTextPrinter(&printerTemplate, 0xFF, NULL); diff --git a/src/berry_blender.c b/src/berry_blender.c index ede1f6e99..39e1dca08 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -3859,13 +3859,13 @@ static void Blender_AddTextPrinter(u8 windowId, const u8 *string, u8 x, u8 y, s3 case 0: case 3: txtColor[0] = TEXT_COLOR_WHITE; - txtColor[1] = TEXT_COLOR_DARK_GREY; - txtColor[2] = TEXT_COLOR_LIGHT_GREY; + txtColor[1] = TEXT_COLOR_DARK_GRAY; + txtColor[2] = TEXT_COLOR_LIGHT_GRAY; break; case 1: txtColor[0] = TEXT_COLOR_TRANSPARENT; - txtColor[1] = TEXT_COLOR_DARK_GREY; - txtColor[2] = TEXT_COLOR_LIGHT_GREY; + txtColor[1] = TEXT_COLOR_DARK_GRAY; + txtColor[2] = TEXT_COLOR_LIGHT_GRAY; break; case 2: txtColor[0] = TEXT_COLOR_TRANSPARENT; diff --git a/src/berry_crush.c b/src/berry_crush.c index e63eb9f82..abaad232e 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -152,9 +152,9 @@ enum { #define PLAY_AGAIN_NO_BERRIES 3 enum { - COLORID_GREY, + COLORID_GRAY, COLORID_BLACK, - COLORID_LIGHT_GREY, + COLORID_LIGHT_GRAY, COLORID_BLUE, COLORID_GREEN, COLORID_RED, @@ -457,9 +457,9 @@ static const struct BgTemplate sBgTemplates[4] = static const u8 sTextColorTable[][3] = { - [COLORID_GREY] = {TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY}, - [COLORID_BLACK] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY}, - [COLORID_LIGHT_GREY] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_LIGHT_GREY, TEXT_COLOR_RED}, + [COLORID_GRAY] = {TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}, + [COLORID_BLACK] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY}, + [COLORID_LIGHT_GRAY] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_LIGHT_GRAY, TEXT_COLOR_RED}, [COLORID_BLUE] = {TEXT_COLOR_WHITE, TEXT_COLOR_BLUE, TEXT_COLOR_LIGHT_BLUE}, [COLORID_GREEN] = {TEXT_COLOR_WHITE, TEXT_COLOR_GREEN, TEXT_COLOR_LIGHT_GREEN}, [COLORID_RED] = {TEXT_COLOR_WHITE, TEXT_COLOR_RED, TEXT_COLOR_LIGHT_RED}, @@ -1653,7 +1653,7 @@ static void PrintResultsText(struct BerryCrushGame * game, u8 page, u8 sp14, u8 break; } x = GetStringRightAlignXOffset(2, gStringVar4, sp14 - 4); - AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GREY], 0, gStringVar4); + AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GRAY], 0, gStringVar4); if (playerId == game->localId) StringCopy(gStringVar3, gText_1DotBlueF700); else @@ -1661,7 +1661,7 @@ static void PrintResultsText(struct BerryCrushGame * game, u8 page, u8 sp14, u8 gStringVar3[0] = ranking + CHAR_1; DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, game->players[playerId].name); DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gStringVar3); - AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, 4, y, sTextColorTable[COLORID_GREY], 0, gStringVar4); + AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, 4, y, sTextColorTable[COLORID_GRAY], 0, gStringVar4); } } @@ -1676,34 +1676,34 @@ static void PrintCrushingResults(struct BerryCrushGame *game) FramesToMinSec(&game->gfx, results->time); // Print time text - AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GREY], 0, gText_TimeColon); + AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GRAY], 0, gText_TimeColon); // Print seconds text x = 176 - (u8)GetStringWidth(2, gText_SpaceSec, -1); - AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GREY], 0, gText_SpaceSec); + AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GRAY], 0, gText_SpaceSec); // Print seconds value ConvertIntToDecimalStringN(gStringVar1, game->gfx.secondsInt, STR_CONV_MODE_LEADING_ZEROS, 2); ConvertIntToDecimalStringN(gStringVar2, game->gfx.secondsFrac, STR_CONV_MODE_LEADING_ZEROS, 2); StringExpandPlaceholders(gStringVar4, gText_XDotY2); x -= GetStringWidth(2, gStringVar4, -1); - AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GREY], 0, gStringVar4); + AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GRAY], 0, gStringVar4); // Print minutes text x -= GetStringWidth(2, gText_SpaceMin, -1); - AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GREY], 0, gText_SpaceMin); + AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GRAY], 0, gText_SpaceMin); // Print minutes value ConvertIntToDecimalStringN(gStringVar1, game->gfx.minutes, STR_CONV_MODE_LEADING_ZEROS, 1); StringExpandPlaceholders(gStringVar4, gText_StrVar1); x -= GetStringWidth(2, gStringVar4, -1); - AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GREY], 0, gStringVar4); + AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GRAY], 0, gStringVar4); // Print pressing speed text y += 14; - AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, 0, y, sTextColorTable[COLORID_GREY], 0, gText_PressingSpeed); + AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, 0, y, sTextColorTable[COLORID_GRAY], 0, gText_PressingSpeed); x = 176 - (u8)GetStringWidth(2, gText_TimesPerSec, -1); - AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GREY], 0, gText_TimesPerSec); + AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GRAY], 0, gText_TimesPerSec); // Print pressing speed value for (i = 0; i < 8; i++) @@ -1716,17 +1716,17 @@ static void PrintCrushingResults(struct BerryCrushGame *game) if (game->newRecord) AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_RED], 0, gStringVar4); else - AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GREY], 0, gStringVar4); + AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GRAY], 0, gStringVar4); // Print silkiness text y += 14; - AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, 0, y, sTextColorTable[COLORID_GREY], 0, gText_Silkiness); + AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, 0, y, sTextColorTable[COLORID_GRAY], 0, gText_Silkiness); // Print silkiness value ConvertIntToDecimalStringN(gStringVar1, results->silkiness, STR_CONV_MODE_RIGHT_ALIGN, 3); StringExpandPlaceholders(gStringVar4, gText_Var1Percent); x = 176 - (u8)GetStringWidth(2, gStringVar4, -1); - AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GREY], 0, gStringVar4); + AddTextPrinterParameterized3(game->gfx.resultsWindowId, 2, x, y, sTextColorTable[COLORID_GRAY], 0, gStringVar4); } static bool32 OpenResultsWindow(struct BerryCrushGame *game, struct BerryCrushGame_Gfx *gfx) @@ -1825,9 +1825,9 @@ static void Task_ShowRankings(u8 taskId) { ConvertIntToDecimalStringN(gStringVar1, i + 2, STR_CONV_MODE_LEFT_ALIGN, 1); StringExpandPlaceholders(gStringVar4, gText_Var1Players); - AddTextPrinterParameterized3(tWindowId, 1, 0, yPos, sTextColorTable[COLORID_GREY], 0, gStringVar4); + AddTextPrinterParameterized3(tWindowId, 1, 0, yPos, sTextColorTable[COLORID_GRAY], 0, gStringVar4); xPos = 192 - (u8)GetStringWidth(1, gText_TimesPerSec, -1); - AddTextPrinterParameterized3(tWindowId, 1, xPos, yPos, sTextColorTable[COLORID_GREY], 0, gText_TimesPerSec); + AddTextPrinterParameterized3(tWindowId, 1, xPos, yPos, sTextColorTable[COLORID_GRAY], 0, gText_TimesPerSec); for (j = 0; j < 8; j++) { if (((tPressingSpeeds(i) & 0xFF) >> (7 - j)) & 1) @@ -1837,7 +1837,7 @@ static void Task_ShowRankings(u8 taskId) ConvertIntToDecimalStringN(gStringVar2, score / 1000000, STR_CONV_MODE_LEADING_ZEROS, 2); StringExpandPlaceholders(gStringVar4, gText_XDotY3); xPos -= GetStringWidth(1, gStringVar4, -1); - AddTextPrinterParameterized3(tWindowId, 1, xPos, yPos, sTextColorTable[COLORID_GREY], 0, gStringVar4); + AddTextPrinterParameterized3(tWindowId, 1, xPos, yPos, sTextColorTable[COLORID_GRAY], 0, gStringVar4); yPos += 16; score = 0; } @@ -1933,7 +1933,7 @@ static void DrawPlayerNameWindows(struct BerryCrushGame *game) 1, 0, 0, - sTextColorTable[COLORID_LIGHT_GREY], + sTextColorTable[COLORID_LIGHT_GRAY], 0, game->players[i].name ); diff --git a/src/credits.c b/src/credits.c index f6871aeec..b32949754 100644 --- a/src/credits.c +++ b/src/credits.c @@ -391,13 +391,13 @@ static void PrintCreditsText(const u8 *string, u8 y, bool8 isTitle) if (isTitle == TRUE) { - color[1] = TEXT_COLOR_LIGHT_GREY; + color[1] = TEXT_COLOR_LIGHT_GRAY; color[2] = TEXT_COLOR_RED; } else { color[1] = TEXT_COLOR_WHITE; - color[2] = TEXT_COLOR_DARK_GREY; + color[2] = TEXT_COLOR_DARK_GRAY; } x = GetStringCenterAlignXOffsetWithLetterSpacing(1, string, DISPLAY_WIDTH, 1); diff --git a/src/data/party_menu.h b/src/data/party_menu.h index a4a030e3f..570ef738e 100644 --- a/src/data/party_menu.h +++ b/src/data/party_menu.h @@ -118,12 +118,12 @@ static const u32 sCancelButton_Tilemap[] = INCBIN_U32("graphics/interface/party_ // Text colors for BG, FG, and Shadow in that order static const u8 sFontColorTable[][3] = { - {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_LIGHT_GREY, TEXT_COLOR_DARK_GREY}, // Default + {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_LIGHT_GRAY, TEXT_COLOR_DARK_GRAY}, // Default {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_GREEN}, // Unused {TEXT_COLOR_TRANSPARENT, TEXT_DYNAMIC_COLOR_2, TEXT_DYNAMIC_COLOR_3}, // Gender symbol - {TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY}, // Selection actions + {TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}, // Selection actions {TEXT_COLOR_WHITE, TEXT_COLOR_BLUE, TEXT_COLOR_LIGHT_BLUE}, // Field moves - {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY}, // Unused + {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY}, // Unused }; static const struct WindowTemplate sSinglePartyMenuWindowTemplate[] = diff --git a/src/data/trade.h b/src/data/trade.h index 7001b6ce5..b29e7c3d1 100644 --- a/src/data/trade.h +++ b/src/data/trade.h @@ -15,7 +15,7 @@ static const u16 sTradePartyBoxTilemap[] = INCBIN_U16("graphics/trade/party_box_ static const u8 sTradeStripesBG2Tilemap[] = INCBIN_U8("graphics/trade/stripes_bg2_map.bin"); static const u8 sTradeStripesBG3Tilemap[] = INCBIN_U8("graphics/trade/stripes_bg3_map.bin"); static const u8 sText_EmptyString[] = _(""); -static const u8 sText_UnusedTextFormat[] = _("{COLOR WHITE}{HIGHLIGHT TRANSPARENT}{SHADOW DARK_GREY}"); +static const u8 sText_UnusedTextFormat[] = _("{COLOR WHITE}{HIGHLIGHT TRANSPARENT}{SHADOW DARK_GRAY}"); const u8 gText_MaleSymbol4[] = _("♂"); const u8 gText_FemaleSymbol4[] = _("♀"); const u8 gText_GenderlessSymbol[] = _(""); @@ -35,10 +35,10 @@ static const u8 sText_CancelTrade[] = _("Cancel trade?"); static const u8 sJPText_PressBButtonToQuit[] = _("Bボタン で もどります"); static const u8 sText_Summary2[] = _("SUMMARY"); static const u8 sText_Trade2[] = _("TRADE"); -static const u8 sText_CommunicationStandby[] = _("{COLOR DARK_GREY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GREY}Communication standby…\nPlease wait."); -static const u8 sText_TheTradeHasBeenCanceled[] = _("{COLOR DARK_GREY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GREY}The trade has\nbeen canceled."); +static const u8 sText_CommunicationStandby[] = _("{COLOR DARK_GRAY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GRAY}Communication standby…\nPlease wait."); +static const u8 sText_TheTradeHasBeenCanceled[] = _("{COLOR DARK_GRAY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GRAY}The trade has\nbeen canceled."); static const u8 sText_OnlyPkmnForBattle[] = _("That's your only\nPOKéMON for battle."); -static const u8 sText_WaitingForYourFriend[] = _("{COLOR DARK_GREY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GREY}Waiting for your friend\nto finish…"); +static const u8 sText_WaitingForYourFriend[] = _("{COLOR DARK_GRAY}{HIGHLIGHT WHITE}{SHADOW LIGHT_GRAY}Waiting for your friend\nto finish…"); static const u8 sText_YourFriendWantsToTrade[] = _("Your friend wants\nto trade POKéMON."); static const struct OamData sTradeOamData_32x16 = @@ -392,7 +392,7 @@ static const u8 sTradeTextColors[] = { TEXT_COLOR_TRANSPARENT, //bg color TEXT_COLOR_WHITE, //fg color - TEXT_COLOR_DARK_GREY //shadow color + TEXT_COLOR_DARK_GRAY //shadow color }; static const struct BgTemplate sTradeMenuBgTemplates[] = diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index d3244f4b9..d766da607 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -4500,7 +4500,7 @@ struct WinCoords }; enum { - COLORID_GREY, + COLORID_GRAY, COLORID_RED, COLORID_BLUE, COLORID_GREEN, // Unused @@ -4508,7 +4508,7 @@ enum { static const u8 sTextColorTable[][3] = { - [COLORID_GREY] = {TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY}, + [COLORID_GRAY] = {TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}, [COLORID_RED] = {TEXT_COLOR_WHITE, TEXT_COLOR_RED, TEXT_COLOR_LIGHT_RED}, [COLORID_BLUE] = {TEXT_COLOR_WHITE, TEXT_COLOR_BLUE, TEXT_COLOR_LIGHT_BLUE}, [COLORID_GREEN] = {TEXT_COLOR_WHITE, TEXT_COLOR_GREEN, TEXT_COLOR_LIGHT_GREEN}, @@ -4638,7 +4638,7 @@ static void ShowNames(void) window.baseBlock = 0x13; for (i = 0; i < numPlayers; coords++, i++) { - colorsId = COLORID_GREY; + colorsId = COLORID_GRAY; playerId = GetPlayerIdByPos(i); left = (56 - GetStringWidth(1, GetPlayerName(playerId), -1)) / 2u; window.tilemapLeft = coords->left; @@ -4729,7 +4729,7 @@ static void PrintRankedScores(u8 numPlayers_) x = 216 - GetStringWidth(1, gText_SpacePoints, 0); for (i = 0; i < numPlayers; i++) { - u8 colorsId = COLORID_GREY; + u8 colorsId = COLORID_GRAY; u8 playerId = playersByRanking[i]; u32 points = scoreResults[playerId].score; @@ -4776,7 +4776,7 @@ static void ShowResults(void) AddTextPrinterParameterized(sGfx->windowIds[1], 1, gText_10P30P50P50P, 68, 17, -1, NULL); for (i = 0; i < numPlayers; i++) { - u8 colorsId = COLORID_GREY; + u8 colorsId = COLORID_GRAY; if (i == GetMultiplayerId()) colorsId = COLORID_BLUE; diff --git a/src/easy_chat.c b/src/easy_chat.c index 13e89c31f..96d680840 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -3932,7 +3932,7 @@ static void PrintTitle(void) xOffset = GetStringCenterAlignXOffset(1, titleText, 144); FillWindowPixelBuffer(0, PIXEL_FILL(0)); - PrintEasyChatTextWithColors(0, 1, titleText, xOffset, 1, TEXT_SPEED_FF, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY); + PrintEasyChatTextWithColors(0, 1, titleText, xOffset, 1, TEXT_SPEED_FF, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); PutWindowTilemap(0); CopyWindowToVram(0, 3); } @@ -4330,7 +4330,7 @@ static void PrintWordSelectText(u8 scrollOffset, u8 numRows) if (!DummyWordCheck(easyChatWord)) PrintEasyChatText(2, 1, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SPEED_FF, NULL); else // Never reached - PrintEasyChatTextWithColors(2, 1, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SPEED_FF, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_LIGHT_GREY); + PrintEasyChatTextWithColors(2, 1, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SPEED_FF, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_LIGHT_GRAY); } } diff --git a/src/frontier_pass.c b/src/frontier_pass.c index 2de27c36b..4081aaabf 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -288,7 +288,7 @@ static const struct WindowTemplate sMapWindowTemplates[] = static const u8 sTextColors[][3] = { - {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY}, + {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}, {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_BLUE}, {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_RED, TEXT_COLOR_LIGHT_RED}, }; diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 4461a5e5d..037acd09c 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -138,8 +138,8 @@ static const struct BgTemplate sHof_BgTemplates[] = static const struct WindowTemplate sHof_WindowTemplate = {0, 2, 2, 0xE, 6, 0xE, 1}; -static const u8 sMonInfoTextColors[4] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY}; -static const u8 sPlayerInfoTextColors[4] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY}; +static const u8 sMonInfoTextColors[4] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY}; +static const u8 sPlayerInfoTextColors[4] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}; static const u8 sUnused_085E538C[] = {4, 5, 0, 0}; diff --git a/src/link.c b/src/link.c index 0b2f46a34..8a04b53e5 100644 --- a/src/link.c +++ b/src/link.c @@ -221,7 +221,7 @@ static const struct WindowTemplate sLinkErrorWindowTemplates[] = { }, DUMMY_WIN_TEMPLATE }; -static const u8 sTextColors[] = { TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY }; +static const u8 sTextColors[] = { TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY }; static const u8 sUnusedData[] = {0x00, 0xFF, 0xFE, 0xFF, 0x00}; bool8 IsWirelessAdapterConnected(void) diff --git a/src/menu.c b/src/menu.c index 9957f7203..44b39d762 100644 --- a/src/menu.c +++ b/src/menu.c @@ -95,7 +95,7 @@ static const struct WindowTemplate sYesNo_WindowTemplates = }; const u16 gUnknown_0860F0B0[] = INCBIN_U16("graphics/interface/860F0B0.gbapal"); -const u8 sTextColors[] = { TEXT_DYNAMIC_COLOR_6, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY }; +const u8 sTextColors[] = { TEXT_DYNAMIC_COLOR_6, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY }; // Table of move info icon offsets in graphics/interface_fr/menu.png static const struct MenuInfoIcon sMenuInfoIcons[] = @@ -843,13 +843,13 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo { color[0] = TEXT_COLOR_TRANSPARENT; color[1] = TEXT_COLOR_WHITE; - color[2] = TEXT_COLOR_DARK_GREY; + color[2] = TEXT_COLOR_DARK_GRAY; } else { color[0] = TEXT_DYNAMIC_COLOR_6; color[1] = TEXT_COLOR_WHITE; - color[2] = TEXT_COLOR_DARK_GREY; + color[2] = TEXT_COLOR_DARK_GRAY; } PutWindowTilemap(sWindowId); FillWindowPixelBuffer(sWindowId, PIXEL_FILL(15)); diff --git a/src/menu_specialized.c b/src/menu_specialized.c index 687324612..4c4be57f0 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -73,7 +73,7 @@ static const struct WindowTemplate sUnknown_086253E8[] = static const u8 sPlayerNameTextColors[] = { - TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY + TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY }; static const u8 sEmptyItemName[] = _(""); @@ -840,7 +840,7 @@ void MoveRelearnerPrintText(u8 *str) FillWindowPixelBuffer(3, PIXEL_FILL(1)); gTextFlags.canABSpeedUpPrint = TRUE; speed = GetPlayerTextSpeedDelay(); - AddTextPrinterParameterized2(3, 1, str, speed, NULL, TEXT_COLOR_DARK_GREY, TEXT_COLOR_WHITE, 3); + AddTextPrinterParameterized2(3, 1, str, speed, NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, 3); } bool16 MoveRelearnerRunTextPrinters(void) diff --git a/src/mevent_801BAAC.c b/src/mevent_801BAAC.c index fa0153e62..2afb9ea70 100644 --- a/src/mevent_801BAAC.c +++ b/src/mevent_801BAAC.c @@ -63,8 +63,8 @@ void sub_801C61C(void); extern const struct OamData gOamData_AffineOff_ObjNormal_32x16; const u8 sTextColorTable[][3] = { - {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY}, - {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY} + {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}, + {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY} }; const u8 ALIGNED(4) gUnknown_082F0E18[3] = {7, 4, 7}; const struct WindowTemplate gUnknown_082F0E1C[] = { diff --git a/src/naming_screen.c b/src/naming_screen.c index a1dfac88e..b594fe106 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1929,9 +1929,9 @@ struct TextColor // Needed because of alignment static const struct TextColor sTextColorStruct = { { - {TEXT_DYNAMIC_COLOR_4, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY}, - {TEXT_DYNAMIC_COLOR_5, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY}, - {TEXT_DYNAMIC_COLOR_6, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY} + {TEXT_DYNAMIC_COLOR_4, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY}, + {TEXT_DYNAMIC_COLOR_5, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY}, + {TEXT_DYNAMIC_COLOR_6, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY} } }; @@ -1999,7 +1999,7 @@ static void DrawKeyboardPageOnDeck(void) static void PrintControls(void) { - const u8 color[3] = { TEXT_DYNAMIC_COLOR_6, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY }; + const u8 color[3] = { TEXT_DYNAMIC_COLOR_6, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY }; FillWindowPixelBuffer(sNamingScreen->windows[WIN_BANNER], PIXEL_FILL(15)); AddTextPrinterParameterized3(sNamingScreen->windows[WIN_BANNER], 0, 2, 1, color, 0, gText_MoveOkBack); diff --git a/src/party_menu.c b/src/party_menu.c index 7b77a1067..8a0c01e25 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -4954,7 +4954,7 @@ static void DisplayLevelUpStatsPg1(u8 taskId) s16 *arrayPtr = sPartyMenuInternal->data; arrayPtr[12] = CreateLevelUpStatsWindow(); - DrawLevelUpWindowPg1(arrayPtr[12], arrayPtr, &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY); + DrawLevelUpWindowPg1(arrayPtr[12], arrayPtr, &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); CopyWindowToVram(arrayPtr[12], 2); ScheduleBgCopyTilemapToVram(2); } @@ -4963,7 +4963,7 @@ static void DisplayLevelUpStatsPg2(u8 taskId) { s16 *arrayPtr = sPartyMenuInternal->data; - DrawLevelUpWindowPg2(arrayPtr[12], &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY); + DrawLevelUpWindowPg2(arrayPtr[12], &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); CopyWindowToVram(arrayPtr[12], 2); ScheduleBgCopyTilemapToVram(2); } diff --git a/src/pokedex.c b/src/pokedex.c index 558c27083..2d371f937 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2318,7 +2318,7 @@ static void PrintMonDexNumAndName(u8 windowId, u8 fontId, const u8* str, u8 left color[0] = TEXT_COLOR_TRANSPARENT; color[1] = TEXT_DYNAMIC_COLOR_6; - color[2] = TEXT_COLOR_LIGHT_GREY; + color[2] = TEXT_COLOR_LIGHT_GRAY; AddTextPrinterParameterized4(windowId, fontId, left * 8, (top * 8) + 1, 0, 0, color, -1, str); } @@ -3160,7 +3160,7 @@ static void PrintInfoScreenText(const u8* str, u8 left, u8 top) u8 color[3]; color[0] = TEXT_COLOR_TRANSPARENT; color[1] = TEXT_DYNAMIC_COLOR_6; - color[2] = TEXT_COLOR_LIGHT_GREY; + color[2] = TEXT_COLOR_LIGHT_GRAY; AddTextPrinterParameterized4(0, 1, left, top, 0, 0, color, -1, str); } @@ -4457,7 +4457,7 @@ static void PrintInfoSubMenuText(u8 windowId, const u8 *str, u8 left, u8 top) u8 color[3]; color[0] = TEXT_COLOR_TRANSPARENT; color[1] = TEXT_DYNAMIC_COLOR_6; - color[2] = TEXT_COLOR_LIGHT_GREY; + color[2] = TEXT_COLOR_LIGHT_GRAY; AddTextPrinterParameterized4(windowId, 1, left, top, 0, 0, color, -1, str); } @@ -4766,7 +4766,7 @@ static void PrintSearchText(const u8 *str, u32 x, u32 y) color[0] = TEXT_COLOR_TRANSPARENT; color[1] = TEXT_DYNAMIC_COLOR_6; - color[2] = TEXT_COLOR_DARK_GREY; + color[2] = TEXT_COLOR_DARK_GRAY; AddTextPrinterParameterized4(0, 1, x, y, 0, 0, color, -1, str); } diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c index a1b7d36aa..5c678ed8c 100755 --- a/src/pokemon_jump.c +++ b/src/pokemon_jump.c @@ -3628,7 +3628,7 @@ static void CreatePokeJumpYesNoMenu(u16 left, u16 top, u8 cursorPos) // "Points" for jump score and "times" for number of jumps in a row static void PrintScoreSuffixes(void) { - u8 color[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY}; + u8 color[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}; PutWindowTilemap(WIN_POINTS); PutWindowTilemap(WIN_TIMES); @@ -3868,7 +3868,7 @@ static void PrintPokeJumpPlayerNames(bool32 highlightSelf) if (!highlightSelf) { for (i = 0; i < playersCount; i++) - PrintPokeJumpPlayerName(i, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY); + PrintPokeJumpPlayerName(i, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); } else { @@ -3877,7 +3877,7 @@ static void PrintPokeJumpPlayerNames(bool32 highlightSelf) for (i = 0; i < playersCount; i++) { if (multiplayerId != i) - PrintPokeJumpPlayerName(i, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY); + PrintPokeJumpPlayerName(i, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); else PrintPokeJumpPlayerName(i, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_RED, TEXT_COLOR_LIGHT_RED); } diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index d249381d8..0a35aa323 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -6884,18 +6884,18 @@ static void SetCursorMonData(void *pokemon, u8 mode) *(txtPtr)++ = CHAR_FEMALE; break; default: - *(txtPtr)++ = TEXT_COLOR_DARK_GREY; + *(txtPtr)++ = TEXT_COLOR_DARK_GRAY; *(txtPtr)++ = TEXT_COLOR_WHITE; - *(txtPtr)++ = TEXT_COLOR_LIGHT_GREY; + *(txtPtr)++ = TEXT_COLOR_LIGHT_GRAY; *(txtPtr)++ = CHAR_UNK_SPACER; break; } *(txtPtr++) = EXT_CTRL_CODE_BEGIN; *(txtPtr++) = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW; - *(txtPtr++) = TEXT_COLOR_DARK_GREY; + *(txtPtr++) = TEXT_COLOR_DARK_GRAY; *(txtPtr++) = TEXT_COLOR_WHITE; - *(txtPtr++) = TEXT_COLOR_LIGHT_GREY; + *(txtPtr++) = TEXT_COLOR_LIGHT_GRAY; *(txtPtr++) = CHAR_SPACE; *(txtPtr++) = CHAR_EXTRA_SYMBOL; *(txtPtr++) = CHAR_LV_2; diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 7dcfd7b99..3041fdb13 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -707,7 +707,7 @@ static void (*const sTextPrinterTasks[])(u8 taskId) = }; static const u8 sMemoNatureTextColor[] = _("{COLOR LIGHT_RED}{SHADOW GREEN}"); -static const u8 sMemoMiscTextColor[] = _("{COLOR WHITE}{SHADOW DARK_GREY}"); // This is also affected by palettes, apparently +static const u8 sMemoMiscTextColor[] = _("{COLOR WHITE}{SHADOW DARK_GRAY}"); // This is also affected by palettes, apparently static const u8 sStatsLeftColumnLayout[] = _("{DYNAMIC 0}/{DYNAMIC 1}\n{DYNAMIC 2}\n{DYNAMIC 3}"); static const u8 sStatsRightColumnLayout[] = _("{DYNAMIC 0}\n{DYNAMIC 1}\n{DYNAMIC 2}"); static const u8 sMovesPPLayout[] = _("{PP}{DYNAMIC 0}/{DYNAMIC 1}"); diff --git a/src/pokenav_conditions_3.c b/src/pokenav_conditions_3.c index 2a1dda1fa..712be6f69 100644 --- a/src/pokenav_conditions_3.c +++ b/src/pokenav_conditions_3.c @@ -124,8 +124,8 @@ static const struct WindowTemplate sSearchResultListMenuWindowTemplate = .baseBlock = 20 }; -static const u8 sText_MaleSymbol[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}"); -static const u8 sText_FemaleSymbol[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}"); +static const u8 sText_MaleSymbol[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GRAY}{WHITE}{LIGHT_GRAY}"); +static const u8 sText_FemaleSymbol[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GRAY}{WHITE}{LIGHT_GRAY}"); static const u8 sText_NoGenderSymbol[] = _("{UNK_SPACER}"); bool32 PokenavCallback_Init_ConditionSearch(void) diff --git a/src/pokenav_main_menu.c b/src/pokenav_main_menu.c index 07e5242fe..9c4d15286 100644 --- a/src/pokenav_main_menu.c +++ b/src/pokenav_main_menu.c @@ -102,7 +102,7 @@ static const u8 *const sHelpBarTexts[HELPBAR_COUNT] = static const u8 sHelpBarTextColors[3] = { - TEXT_COLOR_RED, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY + TEXT_COLOR_RED, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY }; static const struct CompressedSpriteSheet gSpinningPokenavSpriteSheet[] = diff --git a/src/pokenav_match_call_ui.c b/src/pokenav_match_call_ui.c index 11bb30162..b3f9331b7 100644 --- a/src/pokenav_match_call_ui.c +++ b/src/pokenav_match_call_ui.c @@ -708,7 +708,7 @@ void sub_81C8C64(struct PokenavListMenuWindow *listWindow, u32 a1) void sub_81C8CB4(struct MatchCallWindowState *state, struct PokenavSub17Substruct *list) { - u8 colors[3] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_RED}; + u8 colors[3] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_RED}; list->unk34(state->unk10 + state->unkC * state->windowTopIndex, list->unkTextBuffer); list->unk38(list->listWindow.windowId, state->windowTopIndex, list->listWindow.unkA); diff --git a/src/pokenav_ribbons_1.c b/src/pokenav_ribbons_1.c index f80f95998..69326ad23 100644 --- a/src/pokenav_ribbons_1.c +++ b/src/pokenav_ribbons_1.c @@ -119,8 +119,8 @@ static const struct WindowTemplate sRibbonsMonListWindowTemplate = .baseBlock = 20 }; -static const u8 sText_MaleSymbol[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}"); -static const u8 sText_FemaleSymbol[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}"); +static const u8 sText_MaleSymbol[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GRAY}{WHITE}{LIGHT_GRAY}"); +static const u8 sText_FemaleSymbol[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GRAY}{WHITE}{LIGHT_GRAY}"); static const u8 sText_NoGenderSymbol[] = _("{UNK_SPACER}"); bool32 PokenavCallback_Init_MonRibbonList(void) diff --git a/src/pokenav_ribbons_2.c b/src/pokenav_ribbons_2.c index cbcd29776..8a9061ace 100644 --- a/src/pokenav_ribbons_2.c +++ b/src/pokenav_ribbons_2.c @@ -802,7 +802,7 @@ static void AddRibbonCountWindow(struct PokenavSub14 *structPtr) static void PrintCurrentMonRibbonCount(struct PokenavSub14 *structPtr) { - u8 color[] = {TEXT_COLOR_RED, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY}; + u8 color[] = {TEXT_COLOR_RED, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}; ConvertIntToDecimalStringN(gStringVar1, GetCurrMonRibbonCount(), STR_CONV_MODE_LEFT_ALIGN, 2); DynamicPlaceholderTextUtil_Reset(); @@ -817,7 +817,7 @@ static void PrintRibbonNameAndDescription(struct PokenavSub14 *structPtr) { s32 i; u32 ribbonId = GetRibbonId(); - u8 color[] = {TEXT_COLOR_RED, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY}; + u8 color[] = {TEXT_COLOR_RED, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}; FillWindowPixelBuffer(structPtr->ribbonCountWindowId, PIXEL_FILL(4)); if (ribbonId < FIRST_GIFT_RIBBON) @@ -864,8 +864,8 @@ static void AddRibbonSummaryMonNameWindow(struct PokenavSub14 *structPtr) PrintRibbbonsSummaryMonInfo(structPtr); } -static const u8 sMaleIconString[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}"); -static const u8 sFemaleIconString[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}"); +static const u8 sMaleIconString[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GRAY}{WHITE}{LIGHT_GRAY}"); +static const u8 sFemaleIconString[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GRAY}{WHITE}{LIGHT_GRAY}"); static const u8 sGenderlessIconString[] = _("{UNK_SPACER}"); static void PrintRibbbonsSummaryMonInfo(struct PokenavSub14 *structPtr) diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index facdbdc17..529bb75e7 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -152,7 +152,7 @@ static void SaveFailedScreenTextPrint(const u8 *text, u8 x, u8 y) color[0] = TEXT_COLOR_TRANSPARENT; color[1] = TEXT_DYNAMIC_COLOR_6; - color[2] = TEXT_COLOR_LIGHT_GREY; + color[2] = TEXT_COLOR_LIGHT_GRAY; AddTextPrinterParameterized4(sWindowIds[TEXT_WIN_ID], 1, x * 8, y * 8 + 1, 0, 0, color, 0, text); } diff --git a/src/slot_machine.c b/src/slot_machine.c index 199e01bdd..aa32d5d95 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -682,7 +682,7 @@ static const struct WindowTemplate sWindowTemplate_InfoBox = .baseBlock = 1 }; -static const u8 sColors_ReeltimeHelp[] = {TEXT_COLOR_LIGHT_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY}; +static const u8 sColors_ReeltimeHelp[] = {TEXT_COLOR_LIGHT_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY}; static bool8 (*const sSlotActions[])(struct Task *task) = { diff --git a/src/start_menu.c b/src/start_menu.c index 2316b85b6..7c4b0d522 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -1242,9 +1242,9 @@ static void Task_SaveAfterLinkBattle(u8 taskId) gText_SavingDontTurnOffPower, TEXT_SPEED_FF, NULL, - TEXT_COLOR_DARK_GREY, + TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, - TEXT_COLOR_LIGHT_GREY); + TEXT_COLOR_LIGHT_GRAY); DrawTextBorderOuter(0, 8, 14); PutWindowTilemap(0); CopyWindowToVram(0, 3); diff --git a/src/starter_choose.c b/src/starter_choose.c index f29023d96..4b582f839 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -153,7 +153,7 @@ static const struct BgTemplate sBgTemplates[3] = }, }; -static const u8 sTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GREY}; +static const u8 sTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY}; static const struct OamData sOam_Hand = { diff --git a/src/strings.c b/src/strings.c index 19d0e3cca..5c9b09c83 100644 --- a/src/strings.c +++ b/src/strings.c @@ -981,8 +981,8 @@ const u8 gText_TrainerCloseBy[] = _("That TRAINER is close by.\nTalk to the TRAI const u8 gText_InParty[] = _("IN PARTY"); const u8 gText_Number2[] = _("No. "); const u8 gText_Ribbons[] = _("RIBBONS"); // Unused -const u8 gText_PokemonMaleLv[] = _("{DYNAMIC 0}{COLOR_HIGHLIGHT_SHADOW LIGHT_RED WHITE GREEN}♂{COLOR_HIGHLIGHT_SHADOW DARK_GREY WHITE LIGHT_GREY}/{LV}{DYNAMIC 1}"); // Unused -const u8 gText_PokemonFemaleLv[] = _("{DYNAMIC 0}{COLOR_HIGHLIGHT_SHADOW LIGHT_GREEN WHITE BLUE}♀{COLOR_HIGHLIGHT_SHADOW DARK_GREY WHITE LIGHT_GREY}/{LV}{DYNAMIC 1}"); // Unused +const u8 gText_PokemonMaleLv[] = _("{DYNAMIC 0}{COLOR_HIGHLIGHT_SHADOW LIGHT_RED WHITE GREEN}♂{COLOR_HIGHLIGHT_SHADOW DARK_GRAY WHITE LIGHT_GRAY}/{LV}{DYNAMIC 1}"); // Unused +const u8 gText_PokemonFemaleLv[] = _("{DYNAMIC 0}{COLOR_HIGHLIGHT_SHADOW LIGHT_GREEN WHITE BLUE}♀{COLOR_HIGHLIGHT_SHADOW DARK_GRAY WHITE LIGHT_GRAY}/{LV}{DYNAMIC 1}"); // Unused const u8 gText_PokemonNoGenderLv[] = _("{DYNAMIC 0}/{LV}{DYNAMIC 1}"); // Unused const u8 gText_Unknown[] = _("UNKNOWN"); const u8 gText_Call[] = _("CALL"); @@ -990,8 +990,8 @@ const u8 gText_Check[] = _("CHECK"); const u8 gText_Cancel6[] = _("CANCEL"); const u8 gText_NumberF700[] = _("No. {DYNAMIC 0}"); const u8 gText_RibbonsF700[] = _("RIBBONS {DYNAMIC 0}"); -const u8 gText_PokemonMaleLv2[] = _("{DYNAMIC 0}{COLOR_HIGHLIGHT_SHADOW LIGHT_RED WHITE GREEN}♂{COLOR_HIGHLIGHT_SHADOW DARK_GREY WHITE LIGHT_GREY}/{LV}{DYNAMIC 1}{DYNAMIC 2}"); // Unused -const u8 gText_PokemonFemaleLv2[] = _("{DYNAMIC 0}{COLOR_HIGHLIGHT_SHADOW LIGHT_GREEN WHITE BLUE}♀{COLOR_HIGHLIGHT_SHADOW DARK_GREY WHITE LIGHT_GREY}/{LV}{DYNAMIC 1}{DYNAMIC 2}"); // Unused +const u8 gText_PokemonMaleLv2[] = _("{DYNAMIC 0}{COLOR_HIGHLIGHT_SHADOW LIGHT_RED WHITE GREEN}♂{COLOR_HIGHLIGHT_SHADOW DARK_GRAY WHITE LIGHT_GRAY}/{LV}{DYNAMIC 1}{DYNAMIC 2}"); // Unused +const u8 gText_PokemonFemaleLv2[] = _("{DYNAMIC 0}{COLOR_HIGHLIGHT_SHADOW LIGHT_GREEN WHITE BLUE}♀{COLOR_HIGHLIGHT_SHADOW DARK_GRAY WHITE LIGHT_GRAY}/{LV}{DYNAMIC 1}{DYNAMIC 2}"); // Unused const u8 gText_PokemonNoGenderLv2[] = _("{DYNAMIC 0}/{LV}{DYNAMIC 1}{DYNAMIC 2}"); // Unused const u8 gText_CombineFourWordsOrPhrases[] = _("Combine four words or phrases"); const u8 gText_AndMakeYourProfile[] = _("and make your profile."); @@ -1200,18 +1200,18 @@ const u8 gText_Var1sTrainerCard[] = _("{STR_VAR_1}'s TRAINER CARD"); const u8 gText_HallOfFameDebut[] = _("HALL OF FAME DEBUT "); const u8 gText_LinkBattles[] = _("LINK BATTLES"); const u8 gText_LinkCableBattles[] = _("LINK CABLE BATTLES"); -const u8 gText_WinsLosses[] = _("W:{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_1}{COLOR DARK_GREY}{SHADOW LIGHT_GREY} L:{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_2}{COLOR DARK_GREY}{SHADOW LIGHT_GREY}"); +const u8 gText_WinsLosses[] = _("W:{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_1}{COLOR DARK_GRAY}{SHADOW LIGHT_GRAY} L:{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_2}{COLOR DARK_GRAY}{SHADOW LIGHT_GRAY}"); const u8 gText_PokemonTrades[] = _("POKéMON TRADES"); const u8 gText_UnionTradesAndBattles[] = _("UNION TRADES & BATTLES"); const u8 gText_BerryCrush[] = _("BERRY CRUSH"); const u8 gText_WaitingTrainerFinishReading[] = _("Waiting for the other TRAINER to\nfinish reading your TRAINER CARD."); const u8 gText_PokeblocksWithFriends[] = _("{POKEBLOCK}S W/FRIENDS"); -const u8 gText_NumPokeblocks[] = _("{STR_VAR_1}{COLOR DARK_GREY}{SHADOW LIGHT_GREY}"); +const u8 gText_NumPokeblocks[] = _("{STR_VAR_1}{COLOR DARK_GRAY}{SHADOW LIGHT_GRAY}"); const u8 gText_WonContestsWFriends[] = _("WON CONTESTS W/FRIENDS"); const u8 gText_BattlePtsWon[] = _("BATTLE POINTS WON"); -const u8 gText_NumBP[] = _("{STR_VAR_1}{COLOR DARK_GREY}{SHADOW LIGHT_GREY}BP"); +const u8 gText_NumBP[] = _("{STR_VAR_1}{COLOR DARK_GRAY}{SHADOW LIGHT_GRAY}BP"); const u8 gText_BattleTower[] = _("BATTLE TOWER"); -const u8 gText_WinsStraight[] = _("W/{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_1}{COLOR DARK_GREY}{SHADOW LIGHT_GREY} STRAIGHT/{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_2}"); +const u8 gText_WinsStraight[] = _("W/{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_1}{COLOR DARK_GRAY}{SHADOW LIGHT_GRAY} STRAIGHT/{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_2}"); const u8 gText_BattleTower2[] = _("BATTLE TOWER"); const u8 gText_BattleDome[] = _("BATTLE DOME"); const u8 gText_BattlePalace[] = _("BATTLE PALACE"); @@ -1228,7 +1228,7 @@ ALIGNED(4) const u8 gText_Facility[] = _("{STR_VAR_1}"); const u8 gText_Give[] = _("Give"); const u8 gText_NoNeed[] = _("No need"); -const u8 gText_ColorLightShadowDarkGrey[] = _("{COLOR LIGHT_GREY}{SHADOW DARK_GREY}"); +const u8 gText_ColorLightShadowDarkGrey[] = _("{COLOR LIGHT_GRAY}{SHADOW DARK_GRAY}"); const u8 gText_ColorBlue[] = _("{COLOR BLUE}"); const u8 gText_ColorTransparent[] = _("{HIGHLIGHT TRANSPARENT}{COLOR TRANSPARENT}"); const u8 gText_CDot[] = _("C."); @@ -1238,9 +1238,9 @@ const u8 gText_PreliminaryResults[] = _("The preliminary results!"); const u8 gText_Round2Results[] = _("Round 2 results!"); const u8 gText_ContestantsMonWon[] = _("{STR_VAR_1}'s {STR_VAR_2} won!"); const u8 gText_CommunicationStandby[] = _("Communication standby…"); -const u8 gText_ColorDarkGrey[] = _("{COLOR DARK_GREY}"); +const u8 gText_ColorDarkGrey[] = _("{COLOR DARK_GRAY}"); const u8 gText_ColorDynamic6WhiteDynamic5[] = _("{COLOR_HIGHLIGHT_SHADOW DYNAMIC_COLOR6 WHITE DYNAMIC_COLOR5}"); // Unused -const u8 gText_HighlightDarkGrey[] = _("{HIGHLIGHT DARK_GREY}"); +const u8 gText_HighlightDarkGrey[] = _("{HIGHLIGHT DARK_GRAY}"); const u8 gText_EmptySpace2[] = _(" "); // Unused const u8 gText_DynColor2Male[] = _("{COLOR DYNAMIC_COLOR2}♂"); const u8 gText_DynColor1Female[] = _("{COLOR DYNAMIC_COLOR1}♀"); @@ -1535,7 +1535,7 @@ const u8 gJPText_Player[] = _("プレイヤー"); // Unused const u8 gJPText_Sama[] = _("さま"); // Unused const u8 gText_DexHoenn[] = _("HOENN"); const u8 gText_DexNational[] = _("NATIONAL"); -const u8 gText_PokedexDiploma[] = _("PLAYER: {CLEAR 0x10}{COLOR RED}{SHADOW LIGHT_RED}{PLAYER}{COLOR DARK_GREY}{SHADOW LIGHT_GREY}\n\nThis document certifies\nthat you have successfully\ncompleted your\n{STR_VAR_1} POKéDEX.\n\n{CLEAR_TO 0x42}{COLOR RED}{SHADOW LIGHT_RED}GAME FREAK"); +const u8 gText_PokedexDiploma[] = _("PLAYER: {CLEAR 0x10}{COLOR RED}{SHADOW LIGHT_RED}{PLAYER}{COLOR DARK_GRAY}{SHADOW LIGHT_GRAY}\n\nThis document certifies\nthat you have successfully\ncompleted your\n{STR_VAR_1} POKéDEX.\n\n{CLEAR_TO 0x42}{COLOR RED}{SHADOW LIGHT_RED}GAME FREAK"); const u8 gJPText_GameFreak[] = _("{COLOR RED}{SHADOW LIGHT_RED}ゲ-ムフリ-ク"); // Unused const u8 gText_DiplomaEmpty[] = _("{COLOR RED}{SHADOW LIGHT_RED}"); // Unused const u8 gText_Hoenn[] = _("HOENN"); diff --git a/src/trainer_card.c b/src/trainer_card.c index d4bcf4299..03a7b9219 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -273,7 +273,7 @@ static const u16 *const sKantoTrainerCardStarPals[] = sKantoTrainerCard4Star_Pal, }; -static const u8 sTrainerCardTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY}; +static const u8 sTrainerCardTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}; static const u8 sTrainerCardStatColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_RED, TEXT_COLOR_LIGHT_RED}; static const u8 sTimeColonInvisibleTextColors[6] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_TRANSPARENT}; diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 3bc6c970b..059773a0b 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -202,7 +202,7 @@ static const u16 *const *const sPrizeListSets[] = }; static const u16 sEReader_Pal[] = INCBIN_U16("graphics/misc/trainer_hill_ereader.gbapal"); -static const u8 sRecordWinColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY}; +static const u8 sRecordWinColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}; static const struct TrHillTag *const sDataPerTag[] = { diff --git a/src/union_room.c b/src/union_room.c index a12b385f5..f41cfd45f 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -3769,9 +3769,9 @@ static void UR_AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str case UR_COLOR_DKE_WHT_LTE: printerTemplate.letterSpacing = 0; printerTemplate.lineSpacing = 0; - printerTemplate.fgColor = TEXT_COLOR_DARK_GREY; + printerTemplate.fgColor = TEXT_COLOR_DARK_GRAY; printerTemplate.bgColor = TEXT_COLOR_WHITE; - printerTemplate.shadowColor = TEXT_COLOR_LIGHT_GREY; + printerTemplate.shadowColor = TEXT_COLOR_LIGHT_GRAY; break; case UR_COLOR_RED_WHT_LTR: printerTemplate.letterSpacing = 0; @@ -3792,14 +3792,14 @@ static void UR_AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str printerTemplate.lineSpacing = 0; printerTemplate.fgColor = TEXT_COLOR_WHITE; printerTemplate.bgColor = TEXT_COLOR_WHITE; - printerTemplate.shadowColor = TEXT_COLOR_LIGHT_GREY; + printerTemplate.shadowColor = TEXT_COLOR_LIGHT_GRAY; break; case UR_COLOR_WHT_DKE_LTE: printerTemplate.letterSpacing = 0; printerTemplate.lineSpacing = 0; printerTemplate.fgColor = TEXT_COLOR_WHITE; - printerTemplate.bgColor = TEXT_COLOR_DARK_GREY; - printerTemplate.shadowColor = TEXT_COLOR_LIGHT_GREY; + printerTemplate.bgColor = TEXT_COLOR_DARK_GRAY; + printerTemplate.shadowColor = TEXT_COLOR_LIGHT_GRAY; break; case UR_COLOR_GRN_DN6_LTB: printerTemplate.letterSpacing = 0; diff --git a/src/union_room_battle.c b/src/union_room_battle.c index c212e4706..2d1274f6e 100644 --- a/src/union_room_battle.c +++ b/src/union_room_battle.c @@ -49,7 +49,7 @@ static const struct WindowTemplate sWindowTemplates[] = { DUMMY_WIN_TEMPLATE }; -static const u8 sTextColors[] = { TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY }; +static const u8 sTextColors[] = { TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY }; static void CB2_SetUpPartiesAndStartBattle(void) { diff --git a/src/wireless_communication_status_screen.c b/src/wireless_communication_status_screen.c index 72557aefd..dbc71d634 100644 --- a/src/wireless_communication_status_screen.c +++ b/src/wireless_communication_status_screen.c @@ -319,13 +319,13 @@ static void WCSS_AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 * { case COLORMODE_NORMAL: color[0] = TEXT_COLOR_TRANSPARENT; - color[1] = TEXT_COLOR_DARK_GREY; - color[2] = TEXT_COLOR_LIGHT_GREY; + color[1] = TEXT_COLOR_DARK_GRAY; + color[2] = TEXT_COLOR_LIGHT_GRAY; break; case COLORMODE_WHITE_LGRAY: color[0] = TEXT_COLOR_TRANSPARENT; color[1] = TEXT_COLOR_WHITE; - color[2] = TEXT_COLOR_LIGHT_GREY; + color[2] = TEXT_COLOR_LIGHT_GRAY; break; case COLORMODE_RED: color[0] = TEXT_COLOR_TRANSPARENT; @@ -340,7 +340,7 @@ static void WCSS_AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 * case COLORMODE_WHITE_DGRAY: color[0] = TEXT_COLOR_TRANSPARENT; color[1] = TEXT_COLOR_WHITE; - color[2] = TEXT_COLOR_DARK_GREY; + color[2] = TEXT_COLOR_DARK_GRAY; break; } From 72ba8cf58de8297c56d2269e0519064dc2de5f76 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 9 Apr 2021 12:41:02 -0400 Subject: [PATCH 27/63] Document pokemon animation types --- include/constants/battle_anim.h | 29 - include/pokemon_animation.h | 182 ++ include/pokemon_summary_screen.h | 3 +- src/pokeball.c | 2 +- src/pokemon.c | 910 ++++---- src/pokemon_animation.c | 3492 +++++++++++++++--------------- src/pokemon_summary_screen.c | 23 +- 7 files changed, 2370 insertions(+), 2271 deletions(-) diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 5f8900bf6..4622876cc 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -410,33 +410,4 @@ #define ANIM_WEATHER_SANDSTORM 3 #define ANIM_WEATHER_HAIL 4 -// Battle mon back animations. -#define BACK_ANIM_NONE 0x00 -#define BACK_ANIM_H_SLIDE_QUICK 0x01 -#define BACK_ANIM_H_SLIDE 0x02 -#define BACK_ANIM_H_SLIDE_WITH_V_COMPRESS_1 0x03 -#define BACK_ANIM_H_SLIDE_WITH_V_COMPRESS_2 0x04 -#define BACK_ANIM_SHRINK_GROW_1 0x05 -#define BACK_ANIM_GROW_1 0x06 -#define BACK_ANIM_CIRCLE_MOVE_COUNTERCLOCKWISE 0x07 -#define BACK_ANIM_HORIZONTAL_SHAKE 0x08 -#define BACK_ANIM_VERTICAL_SHAKE 0x09 -#define BACK_ANIM_V_SHAKE_WITH_H_SLIDE 0x0a -#define BACK_ANIM_VERTICAL_STRETCH 0x0b -#define BACK_ANIM_HORIZONTAL_STRETCH 0x0c -#define BACK_ANIM_GROW_2 0x0d -#define BACK_ANIM_V_SHAKE_WITH_PAUSE 0x0e -#define BACK_ANIM_CIRCLE_MOVE_CLOCKWISE 0x0f -#define BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL 0x10 -#define BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE 0x11 -#define BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE 0x12 -#define BACK_ANIM_DIP_RIGHT_SIDE 0x13 -#define BACK_ANIM_SHRINK_GROW_2 0x14 -#define BACK_ANIM_JOLT_RIGHT 0x15 -#define BACK_ANIM_FLASH_YELLOW_WITH_SHAKE 0x16 -#define BACK_ANIM_FADE_RED_WITH_SHAKE 0x17 -#define BACK_ANIM_FADE_GREEN_WITH_SHAKE 0x18 -#define BACK_ANIM_FADE_BLUE_WITH_SHAKE 0x19 - - #endif // GUARD_CONSTANTS_BATTLE_ANIM_H diff --git a/include/pokemon_animation.h b/include/pokemon_animation.h index c1ab8d817..5174c8a77 100644 --- a/include/pokemon_animation.h +++ b/include/pokemon_animation.h @@ -7,4 +7,186 @@ void StartMonSummaryAnimation(struct Sprite *sprite, u8 frontAnimId); void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet); void SetSpriteCB_MonAnimDummy(struct Sprite *sprite); +// Pokémon back animation sets +#define BACK_ANIM_NONE 0 +#define BACK_ANIM_H_VIBRATE 1 +#define BACK_ANIM_H_SLIDE 2 +#define BACK_ANIM_H_SPRING 3 +#define BACK_ANIM_H_SPRING_REPEATED 4 +#define BACK_ANIM_SHRINK_GROW 5 +#define BACK_ANIM_GROW 6 +#define BACK_ANIM_CIRCLE_COUNTERCLOCKWISE 7 +#define BACK_ANIM_H_SHAKE 8 +#define BACK_ANIM_V_SHAKE 9 +#define BACK_ANIM_V_SHAKE_H_SLIDE 10 +#define BACK_ANIM_V_STRETCH 11 +#define BACK_ANIM_H_STRETCH 12 +#define BACK_ANIM_GROW_STUTTER 13 +#define BACK_ANIM_V_SHAKE_LOW 14 +#define BACK_ANIM_TRIANGLE_DOWN 15 +#define BACK_ANIM_CONCAVE_ARC_LARGE 16 +#define BACK_ANIM_CONVEX_DOUBLE_ARC 17 +#define BACK_ANIM_CONCAVE_ARC_SMALL 18 +#define BACK_ANIM_DIP_RIGHT_SIDE 19 +#define BACK_ANIM_SHRINK_GROW_VIBRATE 20 +#define BACK_ANIM_JOLT_RIGHT 21 +#define BACK_ANIM_SHAKE_FLASH_YELLOW 22 +#define BACK_ANIM_SHAKE_GLOW_RED 23 +#define BACK_ANIM_SHAKE_GLOW_GREEN 24 +#define BACK_ANIM_SHAKE_GLOW_BLUE 25 + +// Pokémon animation function ids (for front and back) +// Each front anim uses 1, and each back anim uses a set of 3 +#define ANIM_V_SQUISH_AND_BOUNCE 0 +#define ANIM_CIRCULAR_STRETCH_TWICE 1 +#define ANIM_H_VIBRATE 2 +#define ANIM_H_SLIDE 3 +#define ANIM_V_SLIDE 4 +#define ANIM_BOUNCE_ROTATE_TO_SIDES 5 +#define ANIM_V_JUMPS_H_JUMPS 6 +#define ANIM_ROTATE_TO_SIDES 7 +#define ANIM_ROTATE_TO_SIDES_TWICE 8 +#define ANIM_GROW_VIBRATE 9 +#define ANIM_ZIGZAG_FAST 10 +#define ANIM_SWING_CONCAVE 11 +#define ANIM_SWING_CONCAVE_FAST 12 +#define ANIM_SWING_CONVEX 13 +#define ANIM_SWING_CONVEX_FAST 14 +#define ANIM_H_SHAKE 15 +#define ANIM_V_SHAKE 16 +#define ANIM_CIRCULAR_VIBRATE 17 +#define ANIM_TWIST 18 +#define ANIM_SHRINK_GROW 19 +#define ANIM_CIRCLE_C_CLOCKWISE 20 +#define ANIM_GLOW_BLACK 21 +#define ANIM_H_STRETCH 22 +#define ANIM_V_STRETCH 23 +#define ANIM_RISING_WOBBLE 24 +#define ANIM_V_SHAKE_TWICE 25 +#define ANIM_TIP_MOVE_FORWARD 26 +#define ANIM_H_PIVOT 27 +#define ANIM_V_SLIDE_WOBBLE 28 +#define ANIM_H_SLIDE_WOBBLE 29 +#define ANIM_V_JUMPS_BIG 30 +#define ANIM_SPIN_LONG 31 +#define ANIM_GLOW_ORANGE 32 +#define ANIM_GLOW_RED 33 +#define ANIM_GLOW_BLUE 34 +#define ANIM_GLOW_YELLOW 35 +#define ANIM_GLOW_PURPLE 36 +#define ANIM_BACK_AND_LUNGE 37 +#define ANIM_BACK_FLIP 38 +#define ANIM_FLICKER 39 +#define ANIM_BACK_FLIP_BIG 40 +#define ANIM_FRONT_FLIP 41 +#define ANIM_TUMBLING_FRONT_FLIP 42 +#define ANIM_FIGURE_8 43 +#define ANIM_FLASH_YELLOW 44 +#define ANIM_SWING_CONCAVE_FAST_SHORT 45 +#define ANIM_SWING_CONVEX_FAST_SHORT 46 +#define ANIM_ROTATE_UP_SLAM_DOWN 47 +#define ANIM_DEEP_V_SQUISH_AND_BOUNCE 48 +#define ANIM_H_JUMPS 49 +#define ANIM_H_JUMPS_V_STRETCH 50 +#define ANIM_ROTATE_TO_SIDES_FAST 51 +#define ANIM_ROTATE_UP_TO_SIDES 52 +#define ANIM_FLICKER_INCREASING 53 +#define ANIM_TIP_HOP_FORWARD 54 +#define ANIM_PIVOT_SHAKE 55 +#define ANIM_TIP_AND_SHAKE 56 +#define ANIM_VIBRATE_TO_CORNERS 57 +#define ANIM_GROW_IN_STAGES 58 +#define ANIM_V_SPRING 59 +#define ANIM_V_REPEATED_SPRING 60 +#define ANIM_SPRING_RISING 61 +#define ANIM_H_SPRING 62 +#define ANIM_H_REPEATED_SPRING_SLOW 63 +#define ANIM_H_SLIDE_SHRINK 64 +#define ANIM_LUNGE_GROW 65 +#define ANIM_CIRCLE_INTO_BG 66 +#define ANIM_RAPID_H_HOPS 67 +#define ANIM_FOUR_PETAL 68 +#define ANIM_V_SQUISH_AND_BOUNCE_SLOW 69 +#define ANIM_H_SLIDE_SLOW 70 +#define ANIM_V_SLIDE_SLOW 71 +#define ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL 72 +#define ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW 73 +#define ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL_SLOW 74 +#define ANIM_ZIGZAG_SLOW 75 +#define ANIM_H_SHAKE_SLOW 76 +#define ANIM_V_SHAKE_SLOW 77 +#define ANIM_TWIST_TWICE 78 +#define ANIM_CIRCLE_C_CLOCKWISE_SLOW 79 +#define ANIM_V_SHAKE_TWICE_SLOW 80 +#define ANIM_V_SLIDE_WOBBLE_SMALL 81 +#define ANIM_V_JUMPS_SMALL 82 +#define ANIM_SPIN 83 +#define ANIM_TUMBLING_FRONT_FLIP_TWICE 84 +#define ANIM_DEEP_V_SQUISH_AND_BOUNCE_TWICE 85 +#define ANIM_H_JUMPS_V_STRETCH_TWICE 86 +#define ANIM_V_SHAKE_BACK 87 +#define ANIM_V_SHAKE_BACK_SLOW 88 +#define ANIM_V_SHAKE_H_SLIDE_SLOW 89 +#define ANIM_V_STRETCH_BOTH_ENDS_SLOW 90 +#define ANIM_H_STRETCH_FAR_SLOW 91 +#define ANIM_V_SHAKE_LOW_TWICE 92 +#define ANIM_H_SHAKE_FAST 93 +#define ANIM_H_SLIDE_FAST 94 +#define ANIM_H_VIBRATE_FAST 95 +#define ANIM_H_VIBRATE_FASTEST 96 +#define ANIM_V_SHAKE_BACK_FAST 97 +#define ANIM_V_SHAKE_LOW_TWICE_SLOW 98 +#define ANIM_V_SHAKE_LOW_TWICE_FAST 99 +#define ANIM_CIRCLE_C_CLOCKWISE_LONG 100 +#define ANIM_GROW_STUTTER_SLOW 101 +#define ANIM_V_SHAKE_H_SLIDE 102 +#define ANIM_V_SHAKE_H_SLIDE_FAST 103 +#define ANIM_TRIANGLE_DOWN_SLOW 104 +#define ANIM_TRIANGLE_DOWN 105 +#define ANIM_TRIANGLE_DOWN_TWICE 106 +#define ANIM_GROW 107 +#define ANIM_GROW_TWICE 108 +#define ANIM_H_SPRING_FAST 109 +#define ANIM_H_SPRING_SLOW 110 +#define ANIM_H_REPEATED_SPRING_FAST 111 +#define ANIM_H_REPEATED_SPRING 112 +#define ANIM_SHRINK_GROW_FAST 113 +#define ANIM_SHRINK_GROW_SLOW 114 +#define ANIM_V_STRETCH_BOTH_ENDS 115 +#define ANIM_V_STRETCH_BOTH_ENDS_TWICE 116 +#define ANIM_H_STRETCH_FAR_TWICE 117 +#define ANIM_H_STRETCH_FAR 118 +#define ANIM_GROW_STUTTER_TWICE 119 +#define ANIM_GROW_STUTTER 120 +#define ANIM_CONCAVE_ARC_LARGE_SLOW 121 +#define ANIM_CONCAVE_ARC_LARGE 122 +#define ANIM_CONCAVE_ARC_LARGE_TWICE 123 +#define ANIM_CONVEX_DOUBLE_ARC_SLOW 124 +#define ANIM_CONVEX_DOUBLE_ARC 125 +#define ANIM_CONVEX_DOUBLE_ARC_TWICE 126 +#define ANIM_CONCAVE_ARC_SMALL_SLOW 127 +#define ANIM_CONCAVE_ARC_SMALL 128 +#define ANIM_CONCAVE_ARC_SMALL_TWICE 129 +#define ANIM_H_DIP 130 +#define ANIM_H_DIP_FAST 131 +#define ANIM_H_DIP_TWICE 132 +#define ANIM_SHRINK_GROW_VIBRATE_FAST 133 +#define ANIM_SHRINK_GROW_VIBRATE 134 +#define ANIM_SHRINK_GROW_VIBRATE_SLOW 135 +#define ANIM_JOLT_RIGHT_FAST 136 +#define ANIM_JOLT_RIGHT 137 +#define ANIM_JOLT_RIGHT_SLOW 138 +#define ANIM_SHAKE_FLASH_YELLOW_FAST 139 +#define ANIM_SHAKE_FLASH_YELLOW 140 +#define ANIM_SHAKE_FLASH_YELLOW_SLOW 141 +#define ANIM_SHAKE_GLOW_RED_FAST 142 +#define ANIM_SHAKE_GLOW_RED 143 +#define ANIM_SHAKE_GLOW_RED_SLOW 144 +#define ANIM_SHAKE_GLOW_GREEN_FAST 145 +#define ANIM_SHAKE_GLOW_GREEN 146 +#define ANIM_SHAKE_GLOW_GREEN_SLOW 147 +#define ANIM_SHAKE_GLOW_BLUE_FAST 148 +#define ANIM_SHAKE_GLOW_BLUE 149 +#define ANIM_SHAKE_GLOW_BLUE_SLOW 150 + #endif // GUARD_POKEMON_ANIMATION_H diff --git a/include/pokemon_summary_screen.h b/include/pokemon_summary_screen.h index 6413dcdec..151ea3af8 100755 --- a/include/pokemon_summary_screen.h +++ b/include/pokemon_summary_screen.h @@ -12,8 +12,7 @@ void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void ShowSelectMovePokemonSummaryScreen(struct Pokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void), u16 newMove); void ShowPokemonSummaryScreenSet40EF(u8 mode, struct BoxPokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void)); u8 GetMoveSlotToReplace(void); -void SummaryScreen_SetUnknownTaskId(u8 taskId); -void SummaryScreen_DestroyUnknownTask(void); +void SummaryScreen_SetAnimDelayTaskId(u8 taskId); // The Pokemon Summary Screen can operate in different modes. Certain features, // such as move re-ordering, are available in the different modes. diff --git a/src/pokeball.c b/src/pokeball.c index 678b9da33..77d2b119c 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -791,7 +791,7 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite) gTasks[taskId].tCryTaskWantedCry = wantedCryCase; gTasks[taskId].tCryTaskBattler = battlerId; gTasks[taskId].tCryTaskMonSpriteId = gBattlerSpriteIds[sprite->sBattler]; - gTasks[taskId].tCryTaskMonPtr1 = (u32)(mon) >> 0x10; + gTasks[taskId].tCryTaskMonPtr1 = (u32)(mon) >> 16; gTasks[taskId].tCryTaskMonPtr2 = (u32)(mon); gTasks[taskId].tCryTaskState = 0; } diff --git a/src/pokemon.c b/src/pokemon.c index e28fba1b4..5166070f9 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1391,476 +1391,450 @@ const s8 gNatureStatTable[NUM_NATURES][NUM_NATURE_STATS] = static const u8 sMonFrontAnimIdsTable[] = { - [SPECIES_BULBASAUR - 1] = 0x06, - [SPECIES_IVYSAUR - 1] = 0x17, - [SPECIES_VENUSAUR - 1] = 0x2f, - [SPECIES_CHARMANDER - 1] = 0x52, - [SPECIES_CHARMELEON - 1] = 0x25, - [SPECIES_CHARIZARD - 1] = 0x10, - [SPECIES_SQUIRTLE - 1] = 0x0b, - [SPECIES_WARTORTLE - 1] = 0x13, - [SPECIES_BLASTOISE - 1] = 0x19, - [SPECIES_CATERPIE - 1] = 0x0b, - [SPECIES_METAPOD - 1] = 0x0b, - [SPECIES_BUTTERFREE - 1] = 0x1d, - [SPECIES_WEEDLE - 1] = 0x46, - [SPECIES_KAKUNA - 1] = 0x20, - [SPECIES_BEEDRILL - 1] = 0x02, - [SPECIES_PIDGEY - 1] = 0x47, - [SPECIES_PIDGEOTTO - 1] = 0x17, - [SPECIES_PIDGEOT - 1] = 0x29, - [SPECIES_RATTATA - 1] = 0x43, - [SPECIES_RATICATE - 1] = 0x2b, - [SPECIES_SPEAROW - 1] = 0x18, - [SPECIES_FEAROW - 1] = 0x2b, - [SPECIES_EKANS - 1] = 0x16, - [SPECIES_ARBOK - 1] = 0x17, - [SPECIES_PIKACHU - 1] = 0x2c, - [SPECIES_RAICHU - 1] = 0x17, - [SPECIES_SANDSHREW - 1] = 0x2d, - [SPECIES_SANDSLASH - 1] = 0x17, - [SPECIES_NIDORAN_F - 1] = 0x00, - [SPECIES_NIDORINA - 1] = 0x17, - [SPECIES_NIDOQUEEN - 1] = 0x0f, - [SPECIES_NIDORAN_M - 1] = 0x09, - [SPECIES_NIDORINO - 1] = 0x13, - [SPECIES_NIDOKING - 1] = 0x0f, - [SPECIES_CLEFAIRY - 1] = 0x00, - [SPECIES_CLEFABLE - 1] = 0x4a, - [SPECIES_VULPIX - 1] = 0x17, - [SPECIES_NINETALES - 1] = 0x10, - [SPECIES_JIGGLYPUFF - 1] = 0x48, - [SPECIES_WIGGLYTUFF - 1] = 0x31, - [SPECIES_ZUBAT - 1] = 0x00, - [SPECIES_GOLBAT - 1] = 0x1d, - [SPECIES_ODDISH - 1] = 0x00, - [SPECIES_GLOOM - 1] = 0x45, - [SPECIES_VILEPLUME - 1] = 0x49, - [SPECIES_PARAS - 1] = 0x46, - [SPECIES_PARASECT - 1] = 0x0f, - [SPECIES_VENONAT - 1] = 0x06, - [SPECIES_VENOMOTH - 1] = 0x4b, - [SPECIES_DIGLETT - 1] = 0x10, - [SPECIES_DUGTRIO - 1] = 0x4c, - [SPECIES_MEOWTH - 1] = 0x52, - [SPECIES_PERSIAN - 1] = 0x17, - [SPECIES_PSYDUCK - 1] = 0x06, - [SPECIES_GOLDUCK - 1] = 0x4c, - [SPECIES_MANKEY - 1] = 0x32, - [SPECIES_PRIMEAPE - 1] = 0x48, - [SPECIES_GROWLITHE - 1] = 0x25, - [SPECIES_ARCANINE - 1] = 0x02, - [SPECIES_POLIWAG - 1] = 0x00, - [SPECIES_POLIWHIRL - 1] = 0x32, - [SPECIES_POLIWRATH - 1] = 0x19, - [SPECIES_ABRA - 1] = 0x31, - [SPECIES_KADABRA - 1] = 0x09, - [SPECIES_ALAKAZAM - 1] = 0x17, - [SPECIES_MACHOP - 1] = 0x00, - [SPECIES_MACHOKE - 1] = 0x10, - [SPECIES_MACHAMP - 1] = 0x31, - [SPECIES_BELLSPROUT - 1] = 0x17, - [SPECIES_WEEPINBELL - 1] = 0x0d, - [SPECIES_VICTREEBEL - 1] = 0x32, - [SPECIES_TENTACOOL - 1] = 0x00, - [SPECIES_TENTACRUEL - 1] = 0x00, - [SPECIES_GEODUDE - 1] = 0x48, - [SPECIES_GRAVELER - 1] = 0x48, - [SPECIES_GOLEM - 1] = 0x2f, - [SPECIES_PONYTA - 1] = 0x20, - [SPECIES_RAPIDASH - 1] = 0x11, - [SPECIES_SLOWPOKE - 1] = 0x45, - [SPECIES_SLOWBRO - 1] = 0x0b, - [SPECIES_MAGNEMITE - 1] = 0x54, - [SPECIES_MAGNETON - 1] = 0x2c, - [SPECIES_FARFETCHD - 1] = 0x48, - [SPECIES_DODUO - 1] = 0x4c, - [SPECIES_DODRIO - 1] = 0x41, - [SPECIES_SEEL - 1] = 0x0b, - [SPECIES_DEWGONG - 1] = 0x45, - [SPECIES_GRIMER - 1] = 0x46, - [SPECIES_MUK - 1] = 0x30, - [SPECIES_SHELLDER - 1] = 0x12, - [SPECIES_CLOYSTER - 1] = 0x1d, - [SPECIES_GASTLY - 1] = 0x15, - [SPECIES_HAUNTER - 1] = 0x35, - [SPECIES_GENGAR - 1] = 0x3a, - [SPECIES_ONIX - 1] = 0x43, - [SPECIES_DROWZEE - 1] = 0x4f, - [SPECIES_HYPNO - 1] = 0x09, - [SPECIES_KRABBY - 1] = 0x03, - [SPECIES_KINGLER - 1] = 0x4b, - [SPECIES_VOLTORB - 1] = 0x00, - [SPECIES_ELECTRODE - 1] = 0x00, - [SPECIES_EXEGGCUTE - 1] = 0x46, - [SPECIES_EXEGGUTOR - 1] = 0x32, - [SPECIES_CUBONE - 1] = 0x48, - [SPECIES_MAROWAK - 1] = 0x05, - [SPECIES_HITMONLEE - 1] = 0x16, - [SPECIES_HITMONCHAN - 1] = 0x09, - [SPECIES_LICKITUNG - 1] = 0x45, - [SPECIES_KOFFING - 1] = 0x13, - [SPECIES_WEEZING - 1] = 0x04, - [SPECIES_RHYHORN - 1] = 0x10, - [SPECIES_RHYDON - 1] = 0x13, - [SPECIES_CHANSEY - 1] = 0x45, - [SPECIES_TANGELA - 1] = 0x48, - [SPECIES_KANGASKHAN - 1] = 0x17, - [SPECIES_HORSEA - 1] = 0x12, - [SPECIES_SEADRA - 1] = 0x04, - [SPECIES_GOLDEEN - 1] = 0x0d, - [SPECIES_SEAKING - 1] = 0x1c, - [SPECIES_STARYU - 1] = 0x4e, - [SPECIES_STARMIE - 1] = 0x12, - [SPECIES_MR_MIME - 1] = 0x46, - [SPECIES_SCYTHER - 1] = 0x02, - [SPECIES_JYNX - 1] = 0x17, - [SPECIES_ELECTABUZZ - 1] = 0x2c, - [SPECIES_MAGMAR - 1] = 0x0f, - [SPECIES_PINSIR - 1] = 0x09, - [SPECIES_TAUROS - 1] = 0x19, - [SPECIES_MAGIKARP - 1] = 0x05, - [SPECIES_GYARADOS - 1] = 0x48, - [SPECIES_LAPRAS - 1] = 0x17, - [SPECIES_DITTO - 1] = 0x01, - [SPECIES_EEVEE - 1] = 0x17, - [SPECIES_VAPOREON - 1] = 0x17, - [SPECIES_JOLTEON - 1] = 0x00, - [SPECIES_FLAREON - 1] = 0x17, - [SPECIES_PORYGON - 1] = 0x52, - [SPECIES_OMANYTE - 1] = 0x51, - [SPECIES_OMASTAR - 1] = 0x09, - [SPECIES_KABUTO - 1] = 0x1d, - [SPECIES_KABUTOPS - 1] = 0x0f, - [SPECIES_AERODACTYL - 1] = 0x47, - [SPECIES_SNORLAX - 1] = 0x0b, - [SPECIES_ARTICUNO - 1] = 0x09, - [SPECIES_ZAPDOS - 1] = 0x2c, - [SPECIES_MOLTRES - 1] = 0x45, - [SPECIES_DRATINI - 1] = 0x00, - [SPECIES_DRAGONAIR - 1] = 0x10, - [SPECIES_DRAGONITE - 1] = 0x47, - [SPECIES_MEWTWO - 1] = 0x09, - [SPECIES_MEW - 1] = 0x0d, - [SPECIES_CHIKORITA - 1] = 0x00, - [SPECIES_BAYLEEF - 1] = 0x00, - [SPECIES_MEGANIUM - 1] = 0x17, - [SPECIES_CYNDAQUIL - 1] = 0x52, - [SPECIES_QUILAVA - 1] = 0x17, - [SPECIES_TYPHLOSION - 1] = 0x10, - [SPECIES_TOTODILE - 1] = 0x31, - [SPECIES_CROCONAW - 1] = 0x0f, - [SPECIES_FERALIGATR - 1] = 0x0f, - [SPECIES_SENTRET - 1] = 0x00, - [SPECIES_FURRET - 1] = 0x32, - [SPECIES_HOOTHOOT - 1] = 0x47, - [SPECIES_NOCTOWL - 1] = 0x17, - [SPECIES_LEDYBA - 1] = 0x52, - [SPECIES_LEDIAN - 1] = 0x47, - [SPECIES_SPINARAK - 1] = 0x4f, - [SPECIES_ARIADOS - 1] = 0x0f, - [SPECIES_CROBAT - 1] = 0x00, - [SPECIES_CHINCHOU - 1] = 0x45, - [SPECIES_LANTURN - 1] = 0x51, - [SPECIES_PICHU - 1] = 0x1e, - [SPECIES_CLEFFA - 1] = 0x52, - [SPECIES_IGGLYBUFF - 1] = 0x0c, - [SPECIES_TOGEPI - 1] = 0x0b, - [SPECIES_TOGETIC - 1] = 0x00, - [SPECIES_NATU - 1] = 0x31, - [SPECIES_XATU - 1] = 0x09, - [SPECIES_MAREEP - 1] = 0x00, - [SPECIES_FLAAFFY - 1] = 0x1e, - [SPECIES_AMPHAROS - 1] = 0x2c, - [SPECIES_BELLOSSOM - 1] = 0x0b, - [SPECIES_MARILL - 1] = 0x00, - [SPECIES_AZUMARILL - 1] = 0x4a, - [SPECIES_SUDOWOODO - 1] = 0x46, - [SPECIES_POLITOED - 1] = 0x32, - [SPECIES_HOPPIP - 1] = 0x1c, - [SPECIES_SKIPLOOM - 1] = 0x18, - [SPECIES_JUMPLUFF - 1] = 0x51, - [SPECIES_AIPOM - 1] = 0x32, - [SPECIES_SUNKERN - 1] = 0x52, - [SPECIES_SUNFLORA - 1] = 0x00, - [SPECIES_YANMA - 1] = 0x2b, - [SPECIES_WOOPER - 1] = 0x00, - [SPECIES_QUAGSIRE - 1] = 0x16, - [SPECIES_ESPEON - 1] = 0x09, - [SPECIES_UMBREON - 1] = 0x10, - [SPECIES_MURKROW - 1] = 0x00, - [SPECIES_SLOWKING - 1] = 0x13, - [SPECIES_MISDREAVUS - 1] = 0x1c, - [SPECIES_UNOWN - 1] = 0x0a, - [SPECIES_WOBBUFFET - 1] = 0x30, - [SPECIES_GIRAFARIG - 1] = 0x1e, - [SPECIES_PINECO - 1] = 0x0b, - [SPECIES_FORRETRESS - 1] = 0x10, - [SPECIES_DUNSPARCE - 1] = 0x00, - [SPECIES_GLIGAR - 1] = 0x13, - [SPECIES_STEELIX - 1] = 0x0f, - [SPECIES_SNUBBULL - 1] = 0x17, - [SPECIES_GRANBULL - 1] = 0x10, - [SPECIES_QWILFISH - 1] = 0x3a, - [SPECIES_SCIZOR - 1] = 0x02, - [SPECIES_SHUCKLE - 1] = 0x0b, - [SPECIES_HERACROSS - 1] = 0x41, - [SPECIES_SNEASEL - 1] = 0x16, - [SPECIES_TEDDIURSA - 1] = 0x17, - [SPECIES_URSARING - 1] = 0x10, - [SPECIES_SLUGMA - 1] = 0x17, - [SPECIES_MAGCARGO - 1] = 0x17, - [SPECIES_SWINUB - 1] = 0x00, - [SPECIES_PILOSWINE - 1] = 0x0f, - [SPECIES_CORSOLA - 1] = 0x03, - [SPECIES_REMORAID - 1] = 0x52, - [SPECIES_OCTILLERY - 1] = 0x17, - [SPECIES_DELIBIRD - 1] = 0x52, - [SPECIES_MANTINE - 1] = 0x0d, - [SPECIES_SKARMORY - 1] = 0x17, - [SPECIES_HOUNDOUR - 1] = 0x17, - [SPECIES_HOUNDOOM - 1] = 0x10, - [SPECIES_KINGDRA - 1] = 0x42, - [SPECIES_PHANPY - 1] = 0x32, - [SPECIES_DONPHAN - 1] = 0x19, - [SPECIES_PORYGON2 - 1] = 0x00, - [SPECIES_STANTLER - 1] = 0x00, - [SPECIES_SMEARGLE - 1] = 0x31, - [SPECIES_TYROGUE - 1] = 0x16, - [SPECIES_HITMONTOP - 1] = 0x02, - [SPECIES_SMOOCHUM - 1] = 0x09, - [SPECIES_ELEKID - 1] = 0x2c, - [SPECIES_MAGBY - 1] = 0x00, - [SPECIES_MILTANK - 1] = 0x45, - [SPECIES_BLISSEY - 1] = 0x00, - [SPECIES_RAIKOU - 1] = 0x2c, - [SPECIES_ENTEI - 1] = 0x09, - [SPECIES_SUICUNE - 1] = 0x10, - [SPECIES_LARVITAR - 1] = 0x52, - [SPECIES_PUPITAR - 1] = 0x10, - [SPECIES_TYRANITAR - 1] = 0x0f, - [SPECIES_LUGIA - 1] = 0x3a, - [SPECIES_HO_OH - 1] = 0x09, - [SPECIES_CELEBI - 1] = 0x18, - [SPECIES_OLD_UNOWN_B - 1] = 0x00, - [SPECIES_OLD_UNOWN_C - 1] = 0x00, - [SPECIES_OLD_UNOWN_D - 1] = 0x00, - [SPECIES_OLD_UNOWN_E - 1] = 0x00, - [SPECIES_OLD_UNOWN_F - 1] = 0x00, - [SPECIES_OLD_UNOWN_G - 1] = 0x00, - [SPECIES_OLD_UNOWN_H - 1] = 0x00, - [SPECIES_OLD_UNOWN_I - 1] = 0x00, - [SPECIES_OLD_UNOWN_J - 1] = 0x00, - [SPECIES_OLD_UNOWN_K - 1] = 0x00, - [SPECIES_OLD_UNOWN_L - 1] = 0x00, - [SPECIES_OLD_UNOWN_M - 1] = 0x00, - [SPECIES_OLD_UNOWN_N - 1] = 0x00, - [SPECIES_OLD_UNOWN_O - 1] = 0x00, - [SPECIES_OLD_UNOWN_P - 1] = 0x00, - [SPECIES_OLD_UNOWN_Q - 1] = 0x00, - [SPECIES_OLD_UNOWN_R - 1] = 0x00, - [SPECIES_OLD_UNOWN_S - 1] = 0x00, - [SPECIES_OLD_UNOWN_T - 1] = 0x00, - [SPECIES_OLD_UNOWN_U - 1] = 0x00, - [SPECIES_OLD_UNOWN_V - 1] = 0x00, - [SPECIES_OLD_UNOWN_W - 1] = 0x00, - [SPECIES_OLD_UNOWN_X - 1] = 0x00, - [SPECIES_OLD_UNOWN_Y - 1] = 0x00, - [SPECIES_OLD_UNOWN_Z - 1] = 0x00, - [SPECIES_TREECKO - 1] = 0x00, - [SPECIES_GROVYLE - 1] = 0x17, - [SPECIES_SCEPTILE - 1] = 0x10, - [SPECIES_TORCHIC - 1] = 0x16, - [SPECIES_COMBUSKEN - 1] = 0x06, - [SPECIES_BLAZIKEN - 1] = 0x0f, - [SPECIES_MUDKIP - 1] = 0x01, - [SPECIES_MARSHTOMP - 1] = 0x04, - [SPECIES_SWAMPERT - 1] = 0x1e, - [SPECIES_POOCHYENA - 1] = 0x10, - [SPECIES_MIGHTYENA - 1] = 0x10, - [SPECIES_ZIGZAGOON - 1] = 0x03, - [SPECIES_LINOONE - 1] = 0x09, - [SPECIES_WURMPLE - 1] = 0x00, - [SPECIES_SILCOON - 1] = 0x00, - [SPECIES_BEAUTIFLY - 1] = 0x04, - [SPECIES_CASCOON - 1] = 0x04, - [SPECIES_DUSTOX - 1] = 0x06, - [SPECIES_LOTAD - 1] = 0x00, - [SPECIES_LOMBRE - 1] = 0x00, - [SPECIES_LUDICOLO - 1] = 0x49, - [SPECIES_SEEDOT - 1] = 0x05, - [SPECIES_NUZLEAF - 1] = 0x00, - [SPECIES_SHIFTRY - 1] = 0x02, - [SPECIES_NINCADA - 1] = 0x00, - [SPECIES_NINJASK - 1] = 0x46, - [SPECIES_SHEDINJA - 1] = 0x1c, - [SPECIES_TAILLOW - 1] = 0x1e, - [SPECIES_SWELLOW - 1] = 0x01, - [SPECIES_SHROOMISH - 1] = 0x00, - [SPECIES_BRELOOM - 1] = 0x00, - [SPECIES_SPINDA - 1] = 0x31, - [SPECIES_WINGULL - 1] = 0x1b, - [SPECIES_PELIPPER - 1] = 0x1c, - [SPECIES_SURSKIT - 1] = 0x00, - [SPECIES_MASQUERAIN - 1] = 0x00, - [SPECIES_WAILMER - 1] = 0x01, - [SPECIES_WAILORD - 1] = 0x1c, - [SPECIES_SKITTY - 1] = 0x00, - [SPECIES_DELCATTY - 1] = 0x17, - [SPECIES_KECLEON - 1] = 0x35, - [SPECIES_BALTOY - 1] = 0x1d, - [SPECIES_CLAYDOL - 1] = 0x51, - [SPECIES_NOSEPASS - 1] = 0x49, - [SPECIES_TORKOAL - 1] = 0x17, - [SPECIES_SABLEYE - 1] = 0x15, - [SPECIES_BARBOACH - 1] = 0x49, - [SPECIES_WHISCASH - 1] = 0x49, - [SPECIES_LUVDISC - 1] = 0x1d, - [SPECIES_CORPHISH - 1] = 0x10, - [SPECIES_CRAWDAUNT - 1] = 0x09, - [SPECIES_FEEBAS - 1] = 0x49, - [SPECIES_MILOTIC - 1] = 0x22, - [SPECIES_CARVANHA - 1] = 0x49, - [SPECIES_SHARPEDO - 1] = 0x56, - [SPECIES_TRAPINCH - 1] = 0x10, - [SPECIES_VIBRAVA - 1] = 0x0f, - [SPECIES_FLYGON - 1] = 0x4b, - [SPECIES_MAKUHITA - 1] = 0x0b, - [SPECIES_HARIYAMA - 1] = 0x34, - [SPECIES_ELECTRIKE - 1] = 0x00, - [SPECIES_MANECTRIC - 1] = 0x00, - [SPECIES_NUMEL - 1] = 0x04, - [SPECIES_CAMERUPT - 1] = 0x10, - [SPECIES_SPHEAL - 1] = 0x53, - [SPECIES_SEALEO - 1] = 0x17, - [SPECIES_WALREIN - 1] = 0x0f, - [SPECIES_CACNEA - 1] = 0x49, - [SPECIES_CACTURNE - 1] = 0x04, - [SPECIES_SNORUNT - 1] = 0x45, - [SPECIES_GLALIE - 1] = 0x0a, - [SPECIES_LUNATONE - 1] = 0x0e, - [SPECIES_SOLROCK - 1] = 0x08, - [SPECIES_AZURILL - 1] = 0x00, - [SPECIES_SPOINK - 1] = 0x56, - [SPECIES_GRUMPIG - 1] = 0x32, - [SPECIES_PLUSLE - 1] = 0x00, - [SPECIES_MINUN - 1] = 0x01, - [SPECIES_MAWILE - 1] = 0x00, - [SPECIES_MEDITITE - 1] = 0x05, - [SPECIES_MEDICHAM - 1] = 0x45, - [SPECIES_SWABLU - 1] = 0x04, - [SPECIES_ALTARIA - 1] = 0x16, - [SPECIES_WYNAUT - 1] = 0x32, - [SPECIES_DUSKULL - 1] = 0x0a, - [SPECIES_DUSCLOPS - 1] = 0x02, - [SPECIES_ROSELIA - 1] = 0x45, - [SPECIES_SLAKOTH - 1] = 0x45, - [SPECIES_VIGOROTH - 1] = 0x31, - [SPECIES_SLAKING - 1] = 0x45, - [SPECIES_GULPIN - 1] = 0x00, - [SPECIES_SWALOT - 1] = 0x45, - [SPECIES_TROPIUS - 1] = 0x10, - [SPECIES_WHISMUR - 1] = 0x03, - [SPECIES_LOUDRED - 1] = 0x49, - [SPECIES_EXPLOUD - 1] = 0x19, - [SPECIES_CLAMPERL - 1] = 0x12, - [SPECIES_HUNTAIL - 1] = 0x09, - [SPECIES_GOREBYSS - 1] = 0x1c, - [SPECIES_ABSOL - 1] = 0x11, - [SPECIES_SHUPPET - 1] = 0x1c, - [SPECIES_BANETTE - 1] = 0x0d, - [SPECIES_SEVIPER - 1] = 0x17, - [SPECIES_ZANGOOSE - 1] = 0x09, - [SPECIES_RELICANTH - 1] = 0x1a, - [SPECIES_ARON - 1] = 0x45, - [SPECIES_LAIRON - 1] = 0x00, - [SPECIES_AGGRON - 1] = 0x19, - [SPECIES_CASTFORM - 1] = 0x1d, - [SPECIES_VOLBEAT - 1] = 0x00, - [SPECIES_ILLUMISE - 1] = 0x05, - [SPECIES_LILEEP - 1] = 0x17, - [SPECIES_CRADILY - 1] = 0x19, - [SPECIES_ANORITH - 1] = 0x12, - [SPECIES_ARMALDO - 1] = 0x10, - [SPECIES_RALTS - 1] = 0x45, - [SPECIES_KIRLIA - 1] = 0x00, - [SPECIES_GARDEVOIR - 1] = 0x00, - [SPECIES_BAGON - 1] = 0x19, - [SPECIES_SHELGON - 1] = 0x04, - [SPECIES_SALAMENCE - 1] = 0x0f, - [SPECIES_BELDUM - 1] = 0x0f, - [SPECIES_METANG - 1] = 0x04, - [SPECIES_METAGROSS - 1] = 0x10, - [SPECIES_REGIROCK - 1] = 0x01, - [SPECIES_REGICE - 1] = 0x44, - [SPECIES_REGISTEEL - 1] = 0x09, - [SPECIES_KYOGRE - 1] = 0x2d, - [SPECIES_GROUDON - 1] = 0x10, - [SPECIES_RAYQUAZA - 1] = 0x0f, - [SPECIES_LATIAS - 1] = 0x2d, - [SPECIES_LATIOS - 1] = 0x10, - [SPECIES_JIRACHI - 1] = 0x0d, - [SPECIES_DEOXYS - 1] = 0x1b, - [SPECIES_CHIMECHO - 1] = 0x1d, + [SPECIES_BULBASAUR - 1] = ANIM_V_JUMPS_H_JUMPS, + [SPECIES_IVYSAUR - 1] = ANIM_V_STRETCH, + [SPECIES_VENUSAUR - 1] = ANIM_ROTATE_UP_SLAM_DOWN, + [SPECIES_CHARMANDER - 1] = ANIM_V_JUMPS_SMALL, + [SPECIES_CHARMELEON - 1] = ANIM_BACK_AND_LUNGE, + [SPECIES_CHARIZARD - 1] = ANIM_V_SHAKE, + [SPECIES_SQUIRTLE - 1] = ANIM_SWING_CONCAVE, + [SPECIES_WARTORTLE - 1] = ANIM_SHRINK_GROW, + [SPECIES_BLASTOISE - 1] = ANIM_V_SHAKE_TWICE, + [SPECIES_CATERPIE - 1] = ANIM_SWING_CONCAVE, + [SPECIES_METAPOD - 1] = ANIM_SWING_CONCAVE, + [SPECIES_BUTTERFREE - 1] = ANIM_H_SLIDE_WOBBLE, + [SPECIES_WEEDLE - 1] = ANIM_H_SLIDE_SLOW, + [SPECIES_KAKUNA - 1] = ANIM_GLOW_ORANGE, + [SPECIES_BEEDRILL - 1] = ANIM_H_VIBRATE, + [SPECIES_PIDGEY - 1] = ANIM_V_SLIDE_SLOW, + [SPECIES_PIDGEOTTO - 1] = ANIM_V_STRETCH, + [SPECIES_PIDGEOT - 1] = ANIM_FRONT_FLIP, + [SPECIES_RATTATA - 1] = ANIM_RAPID_H_HOPS, + [SPECIES_RATICATE - 1] = ANIM_FIGURE_8, + [SPECIES_SPEAROW - 1] = ANIM_RISING_WOBBLE, + [SPECIES_FEAROW - 1] = ANIM_FIGURE_8, + [SPECIES_EKANS - 1] = ANIM_H_STRETCH, + [SPECIES_ARBOK - 1] = ANIM_V_STRETCH, + [SPECIES_PIKACHU - 1] = ANIM_FLASH_YELLOW, + [SPECIES_RAICHU - 1] = ANIM_V_STRETCH, + [SPECIES_SANDSHREW - 1] = ANIM_SWING_CONCAVE_FAST_SHORT, + [SPECIES_SANDSLASH - 1] = ANIM_V_STRETCH, + [SPECIES_NIDORAN_F - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_NIDORINA - 1] = ANIM_V_STRETCH, + [SPECIES_NIDOQUEEN - 1] = ANIM_H_SHAKE, + [SPECIES_NIDORAN_M - 1] = ANIM_GROW_VIBRATE, + [SPECIES_NIDORINO - 1] = ANIM_SHRINK_GROW, + [SPECIES_NIDOKING - 1] = ANIM_H_SHAKE, + [SPECIES_CLEFAIRY - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_CLEFABLE - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL_SLOW, + [SPECIES_VULPIX - 1] = ANIM_V_STRETCH, + [SPECIES_NINETALES - 1] = ANIM_V_SHAKE, + [SPECIES_JIGGLYPUFF - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL, + [SPECIES_WIGGLYTUFF - 1] = ANIM_H_JUMPS, + [SPECIES_ZUBAT - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_GOLBAT - 1] = ANIM_H_SLIDE_WOBBLE, + [SPECIES_ODDISH - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_GLOOM - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_VILEPLUME - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, + [SPECIES_PARAS - 1] = ANIM_H_SLIDE_SLOW, + [SPECIES_PARASECT - 1] = ANIM_H_SHAKE, + [SPECIES_VENONAT - 1] = ANIM_V_JUMPS_H_JUMPS, + [SPECIES_VENOMOTH - 1] = ANIM_ZIGZAG_SLOW, + [SPECIES_DIGLETT - 1] = ANIM_V_SHAKE, + [SPECIES_DUGTRIO - 1] = ANIM_H_SHAKE_SLOW, + [SPECIES_MEOWTH - 1] = ANIM_V_JUMPS_SMALL, + [SPECIES_PERSIAN - 1] = ANIM_V_STRETCH, + [SPECIES_PSYDUCK - 1] = ANIM_V_JUMPS_H_JUMPS, + [SPECIES_GOLDUCK - 1] = ANIM_H_SHAKE_SLOW, + [SPECIES_MANKEY - 1] = ANIM_H_JUMPS_V_STRETCH, + [SPECIES_PRIMEAPE - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL, + [SPECIES_GROWLITHE - 1] = ANIM_BACK_AND_LUNGE, + [SPECIES_ARCANINE - 1] = ANIM_H_VIBRATE, + [SPECIES_POLIWAG - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_POLIWHIRL - 1] = ANIM_H_JUMPS_V_STRETCH, + [SPECIES_POLIWRATH - 1] = ANIM_V_SHAKE_TWICE, + [SPECIES_ABRA - 1] = ANIM_H_JUMPS, + [SPECIES_KADABRA - 1] = ANIM_GROW_VIBRATE, + [SPECIES_ALAKAZAM - 1] = ANIM_V_STRETCH, + [SPECIES_MACHOP - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_MACHOKE - 1] = ANIM_V_SHAKE, + [SPECIES_MACHAMP - 1] = ANIM_H_JUMPS, + [SPECIES_BELLSPROUT - 1] = ANIM_V_STRETCH, + [SPECIES_WEEPINBELL - 1] = ANIM_SWING_CONVEX, + [SPECIES_VICTREEBEL - 1] = ANIM_H_JUMPS_V_STRETCH, + [SPECIES_TENTACOOL - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_TENTACRUEL - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_GEODUDE - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL, + [SPECIES_GRAVELER - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL, + [SPECIES_GOLEM - 1] = ANIM_ROTATE_UP_SLAM_DOWN, + [SPECIES_PONYTA - 1] = ANIM_GLOW_ORANGE, + [SPECIES_RAPIDASH - 1] = ANIM_CIRCULAR_VIBRATE, + [SPECIES_SLOWPOKE - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_SLOWBRO - 1] = ANIM_SWING_CONCAVE, + [SPECIES_MAGNEMITE - 1] = ANIM_TUMBLING_FRONT_FLIP_TWICE, + [SPECIES_MAGNETON - 1] = ANIM_FLASH_YELLOW, + [SPECIES_FARFETCHD - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL, + [SPECIES_DODUO - 1] = ANIM_H_SHAKE_SLOW, + [SPECIES_DODRIO - 1] = ANIM_LUNGE_GROW, + [SPECIES_SEEL - 1] = ANIM_SWING_CONCAVE, + [SPECIES_DEWGONG - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_GRIMER - 1] = ANIM_H_SLIDE_SLOW, + [SPECIES_MUK - 1] = ANIM_DEEP_V_SQUISH_AND_BOUNCE, + [SPECIES_SHELLDER - 1] = ANIM_TWIST, + [SPECIES_CLOYSTER - 1] = ANIM_H_SLIDE_WOBBLE, + [SPECIES_GASTLY - 1] = ANIM_GLOW_BLACK, + [SPECIES_HAUNTER - 1] = ANIM_FLICKER_INCREASING, + [SPECIES_GENGAR - 1] = ANIM_GROW_IN_STAGES, + [SPECIES_ONIX - 1] = ANIM_RAPID_H_HOPS, + [SPECIES_DROWZEE - 1] = ANIM_CIRCLE_C_CLOCKWISE_SLOW, + [SPECIES_HYPNO - 1] = ANIM_GROW_VIBRATE, + [SPECIES_KRABBY - 1] = ANIM_H_SLIDE, + [SPECIES_KINGLER - 1] = ANIM_ZIGZAG_SLOW, + [SPECIES_VOLTORB - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_ELECTRODE - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_EXEGGCUTE - 1] = ANIM_H_SLIDE_SLOW, + [SPECIES_EXEGGUTOR - 1] = ANIM_H_JUMPS_V_STRETCH, + [SPECIES_CUBONE - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL, + [SPECIES_MAROWAK - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES, + [SPECIES_HITMONLEE - 1] = ANIM_H_STRETCH, + [SPECIES_HITMONCHAN - 1] = ANIM_GROW_VIBRATE, + [SPECIES_LICKITUNG - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_KOFFING - 1] = ANIM_SHRINK_GROW, + [SPECIES_WEEZING - 1] = ANIM_V_SLIDE, + [SPECIES_RHYHORN - 1] = ANIM_V_SHAKE, + [SPECIES_RHYDON - 1] = ANIM_SHRINK_GROW, + [SPECIES_CHANSEY - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_TANGELA - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL, + [SPECIES_KANGASKHAN - 1] = ANIM_V_STRETCH, + [SPECIES_HORSEA - 1] = ANIM_TWIST, + [SPECIES_SEADRA - 1] = ANIM_V_SLIDE, + [SPECIES_GOLDEEN - 1] = ANIM_SWING_CONVEX, + [SPECIES_SEAKING - 1] = ANIM_V_SLIDE_WOBBLE, + [SPECIES_STARYU - 1] = ANIM_TWIST_TWICE, + [SPECIES_STARMIE - 1] = ANIM_TWIST, + [SPECIES_MR_MIME - 1] = ANIM_H_SLIDE_SLOW, + [SPECIES_SCYTHER - 1] = ANIM_H_VIBRATE, + [SPECIES_JYNX - 1] = ANIM_V_STRETCH, + [SPECIES_ELECTABUZZ - 1] = ANIM_FLASH_YELLOW, + [SPECIES_MAGMAR - 1] = ANIM_H_SHAKE, + [SPECIES_PINSIR - 1] = ANIM_GROW_VIBRATE, + [SPECIES_TAUROS - 1] = ANIM_V_SHAKE_TWICE, + [SPECIES_MAGIKARP - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES, + [SPECIES_GYARADOS - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL, + [SPECIES_LAPRAS - 1] = ANIM_V_STRETCH, + [SPECIES_DITTO - 1] = ANIM_CIRCULAR_STRETCH_TWICE, + [SPECIES_EEVEE - 1] = ANIM_V_STRETCH, + [SPECIES_VAPOREON - 1] = ANIM_V_STRETCH, + [SPECIES_JOLTEON - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_FLAREON - 1] = ANIM_V_STRETCH, + [SPECIES_PORYGON - 1] = ANIM_V_JUMPS_SMALL, + [SPECIES_OMANYTE - 1] = ANIM_V_SLIDE_WOBBLE_SMALL, + [SPECIES_OMASTAR - 1] = ANIM_GROW_VIBRATE, + [SPECIES_KABUTO - 1] = ANIM_H_SLIDE_WOBBLE, + [SPECIES_KABUTOPS - 1] = ANIM_H_SHAKE, + [SPECIES_AERODACTYL - 1] = ANIM_V_SLIDE_SLOW, + [SPECIES_SNORLAX - 1] = ANIM_SWING_CONCAVE, + [SPECIES_ARTICUNO - 1] = ANIM_GROW_VIBRATE, + [SPECIES_ZAPDOS - 1] = ANIM_FLASH_YELLOW, + [SPECIES_MOLTRES - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_DRATINI - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_DRAGONAIR - 1] = ANIM_V_SHAKE, + [SPECIES_DRAGONITE - 1] = ANIM_V_SLIDE_SLOW, + [SPECIES_MEWTWO - 1] = ANIM_GROW_VIBRATE, + [SPECIES_MEW - 1] = ANIM_SWING_CONVEX, + [SPECIES_CHIKORITA - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_BAYLEEF - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_MEGANIUM - 1] = ANIM_V_STRETCH, + [SPECIES_CYNDAQUIL - 1] = ANIM_V_JUMPS_SMALL, + [SPECIES_QUILAVA - 1] = ANIM_V_STRETCH, + [SPECIES_TYPHLOSION - 1] = ANIM_V_SHAKE, + [SPECIES_TOTODILE - 1] = ANIM_H_JUMPS, + [SPECIES_CROCONAW - 1] = ANIM_H_SHAKE, + [SPECIES_FERALIGATR - 1] = ANIM_H_SHAKE, + [SPECIES_SENTRET - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_FURRET - 1] = ANIM_H_JUMPS_V_STRETCH, + [SPECIES_HOOTHOOT - 1] = ANIM_V_SLIDE_SLOW, + [SPECIES_NOCTOWL - 1] = ANIM_V_STRETCH, + [SPECIES_LEDYBA - 1] = ANIM_V_JUMPS_SMALL, + [SPECIES_LEDIAN - 1] = ANIM_V_SLIDE_SLOW, + [SPECIES_SPINARAK - 1] = ANIM_CIRCLE_C_CLOCKWISE_SLOW, + [SPECIES_ARIADOS - 1] = ANIM_H_SHAKE, + [SPECIES_CROBAT - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_CHINCHOU - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_LANTURN - 1] = ANIM_V_SLIDE_WOBBLE_SMALL, + [SPECIES_PICHU - 1] = ANIM_V_JUMPS_BIG, + [SPECIES_CLEFFA - 1] = ANIM_V_JUMPS_SMALL, + [SPECIES_IGGLYBUFF - 1] = ANIM_SWING_CONCAVE_FAST, + [SPECIES_TOGEPI - 1] = ANIM_SWING_CONCAVE, + [SPECIES_TOGETIC - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_NATU - 1] = ANIM_H_JUMPS, + [SPECIES_XATU - 1] = ANIM_GROW_VIBRATE, + [SPECIES_MAREEP - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_FLAAFFY - 1] = ANIM_V_JUMPS_BIG, + [SPECIES_AMPHAROS - 1] = ANIM_FLASH_YELLOW, + [SPECIES_BELLOSSOM - 1] = ANIM_SWING_CONCAVE, + [SPECIES_MARILL - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_AZUMARILL - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL_SLOW, + [SPECIES_SUDOWOODO - 1] = ANIM_H_SLIDE_SLOW, + [SPECIES_POLITOED - 1] = ANIM_H_JUMPS_V_STRETCH, + [SPECIES_HOPPIP - 1] = ANIM_V_SLIDE_WOBBLE, + [SPECIES_SKIPLOOM - 1] = ANIM_RISING_WOBBLE, + [SPECIES_JUMPLUFF - 1] = ANIM_V_SLIDE_WOBBLE_SMALL, + [SPECIES_AIPOM - 1] = ANIM_H_JUMPS_V_STRETCH, + [SPECIES_SUNKERN - 1] = ANIM_V_JUMPS_SMALL, + [SPECIES_SUNFLORA - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_YANMA - 1] = ANIM_FIGURE_8, + [SPECIES_WOOPER - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_QUAGSIRE - 1] = ANIM_H_STRETCH, + [SPECIES_ESPEON - 1] = ANIM_GROW_VIBRATE, + [SPECIES_UMBREON - 1] = ANIM_V_SHAKE, + [SPECIES_MURKROW - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_SLOWKING - 1] = ANIM_SHRINK_GROW, + [SPECIES_MISDREAVUS - 1] = ANIM_V_SLIDE_WOBBLE, + [SPECIES_UNOWN - 1] = ANIM_ZIGZAG_FAST, + [SPECIES_WOBBUFFET - 1] = ANIM_DEEP_V_SQUISH_AND_BOUNCE, + [SPECIES_GIRAFARIG - 1] = ANIM_V_JUMPS_BIG, + [SPECIES_PINECO - 1] = ANIM_SWING_CONCAVE, + [SPECIES_FORRETRESS - 1] = ANIM_V_SHAKE, + [SPECIES_DUNSPARCE - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_GLIGAR - 1] = ANIM_SHRINK_GROW, + [SPECIES_STEELIX - 1] = ANIM_H_SHAKE, + [SPECIES_SNUBBULL - 1] = ANIM_V_STRETCH, + [SPECIES_GRANBULL - 1] = ANIM_V_SHAKE, + [SPECIES_QWILFISH - 1] = ANIM_GROW_IN_STAGES, + [SPECIES_SCIZOR - 1] = ANIM_H_VIBRATE, + [SPECIES_SHUCKLE - 1] = ANIM_SWING_CONCAVE, + [SPECIES_HERACROSS - 1] = ANIM_LUNGE_GROW, + [SPECIES_SNEASEL - 1] = ANIM_H_STRETCH, + [SPECIES_TEDDIURSA - 1] = ANIM_V_STRETCH, + [SPECIES_URSARING - 1] = ANIM_V_SHAKE, + [SPECIES_SLUGMA - 1] = ANIM_V_STRETCH, + [SPECIES_MAGCARGO - 1] = ANIM_V_STRETCH, + [SPECIES_SWINUB - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_PILOSWINE - 1] = ANIM_H_SHAKE, + [SPECIES_CORSOLA - 1] = ANIM_H_SLIDE, + [SPECIES_REMORAID - 1] = ANIM_V_JUMPS_SMALL, + [SPECIES_OCTILLERY - 1] = ANIM_V_STRETCH, + [SPECIES_DELIBIRD - 1] = ANIM_V_JUMPS_SMALL, + [SPECIES_MANTINE - 1] = ANIM_SWING_CONVEX, + [SPECIES_SKARMORY - 1] = ANIM_V_STRETCH, + [SPECIES_HOUNDOUR - 1] = ANIM_V_STRETCH, + [SPECIES_HOUNDOOM - 1] = ANIM_V_SHAKE, + [SPECIES_KINGDRA - 1] = ANIM_CIRCLE_INTO_BG, + [SPECIES_PHANPY - 1] = ANIM_H_JUMPS_V_STRETCH, + [SPECIES_DONPHAN - 1] = ANIM_V_SHAKE_TWICE, + [SPECIES_PORYGON2 - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_STANTLER - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_SMEARGLE - 1] = ANIM_H_JUMPS, + [SPECIES_TYROGUE - 1] = ANIM_H_STRETCH, + [SPECIES_HITMONTOP - 1] = ANIM_H_VIBRATE, + [SPECIES_SMOOCHUM - 1] = ANIM_GROW_VIBRATE, + [SPECIES_ELEKID - 1] = ANIM_FLASH_YELLOW, + [SPECIES_MAGBY - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_MILTANK - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_BLISSEY - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_RAIKOU - 1] = ANIM_FLASH_YELLOW, + [SPECIES_ENTEI - 1] = ANIM_GROW_VIBRATE, + [SPECIES_SUICUNE - 1] = ANIM_V_SHAKE, + [SPECIES_LARVITAR - 1] = ANIM_V_JUMPS_SMALL, + [SPECIES_PUPITAR - 1] = ANIM_V_SHAKE, + [SPECIES_TYRANITAR - 1] = ANIM_H_SHAKE, + [SPECIES_LUGIA - 1] = ANIM_GROW_IN_STAGES, + [SPECIES_HO_OH - 1] = ANIM_GROW_VIBRATE, + [SPECIES_CELEBI - 1] = ANIM_RISING_WOBBLE, + [SPECIES_GROVYLE - 1] = ANIM_V_STRETCH, + [SPECIES_SCEPTILE - 1] = ANIM_V_SHAKE, + [SPECIES_TORCHIC - 1] = ANIM_H_STRETCH, + [SPECIES_COMBUSKEN - 1] = ANIM_V_JUMPS_H_JUMPS, + [SPECIES_BLAZIKEN - 1] = ANIM_H_SHAKE, + [SPECIES_MUDKIP - 1] = ANIM_CIRCULAR_STRETCH_TWICE, + [SPECIES_MARSHTOMP - 1] = ANIM_V_SLIDE, + [SPECIES_SWAMPERT - 1] = ANIM_V_JUMPS_BIG, + [SPECIES_POOCHYENA - 1] = ANIM_V_SHAKE, + [SPECIES_MIGHTYENA - 1] = ANIM_V_SHAKE, + [SPECIES_ZIGZAGOON - 1] = ANIM_H_SLIDE, + [SPECIES_LINOONE - 1] = ANIM_GROW_VIBRATE, + [SPECIES_WURMPLE - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_SILCOON - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_BEAUTIFLY - 1] = ANIM_V_SLIDE, + [SPECIES_CASCOON - 1] = ANIM_V_SLIDE, + [SPECIES_DUSTOX - 1] = ANIM_V_JUMPS_H_JUMPS, + [SPECIES_LOTAD - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_LOMBRE - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_LUDICOLO - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, + [SPECIES_SEEDOT - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES, + [SPECIES_NUZLEAF - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_SHIFTRY - 1] = ANIM_H_VIBRATE, + [SPECIES_NINCADA - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_NINJASK - 1] = ANIM_H_SLIDE_SLOW, + [SPECIES_SHEDINJA - 1] = ANIM_V_SLIDE_WOBBLE, + [SPECIES_TAILLOW - 1] = ANIM_V_JUMPS_BIG, + [SPECIES_SWELLOW - 1] = ANIM_CIRCULAR_STRETCH_TWICE, + [SPECIES_SHROOMISH - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_BRELOOM - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_SPINDA - 1] = ANIM_H_JUMPS, + [SPECIES_WINGULL - 1] = ANIM_H_PIVOT, + [SPECIES_PELIPPER - 1] = ANIM_V_SLIDE_WOBBLE, + [SPECIES_SURSKIT - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_MASQUERAIN - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_WAILMER - 1] = ANIM_CIRCULAR_STRETCH_TWICE, + [SPECIES_WAILORD - 1] = ANIM_V_SLIDE_WOBBLE, + [SPECIES_SKITTY - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_DELCATTY - 1] = ANIM_V_STRETCH, + [SPECIES_KECLEON - 1] = ANIM_FLICKER_INCREASING, + [SPECIES_BALTOY - 1] = ANIM_H_SLIDE_WOBBLE, + [SPECIES_CLAYDOL - 1] = ANIM_V_SLIDE_WOBBLE_SMALL, + [SPECIES_NOSEPASS - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, + [SPECIES_TORKOAL - 1] = ANIM_V_STRETCH, + [SPECIES_SABLEYE - 1] = ANIM_GLOW_BLACK, + [SPECIES_BARBOACH - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, + [SPECIES_WHISCASH - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, + [SPECIES_LUVDISC - 1] = ANIM_H_SLIDE_WOBBLE, + [SPECIES_CORPHISH - 1] = ANIM_V_SHAKE, + [SPECIES_CRAWDAUNT - 1] = ANIM_GROW_VIBRATE, + [SPECIES_FEEBAS - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, + [SPECIES_MILOTIC - 1] = ANIM_GLOW_BLUE, + [SPECIES_CARVANHA - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, + [SPECIES_SHARPEDO - 1] = ANIM_H_JUMPS_V_STRETCH_TWICE, + [SPECIES_TRAPINCH - 1] = ANIM_V_SHAKE, + [SPECIES_VIBRAVA - 1] = ANIM_H_SHAKE, + [SPECIES_FLYGON - 1] = ANIM_ZIGZAG_SLOW, + [SPECIES_MAKUHITA - 1] = ANIM_SWING_CONCAVE, + [SPECIES_HARIYAMA - 1] = ANIM_ROTATE_UP_TO_SIDES, + [SPECIES_ELECTRIKE - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_MANECTRIC - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_NUMEL - 1] = ANIM_V_SLIDE, + [SPECIES_CAMERUPT - 1] = ANIM_V_SHAKE, + [SPECIES_SPHEAL - 1] = ANIM_SPIN, + [SPECIES_SEALEO - 1] = ANIM_V_STRETCH, + [SPECIES_WALREIN - 1] = ANIM_H_SHAKE, + [SPECIES_CACNEA - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, + [SPECIES_CACTURNE - 1] = ANIM_V_SLIDE, + [SPECIES_SNORUNT - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_GLALIE - 1] = ANIM_ZIGZAG_FAST, + [SPECIES_LUNATONE - 1] = ANIM_SWING_CONVEX_FAST, + [SPECIES_SOLROCK - 1] = ANIM_ROTATE_TO_SIDES_TWICE, + [SPECIES_AZURILL - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_SPOINK - 1] = ANIM_H_JUMPS_V_STRETCH_TWICE, + [SPECIES_GRUMPIG - 1] = ANIM_H_JUMPS_V_STRETCH, + [SPECIES_PLUSLE - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_MINUN - 1] = ANIM_CIRCULAR_STRETCH_TWICE, + [SPECIES_MAWILE - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_MEDITITE - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES, + [SPECIES_MEDICHAM - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_SWABLU - 1] = ANIM_V_SLIDE, + [SPECIES_ALTARIA - 1] = ANIM_H_STRETCH, + [SPECIES_WYNAUT - 1] = ANIM_H_JUMPS_V_STRETCH, + [SPECIES_DUSKULL - 1] = ANIM_ZIGZAG_FAST, + [SPECIES_DUSCLOPS - 1] = ANIM_H_VIBRATE, + [SPECIES_ROSELIA - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_SLAKOTH - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_VIGOROTH - 1] = ANIM_H_JUMPS, + [SPECIES_SLAKING - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_GULPIN - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_SWALOT - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_TROPIUS - 1] = ANIM_V_SHAKE, + [SPECIES_WHISMUR - 1] = ANIM_H_SLIDE, + [SPECIES_LOUDRED - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, + [SPECIES_EXPLOUD - 1] = ANIM_V_SHAKE_TWICE, + [SPECIES_CLAMPERL - 1] = ANIM_TWIST, + [SPECIES_HUNTAIL - 1] = ANIM_GROW_VIBRATE, + [SPECIES_GOREBYSS - 1] = ANIM_V_SLIDE_WOBBLE, + [SPECIES_ABSOL - 1] = ANIM_CIRCULAR_VIBRATE, + [SPECIES_SHUPPET - 1] = ANIM_V_SLIDE_WOBBLE, + [SPECIES_BANETTE - 1] = ANIM_SWING_CONVEX, + [SPECIES_SEVIPER - 1] = ANIM_V_STRETCH, + [SPECIES_ZANGOOSE - 1] = ANIM_GROW_VIBRATE, + [SPECIES_RELICANTH - 1] = ANIM_TIP_MOVE_FORWARD, + [SPECIES_ARON - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_LAIRON - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_AGGRON - 1] = ANIM_V_SHAKE_TWICE, + [SPECIES_CASTFORM - 1] = ANIM_H_SLIDE_WOBBLE, + [SPECIES_VOLBEAT - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_ILLUMISE - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES, + [SPECIES_LILEEP - 1] = ANIM_V_STRETCH, + [SPECIES_CRADILY - 1] = ANIM_V_SHAKE_TWICE, + [SPECIES_ANORITH - 1] = ANIM_TWIST, + [SPECIES_ARMALDO - 1] = ANIM_V_SHAKE, + [SPECIES_RALTS - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, + [SPECIES_KIRLIA - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_GARDEVOIR - 1] = ANIM_V_SQUISH_AND_BOUNCE, + [SPECIES_BAGON - 1] = ANIM_V_SHAKE_TWICE, + [SPECIES_SHELGON - 1] = ANIM_V_SLIDE, + [SPECIES_SALAMENCE - 1] = ANIM_H_SHAKE, + [SPECIES_BELDUM - 1] = ANIM_H_SHAKE, + [SPECIES_METANG - 1] = ANIM_V_SLIDE, + [SPECIES_METAGROSS - 1] = ANIM_V_SHAKE, + [SPECIES_REGIROCK - 1] = ANIM_CIRCULAR_STRETCH_TWICE, + [SPECIES_REGICE - 1] = ANIM_FOUR_PETAL, + [SPECIES_REGISTEEL - 1] = ANIM_GROW_VIBRATE, + [SPECIES_KYOGRE - 1] = ANIM_SWING_CONCAVE_FAST_SHORT, + [SPECIES_GROUDON - 1] = ANIM_V_SHAKE, + [SPECIES_RAYQUAZA - 1] = ANIM_H_SHAKE, + [SPECIES_LATIAS - 1] = ANIM_SWING_CONCAVE_FAST_SHORT, + [SPECIES_LATIOS - 1] = ANIM_V_SHAKE, + [SPECIES_JIRACHI - 1] = ANIM_SWING_CONVEX, + [SPECIES_DEOXYS - 1] = ANIM_H_PIVOT, + [SPECIES_CHIMECHO - 1] = ANIM_H_SLIDE_WOBBLE, }; static const u8 sMonAnimationDelayTable[NUM_SPECIES - 1] = { - [SPECIES_BLASTOISE - 1] = 0x32, - [SPECIES_WEEDLE - 1] = 0x0a, - [SPECIES_KAKUNA - 1] = 0x14, - [SPECIES_BEEDRILL - 1] = 0x23, - [SPECIES_PIDGEOTTO - 1] = 0x19, - [SPECIES_FEAROW - 1] = 0x02, - [SPECIES_EKANS - 1] = 0x1e, - [SPECIES_NIDORAN_F - 1] = 0x1c, - [SPECIES_NIDOKING - 1] = 0x19, - [SPECIES_PARAS - 1] = 0x0a, - [SPECIES_PARASECT - 1] = 0x2d, - [SPECIES_VENONAT - 1] = 0x14, - [SPECIES_DIGLETT - 1] = 0x19, - [SPECIES_DUGTRIO - 1] = 0x23, - [SPECIES_MEOWTH - 1] = 0x28, - [SPECIES_PERSIAN - 1] = 0x14, - [SPECIES_MANKEY - 1] = 0x14, - [SPECIES_GROWLITHE - 1] = 0x1e, - [SPECIES_ARCANINE - 1] = 0x28, - [SPECIES_POLIWHIRL - 1] = 0x05, - [SPECIES_WEEPINBELL - 1] = 0x03, - [SPECIES_MUK - 1] = 0x2d, - [SPECIES_SHELLDER - 1] = 0x14, - [SPECIES_HAUNTER - 1] = 0x17, - [SPECIES_DROWZEE - 1] = 0x30, - [SPECIES_HYPNO - 1] = 0x28, - [SPECIES_HITMONCHAN - 1] = 0x19, - [SPECIES_SCYTHER - 1] = 0x0a, - [SPECIES_TAUROS - 1] = 0x0a, - [SPECIES_TYPHLOSION - 1] = 0x14, - [SPECIES_FERALIGATR - 1] = 0x05, - [SPECIES_NATU - 1] = 0x1e, - [SPECIES_MAREEP - 1] = 0x32, - [SPECIES_AMPHAROS - 1] = 0x0a, - [SPECIES_POLITOED - 1] = 0x28, - [SPECIES_DUNSPARCE - 1] = 0x0a, - [SPECIES_STEELIX - 1] = 0x2d, - [SPECIES_QWILFISH - 1] = 0x27, - [SPECIES_SCIZOR - 1] = 0x13, - [SPECIES_OCTILLERY - 1] = 0x14, - [SPECIES_SMOOCHUM - 1] = 0x28, - [SPECIES_TYRANITAR - 1] = 0x0a, - [SPECIES_LUGIA - 1] = 0x14, - [SPECIES_WAILORD - 1] = 0x0a, - [SPECIES_KECLEON - 1] = 0x1e, - [SPECIES_MILOTIC - 1] = 0x2d, - [SPECIES_SPHEAL - 1] = 0x0f, - [SPECIES_SNORUNT - 1] = 0x14, - [SPECIES_GRUMPIG - 1] = 0x0f, - [SPECIES_WYNAUT - 1] = 0x0f, - [SPECIES_DUSCLOPS - 1] = 0x1e, - [SPECIES_ABSOL - 1] = 0x2d, - [SPECIES_SALAMENCE - 1] = 0x46, - [SPECIES_KYOGRE - 1] = 0x3c, - [SPECIES_RAYQUAZA - 1] = 0x3c, + [SPECIES_BLASTOISE - 1] = 50, + [SPECIES_WEEDLE - 1] = 10, + [SPECIES_KAKUNA - 1] = 20, + [SPECIES_BEEDRILL - 1] = 35, + [SPECIES_PIDGEOTTO - 1] = 25, + [SPECIES_FEAROW - 1] = 2, + [SPECIES_EKANS - 1] = 30, + [SPECIES_NIDORAN_F - 1] = 28, + [SPECIES_NIDOKING - 1] = 25, + [SPECIES_PARAS - 1] = 10, + [SPECIES_PARASECT - 1] = 45, + [SPECIES_VENONAT - 1] = 20, + [SPECIES_DIGLETT - 1] = 25, + [SPECIES_DUGTRIO - 1] = 35, + [SPECIES_MEOWTH - 1] = 40, + [SPECIES_PERSIAN - 1] = 20, + [SPECIES_MANKEY - 1] = 20, + [SPECIES_GROWLITHE - 1] = 30, + [SPECIES_ARCANINE - 1] = 40, + [SPECIES_POLIWHIRL - 1] = 5, + [SPECIES_WEEPINBELL - 1] = 3, + [SPECIES_MUK - 1] = 45, + [SPECIES_SHELLDER - 1] = 20, + [SPECIES_HAUNTER - 1] = 23, + [SPECIES_DROWZEE - 1] = 48, + [SPECIES_HYPNO - 1] = 40, + [SPECIES_HITMONCHAN - 1] = 25, + [SPECIES_SCYTHER - 1] = 10, + [SPECIES_TAUROS - 1] = 10, + [SPECIES_TYPHLOSION - 1] = 20, + [SPECIES_FERALIGATR - 1] = 5, + [SPECIES_NATU - 1] = 30, + [SPECIES_MAREEP - 1] = 50, + [SPECIES_AMPHAROS - 1] = 10, + [SPECIES_POLITOED - 1] = 40, + [SPECIES_DUNSPARCE - 1] = 10, + [SPECIES_STEELIX - 1] = 45, + [SPECIES_QWILFISH - 1] = 39, + [SPECIES_SCIZOR - 1] = 19, + [SPECIES_OCTILLERY - 1] = 20, + [SPECIES_SMOOCHUM - 1] = 40, + [SPECIES_TYRANITAR - 1] = 10, + [SPECIES_LUGIA - 1] = 20, + [SPECIES_WAILORD - 1] = 10, + [SPECIES_KECLEON - 1] = 30, + [SPECIES_MILOTIC - 1] = 45, + [SPECIES_SPHEAL - 1] = 15, + [SPECIES_SNORUNT - 1] = 20, + [SPECIES_GRUMPIG - 1] = 15, + [SPECIES_WYNAUT - 1] = 15, + [SPECIES_DUSCLOPS - 1] = 30, + [SPECIES_ABSOL - 1] = 45, + [SPECIES_SALAMENCE - 1] = 70, + [SPECIES_KYOGRE - 1] = 60, + [SPECIES_RAYQUAZA - 1] = 60, }; const u8 gPPUpGetMask[] = {0x03, 0x0c, 0x30, 0xc0}; // Masks for getting PP Up count, also PP Max values @@ -6627,7 +6601,7 @@ static void Task_PokemonSummaryAnimateAfterDelay(u8 taskId) if (--gTasks[taskId].data[3] == 0) { StartMonSummaryAnimation(READ_PTR_FROM_TASK(taskId, 0), gTasks[taskId].data[2]); - SummaryScreen_SetUnknownTaskId(0xFF); + SummaryScreen_SetAnimDelayTaskId(TASK_NONE); DestroyTask(taskId); } } @@ -6694,7 +6668,7 @@ void PokemonSummaryDoMonAnimation(struct Sprite* sprite, u16 species, bool8 oneF STORE_PTR_IN_TASK(sprite, taskId, 0); gTasks[taskId].data[2] = sMonFrontAnimIdsTable[species - 1]; gTasks[taskId].data[3] = sMonAnimationDelayTable[species - 1]; - SummaryScreen_SetUnknownTaskId(taskId); + SummaryScreen_SetAnimDelayTaskId(taskId); SetSpriteCB_MonAnimDummy(sprite); } else diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index da30963b5..5c5cdde7b 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -10,7 +10,33 @@ #include "constants/battle_anim.h" #include "constants/rgb.h" -struct UnkAnimStruct +/* + This file handles the movements of the Pokémon intro animations. + + Each animation type is identified by an ANIM_* constant that + refers to a sprite callback to start the animation. These functions + are named Anim_ or Anim__. Many of these + functions share additional movement functions to do a variation of the + same movement (e.g. a faster or larger movement). + Vertical and Horizontal are frequently shortened to V and H. + + Every front animation uses 1 of these ANIMs, and every back animation + uses a BACK_ANIM_* that refers to a set of 3 ANIM functions. Which of + 3 that gets used depends on the Pokémon's nature (see sBackAnimationIds). + + The table linking species to a BACK_ANIM is in this file (sSpeciesToBackAnimSet) + while the table linking species to an ANIM for their front animation is in + pokemon.c (sMonFrontAnimIdsTable). + + These are the functions that will start an animation: + - LaunchAnimationTaskForFrontSprite + - LaunchAnimationTaskForBackSprite + - StartMonSummaryAnimation +*/ + +#define sDontFlip data[1] // TRUE if a normal animation, FALSE if Summary Screen animation + +struct PokemonAnimData { u16 field_0; s16 field_2; @@ -19,797 +45,794 @@ struct UnkAnimStruct s16 field_8; }; -// this file's functions -static void pokemonanimfunc_00(struct Sprite *sprite); -static void pokemonanimfunc_01(struct Sprite *sprite); -static void pokemonanimfunc_02(struct Sprite *sprite); -static void pokemonanimfunc_03(struct Sprite *sprite); -static void pokemonanimfunc_04(struct Sprite *sprite); -static void pokemonanimfunc_05(struct Sprite *sprite); -static void pokemonanimfunc_06(struct Sprite *sprite); -static void pokemonanimfunc_07(struct Sprite *sprite); -static void pokemonanimfunc_08(struct Sprite *sprite); -static void pokemonanimfunc_09(struct Sprite *sprite); -static void pokemonanimfunc_0A(struct Sprite *sprite); -static void pokemonanimfunc_0B(struct Sprite *sprite); -static void pokemonanimfunc_0C(struct Sprite *sprite); -static void pokemonanimfunc_0D(struct Sprite *sprite); -static void pokemonanimfunc_0E(struct Sprite *sprite); -static void pokemonanimfunc_0F(struct Sprite *sprite); -static void pokemonanimfunc_10(struct Sprite *sprite); -static void pokemonanimfunc_11(struct Sprite *sprite); -static void pokemonanimfunc_12(struct Sprite *sprite); -static void pokemonanimfunc_13(struct Sprite *sprite); -static void pokemonanimfunc_14(struct Sprite *sprite); -static void pokemonanimfunc_15(struct Sprite *sprite); -static void pokemonanimfunc_16(struct Sprite *sprite); -static void pokemonanimfunc_17(struct Sprite *sprite); -static void pokemonanimfunc_18(struct Sprite *sprite); -static void pokemonanimfunc_19(struct Sprite *sprite); -static void pokemonanimfunc_1A(struct Sprite *sprite); -static void pokemonanimfunc_1B(struct Sprite *sprite); -static void pokemonanimfunc_1C(struct Sprite *sprite); -static void pokemonanimfunc_1D(struct Sprite *sprite); -static void pokemonanimfunc_1E(struct Sprite *sprite); -static void pokemonanimfunc_1F(struct Sprite *sprite); -static void pokemonanimfunc_20(struct Sprite *sprite); -static void pokemonanimfunc_21(struct Sprite *sprite); -static void pokemonanimfunc_22(struct Sprite *sprite); -static void pokemonanimfunc_23(struct Sprite *sprite); -static void pokemonanimfunc_24(struct Sprite *sprite); -static void pokemonanimfunc_25(struct Sprite *sprite); -static void pokemonanimfunc_26(struct Sprite *sprite); -static void pokemonanimfunc_27(struct Sprite *sprite); -static void pokemonanimfunc_28(struct Sprite *sprite); -static void pokemonanimfunc_29(struct Sprite *sprite); -static void pokemonanimfunc_2A(struct Sprite *sprite); -static void pokemonanimfunc_2B(struct Sprite *sprite); -static void pokemonanimfunc_2C(struct Sprite *sprite); -static void pokemonanimfunc_2D(struct Sprite *sprite); -static void pokemonanimfunc_2E(struct Sprite *sprite); -static void pokemonanimfunc_2F(struct Sprite *sprite); -static void pokemonanimfunc_30(struct Sprite *sprite); -static void pokemonanimfunc_31(struct Sprite *sprite); -static void pokemonanimfunc_32(struct Sprite *sprite); -static void pokemonanimfunc_33(struct Sprite *sprite); -static void pokemonanimfunc_34(struct Sprite *sprite); -static void pokemonanimfunc_35(struct Sprite *sprite); -static void pokemonanimfunc_36(struct Sprite *sprite); -static void pokemonanimfunc_37(struct Sprite *sprite); -static void pokemonanimfunc_38(struct Sprite *sprite); -static void pokemonanimfunc_39(struct Sprite *sprite); -static void pokemonanimfunc_3A(struct Sprite *sprite); -static void pokemonanimfunc_3B(struct Sprite *sprite); -static void pokemonanimfunc_3C(struct Sprite *sprite); -static void pokemonanimfunc_3D(struct Sprite *sprite); -static void pokemonanimfunc_3E(struct Sprite *sprite); -static void pokemonanimfunc_3F(struct Sprite *sprite); -static void pokemonanimfunc_40(struct Sprite *sprite); -static void pokemonanimfunc_41(struct Sprite *sprite); -static void pokemonanimfunc_42(struct Sprite *sprite); -static void pokemonanimfunc_43(struct Sprite *sprite); -static void pokemonanimfunc_44(struct Sprite *sprite); -static void pokemonanimfunc_45(struct Sprite *sprite); -static void pokemonanimfunc_46(struct Sprite *sprite); -static void pokemonanimfunc_47(struct Sprite *sprite); -static void pokemonanimfunc_48(struct Sprite *sprite); -static void pokemonanimfunc_49(struct Sprite *sprite); -static void pokemonanimfunc_4A(struct Sprite *sprite); -static void pokemonanimfunc_4B(struct Sprite *sprite); -static void pokemonanimfunc_4C(struct Sprite *sprite); -static void pokemonanimfunc_4D(struct Sprite *sprite); -static void pokemonanimfunc_4E(struct Sprite *sprite); -static void pokemonanimfunc_4F(struct Sprite *sprite); -static void pokemonanimfunc_50(struct Sprite *sprite); -static void pokemonanimfunc_51(struct Sprite *sprite); -static void pokemonanimfunc_52(struct Sprite *sprite); -static void pokemonanimfunc_53(struct Sprite *sprite); -static void pokemonanimfunc_54(struct Sprite *sprite); -static void pokemonanimfunc_55(struct Sprite *sprite); -static void pokemonanimfunc_56(struct Sprite *sprite); -static void pokemonanimfunc_57(struct Sprite *sprite); -static void pokemonanimfunc_58(struct Sprite *sprite); -static void pokemonanimfunc_59(struct Sprite *sprite); -static void pokemonanimfunc_5A(struct Sprite *sprite); -static void pokemonanimfunc_5B(struct Sprite *sprite); -static void pokemonanimfunc_5C(struct Sprite *sprite); -static void pokemonanimfunc_5D(struct Sprite *sprite); -static void pokemonanimfunc_5E(struct Sprite *sprite); -static void pokemonanimfunc_5F(struct Sprite *sprite); -static void pokemonanimfunc_60(struct Sprite *sprite); -static void pokemonanimfunc_61(struct Sprite *sprite); -static void pokemonanimfunc_62(struct Sprite *sprite); -static void pokemonanimfunc_63(struct Sprite *sprite); -static void pokemonanimfunc_64(struct Sprite *sprite); -static void pokemonanimfunc_65(struct Sprite *sprite); -static void pokemonanimfunc_66(struct Sprite *sprite); -static void pokemonanimfunc_67(struct Sprite *sprite); -static void pokemonanimfunc_68(struct Sprite *sprite); -static void pokemonanimfunc_69(struct Sprite *sprite); -static void pokemonanimfunc_6A(struct Sprite *sprite); -static void pokemonanimfunc_6B(struct Sprite *sprite); -static void pokemonanimfunc_6C(struct Sprite *sprite); -static void pokemonanimfunc_6D(struct Sprite *sprite); -static void pokemonanimfunc_6E(struct Sprite *sprite); -static void pokemonanimfunc_6F(struct Sprite *sprite); -static void pokemonanimfunc_70(struct Sprite *sprite); -static void pokemonanimfunc_71(struct Sprite *sprite); -static void pokemonanimfunc_72(struct Sprite *sprite); -static void pokemonanimfunc_73(struct Sprite *sprite); -static void pokemonanimfunc_74(struct Sprite *sprite); -static void pokemonanimfunc_75(struct Sprite *sprite); -static void pokemonanimfunc_76(struct Sprite *sprite); -static void pokemonanimfunc_77(struct Sprite *sprite); -static void pokemonanimfunc_78(struct Sprite *sprite); -static void pokemonanimfunc_79(struct Sprite *sprite); -static void pokemonanimfunc_7A(struct Sprite *sprite); -static void pokemonanimfunc_7B(struct Sprite *sprite); -static void pokemonanimfunc_7C(struct Sprite *sprite); -static void pokemonanimfunc_7D(struct Sprite *sprite); -static void pokemonanimfunc_7E(struct Sprite *sprite); -static void pokemonanimfunc_7F(struct Sprite *sprite); -static void pokemonanimfunc_80(struct Sprite *sprite); -static void pokemonanimfunc_81(struct Sprite *sprite); -static void pokemonanimfunc_82(struct Sprite *sprite); -static void pokemonanimfunc_83(struct Sprite *sprite); -static void pokemonanimfunc_84(struct Sprite *sprite); -static void pokemonanimfunc_85(struct Sprite *sprite); -static void pokemonanimfunc_86(struct Sprite *sprite); -static void pokemonanimfunc_87(struct Sprite *sprite); -static void pokemonanimfunc_88(struct Sprite *sprite); -static void pokemonanimfunc_89(struct Sprite *sprite); -static void pokemonanimfunc_8A(struct Sprite *sprite); -static void pokemonanimfunc_8B(struct Sprite *sprite); -static void pokemonanimfunc_8C(struct Sprite *sprite); -static void pokemonanimfunc_8D(struct Sprite *sprite); -static void pokemonanimfunc_8E(struct Sprite *sprite); -static void pokemonanimfunc_8F(struct Sprite *sprite); -static void pokemonanimfunc_90(struct Sprite *sprite); -static void pokemonanimfunc_91(struct Sprite *sprite); -static void pokemonanimfunc_92(struct Sprite *sprite); -static void pokemonanimfunc_93(struct Sprite *sprite); -static void pokemonanimfunc_94(struct Sprite *sprite); -static void pokemonanimfunc_95(struct Sprite *sprite); -static void pokemonanimfunc_96(struct Sprite *sprite); +static void Anim_VerticalSquishBounce(struct Sprite *sprite); +static void Anim_CircularStretchTwice(struct Sprite *sprite); +static void Anim_HorizontalVibrate(struct Sprite *sprite); +static void Anim_HorizontalSlide(struct Sprite *sprite); +static void Anim_VerticalSlide(struct Sprite *sprite); +static void Anim_BounceRotateToSides(struct Sprite *sprite); +static void Anim_VerticalJumpsHorizontalJumps(struct Sprite *sprite); +static void Anim_RotateToSides(struct Sprite *sprite); +static void Anim_RotateToSides_Twice(struct Sprite *sprite); +static void Anim_GrowVibrate(struct Sprite *sprite); +static void Anim_ZigzagFast(struct Sprite *sprite); +static void Anim_SwingConcave(struct Sprite *sprite); +static void Anim_SwingConcave_Fast(struct Sprite *sprite); +static void Anim_SwingConvex(struct Sprite *sprite); +static void Anim_SwingConvex_Fast(struct Sprite *sprite); +static void Anim_HorizontalShake(struct Sprite *sprite); +static void Anim_VerticalShake(struct Sprite *sprite); +static void Anim_CircularVibrate(struct Sprite *sprite); +static void Anim_Twist(struct Sprite *sprite); +static void Anim_ShrinkGrow(struct Sprite *sprite); +static void Anim_CircleCounterclockwise(struct Sprite *sprite); +static void Anim_GlowBlack(struct Sprite *sprite); +static void Anim_HorizontalStretch(struct Sprite *sprite); +static void Anim_VerticalStretch(struct Sprite *sprite); +static void Anim_RisingWobble(struct Sprite *sprite); +static void Anim_VerticalShakeTwice(struct Sprite *sprite); +static void Anim_TipMoveForward(struct Sprite *sprite); +static void Anim_HorizontalPivot(struct Sprite *sprite); +static void Anim_VerticalSlideWobble(struct Sprite *sprite); +static void Anim_HorizontalSlideWobble(struct Sprite *sprite); +static void Anim_VerticalJumps_Big(struct Sprite *sprite); +static void Anim_Spin_Long(struct Sprite *sprite); +static void Anim_GlowOrange(struct Sprite *sprite); +static void Anim_GlowRed(struct Sprite *sprite); +static void Anim_GlowBlue(struct Sprite *sprite); +static void Anim_GlowYellow(struct Sprite *sprite); +static void Anim_GlowPurple(struct Sprite *sprite); +static void Anim_BackAndLunge(struct Sprite *sprite); +static void Anim_BackFlip(struct Sprite *sprite); +static void Anim_Flicker(struct Sprite *sprite); +static void Anim_BackFlipBig(struct Sprite *sprite); +static void Anim_FrontFlip(struct Sprite *sprite); +static void Anim_TumblingFrontFlip(struct Sprite *sprite); +static void Anim_Figure8(struct Sprite *sprite); +static void Anim_FlashYellow(struct Sprite *sprite); +static void Anim_SwingConcave_FastShort(struct Sprite *sprite); +static void Anim_SwingConvex_FastShort(struct Sprite *sprite); +static void Anim_RotateUpSlamDown(struct Sprite *sprite); +static void Anim_DeepVerticalSquishBounce(struct Sprite *sprite); +static void Anim_HorizontalJumps(struct Sprite *sprite); +static void Anim_HorizontalJumpsVerticalStretch(struct Sprite *sprite); +static void Anim_RotateToSides_Fast(struct Sprite *sprite); +static void Anim_RotateUpToSides(struct Sprite *sprite); +static void Anim_FlickerIncreasing(struct Sprite *sprite); +static void Anim_TipHopForward(struct Sprite *sprite); +static void Anim_PivotShake(struct Sprite *sprite); +static void Anim_TipAndShake(struct Sprite *sprite); +static void Anim_VibrateToCorners(struct Sprite *sprite); +static void Anim_GrowInStages(struct Sprite *sprite); +static void Anim_VerticalSpring(struct Sprite *sprite); +static void Anim_VerticalRepeatedSpring(struct Sprite *sprite); +static void Anim_SpringRising(struct Sprite *sprite); +static void Anim_HorizontalSpring(struct Sprite *sprite); +static void Anim_HorizontalRepeatedSpring_Slow(struct Sprite *sprite); +static void Anim_HorizontalSlideShrink(struct Sprite *sprite); +static void Anim_LungeGrow(struct Sprite *sprite); +static void Anim_CircleIntoBackground(struct Sprite *sprite); +static void Anim_RapidHorizontalHops(struct Sprite *sprite); +static void Anim_FourPetal(struct Sprite *sprite); +static void Anim_VerticalSquishBounce_Slow(struct Sprite *sprite); +static void Anim_HorizontalSlide_Slow(struct Sprite *sprite); +static void Anim_VerticalSlide_Slow(struct Sprite *sprite); +static void Anim_BounceRotateToSides_Small(struct Sprite *sprite); +static void Anim_BounceRotateToSides_Slow(struct Sprite *sprite); +static void Anim_BounceRotateToSides_SmallSlow(struct Sprite *sprite); +static void Anim_ZigzagSlow(struct Sprite *sprite); +static void Anim_HorizontalShake_Slow(struct Sprite *sprite); +static void Anim_VertialShake_Slow(struct Sprite *sprite); +static void Anim_Twist_Twice(struct Sprite *sprite); +static void Anim_CircleCounterclockwise_Slow(struct Sprite *sprite); +static void Anim_VerticalShakeTwice_Slow(struct Sprite *sprite); +static void Anim_VerticalSlideWobble_Small(struct Sprite *sprite); +static void Anim_VerticalJumps_Small(struct Sprite *sprite); +static void Anim_Spin(struct Sprite *sprite); +static void Anim_TumblingFrontFlip_Twice(struct Sprite *sprite); +static void Anim_DeepVerticalSquishBounce_Twice(struct Sprite *sprite); +static void Anim_HorizontalJumpsVerticalStretch_Twice(struct Sprite *sprite); +static void Anim_VerticalShakeBack(struct Sprite *sprite); +static void Anim_VerticalShakeBack_Slow(struct Sprite *sprite); +static void Anim_VerticalShakeHorizontalSlide_Slow(struct Sprite *sprite); +static void Anim_VerticalStretchBothEnds_Slow(struct Sprite *sprite); +static void Anim_HorizontalStretchFar_Slow(struct Sprite *sprite); +static void Anim_VerticalShakeLowTwice(struct Sprite *sprite); +static void Anim_HorizontalShake_Fast(struct Sprite *sprite); +static void Anim_HorizontalSlide_Fast(struct Sprite *sprite); +static void Anim_HorizontalVibrate_Fast(struct Sprite *sprite); +static void Anim_HorizontalVibrate_Fastest(struct Sprite *sprite); +static void Anim_VerticalShakeBack_Fast(struct Sprite *sprite); +static void Anim_VerticalShakeLowTwice_Slow(struct Sprite *sprite); +static void Anim_VerticalShakeLowTwice_Fast(struct Sprite *sprite); +static void Anim_CircleCounterclockwise_Long(struct Sprite *sprite); +static void Anim_GrowStutter_Slow(struct Sprite *sprite); +static void Anim_VerticalShakeHorizontalSlide(struct Sprite *sprite); +static void Anim_VerticalShakeHorizontalSlide_Fast(struct Sprite *sprite); +static void Anim_TriangleDown_Slow(struct Sprite *sprite); +static void Anim_TriangleDown(struct Sprite *sprite); +static void Anim_TriangleDown_Fast(struct Sprite *sprite); +static void Anim_Grow(struct Sprite *sprite); +static void Anim_Grow_Twice(struct Sprite *sprite); +static void Anim_HorizontalSpring_Fast(struct Sprite *sprite); +static void Anim_HorizontalSpring_Slow(struct Sprite *sprite); +static void Anim_HorizontalRepeatedSpring_Fast(struct Sprite *sprite); +static void Anim_HorizontalRepeatedSpring(struct Sprite *sprite); +static void Anim_ShrinkGrow_Fast(struct Sprite *sprite); +static void Anim_ShrinkGrow_Slow(struct Sprite *sprite); +static void Anim_VerticalStretchBothEnds(struct Sprite *sprite); +static void Anim_VerticalStretchBothEnds_Twice(struct Sprite *sprite); +static void Anim_HorizontalStretchFar_Twice(struct Sprite *sprite); +static void Anim_HorizontalStretchFar(struct Sprite *sprite); +static void Anim_GrowStutter_Twice(struct Sprite *sprite); +static void Anim_GrowStutter(struct Sprite *sprite); +static void Anim_ConcaveArcLarge_Slow(struct Sprite *sprite); +static void Anim_ConcaveArcLarge(struct Sprite *sprite); +static void Anim_ConcaveArcLarge_Twice(struct Sprite *sprite); +static void Anim_ConvexDoubleArc_Slow(struct Sprite *sprite); +static void Anim_ConvexDoubleArc(struct Sprite *sprite); +static void Anim_ConvexDoubleArc_Twice(struct Sprite *sprite); +static void Anim_ConcaveArcSmall_Slow(struct Sprite *sprite); +static void Anim_ConcaveArcSmall(struct Sprite *sprite); +static void Anim_ConcaveArcSmall_Twice(struct Sprite *sprite); +static void Anim_HorizontalDip(struct Sprite *sprite); +static void Anim_HorizontalDip_Fast(struct Sprite *sprite); +static void Anim_HorizontalDip_Twice(struct Sprite *sprite); +static void Anim_ShrinkGrowVibrate_Fast(struct Sprite *sprite); +static void Anim_ShrinkGrowVibrate(struct Sprite *sprite); +static void Anim_ShrinkGrowVibrate_Slow(struct Sprite *sprite); +static void Anim_JoltRight_Fast(struct Sprite *sprite); +static void Anim_JoltRight(struct Sprite *sprite); +static void Anim_JoltRight_Slow(struct Sprite *sprite); +static void Anim_ShakeFlashYellow_Fast(struct Sprite *sprite); +static void Anim_ShakeFlashYellow(struct Sprite *sprite); +static void Anim_ShakeFlashYellow_Slow(struct Sprite *sprite); +static void Anim_ShakeGlowRed_Fast(struct Sprite *sprite); +static void Anim_ShakeGlowRed(struct Sprite *sprite); +static void Anim_ShakeGlowRed_Slow(struct Sprite *sprite); +static void Anim_ShakeGlowGreen_Fast(struct Sprite *sprite); +static void Anim_ShakeGlowGreen(struct Sprite *sprite); +static void Anim_ShakeGlowGreen_Slow(struct Sprite *sprite); +static void Anim_ShakeGlowBlue_Fast(struct Sprite *sprite); +static void Anim_ShakeGlowBlue(struct Sprite *sprite); +static void Anim_ShakeGlowBlue_Slow(struct Sprite *sprite); -static void SpriteCB_SetDummyOnAnimEnd(struct Sprite *sprite); +static void WaitAnimEnd(struct Sprite *sprite); -#define STRUCT_COUNT 4 +static struct PokemonAnimData sAnims[MAX_BATTLERS_COUNT]; +static u8 sAnimIdx; +static bool32 sIsSummaryAnim; -// IWRAM bss -static struct UnkAnimStruct sUnknown_03001240[STRUCT_COUNT]; -static u8 sUnknown_03001270; -static bool32 sUnknown_03001274; - -// const rom data static const u8 sSpeciesToBackAnimSet[] = { - [SPECIES_BULBASAUR] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_IVYSAUR] = BACK_ANIM_H_SLIDE, - [SPECIES_VENUSAUR] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_CHARMANDER] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, + [SPECIES_BULBASAUR] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_IVYSAUR] = BACK_ANIM_H_SLIDE, + [SPECIES_VENUSAUR] = BACK_ANIM_H_SHAKE, + [SPECIES_CHARMANDER] = BACK_ANIM_CONCAVE_ARC_SMALL, [SPECIES_CHARMELEON] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_CHARIZARD] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_SQUIRTLE] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_WARTORTLE] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_BLASTOISE] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_CATERPIE] = BACK_ANIM_H_SLIDE, - [SPECIES_METAPOD] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_BUTTERFREE] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_WEEDLE] = BACK_ANIM_H_SLIDE, - [SPECIES_KAKUNA] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_BEEDRILL] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_PIDGEY] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_PIDGEOTTO] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_PIDGEOT] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_RATTATA] = BACK_ANIM_V_SHAKE_WITH_H_SLIDE, - [SPECIES_RATICATE] = BACK_ANIM_V_SHAKE_WITH_H_SLIDE, - [SPECIES_SPEAROW] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_FEAROW] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_EKANS] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_ARBOK] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_PIKACHU] = BACK_ANIM_FLASH_YELLOW_WITH_SHAKE, - [SPECIES_RAICHU] = BACK_ANIM_FLASH_YELLOW_WITH_SHAKE, - [SPECIES_SANDSHREW] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_SANDSLASH] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_NIDORAN_F] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_NIDORINA] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_NIDOQUEEN] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_NIDORAN_M] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_NIDORINO] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_NIDOKING] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_CLEFAIRY] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_CLEFABLE] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_VULPIX] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_NINETALES] = BACK_ANIM_H_SLIDE_QUICK, + [SPECIES_CHARIZARD] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_SQUIRTLE] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_WARTORTLE] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_BLASTOISE] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_CATERPIE] = BACK_ANIM_H_SLIDE, + [SPECIES_METAPOD] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_BUTTERFREE] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_WEEDLE] = BACK_ANIM_H_SLIDE, + [SPECIES_KAKUNA] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_BEEDRILL] = BACK_ANIM_H_VIBRATE, + [SPECIES_PIDGEY] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_PIDGEOTTO] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_PIDGEOT] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_RATTATA] = BACK_ANIM_V_SHAKE_H_SLIDE, + [SPECIES_RATICATE] = BACK_ANIM_V_SHAKE_H_SLIDE, + [SPECIES_SPEAROW] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_FEAROW] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_EKANS] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_ARBOK] = BACK_ANIM_V_SHAKE, + [SPECIES_PIKACHU] = BACK_ANIM_SHAKE_FLASH_YELLOW, + [SPECIES_RAICHU] = BACK_ANIM_SHAKE_FLASH_YELLOW, + [SPECIES_SANDSHREW] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_SANDSLASH] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_NIDORAN_F] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_NIDORINA] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_NIDOQUEEN] = BACK_ANIM_V_SHAKE, + [SPECIES_NIDORAN_M] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_NIDORINO] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_NIDOKING] = BACK_ANIM_V_SHAKE, + [SPECIES_CLEFAIRY] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_CLEFABLE] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_VULPIX] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_NINETALES] = BACK_ANIM_H_VIBRATE, [SPECIES_JIGGLYPUFF] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_WIGGLYTUFF] = BACK_ANIM_GROW_1, - [SPECIES_ZUBAT] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_GOLBAT] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_ODDISH] = BACK_ANIM_H_SLIDE, - [SPECIES_GLOOM] = BACK_ANIM_H_SLIDE, - [SPECIES_VILEPLUME] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_PARAS] = BACK_ANIM_H_SLIDE, - [SPECIES_PARASECT] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_VENONAT] = BACK_ANIM_V_SHAKE_WITH_H_SLIDE, - [SPECIES_VENOMOTH] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_DIGLETT] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_DUGTRIO] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_MEOWTH] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_PERSIAN] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_PSYDUCK] = BACK_ANIM_H_SLIDE, - [SPECIES_GOLDUCK] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_MANKEY] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_PRIMEAPE] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_GROWLITHE] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_ARCANINE] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_POLIWAG] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_POLIWHIRL] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_POLIWRATH] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_ABRA] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_KADABRA] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_ALAKAZAM] = BACK_ANIM_GROW_2, - [SPECIES_MACHOP] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_MACHOKE] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_MACHAMP] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_BELLSPROUT] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_WEEPINBELL] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_VICTREEBEL] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_TENTACOOL] = BACK_ANIM_H_SLIDE, + [SPECIES_WIGGLYTUFF] = BACK_ANIM_GROW, + [SPECIES_ZUBAT] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_GOLBAT] = BACK_ANIM_V_SHAKE, + [SPECIES_ODDISH] = BACK_ANIM_H_SLIDE, + [SPECIES_GLOOM] = BACK_ANIM_H_SLIDE, + [SPECIES_VILEPLUME] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_PARAS] = BACK_ANIM_H_SLIDE, + [SPECIES_PARASECT] = BACK_ANIM_H_SHAKE, + [SPECIES_VENONAT] = BACK_ANIM_V_SHAKE_H_SLIDE, + [SPECIES_VENOMOTH] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_DIGLETT] = BACK_ANIM_V_SHAKE, + [SPECIES_DUGTRIO] = BACK_ANIM_V_SHAKE, + [SPECIES_MEOWTH] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_PERSIAN] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_PSYDUCK] = BACK_ANIM_H_SLIDE, + [SPECIES_GOLDUCK] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_MANKEY] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_PRIMEAPE] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_GROWLITHE] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_ARCANINE] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_POLIWAG] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_POLIWHIRL] = BACK_ANIM_V_SHAKE, + [SPECIES_POLIWRATH] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_ABRA] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_KADABRA] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_ALAKAZAM] = BACK_ANIM_GROW_STUTTER, + [SPECIES_MACHOP] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_MACHOKE] = BACK_ANIM_V_SHAKE, + [SPECIES_MACHAMP] = BACK_ANIM_V_SHAKE, + [SPECIES_BELLSPROUT] = BACK_ANIM_V_STRETCH, + [SPECIES_WEEPINBELL] = BACK_ANIM_V_STRETCH, + [SPECIES_VICTREEBEL] = BACK_ANIM_V_STRETCH, + [SPECIES_TENTACOOL] = BACK_ANIM_H_SLIDE, [SPECIES_TENTACRUEL] = BACK_ANIM_H_SLIDE, - [SPECIES_GEODUDE] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_GRAVELER] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_GOLEM] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_PONYTA] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_RAPIDASH] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_SLOWPOKE] = BACK_ANIM_H_SLIDE, - [SPECIES_SLOWBRO] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_MAGNEMITE] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_MAGNETON] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_FARFETCHD] = BACK_ANIM_H_SLIDE, - [SPECIES_DODUO] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_DODRIO] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_SEEL] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_DEWGONG] = BACK_ANIM_H_SLIDE, - [SPECIES_GRIMER] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_MUK] = BACK_ANIM_HORIZONTAL_STRETCH, - [SPECIES_SHELLDER] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_CLOYSTER] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_GASTLY] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_HAUNTER] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_GENGAR] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_ONIX] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_DROWZEE] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_HYPNO] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_KRABBY] = BACK_ANIM_V_SHAKE_WITH_H_SLIDE, - [SPECIES_KINGLER] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_VOLTORB] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_ELECTRODE] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_EXEGGCUTE] = BACK_ANIM_H_SLIDE, - [SPECIES_EXEGGUTOR] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_CUBONE] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_MAROWAK] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_HITMONLEE] = BACK_ANIM_H_SLIDE, - [SPECIES_HITMONCHAN] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_LICKITUNG] = BACK_ANIM_H_SLIDE, - [SPECIES_KOFFING] = BACK_ANIM_GROW_1, - [SPECIES_WEEZING] = BACK_ANIM_GROW_1, - [SPECIES_RHYHORN] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_RHYDON] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_CHANSEY] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_TANGELA] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_KANGASKHAN] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_HORSEA] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_SEADRA] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_GOLDEEN] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_SEAKING] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_STARYU] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_STARMIE] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_MR_MIME] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_SCYTHER] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_JYNX] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_ELECTABUZZ] = BACK_ANIM_FLASH_YELLOW_WITH_SHAKE, - [SPECIES_MAGMAR] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_PINSIR] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_TAUROS] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_MAGIKARP] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_GYARADOS] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_LAPRAS] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_DITTO] = BACK_ANIM_SHRINK_GROW_1, - [SPECIES_EEVEE] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_VAPOREON] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_JOLTEON] = BACK_ANIM_FLASH_YELLOW_WITH_SHAKE, - [SPECIES_FLAREON] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_PORYGON] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_OMANYTE] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_OMASTAR] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_KABUTO] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_KABUTOPS] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_GEODUDE] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_GRAVELER] = BACK_ANIM_H_SHAKE, + [SPECIES_GOLEM] = BACK_ANIM_H_SHAKE, + [SPECIES_PONYTA] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_RAPIDASH] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_SLOWPOKE] = BACK_ANIM_H_SLIDE, + [SPECIES_SLOWBRO] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_MAGNEMITE] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_MAGNETON] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_FARFETCHD] = BACK_ANIM_H_SLIDE, + [SPECIES_DODUO] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_DODRIO] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_SEEL] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_DEWGONG] = BACK_ANIM_H_SLIDE, + [SPECIES_GRIMER] = BACK_ANIM_V_STRETCH, + [SPECIES_MUK] = BACK_ANIM_H_STRETCH, + [SPECIES_SHELLDER] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_CLOYSTER] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_GASTLY] = BACK_ANIM_H_VIBRATE, + [SPECIES_HAUNTER] = BACK_ANIM_H_VIBRATE, + [SPECIES_GENGAR] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_ONIX] = BACK_ANIM_V_SHAKE, + [SPECIES_DROWZEE] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_HYPNO] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_KRABBY] = BACK_ANIM_V_SHAKE_H_SLIDE, + [SPECIES_KINGLER] = BACK_ANIM_V_SHAKE, + [SPECIES_VOLTORB] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_ELECTRODE] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_EXEGGCUTE] = BACK_ANIM_H_SLIDE, + [SPECIES_EXEGGUTOR] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_CUBONE] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_MAROWAK] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_HITMONLEE] = BACK_ANIM_H_SLIDE, + [SPECIES_HITMONCHAN] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_LICKITUNG] = BACK_ANIM_H_SLIDE, + [SPECIES_KOFFING] = BACK_ANIM_GROW, + [SPECIES_WEEZING] = BACK_ANIM_GROW, + [SPECIES_RHYHORN] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_RHYDON] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_CHANSEY] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_TANGELA] = BACK_ANIM_V_STRETCH, + [SPECIES_KANGASKHAN] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_HORSEA] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_SEADRA] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_GOLDEEN] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_SEAKING] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_STARYU] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_STARMIE] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_MR_MIME] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_SCYTHER] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_JYNX] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_ELECTABUZZ] = BACK_ANIM_SHAKE_FLASH_YELLOW, + [SPECIES_MAGMAR] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_PINSIR] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_TAUROS] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_MAGIKARP] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_GYARADOS] = BACK_ANIM_V_SHAKE, + [SPECIES_LAPRAS] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_DITTO] = BACK_ANIM_SHRINK_GROW, + [SPECIES_EEVEE] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_VAPOREON] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_JOLTEON] = BACK_ANIM_SHAKE_FLASH_YELLOW, + [SPECIES_FLAREON] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_PORYGON] = BACK_ANIM_H_VIBRATE, + [SPECIES_OMANYTE] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_OMASTAR] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_KABUTO] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_KABUTOPS] = BACK_ANIM_JOLT_RIGHT, [SPECIES_AERODACTYL] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_SNORLAX] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_ARTICUNO] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_ZAPDOS] = BACK_ANIM_FLASH_YELLOW_WITH_SHAKE, - [SPECIES_MOLTRES] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_DRATINI] = BACK_ANIM_H_SLIDE, - [SPECIES_DRAGONAIR] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_DRAGONITE] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_MEWTWO] = BACK_ANIM_GROW_2, - [SPECIES_MEW] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_CHIKORITA] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_BAYLEEF] = BACK_ANIM_H_SLIDE, - [SPECIES_MEGANIUM] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_CYNDAQUIL] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_QUILAVA] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_TYPHLOSION] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_TOTODILE] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_CROCONAW] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_FERALIGATR] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_SENTRET] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_FURRET] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_HOOTHOOT] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_NOCTOWL] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_LEDYBA] = BACK_ANIM_V_SHAKE_WITH_H_SLIDE, - [SPECIES_LEDIAN] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_SPINARAK] = BACK_ANIM_V_SHAKE_WITH_H_SLIDE, - [SPECIES_ARIADOS] = BACK_ANIM_H_SLIDE, - [SPECIES_CROBAT] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_CHINCHOU] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_LANTURN] = BACK_ANIM_FLASH_YELLOW_WITH_SHAKE, - [SPECIES_PICHU] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_CLEFFA] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_IGGLYBUFF] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_TOGEPI] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_TOGETIC] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_NATU] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_XATU] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_MAREEP] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_FLAAFFY] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_AMPHAROS] = BACK_ANIM_FLASH_YELLOW_WITH_SHAKE, - [SPECIES_BELLOSSOM] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_MARILL] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_AZUMARILL] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_SUDOWOODO] = BACK_ANIM_H_SLIDE, - [SPECIES_POLITOED] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_HOPPIP] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_SKIPLOOM] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_JUMPLUFF] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_AIPOM] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_SUNKERN] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_SUNFLORA] = BACK_ANIM_H_SLIDE, - [SPECIES_YANMA] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_WOOPER] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_QUAGSIRE] = BACK_ANIM_H_SLIDE, - [SPECIES_ESPEON] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_UMBREON] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_MURKROW] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_SLOWKING] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_MISDREAVUS] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_UNOWN] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_WOBBUFFET] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_GIRAFARIG] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_PINECO] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_FORRETRESS] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_DUNSPARCE] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_GLIGAR] = BACK_ANIM_SHRINK_GROW_1, - [SPECIES_STEELIX] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_SNUBBULL] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_GRANBULL] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_QWILFISH] = BACK_ANIM_GROW_2, - [SPECIES_SCIZOR] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_SHUCKLE] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_HERACROSS] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_SNEASEL] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_TEDDIURSA] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_URSARING] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_SLUGMA] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_MAGCARGO] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_SWINUB] = BACK_ANIM_V_SHAKE_WITH_H_SLIDE, - [SPECIES_PILOSWINE] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_CORSOLA] = BACK_ANIM_H_SLIDE, - [SPECIES_REMORAID] = BACK_ANIM_H_SLIDE, - [SPECIES_OCTILLERY] = BACK_ANIM_SHRINK_GROW_1, - [SPECIES_DELIBIRD] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_MANTINE] = BACK_ANIM_H_SLIDE, - [SPECIES_SKARMORY] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_HOUNDOUR] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_HOUNDOOM] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_KINGDRA] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_PHANPY] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_DONPHAN] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_PORYGON2] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_STANTLER] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_SMEARGLE] = BACK_ANIM_H_SLIDE, - [SPECIES_TYROGUE] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_HITMONTOP] = BACK_ANIM_CIRCLE_MOVE_COUNTERCLOCKWISE, - [SPECIES_SMOOCHUM] = BACK_ANIM_H_SLIDE, - [SPECIES_ELEKID] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_MAGBY] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_MILTANK] = BACK_ANIM_H_SLIDE, - [SPECIES_BLISSEY] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_RAIKOU] = BACK_ANIM_FLASH_YELLOW_WITH_SHAKE, - [SPECIES_ENTEI] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_SUICUNE] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_LARVITAR] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_PUPITAR] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_TYRANITAR] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_LUGIA] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_HO_OH] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_CELEBI] = BACK_ANIM_FADE_GREEN_WITH_SHAKE, - [SPECIES_TREECKO] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_GROVYLE] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_SCEPTILE] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_TORCHIC] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_COMBUSKEN] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_BLAZIKEN] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_MUDKIP] = BACK_ANIM_H_SLIDE, - [SPECIES_MARSHTOMP] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_SWAMPERT] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_POOCHYENA] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_MIGHTYENA] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_ZIGZAGOON] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_LINOONE] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_WURMPLE] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_SILCOON] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_BEAUTIFLY] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_CASCOON] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_DUSTOX] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_LOTAD] = BACK_ANIM_H_SLIDE, - [SPECIES_LOMBRE] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_LUDICOLO] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_SEEDOT] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_NUZLEAF] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_SHIFTRY] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_NINCADA] = BACK_ANIM_V_SHAKE_WITH_H_SLIDE, - [SPECIES_NINJASK] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_SHEDINJA] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_TAILLOW] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_SWELLOW] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_SHROOMISH] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_BRELOOM] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_SPINDA] = BACK_ANIM_CIRCLE_MOVE_COUNTERCLOCKWISE, - [SPECIES_WINGULL] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_PELIPPER] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_SURSKIT] = BACK_ANIM_H_SLIDE_WITH_V_COMPRESS_1, - [SPECIES_MASQUERAIN] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_WAILMER] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_WAILORD] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_SKITTY] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_DELCATTY] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_KECLEON] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_BALTOY] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_CLAYDOL] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_NOSEPASS] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_TORKOAL] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_SABLEYE] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_BARBOACH] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_WHISCASH] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_LUVDISC] = BACK_ANIM_H_SLIDE_WITH_V_COMPRESS_2, - [SPECIES_CORPHISH] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_CRAWDAUNT] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_FEEBAS] = BACK_ANIM_H_SLIDE_WITH_V_COMPRESS_1, - [SPECIES_MILOTIC] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_CARVANHA] = BACK_ANIM_H_SLIDE_WITH_V_COMPRESS_2, - [SPECIES_SHARPEDO] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_TRAPINCH] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_VIBRAVA] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_FLYGON] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_MAKUHITA] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_HARIYAMA] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_ELECTRIKE] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_MANECTRIC] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_NUMEL] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_CAMERUPT] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_SPHEAL] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_SEALEO] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_WALREIN] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_CACNEA] = BACK_ANIM_V_SHAKE_WITH_H_SLIDE, - [SPECIES_CACTURNE] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_SNORUNT] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_GLALIE] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_LUNATONE] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_SOLROCK] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_AZURILL] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_SPOINK] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_GRUMPIG] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_PLUSLE] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_MINUN] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_MAWILE] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_MEDITITE] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_MEDICHAM] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_SWABLU] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_ALTARIA] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_WYNAUT] = BACK_ANIM_CONCAVE_UP_ARC_SWAY_LARGE, - [SPECIES_DUSKULL] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_DUSCLOPS] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_ROSELIA] = BACK_ANIM_FADE_GREEN_WITH_SHAKE, - [SPECIES_SLAKOTH] = BACK_ANIM_H_SLIDE, - [SPECIES_VIGOROTH] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_SMALL, - [SPECIES_SLAKING] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_GULPIN] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_SWALOT] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_TROPIUS] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_WHISMUR] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_LOUDRED] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_EXPLOUD] = BACK_ANIM_GROW_2, - [SPECIES_CLAMPERL] = BACK_ANIM_DIP_RIGHT_SIDE, - [SPECIES_HUNTAIL] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_GOREBYSS] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_ABSOL] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_SHUPPET] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_BANETTE] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_SEVIPER] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_ZANGOOSE] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_RELICANTH] = BACK_ANIM_H_SLIDE, - [SPECIES_ARON] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_LAIRON] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_AGGRON] = BACK_ANIM_V_SHAKE_WITH_PAUSE, - [SPECIES_CASTFORM] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_VOLBEAT] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_ILLUMISE] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_LILEEP] = BACK_ANIM_HORIZONTAL_STRETCH, - [SPECIES_CRADILY] = BACK_ANIM_VERTICAL_STRETCH, - [SPECIES_ANORITH] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_ARMALDO] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_RALTS] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_KIRLIA] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_GARDEVOIR] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_BAGON] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_SHELGON] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_SALAMENCE] = BACK_ANIM_HORIZONTAL_SHAKE, - [SPECIES_BELDUM] = BACK_ANIM_CIRCLE_MOVE_CLOCKWISE, - [SPECIES_METANG] = BACK_ANIM_JOLT_RIGHT, - [SPECIES_METAGROSS] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_REGIROCK] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_REGICE] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_REGISTEEL] = BACK_ANIM_VERTICAL_SHAKE, - [SPECIES_KYOGRE] = BACK_ANIM_FADE_BLUE_WITH_SHAKE, - [SPECIES_GROUDON] = BACK_ANIM_FADE_RED_WITH_SHAKE, - [SPECIES_RAYQUAZA] = BACK_ANIM_GROW_2, - [SPECIES_LATIAS] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_LATIOS] = BACK_ANIM_H_SLIDE_QUICK, - [SPECIES_JIRACHI] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, - [SPECIES_DEOXYS] = BACK_ANIM_SHRINK_GROW_2, - [SPECIES_CHIMECHO] = BACK_ANIM_CONCAVE_DOWN_ARC_SWAY_LARGE, + [SPECIES_SNORLAX] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_ARTICUNO] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_ZAPDOS] = BACK_ANIM_SHAKE_FLASH_YELLOW, + [SPECIES_MOLTRES] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_DRATINI] = BACK_ANIM_H_SLIDE, + [SPECIES_DRAGONAIR] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_DRAGONITE] = BACK_ANIM_V_SHAKE, + [SPECIES_MEWTWO] = BACK_ANIM_GROW_STUTTER, + [SPECIES_MEW] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_CHIKORITA] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_BAYLEEF] = BACK_ANIM_H_SLIDE, + [SPECIES_MEGANIUM] = BACK_ANIM_V_SHAKE, + [SPECIES_CYNDAQUIL] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_QUILAVA] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_TYPHLOSION] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_TOTODILE] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_CROCONAW] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_FERALIGATR] = BACK_ANIM_V_SHAKE, + [SPECIES_SENTRET] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_FURRET] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_HOOTHOOT] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_NOCTOWL] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_LEDYBA] = BACK_ANIM_V_SHAKE_H_SLIDE, + [SPECIES_LEDIAN] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_SPINARAK] = BACK_ANIM_V_SHAKE_H_SLIDE, + [SPECIES_ARIADOS] = BACK_ANIM_H_SLIDE, + [SPECIES_CROBAT] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_CHINCHOU] = BACK_ANIM_V_STRETCH, + [SPECIES_LANTURN] = BACK_ANIM_SHAKE_FLASH_YELLOW, + [SPECIES_PICHU] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_CLEFFA] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_IGGLYBUFF] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_TOGEPI] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_TOGETIC] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_NATU] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_XATU] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_MAREEP] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_FLAAFFY] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_AMPHAROS] = BACK_ANIM_SHAKE_FLASH_YELLOW, + [SPECIES_BELLOSSOM] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_MARILL] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_AZUMARILL] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_SUDOWOODO] = BACK_ANIM_H_SLIDE, + [SPECIES_POLITOED] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_HOPPIP] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_SKIPLOOM] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_JUMPLUFF] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_AIPOM] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_SUNKERN] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_SUNFLORA] = BACK_ANIM_H_SLIDE, + [SPECIES_YANMA] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_WOOPER] = BACK_ANIM_V_STRETCH, + [SPECIES_QUAGSIRE] = BACK_ANIM_H_SLIDE, + [SPECIES_ESPEON] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_UMBREON] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_MURKROW] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_SLOWKING] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_MISDREAVUS] = BACK_ANIM_H_VIBRATE, + [SPECIES_UNOWN] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_WOBBUFFET] = BACK_ANIM_V_STRETCH, + [SPECIES_GIRAFARIG] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_PINECO] = BACK_ANIM_H_SHAKE, + [SPECIES_FORRETRESS] = BACK_ANIM_V_SHAKE, + [SPECIES_DUNSPARCE] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_GLIGAR] = BACK_ANIM_SHRINK_GROW, + [SPECIES_STEELIX] = BACK_ANIM_V_SHAKE, + [SPECIES_SNUBBULL] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_GRANBULL] = BACK_ANIM_V_SHAKE, + [SPECIES_QWILFISH] = BACK_ANIM_GROW_STUTTER, + [SPECIES_SCIZOR] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_SHUCKLE] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_HERACROSS] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_SNEASEL] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_TEDDIURSA] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_URSARING] = BACK_ANIM_V_SHAKE, + [SPECIES_SLUGMA] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_MAGCARGO] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_SWINUB] = BACK_ANIM_V_SHAKE_H_SLIDE, + [SPECIES_PILOSWINE] = BACK_ANIM_H_SHAKE, + [SPECIES_CORSOLA] = BACK_ANIM_H_SLIDE, + [SPECIES_REMORAID] = BACK_ANIM_H_SLIDE, + [SPECIES_OCTILLERY] = BACK_ANIM_SHRINK_GROW, + [SPECIES_DELIBIRD] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_MANTINE] = BACK_ANIM_H_SLIDE, + [SPECIES_SKARMORY] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_HOUNDOUR] = BACK_ANIM_V_SHAKE, + [SPECIES_HOUNDOOM] = BACK_ANIM_V_SHAKE, + [SPECIES_KINGDRA] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_PHANPY] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_DONPHAN] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_PORYGON2] = BACK_ANIM_H_VIBRATE, + [SPECIES_STANTLER] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_SMEARGLE] = BACK_ANIM_H_SLIDE, + [SPECIES_TYROGUE] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_HITMONTOP] = BACK_ANIM_CIRCLE_COUNTERCLOCKWISE, + [SPECIES_SMOOCHUM] = BACK_ANIM_H_SLIDE, + [SPECIES_ELEKID] = BACK_ANIM_H_SHAKE, + [SPECIES_MAGBY] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_MILTANK] = BACK_ANIM_H_SLIDE, + [SPECIES_BLISSEY] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_RAIKOU] = BACK_ANIM_SHAKE_FLASH_YELLOW, + [SPECIES_ENTEI] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_SUICUNE] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_LARVITAR] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_PUPITAR] = BACK_ANIM_V_SHAKE, + [SPECIES_TYRANITAR] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_LUGIA] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_HO_OH] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_CELEBI] = BACK_ANIM_SHAKE_GLOW_GREEN, + [SPECIES_TREECKO] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_GROVYLE] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_SCEPTILE] = BACK_ANIM_V_SHAKE, + [SPECIES_TORCHIC] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_COMBUSKEN] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_BLAZIKEN] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_MUDKIP] = BACK_ANIM_H_SLIDE, + [SPECIES_MARSHTOMP] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_SWAMPERT] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_POOCHYENA] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_MIGHTYENA] = BACK_ANIM_H_SHAKE, + [SPECIES_ZIGZAGOON] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_LINOONE] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_WURMPLE] = BACK_ANIM_V_STRETCH, + [SPECIES_SILCOON] = BACK_ANIM_H_SHAKE, + [SPECIES_BEAUTIFLY] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_CASCOON] = BACK_ANIM_H_SHAKE, + [SPECIES_DUSTOX] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_LOTAD] = BACK_ANIM_H_SLIDE, + [SPECIES_LOMBRE] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_LUDICOLO] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_SEEDOT] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_NUZLEAF] = BACK_ANIM_V_SHAKE, + [SPECIES_SHIFTRY] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_NINCADA] = BACK_ANIM_V_SHAKE_H_SLIDE, + [SPECIES_NINJASK] = BACK_ANIM_H_VIBRATE, + [SPECIES_SHEDINJA] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_TAILLOW] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_SWELLOW] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_SHROOMISH] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_BRELOOM] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_SPINDA] = BACK_ANIM_CIRCLE_COUNTERCLOCKWISE, + [SPECIES_WINGULL] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_PELIPPER] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_SURSKIT] = BACK_ANIM_H_SPRING, + [SPECIES_MASQUERAIN] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_WAILMER] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_WAILORD] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_SKITTY] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_DELCATTY] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_KECLEON] = BACK_ANIM_H_VIBRATE, + [SPECIES_BALTOY] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_CLAYDOL] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_NOSEPASS] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_TORKOAL] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_SABLEYE] = BACK_ANIM_H_VIBRATE, + [SPECIES_BARBOACH] = BACK_ANIM_V_STRETCH, + [SPECIES_WHISCASH] = BACK_ANIM_V_SHAKE, + [SPECIES_LUVDISC] = BACK_ANIM_H_SPRING_REPEATED, + [SPECIES_CORPHISH] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_CRAWDAUNT] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_FEEBAS] = BACK_ANIM_H_SPRING, + [SPECIES_MILOTIC] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_CARVANHA] = BACK_ANIM_H_SPRING_REPEATED, + [SPECIES_SHARPEDO] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_TRAPINCH] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_VIBRAVA] = BACK_ANIM_H_VIBRATE, + [SPECIES_FLYGON] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_MAKUHITA] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_HARIYAMA] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_ELECTRIKE] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_MANECTRIC] = BACK_ANIM_V_SHAKE, + [SPECIES_NUMEL] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_CAMERUPT] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_SPHEAL] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_SEALEO] = BACK_ANIM_V_SHAKE, + [SPECIES_WALREIN] = BACK_ANIM_V_SHAKE, + [SPECIES_CACNEA] = BACK_ANIM_V_SHAKE_H_SLIDE, + [SPECIES_CACTURNE] = BACK_ANIM_H_SHAKE, + [SPECIES_SNORUNT] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_GLALIE] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_LUNATONE] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_SOLROCK] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_AZURILL] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_SPOINK] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_GRUMPIG] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_PLUSLE] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_MINUN] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_MAWILE] = BACK_ANIM_V_SHAKE, + [SPECIES_MEDITITE] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_MEDICHAM] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_SWABLU] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_ALTARIA] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_WYNAUT] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_DUSKULL] = BACK_ANIM_H_VIBRATE, + [SPECIES_DUSCLOPS] = BACK_ANIM_H_VIBRATE, + [SPECIES_ROSELIA] = BACK_ANIM_SHAKE_GLOW_GREEN, + [SPECIES_SLAKOTH] = BACK_ANIM_H_SLIDE, + [SPECIES_VIGOROTH] = BACK_ANIM_CONCAVE_ARC_LARGE, + [SPECIES_SLAKING] = BACK_ANIM_H_SHAKE, + [SPECIES_GULPIN] = BACK_ANIM_V_STRETCH, + [SPECIES_SWALOT] = BACK_ANIM_V_STRETCH, + [SPECIES_TROPIUS] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_WHISMUR] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_LOUDRED] = BACK_ANIM_V_SHAKE, + [SPECIES_EXPLOUD] = BACK_ANIM_GROW_STUTTER, + [SPECIES_CLAMPERL] = BACK_ANIM_DIP_RIGHT_SIDE, + [SPECIES_HUNTAIL] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_GOREBYSS] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_ABSOL] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_SHUPPET] = BACK_ANIM_H_VIBRATE, + [SPECIES_BANETTE] = BACK_ANIM_H_VIBRATE, + [SPECIES_SEVIPER] = BACK_ANIM_V_STRETCH, + [SPECIES_ZANGOOSE] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_RELICANTH] = BACK_ANIM_H_SLIDE, + [SPECIES_ARON] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_LAIRON] = BACK_ANIM_V_SHAKE, + [SPECIES_AGGRON] = BACK_ANIM_V_SHAKE_LOW, + [SPECIES_CASTFORM] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_VOLBEAT] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_ILLUMISE] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_LILEEP] = BACK_ANIM_H_STRETCH, + [SPECIES_CRADILY] = BACK_ANIM_V_STRETCH, + [SPECIES_ANORITH] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_ARMALDO] = BACK_ANIM_V_SHAKE, + [SPECIES_RALTS] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_KIRLIA] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_GARDEVOIR] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_BAGON] = BACK_ANIM_V_SHAKE, + [SPECIES_SHELGON] = BACK_ANIM_V_SHAKE, + [SPECIES_SALAMENCE] = BACK_ANIM_H_SHAKE, + [SPECIES_BELDUM] = BACK_ANIM_TRIANGLE_DOWN, + [SPECIES_METANG] = BACK_ANIM_JOLT_RIGHT, + [SPECIES_METAGROSS] = BACK_ANIM_V_SHAKE, + [SPECIES_REGIROCK] = BACK_ANIM_V_SHAKE, + [SPECIES_REGICE] = BACK_ANIM_V_SHAKE, + [SPECIES_REGISTEEL] = BACK_ANIM_V_SHAKE, + [SPECIES_KYOGRE] = BACK_ANIM_SHAKE_GLOW_BLUE, + [SPECIES_GROUDON] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_RAYQUAZA] = BACK_ANIM_GROW_STUTTER, + [SPECIES_LATIAS] = BACK_ANIM_H_VIBRATE, + [SPECIES_LATIOS] = BACK_ANIM_H_VIBRATE, + [SPECIES_JIRACHI] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_DEOXYS] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_CHIMECHO] = BACK_ANIM_CONVEX_DOUBLE_ARC, }; -static const u8 sUnknown_0860AA64[][2] = +static const u8 sFlashYellowData[][2] = { - {0, 5}, - {1, 1}, - {0, 15}, - {1, 4}, - {0, 2}, - {1, 2}, - {0, 2}, - {1, 2}, - {0, 2}, - {1, 2}, - {0, 2}, - {1, 2}, - {0, 2}, - {0, 0xFF} + {FALSE, 5}, + { TRUE, 1}, + {FALSE, 15}, + { TRUE, 4}, + {FALSE, 2}, + { TRUE, 2}, + {FALSE, 2}, + { TRUE, 2}, + {FALSE, 2}, + { TRUE, 2}, + {FALSE, 2}, + { TRUE, 2}, + {FALSE, 2}, + {FALSE, -1} }; static const u8 sUnknown_0860AA80[][2] = { - {6, 30}, - {0xFE, 15}, - {6, 30}, - {0xFF, 0} + { 6, 30}, + {-2, 15}, + { 6, 30}, + {-1, 0} }; static void (* const sMonAnimFunctions[])(struct Sprite *sprite) = { - pokemonanimfunc_00, - pokemonanimfunc_01, - pokemonanimfunc_02, - pokemonanimfunc_03, - pokemonanimfunc_04, - pokemonanimfunc_05, - pokemonanimfunc_06, - pokemonanimfunc_07, - pokemonanimfunc_08, - pokemonanimfunc_09, - pokemonanimfunc_0A, - pokemonanimfunc_0B, - pokemonanimfunc_0C, - pokemonanimfunc_0D, - pokemonanimfunc_0E, - pokemonanimfunc_0F, - pokemonanimfunc_10, - pokemonanimfunc_11, - pokemonanimfunc_12, - pokemonanimfunc_13, - pokemonanimfunc_14, - pokemonanimfunc_15, - pokemonanimfunc_16, - pokemonanimfunc_17, - pokemonanimfunc_18, - pokemonanimfunc_19, - pokemonanimfunc_1A, - pokemonanimfunc_1B, - pokemonanimfunc_1C, - pokemonanimfunc_1D, - pokemonanimfunc_1E, - pokemonanimfunc_1F, - pokemonanimfunc_20, - pokemonanimfunc_21, - pokemonanimfunc_22, - pokemonanimfunc_23, - pokemonanimfunc_24, - pokemonanimfunc_25, - pokemonanimfunc_26, - pokemonanimfunc_27, - pokemonanimfunc_28, - pokemonanimfunc_29, - pokemonanimfunc_2A, - pokemonanimfunc_2B, - pokemonanimfunc_2C, - pokemonanimfunc_2D, - pokemonanimfunc_2E, - pokemonanimfunc_2F, - pokemonanimfunc_30, - pokemonanimfunc_31, - pokemonanimfunc_32, - pokemonanimfunc_33, - pokemonanimfunc_34, - pokemonanimfunc_35, - pokemonanimfunc_36, - pokemonanimfunc_37, - pokemonanimfunc_38, - pokemonanimfunc_39, - pokemonanimfunc_3A, - pokemonanimfunc_3B, - pokemonanimfunc_3C, - pokemonanimfunc_3D, - pokemonanimfunc_3E, - pokemonanimfunc_3F, - pokemonanimfunc_40, - pokemonanimfunc_41, - pokemonanimfunc_42, - pokemonanimfunc_43, - pokemonanimfunc_44, - pokemonanimfunc_45, - pokemonanimfunc_46, - pokemonanimfunc_47, - pokemonanimfunc_48, - pokemonanimfunc_49, - pokemonanimfunc_4A, - pokemonanimfunc_4B, - pokemonanimfunc_4C, - pokemonanimfunc_4D, - pokemonanimfunc_4E, - pokemonanimfunc_4F, - pokemonanimfunc_50, - pokemonanimfunc_51, - pokemonanimfunc_52, - pokemonanimfunc_53, - pokemonanimfunc_54, - pokemonanimfunc_55, - pokemonanimfunc_56, - pokemonanimfunc_57, - pokemonanimfunc_58, - pokemonanimfunc_59, - pokemonanimfunc_5A, - pokemonanimfunc_5B, - pokemonanimfunc_5C, - pokemonanimfunc_5D, - pokemonanimfunc_5E, - pokemonanimfunc_5F, - pokemonanimfunc_60, - pokemonanimfunc_61, - pokemonanimfunc_62, - pokemonanimfunc_63, - pokemonanimfunc_64, - pokemonanimfunc_65, - pokemonanimfunc_66, - pokemonanimfunc_67, - pokemonanimfunc_68, - pokemonanimfunc_69, - pokemonanimfunc_6A, - pokemonanimfunc_6B, - pokemonanimfunc_6C, - pokemonanimfunc_6D, - pokemonanimfunc_6E, - pokemonanimfunc_6F, - pokemonanimfunc_70, - pokemonanimfunc_71, - pokemonanimfunc_72, - pokemonanimfunc_73, - pokemonanimfunc_74, - pokemonanimfunc_75, - pokemonanimfunc_76, - pokemonanimfunc_77, - pokemonanimfunc_78, - pokemonanimfunc_79, - pokemonanimfunc_7A, - pokemonanimfunc_7B, - pokemonanimfunc_7C, - pokemonanimfunc_7D, - pokemonanimfunc_7E, - pokemonanimfunc_7F, - pokemonanimfunc_80, - pokemonanimfunc_81, - pokemonanimfunc_82, - pokemonanimfunc_83, - pokemonanimfunc_84, - pokemonanimfunc_85, - pokemonanimfunc_86, - pokemonanimfunc_87, - pokemonanimfunc_88, - pokemonanimfunc_89, - pokemonanimfunc_8A, - pokemonanimfunc_8B, - pokemonanimfunc_8C, - pokemonanimfunc_8D, - pokemonanimfunc_8E, - pokemonanimfunc_8F, - pokemonanimfunc_90, - pokemonanimfunc_91, - pokemonanimfunc_92, - pokemonanimfunc_93, - pokemonanimfunc_94, - pokemonanimfunc_95, - pokemonanimfunc_96 + [ANIM_V_SQUISH_AND_BOUNCE] = Anim_VerticalSquishBounce, + [ANIM_CIRCULAR_STRETCH_TWICE] = Anim_CircularStretchTwice, + [ANIM_H_VIBRATE] = Anim_HorizontalVibrate, + [ANIM_H_SLIDE] = Anim_HorizontalSlide, + [ANIM_V_SLIDE] = Anim_VerticalSlide, + [ANIM_BOUNCE_ROTATE_TO_SIDES] = Anim_BounceRotateToSides, + [ANIM_V_JUMPS_H_JUMPS] = Anim_VerticalJumpsHorizontalJumps, + [ANIM_ROTATE_TO_SIDES] = Anim_RotateToSides, // Unused + [ANIM_ROTATE_TO_SIDES_TWICE] = Anim_RotateToSides_Twice, + [ANIM_GROW_VIBRATE] = Anim_GrowVibrate, + [ANIM_ZIGZAG_FAST] = Anim_ZigzagFast, + [ANIM_SWING_CONCAVE] = Anim_SwingConcave, + [ANIM_SWING_CONCAVE_FAST] = Anim_SwingConcave_Fast, + [ANIM_SWING_CONVEX] = Anim_SwingConvex, + [ANIM_SWING_CONVEX_FAST] = Anim_SwingConvex_Fast, + [ANIM_H_SHAKE] = Anim_HorizontalShake, + [ANIM_V_SHAKE] = Anim_VerticalShake, + [ANIM_CIRCULAR_VIBRATE] = Anim_CircularVibrate, + [ANIM_TWIST] = Anim_Twist, + [ANIM_SHRINK_GROW] = Anim_ShrinkGrow, + [ANIM_CIRCLE_C_CLOCKWISE] = Anim_CircleCounterclockwise, + [ANIM_GLOW_BLACK] = Anim_GlowBlack, + [ANIM_H_STRETCH] = Anim_HorizontalStretch, + [ANIM_V_STRETCH] = Anim_VerticalStretch, + [ANIM_RISING_WOBBLE] = Anim_RisingWobble, + [ANIM_V_SHAKE_TWICE] = Anim_VerticalShakeTwice, + [ANIM_TIP_MOVE_FORWARD] = Anim_TipMoveForward, + [ANIM_H_PIVOT] = Anim_HorizontalPivot, + [ANIM_V_SLIDE_WOBBLE] = Anim_VerticalSlideWobble, + [ANIM_H_SLIDE_WOBBLE] = Anim_HorizontalSlideWobble, + [ANIM_V_JUMPS_BIG] = Anim_VerticalJumps_Big, + [ANIM_SPIN_LONG] = Anim_Spin_Long, // Unused + [ANIM_GLOW_ORANGE] = Anim_GlowOrange, + [ANIM_GLOW_RED] = Anim_GlowRed, // Unused + [ANIM_GLOW_BLUE] = Anim_GlowBlue, + [ANIM_GLOW_YELLOW] = Anim_GlowYellow, // Unused + [ANIM_GLOW_PURPLE] = Anim_GlowPurple, // Unused + [ANIM_BACK_AND_LUNGE] = Anim_BackAndLunge, + [ANIM_BACK_FLIP] = Anim_BackFlip, // Unused + [ANIM_FLICKER] = Anim_Flicker, // Unused + [ANIM_BACK_FLIP_BIG] = Anim_BackFlipBig, // Unused + [ANIM_FRONT_FLIP] = Anim_FrontFlip, + [ANIM_TUMBLING_FRONT_FLIP] = Anim_TumblingFrontFlip, // Unused + [ANIM_FIGURE_8] = Anim_Figure8, + [ANIM_FLASH_YELLOW] = Anim_FlashYellow, + [ANIM_SWING_CONCAVE_FAST_SHORT] = Anim_SwingConcave_FastShort, + [ANIM_SWING_CONVEX_FAST_SHORT] = Anim_SwingConvex_FastShort, // Unused + [ANIM_ROTATE_UP_SLAM_DOWN] = Anim_RotateUpSlamDown, + [ANIM_DEEP_V_SQUISH_AND_BOUNCE] = Anim_DeepVerticalSquishBounce, + [ANIM_H_JUMPS] = Anim_HorizontalJumps, + [ANIM_H_JUMPS_V_STRETCH] = Anim_HorizontalJumpsVerticalStretch, + [ANIM_ROTATE_TO_SIDES_FAST] = Anim_RotateToSides_Fast, // Unused + [ANIM_ROTATE_UP_TO_SIDES] = Anim_RotateUpToSides, + [ANIM_FLICKER_INCREASING] = Anim_FlickerIncreasing, + [ANIM_TIP_HOP_FORWARD] = Anim_TipHopForward, // Unused + [ANIM_PIVOT_SHAKE] = Anim_PivotShake, // Unused + [ANIM_TIP_AND_SHAKE] = Anim_TipAndShake, // Unused + [ANIM_VIBRATE_TO_CORNERS] = Anim_VibrateToCorners, // Unused + [ANIM_GROW_IN_STAGES] = Anim_GrowInStages, + [ANIM_V_SPRING] = Anim_VerticalSpring, // Unused + [ANIM_V_REPEATED_SPRING] = Anim_VerticalRepeatedSpring, // Unused + [ANIM_SPRING_RISING] = Anim_SpringRising, // Unused + [ANIM_H_SPRING] = Anim_HorizontalSpring, + [ANIM_H_REPEATED_SPRING_SLOW] = Anim_HorizontalRepeatedSpring_Slow, + [ANIM_H_SLIDE_SHRINK] = Anim_HorizontalSlideShrink, // Unused + [ANIM_LUNGE_GROW] = Anim_LungeGrow, + [ANIM_CIRCLE_INTO_BG] = Anim_CircleIntoBackground, + [ANIM_RAPID_H_HOPS] = Anim_RapidHorizontalHops, + [ANIM_FOUR_PETAL] = Anim_FourPetal, + [ANIM_V_SQUISH_AND_BOUNCE_SLOW] = Anim_VerticalSquishBounce_Slow, + [ANIM_H_SLIDE_SLOW] = Anim_HorizontalSlide_Slow, + [ANIM_V_SLIDE_SLOW] = Anim_VerticalSlide_Slow, + [ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL] = Anim_BounceRotateToSides_Small, + [ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW] = Anim_BounceRotateToSides_Slow, + [ANIM_BOUNCE_ROTATE_TO_SIDES_SMALL_SLOW] = Anim_BounceRotateToSides_SmallSlow, + [ANIM_ZIGZAG_SLOW] = Anim_ZigzagSlow, + [ANIM_H_SHAKE_SLOW] = Anim_HorizontalShake_Slow, + [ANIM_V_SHAKE_SLOW] = Anim_VertialShake_Slow, // Unused + [ANIM_TWIST_TWICE] = Anim_Twist_Twice, + [ANIM_CIRCLE_C_CLOCKWISE_SLOW] = Anim_CircleCounterclockwise_Slow, + [ANIM_V_SHAKE_TWICE_SLOW] = Anim_VerticalShakeTwice_Slow, // Unused + [ANIM_V_SLIDE_WOBBLE_SMALL] = Anim_VerticalSlideWobble_Small, + [ANIM_V_JUMPS_SMALL] = Anim_VerticalJumps_Small, + [ANIM_SPIN] = Anim_Spin, + [ANIM_TUMBLING_FRONT_FLIP_TWICE] = Anim_TumblingFrontFlip_Twice, + [ANIM_DEEP_V_SQUISH_AND_BOUNCE_TWICE] = Anim_DeepVerticalSquishBounce_Twice, // Unused + [ANIM_H_JUMPS_V_STRETCH_TWICE] = Anim_HorizontalJumpsVerticalStretch_Twice, + [ANIM_V_SHAKE_BACK] = Anim_VerticalShakeBack, + [ANIM_V_SHAKE_BACK_SLOW] = Anim_VerticalShakeBack_Slow, + [ANIM_V_SHAKE_H_SLIDE_SLOW] = Anim_VerticalShakeHorizontalSlide_Slow, + [ANIM_V_STRETCH_BOTH_ENDS_SLOW] = Anim_VerticalStretchBothEnds_Slow, + [ANIM_H_STRETCH_FAR_SLOW] = Anim_HorizontalStretchFar_Slow, + [ANIM_V_SHAKE_LOW_TWICE] = Anim_VerticalShakeLowTwice, + [ANIM_H_SHAKE_FAST] = Anim_HorizontalShake_Fast, + [ANIM_H_SLIDE_FAST] = Anim_HorizontalSlide_Fast, + [ANIM_H_VIBRATE_FAST] = Anim_HorizontalVibrate_Fast, + [ANIM_H_VIBRATE_FASTEST] = Anim_HorizontalVibrate_Fastest, + [ANIM_V_SHAKE_BACK_FAST] = Anim_VerticalShakeBack_Fast, + [ANIM_V_SHAKE_LOW_TWICE_SLOW] = Anim_VerticalShakeLowTwice_Slow, + [ANIM_V_SHAKE_LOW_TWICE_FAST] = Anim_VerticalShakeLowTwice_Fast, + [ANIM_CIRCLE_C_CLOCKWISE_LONG] = Anim_CircleCounterclockwise_Long, + [ANIM_GROW_STUTTER_SLOW] = Anim_GrowStutter_Slow, + [ANIM_V_SHAKE_H_SLIDE] = Anim_VerticalShakeHorizontalSlide, + [ANIM_V_SHAKE_H_SLIDE_FAST] = Anim_VerticalShakeHorizontalSlide_Fast, + [ANIM_TRIANGLE_DOWN_SLOW] = Anim_TriangleDown_Slow, + [ANIM_TRIANGLE_DOWN] = Anim_TriangleDown, + [ANIM_TRIANGLE_DOWN_TWICE] = Anim_TriangleDown_Fast, + [ANIM_GROW] = Anim_Grow, + [ANIM_GROW_TWICE] = Anim_Grow_Twice, + [ANIM_H_SPRING_FAST] = Anim_HorizontalSpring_Fast, + [ANIM_H_SPRING_SLOW] = Anim_HorizontalSpring_Slow, + [ANIM_H_REPEATED_SPRING_FAST] = Anim_HorizontalRepeatedSpring_Fast, + [ANIM_H_REPEATED_SPRING] = Anim_HorizontalRepeatedSpring, + [ANIM_SHRINK_GROW_FAST] = Anim_ShrinkGrow_Fast, + [ANIM_SHRINK_GROW_SLOW] = Anim_ShrinkGrow_Slow, + [ANIM_V_STRETCH_BOTH_ENDS] = Anim_VerticalStretchBothEnds, + [ANIM_V_STRETCH_BOTH_ENDS_TWICE] = Anim_VerticalStretchBothEnds_Twice, + [ANIM_H_STRETCH_FAR_TWICE] = Anim_HorizontalStretchFar_Twice, + [ANIM_H_STRETCH_FAR] = Anim_HorizontalStretchFar, + [ANIM_GROW_STUTTER_TWICE] = Anim_GrowStutter_Twice, + [ANIM_GROW_STUTTER] = Anim_GrowStutter, + [ANIM_CONCAVE_ARC_LARGE_SLOW] = Anim_ConcaveArcLarge_Slow, + [ANIM_CONCAVE_ARC_LARGE] = Anim_ConcaveArcLarge, + [ANIM_CONCAVE_ARC_LARGE_TWICE] = Anim_ConcaveArcLarge_Twice, + [ANIM_CONVEX_DOUBLE_ARC_SLOW] = Anim_ConvexDoubleArc_Slow, + [ANIM_CONVEX_DOUBLE_ARC] = Anim_ConvexDoubleArc, + [ANIM_CONVEX_DOUBLE_ARC_TWICE] = Anim_ConvexDoubleArc_Twice, + [ANIM_CONCAVE_ARC_SMALL_SLOW] = Anim_ConcaveArcSmall_Slow, + [ANIM_CONCAVE_ARC_SMALL] = Anim_ConcaveArcSmall, + [ANIM_CONCAVE_ARC_SMALL_TWICE] = Anim_ConcaveArcSmall_Twice, + [ANIM_H_DIP] = Anim_HorizontalDip, + [ANIM_H_DIP_FAST] = Anim_HorizontalDip_Fast, + [ANIM_H_DIP_TWICE] = Anim_HorizontalDip_Twice, + [ANIM_SHRINK_GROW_VIBRATE_FAST] = Anim_ShrinkGrowVibrate_Fast, + [ANIM_SHRINK_GROW_VIBRATE] = Anim_ShrinkGrowVibrate, + [ANIM_SHRINK_GROW_VIBRATE_SLOW] = Anim_ShrinkGrowVibrate_Slow, + [ANIM_JOLT_RIGHT_FAST] = Anim_JoltRight_Fast, + [ANIM_JOLT_RIGHT] = Anim_JoltRight, + [ANIM_JOLT_RIGHT_SLOW] = Anim_JoltRight_Slow, + [ANIM_SHAKE_FLASH_YELLOW_FAST] = Anim_ShakeFlashYellow_Fast, + [ANIM_SHAKE_FLASH_YELLOW] = Anim_ShakeFlashYellow, + [ANIM_SHAKE_FLASH_YELLOW_SLOW] = Anim_ShakeFlashYellow_Slow, + [ANIM_SHAKE_GLOW_RED_FAST] = Anim_ShakeGlowRed_Fast, + [ANIM_SHAKE_GLOW_RED] = Anim_ShakeGlowRed, + [ANIM_SHAKE_GLOW_RED_SLOW] = Anim_ShakeGlowRed_Slow, + [ANIM_SHAKE_GLOW_GREEN_FAST] = Anim_ShakeGlowGreen_Fast, + [ANIM_SHAKE_GLOW_GREEN] = Anim_ShakeGlowGreen, + [ANIM_SHAKE_GLOW_GREEN_SLOW] = Anim_ShakeGlowGreen_Slow, + [ANIM_SHAKE_GLOW_BLUE_FAST] = Anim_ShakeGlowBlue_Fast, + [ANIM_SHAKE_GLOW_BLUE] = Anim_ShakeGlowBlue, + [ANIM_SHAKE_GLOW_BLUE_SLOW] = Anim_ShakeGlowBlue_Slow }; -// counting from Id 1, because 0 in sSpeciesToBackAnimSet is used for mons with no back animation +// Each back anim set has 3 possible animations depending on nature +// Each of the 3 animations is a slight variation of the others +// BACK_ANIM_NONE is skipped below. GetSpeciesBackAnimSet subtracts 1 from the back anim id static const u8 sBackAnimationIds[] = { - 0x60, 0x5f, 0x02, // 1 - 0x5e, 0x03, 0x46, // 2 - 0x6d, 0x3e, 0x6e, // 3 - 0x6f, 0x70, 0x3f, // 4 - 0x71, 0x13, 0x72, // 5 - 0x6c, 0x6b, 0x3a, // 6 - 0x64, 0x14, 0x4f, // 7 - 0x5d, 0x0f, 0x4c, // 8 - 0x61, 0x57, 0x58, // 9 - 0x67, 0x66, 0x59, // 0xA - 0x74, 0x73, 0x5a, // 0xB - 0x75, 0x76, 0x5b, // 0xC - 0x77, 0x78, 0x65, // 0xD - 0x63, 0x5c, 0x62, // 0xE - 0x6a, 0x69, 0x68, // 0xF - 0x7b, 0x7a, 0x79, // 0x10 - 0x7e, 0x7d, 0x7c, // 0x11 - 0x81, 0x80, 0x7f, // 0x12 - 0x84, 0x82, 0x83, // 0x13 - 0x85, 0x86, 0x87, // 0x14 - 0x88, 0x89, 0x8a, // 0x15 - 0x8b, 0x8c, 0x8d, // 0x16 - 0x8e, 0x8f, 0x90, // 0x17 - 0x91, 0x92, 0x93, // 0x18 - 0x94, 0x95, 0x96, // 0x19 + [(BACK_ANIM_H_VIBRATE - 1) * 3] = ANIM_H_VIBRATE_FASTEST, ANIM_H_VIBRATE_FAST, ANIM_H_VIBRATE, + [(BACK_ANIM_H_SLIDE - 1) * 3] = ANIM_H_SLIDE_FAST, ANIM_H_SLIDE, ANIM_H_SLIDE_SLOW, + [(BACK_ANIM_H_SPRING - 1) * 3] = ANIM_H_SPRING_FAST, ANIM_H_SPRING, ANIM_H_SPRING_SLOW, + [(BACK_ANIM_H_SPRING_REPEATED - 1) * 3] = ANIM_H_REPEATED_SPRING_FAST, ANIM_H_REPEATED_SPRING, ANIM_H_REPEATED_SPRING_SLOW, + [(BACK_ANIM_SHRINK_GROW - 1) * 3] = ANIM_SHRINK_GROW_FAST, ANIM_SHRINK_GROW, ANIM_SHRINK_GROW_SLOW, + [(BACK_ANIM_GROW - 1) * 3] = ANIM_GROW_TWICE, ANIM_GROW, ANIM_GROW_IN_STAGES, + [(BACK_ANIM_CIRCLE_COUNTERCLOCKWISE - 1) * 3] = ANIM_CIRCLE_C_CLOCKWISE_LONG, ANIM_CIRCLE_C_CLOCKWISE, ANIM_CIRCLE_C_CLOCKWISE_SLOW, + [(BACK_ANIM_H_SHAKE - 1) * 3] = ANIM_H_SHAKE_FAST, ANIM_H_SHAKE, ANIM_H_SHAKE_SLOW, + [(BACK_ANIM_V_SHAKE - 1) * 3] = ANIM_V_SHAKE_BACK_FAST, ANIM_V_SHAKE_BACK, ANIM_V_SHAKE_BACK_SLOW, + [(BACK_ANIM_V_SHAKE_H_SLIDE - 1) * 3] = ANIM_V_SHAKE_H_SLIDE_FAST, ANIM_V_SHAKE_H_SLIDE, ANIM_V_SHAKE_H_SLIDE_SLOW, + [(BACK_ANIM_V_STRETCH - 1) * 3] = ANIM_V_STRETCH_BOTH_ENDS_TWICE, ANIM_V_STRETCH_BOTH_ENDS, ANIM_V_STRETCH_BOTH_ENDS_SLOW, + [(BACK_ANIM_H_STRETCH - 1) * 3] = ANIM_H_STRETCH_FAR_TWICE, ANIM_H_STRETCH_FAR, ANIM_H_STRETCH_FAR_SLOW, + [(BACK_ANIM_GROW_STUTTER - 1) * 3] = ANIM_GROW_STUTTER_TWICE, ANIM_GROW_STUTTER, ANIM_GROW_STUTTER_SLOW, + [(BACK_ANIM_V_SHAKE_LOW - 1) * 3] = ANIM_V_SHAKE_LOW_TWICE_FAST, ANIM_V_SHAKE_LOW_TWICE, ANIM_V_SHAKE_LOW_TWICE_SLOW, + [(BACK_ANIM_TRIANGLE_DOWN - 1) * 3] = ANIM_TRIANGLE_DOWN_TWICE, ANIM_TRIANGLE_DOWN, ANIM_TRIANGLE_DOWN_SLOW, + [(BACK_ANIM_CONCAVE_ARC_LARGE - 1) * 3] = ANIM_CONCAVE_ARC_LARGE_TWICE, ANIM_CONCAVE_ARC_LARGE, ANIM_CONCAVE_ARC_LARGE_SLOW, + [(BACK_ANIM_CONVEX_DOUBLE_ARC - 1) * 3] = ANIM_CONVEX_DOUBLE_ARC_TWICE, ANIM_CONVEX_DOUBLE_ARC, ANIM_CONVEX_DOUBLE_ARC_SLOW, + [(BACK_ANIM_CONCAVE_ARC_SMALL - 1) * 3] = ANIM_CONCAVE_ARC_SMALL_TWICE, ANIM_CONCAVE_ARC_SMALL, ANIM_CONCAVE_ARC_SMALL_SLOW, + [(BACK_ANIM_DIP_RIGHT_SIDE - 1) * 3] = ANIM_H_DIP_TWICE, ANIM_H_DIP, ANIM_H_DIP_FAST, + [(BACK_ANIM_SHRINK_GROW_VIBRATE - 1) * 3] = ANIM_SHRINK_GROW_VIBRATE_FAST, ANIM_SHRINK_GROW_VIBRATE, ANIM_SHRINK_GROW_VIBRATE_SLOW, + [(BACK_ANIM_JOLT_RIGHT - 1) * 3] = ANIM_JOLT_RIGHT_FAST, ANIM_JOLT_RIGHT, ANIM_JOLT_RIGHT_SLOW, + [(BACK_ANIM_SHAKE_FLASH_YELLOW - 1) * 3] = ANIM_SHAKE_FLASH_YELLOW_FAST, ANIM_SHAKE_FLASH_YELLOW, ANIM_SHAKE_FLASH_YELLOW_SLOW, + [(BACK_ANIM_SHAKE_GLOW_RED - 1) * 3] = ANIM_SHAKE_GLOW_RED_FAST, ANIM_SHAKE_GLOW_RED, ANIM_SHAKE_GLOW_RED_SLOW, + [(BACK_ANIM_SHAKE_GLOW_GREEN - 1) * 3] = ANIM_SHAKE_GLOW_GREEN_FAST, ANIM_SHAKE_GLOW_GREEN, ANIM_SHAKE_GLOW_GREEN_SLOW, + [(BACK_ANIM_SHAKE_GLOW_BLUE - 1) * 3] = ANIM_SHAKE_GLOW_BLUE_FAST, ANIM_SHAKE_GLOW_BLUE, ANIM_SHAKE_GLOW_BLUE_SLOW, }; static const u8 sBackAnimNatureModTable[NUM_NATURES] = { - [NATURE_HARDY] = 0x00, - [NATURE_LONELY] = 0x02, - [NATURE_BRAVE] = 0x00, - [NATURE_ADAMANT] = 0x00, - [NATURE_NAUGHTY] = 0x00, - [NATURE_BOLD] = 0x01, - [NATURE_DOCILE] = 0x01, - [NATURE_RELAXED] = 0x01, - [NATURE_IMPISH] = 0x00, - [NATURE_LAX] = 0x01, - [NATURE_TIMID] = 0x02, - [NATURE_HASTY] = 0x00, - [NATURE_SERIOUS] = 0x01, - [NATURE_JOLLY] = 0x00, - [NATURE_NAIVE] = 0x00, - [NATURE_MODEST] = 0x02, - [NATURE_MILD] = 0x02, - [NATURE_QUIET] = 0x02, - [NATURE_BASHFUL] = 0x02, - [NATURE_RASH] = 0x01, - [NATURE_CALM] = 0x01, - [NATURE_GENTLE] = 0x02, - [NATURE_SASSY] = 0x01, - [NATURE_CAREFUL] = 0x02, - [NATURE_QUIRKY] = 0x01, + [NATURE_HARDY] = 0, + [NATURE_LONELY] = 2, + [NATURE_BRAVE] = 0, + [NATURE_ADAMANT] = 0, + [NATURE_NAUGHTY] = 0, + [NATURE_BOLD] = 1, + [NATURE_DOCILE] = 1, + [NATURE_RELAXED] = 1, + [NATURE_IMPISH] = 0, + [NATURE_LAX] = 1, + [NATURE_TIMID] = 2, + [NATURE_HASTY] = 0, + [NATURE_SERIOUS] = 1, + [NATURE_JOLLY] = 0, + [NATURE_NAIVE] = 0, + [NATURE_MODEST] = 2, + [NATURE_MILD] = 2, + [NATURE_QUIET] = 2, + [NATURE_BASHFUL] = 2, + [NATURE_RASH] = 1, + [NATURE_CALM] = 1, + [NATURE_GENTLE] = 2, + [NATURE_SASSY] = 1, + [NATURE_CAREFUL] = 2, + [NATURE_QUIRKY] = 1, }; static const union AffineAnimCmd sSpriteAffineAnim_860AD48[] = @@ -854,7 +877,7 @@ static void sub_817F3F0(struct Sprite *sprite, u16 index, s16 amplitudeX, s16 am u8 GetSpeciesBackAnimSet(u16 species) { - if (sSpeciesToBackAnimSet[species] != 0) + if (sSpeciesToBackAnimSet[species] != BACK_ANIM_NONE) return sSpeciesToBackAnimSet[species] - 1; else return 0; @@ -864,8 +887,8 @@ u8 GetSpeciesBackAnimSet(u16 species) #define tPtrHi data[1] #define tPtrLo data[2] #define tAnimId data[3] -#define tSaved0 data[4] -#define tSaved2 data[5] +#define tBattlerId data[4] +#define tSpeciesId data[5] // BUG: In vanilla, tPtrLo is read as an s16, so if bit 15 of the // address were to be set it would cause the pointer to be read @@ -885,23 +908,23 @@ static void Task_HandleMonAnimation(u8 taskId) if (gTasks[taskId].tState == 0) { - gTasks[taskId].tSaved0 = sprite->data[0]; - gTasks[taskId].tSaved2 = sprite->data[2]; - sprite->data[1] = 1; + gTasks[taskId].tBattlerId = sprite->data[0]; + gTasks[taskId].tSpeciesId = sprite->data[2]; + sprite->sDontFlip = TRUE; sprite->data[0] = 0; for (i = 2; i < ARRAY_COUNT(sprite->data); i++) sprite->data[i] = 0; sprite->callback = sMonAnimFunctions[gTasks[taskId].tAnimId]; - sUnknown_03001274 = FALSE; + sIsSummaryAnim = FALSE; gTasks[taskId].tState++; } if (sprite->callback == SpriteCallbackDummy) { - sprite->data[0] = gTasks[taskId].tSaved0; - sprite->data[2] = gTasks[taskId].tSaved2; + sprite->data[0] = gTasks[taskId].tBattlerId; + sprite->data[2] = gTasks[taskId].tSpeciesId; sprite->data[1] = 0; DestroyTask(taskId); @@ -911,14 +934,15 @@ static void Task_HandleMonAnimation(u8 taskId) void LaunchAnimationTaskForFrontSprite(struct Sprite *sprite, u8 frontAnimId) { u8 taskId = CreateTask(Task_HandleMonAnimation, 128); - gTasks[taskId].tPtrHi = (u32)(sprite) >> 0x10; + gTasks[taskId].tPtrHi = (u32)(sprite) >> 16; gTasks[taskId].tPtrLo = (u32)(sprite); gTasks[taskId].tAnimId = frontAnimId; } void StartMonSummaryAnimation(struct Sprite *sprite, u8 frontAnimId) { - sUnknown_03001274 = TRUE; + // sDontFlip is expected to still be FALSE here, not explicitly cleared + sIsSummaryAnim = TRUE; sprite->callback = sMonAnimFunctions[frontAnimId]; } @@ -927,12 +951,13 @@ void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet) u8 nature, taskId, animId, battlerId; taskId = CreateTask(Task_HandleMonAnimation, 128); - gTasks[taskId].tPtrHi = (u32)(sprite) >> 0x10; + gTasks[taskId].tPtrHi = (u32)(sprite) >> 16; gTasks[taskId].tPtrLo = (u32)(sprite); battlerId = sprite->data[0]; nature = GetNature(&gPlayerParty[gBattlerPartyIndexes[battlerId]]); + // * 3 below because each back anim has 3 variants depending on nature animId = 3 * backAnimSet + sBackAnimNatureModTable[nature]; gTasks[taskId].tAnimId = sBackAnimationIds[animId]; } @@ -941,8 +966,8 @@ void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet) #undef tPtrHi #undef tPtrLo #undef tAnimId -#undef tSaved0 -#undef tSaved2 +#undef tBattlerId +#undef tSpeciesId void SetSpriteCB_MonAnimDummy(struct Sprite *sprite) { @@ -973,21 +998,21 @@ static void HandleStartAffineAnim(struct Sprite *sprite) sprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; sprite->affineAnims = sSpriteAffineAnimTable_860AD68; - if (sUnknown_03001274 == TRUE) + if (sIsSummaryAnim == TRUE) InitSpriteAffineAnim(sprite); - if (!sprite->data[1]) + if (!sprite->sDontFlip) StartSpriteAffineAnim(sprite, 1); else StartSpriteAffineAnim(sprite, 0); CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); - sprite->affineAnimPaused = 1; + sprite->affineAnimPaused = TRUE; } static void HandleSetAffineData(struct Sprite *sprite, s16 xScale, s16 yScale, u16 rotation) { - if (!sprite->data[1]) + if (!sprite->sDontFlip) { xScale *= -1; rotation *= -1; @@ -996,47 +1021,47 @@ static void HandleSetAffineData(struct Sprite *sprite, s16 xScale, s16 yScale, u SetAffineData(sprite, xScale, yScale, rotation); } -static void sub_817F70C(struct Sprite *sprite) +static void TryFlipX(struct Sprite *sprite) { - if (!sprite->data[1]) + if (!sprite->sDontFlip) sprite->pos2.x *= -1; } -static bool32 sub_817F724(u8 id) +static bool32 InitAnimData(u8 id) { - if (id >= STRUCT_COUNT) + if (id >= MAX_BATTLERS_COUNT) { return FALSE; } else { - sUnknown_03001240[id].field_6 = 0; - sUnknown_03001240[id].field_0 = 0; - sUnknown_03001240[id].field_4 = 1; - sUnknown_03001240[id].field_2 = 0; - sUnknown_03001240[id].field_8 = 0; + sAnims[id].field_6 = 0; + sAnims[id].field_0 = 0; + sAnims[id].field_4 = 1; + sAnims[id].field_2 = 0; + sAnims[id].field_8 = 0; return TRUE; } } -static u8 sub_817F758(void) +static u8 AddNewAnim(void) { - sUnknown_03001270 = (sUnknown_03001270 + 1) % STRUCT_COUNT; - sub_817F724(sUnknown_03001270); - return sUnknown_03001270; + sAnimIdx = (sAnimIdx + 1) % MAX_BATTLERS_COUNT; + InitAnimData(sAnimIdx); + return sAnimIdx; } -static void sub_817F77C(struct Sprite *sprite) +static void ResetSpriteAfterAnim(struct Sprite *sprite) { sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL; CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); - if (sUnknown_03001274 == TRUE) + if (sIsSummaryAnim == TRUE) { - if (!sprite->data[1]) - sprite->hFlip = 1; + if (!sprite->sDontFlip) + sprite->hFlip = TRUE; else - sprite->hFlip = 0; + sprite->hFlip = FALSE; FreeOamMatrix(sprite->oam.matrixNum); sprite->oam.matrixNum |= (sprite->hFlip << 3); @@ -1052,7 +1077,7 @@ static void sub_817F77C(struct Sprite *sprite) #endif // BUGFIX } -static void pokemonanimfunc_01(struct Sprite *sprite) +static void Anim_CircularStretchTwice(struct Sprite *sprite) { if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); @@ -1060,8 +1085,8 @@ static void pokemonanimfunc_01(struct Sprite *sprite) if (sprite->data[2] > 40) { HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -1075,11 +1100,11 @@ static void pokemonanimfunc_01(struct Sprite *sprite) sprite->data[2]++; } -static void pokemonanimfunc_02(struct Sprite *sprite) +static void Anim_HorizontalVibrate(struct Sprite *sprite) { if (sprite->data[2] > 40) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.x = 0; } else @@ -1096,13 +1121,13 @@ static void pokemonanimfunc_02(struct Sprite *sprite) sprite->data[2]++; } -static void sub_817F8FC(struct Sprite *sprite) +static void HorizontalSlide(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] > sprite->data[0]) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.x = 0; } else @@ -1111,23 +1136,23 @@ static void sub_817F8FC(struct Sprite *sprite) } sprite->data[2]++; - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_03(struct Sprite *sprite) +static void Anim_HorizontalSlide(struct Sprite *sprite) { sprite->data[0] = 40; - sub_817F8FC(sprite); - sprite->callback = sub_817F8FC; + HorizontalSlide(sprite); + sprite->callback = HorizontalSlide; } -static void sub_817F978(struct Sprite *sprite) +static void VerticalSlide(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] > sprite->data[0]) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.y = 0; } else @@ -1136,22 +1161,22 @@ static void sub_817F978(struct Sprite *sprite) } sprite->data[2]++; - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_04(struct Sprite *sprite) +static void Anim_VerticalSlide(struct Sprite *sprite) { sprite->data[0] = 40; - sub_817F978(sprite); - sprite->callback = sub_817F978; + VerticalSlide(sprite); + sprite->callback = VerticalSlide; } -static void sub_817F9F4(struct Sprite *sprite) +static void VerticalJumps(struct Sprite *sprite) { s32 counter = sprite->data[2]; if (counter > 384) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.x = 0; sprite->pos2.y = 0; } @@ -1175,20 +1200,20 @@ static void sub_817F9F4(struct Sprite *sprite) sprite->data[2] += 12; } -static void pokemonanimfunc_1E(struct Sprite *sprite) +static void Anim_VerticalJumps_Big(struct Sprite *sprite) { sprite->data[0] = 4; - sub_817F9F4(sprite); - sprite->callback = sub_817F9F4; + VerticalJumps(sprite); + sprite->callback = VerticalJumps; } -static void pokemonanimfunc_06(struct Sprite *sprite) +static void Anim_VerticalJumpsHorizontalJumps(struct Sprite *sprite) { s32 counter = sprite->data[2]; if (counter > 768) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.x = 0; sprite->pos2.y = 0; } @@ -1222,7 +1247,7 @@ static void pokemonanimfunc_06(struct Sprite *sprite) sprite->data[2] += 12; } -static void pokemonanimfunc_09(struct Sprite *sprite) +static void Anim_GrowVibrate(struct Sprite *sprite) { if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); @@ -1230,8 +1255,8 @@ static void pokemonanimfunc_09(struct Sprite *sprite) if (sprite->data[2] > 40) { HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -1254,32 +1279,33 @@ static void pokemonanimfunc_09(struct Sprite *sprite) sprite->data[2]++; } -static const s8 sUnknown_0860AD70[][3] = +// x delta, y delta, time +static const s8 sZigzagData[][3] = { {-1, -1, 6}, - {2, 0, 6}, + { 2, 0, 6}, {-2, 2, 6}, - {2, 0, 6}, + { 2, 0, 6}, {-2, -2, 6}, - {2, 0, 6}, + { 2, 0, 6}, {-2, 2, 6}, - {2, 0, 6}, + { 2, 0, 6}, {-1, -1, 6}, - {0, 0, 0}, + { 0, 0, 0}, }; -static void sub_817FC20(struct Sprite *sprite) +static void Zigzag(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] == 0) sprite->data[3] = 0; - if (sUnknown_0860AD70[sprite->data[3]][2] == sprite->data[2]) + if (sZigzagData[sprite->data[3]][2] == sprite->data[2]) { - if (sUnknown_0860AD70[sprite->data[3]][2] == 0) + if (sZigzagData[sprite->data[3]][2] == 0) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; } else { @@ -1288,32 +1314,32 @@ static void sub_817FC20(struct Sprite *sprite) } } - if (sUnknown_0860AD70[sprite->data[3]][2] == 0) + if (sZigzagData[sprite->data[3]][2] == 0) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; } else { - sprite->pos2.x += sUnknown_0860AD70[sprite->data[3]][0]; - sprite->pos2.y += sUnknown_0860AD70[sprite->data[3]][1]; + sprite->pos2.x += sZigzagData[sprite->data[3]][0]; + sprite->pos2.y += sZigzagData[sprite->data[3]][1]; sprite->data[2]++; - sub_817F70C(sprite); + TryFlipX(sprite); } } -static void pokemonanimfunc_0A(struct Sprite *sprite) +static void Anim_ZigzagFast(struct Sprite *sprite) { - sub_817FC20(sprite); - sprite->callback = sub_817FC20; + Zigzag(sprite); + sprite->callback = Zigzag; } -static void sub_817FCDC(struct Sprite *sprite) +static void HorizontalShake(struct Sprite *sprite) { s32 counter = sprite->data[2]; if (counter > 2304) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.x = 0; } else @@ -1324,21 +1350,21 @@ static void sub_817FCDC(struct Sprite *sprite) sprite->data[2] += sprite->data[0]; } -static void pokemonanimfunc_0F(struct Sprite *sprite) +static void Anim_HorizontalShake(struct Sprite *sprite) { sprite->data[0] = 60; sprite->data[7] = 3; - sub_817FCDC(sprite); - sprite->callback = sub_817FCDC; + HorizontalShake(sprite); + sprite->callback = HorizontalShake; } -static void sub_817FD44(struct Sprite *sprite) +static void VerticalShake(struct Sprite *sprite) { s32 counter = sprite->data[2]; if (counter > 2304) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.y = 0; } else @@ -1349,18 +1375,18 @@ static void sub_817FD44(struct Sprite *sprite) sprite->data[2] += sprite->data[0]; } -static void pokemonanimfunc_10(struct Sprite *sprite) +static void Anim_VerticalShake(struct Sprite *sprite) { sprite->data[0] = 60; - sub_817FD44(sprite); - sprite->callback = sub_817FD44; + VerticalShake(sprite); + sprite->callback = VerticalShake; } -static void pokemonanimfunc_11(struct Sprite *sprite) +static void Anim_CircularVibrate(struct Sprite *sprite) { if (sprite->data[2] > 512) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.x = 0; sprite->pos2.y = 0; } @@ -1384,36 +1410,36 @@ static void pokemonanimfunc_11(struct Sprite *sprite) sprite->data[2] += 9; } -static void sub_817FE30(struct Sprite *sprite) +static void Twist(struct Sprite *sprite) { s16 id = sprite->data[0]; - if (sUnknown_03001240[id].field_0 != 0) + if (sAnims[id].field_0 != 0) { - sUnknown_03001240[id].field_0--; + sAnims[id].field_0--; } else { - if (sprite->data[2] == 0 && sUnknown_03001240[id].field_8 == 0) + if (sprite->data[2] == 0 && sAnims[id].field_8 == 0) { HandleStartAffineAnim(sprite); - sUnknown_03001240[id].field_8++; + sAnims[id].field_8++; } - if (sprite->data[2] > sUnknown_03001240[id].field_6) + if (sprite->data[2] > sAnims[id].field_6) { HandleSetAffineData(sprite, 256, 256, 0); - if (sUnknown_03001240[id].field_4 > 1) + if (sAnims[id].field_4 > 1) { - sUnknown_03001240[id].field_4--; - sUnknown_03001240[id].field_0 = 10; + sAnims[id].field_4--; + sAnims[id].field_0 = 10; sprite->data[2] = 0; } else { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } } else @@ -1426,103 +1452,107 @@ static void sub_817FE30(struct Sprite *sprite) } } -static void pokemonanimfunc_12(struct Sprite *sprite) +static void Anim_Twist(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_6 = 512; - sUnknown_03001240[id].field_0 = 0; - sub_817FE30(sprite); - sprite->callback = sub_817FE30; + sAnims[id].field_6 = 512; + sAnims[id].field_0 = 0; + Twist(sprite); + sprite->callback = Twist; } -static void sub_817FF3C(struct Sprite *sprite) +static void Spin(struct Sprite *sprite) { u8 id = sprite->data[0]; if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); - if (sprite->data[2] > sUnknown_03001240[id].field_0) + if (sprite->data[2] > sAnims[id].field_0) { HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { - sprite->data[6] = (65536 / sUnknown_03001240[id].field_8) * sprite->data[2]; + sprite->data[6] = (65536 / sAnims[id].field_8) * sprite->data[2]; HandleSetAffineData(sprite, 256, 256, sprite->data[6]); } sprite->data[2]++; } -static void pokemonanimfunc_1F(struct Sprite *sprite) +static void Anim_Spin_Long(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_0 = 60; - sUnknown_03001240[id].field_8 = 20; - sub_817FF3C(sprite); - sprite->callback = sub_817FF3C; + sAnims[id].field_0 = 60; + sAnims[id].field_8 = 20; + Spin(sprite); + sprite->callback = Spin; } -static void sub_817FFF0(struct Sprite *sprite) +static void CircleCounterclockwise(struct Sprite *sprite) { u8 id = sprite->data[0]; - sub_817F70C(sprite); + TryFlipX(sprite); - if (sprite->data[2] > sUnknown_03001240[id].field_6) + if (sprite->data[2] > sAnims[id].field_6) { sprite->pos2.x = 0; sprite->pos2.y = 0; - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; } else { s16 index = (sprite->data[2] + 192) % 256; - sprite->pos2.x = -(Cos(index, sUnknown_03001240[id].field_8 * 2)); - sprite->pos2.y = Sin(index, sUnknown_03001240[id].field_8) + sUnknown_03001240[id].field_8; + sprite->pos2.x = -(Cos(index, sAnims[id].field_8 * 2)); + sprite->pos2.y = Sin(index, sAnims[id].field_8) + sAnims[id].field_8; } - sprite->data[2] += sUnknown_03001240[id].field_2; - sub_817F70C(sprite); + sprite->data[2] += sAnims[id].field_2; + TryFlipX(sprite); } -static void pokemonanimfunc_14(struct Sprite *sprite) +static void Anim_CircleCounterclockwise(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_6 = 512; - sUnknown_03001240[id].field_8 = 6; - sUnknown_03001240[id].field_2 = 24; - sub_817FFF0(sprite); - sprite->callback = sub_817FFF0; + sAnims[id].field_6 = 512; + sAnims[id].field_8 = 6; + sAnims[id].field_2 = 24; + CircleCounterclockwise(sprite); + sprite->callback = CircleCounterclockwise; } -static void pokemonanimfunc_15(struct Sprite *sprite) +#define GlowColor(color, colorIncrement, speed) \ +{ \ + if (sprite->data[2] == 0) \ + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; \ + \ + if (sprite->data[2] > 128) \ + { \ + BlendPalette(sprite->data[7], 16, 0, (color)); \ + sprite->callback = WaitAnimEnd; \ + } \ + else \ + { \ + sprite->data[6] = Sin(sprite->data[2], (colorIncrement)); \ + BlendPalette(sprite->data[7], 16, sprite->data[6], (color)); \ + } \ + sprite->data[2] += (speed); \ +} + +static void Anim_GlowBlack(struct Sprite *sprite) { - if (sprite->data[2] == 0) - sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; - - if (sprite->data[2] > 128) - { - BlendPalette(sprite->data[7], 0x10, 0, RGB_BLACK); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; - } - else - { - sprite->data[6] = Sin(sprite->data[2], 16); - BlendPalette(sprite->data[7], 0x10, sprite->data[6], RGB_BLACK); - } - - sprite->data[2]++; + GlowColor(RGB_BLACK, 16, 1); } -static void pokemonanimfunc_16(struct Sprite *sprite) +static void Anim_HorizontalStretch(struct Sprite *sprite) { s16 index1 = 0, index2 = 0; @@ -1532,8 +1562,8 @@ static void pokemonanimfunc_16(struct Sprite *sprite) if (sprite->data[2] > 40) { HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -1545,7 +1575,7 @@ static void pokemonanimfunc_16(struct Sprite *sprite) index1 = 0xFF & sprite->data[7]; } - if (sprite->data[1] == 0) + if (!sprite->sDontFlip) sprite->data[4] = (Sin(index2, 40) - 256) + Sin(index1, 16); else sprite->data[4] = (256 - Sin(index2, 40)) - Sin(index1, 16); @@ -1557,7 +1587,7 @@ static void pokemonanimfunc_16(struct Sprite *sprite) sprite->data[2]++; } -static void pokemonanimfunc_17(struct Sprite *sprite) +static void Anim_VerticalStretch(struct Sprite *sprite) { s16 posY = 0, index1 = 0, index2 = 0; @@ -1567,8 +1597,8 @@ static void pokemonanimfunc_17(struct Sprite *sprite) if (sprite->data[2] > 40) { HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; sprite->pos2.y = posY; } else @@ -1581,7 +1611,7 @@ static void pokemonanimfunc_17(struct Sprite *sprite) index1 = 0xFF & sprite->data[7]; } - if (sprite->data[1] == 0) + if (!sprite->sDontFlip) sprite->data[4] = -(Sin(index2, 16)) - 256; else sprite->data[4] = Sin(index2, 16) + 256; @@ -1598,7 +1628,7 @@ static void pokemonanimfunc_17(struct Sprite *sprite) sprite->data[2]++; } -static void sub_818031C(struct Sprite *sprite) +static void VerticalShakeTwice(struct Sprite *sprite) { u8 index = sprite->data[2]; u8 var7 = sprite->data[6]; @@ -1606,14 +1636,14 @@ static void sub_818031C(struct Sprite *sprite) u8 var6 = sUnknown_0860AA80[sprite->data[5]][1]; u8 amplitude = 0; - if (var5 != 0xFE) + if (var5 != (u8)-2) amplitude = (var6 - var7) * var5 / var6; else amplitude = 0; - if (var5 == 0xFF) + if (var5 == (u8)-1) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.y = 0; } else @@ -1633,18 +1663,18 @@ static void sub_818031C(struct Sprite *sprite) } } -static void pokemonanimfunc_19(struct Sprite *sprite) +static void Anim_VerticalShakeTwice(struct Sprite *sprite) { sprite->data[0] = 48; - sub_818031C(sprite); - sprite->callback = sub_818031C; + VerticalShakeTwice(sprite); + sprite->callback = VerticalShakeTwice; } -static void pokemonanimfunc_1A(struct Sprite *sprite) +static void Anim_TipMoveForward(struct Sprite *sprite) { u8 counter = 0; - sub_817F70C(sprite); + TryFlipX(sprite); counter = sprite->data[2]; if (sprite->data[2] == 0) @@ -1653,8 +1683,8 @@ static void pokemonanimfunc_1A(struct Sprite *sprite) if (sprite->data[2] > 35) { HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; sprite->pos2.x = 0; } else @@ -1670,10 +1700,10 @@ static void pokemonanimfunc_1A(struct Sprite *sprite) } sprite->data[2]++; - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_1B(struct Sprite *sprite) +static void Anim_HorizontalPivot(struct Sprite *sprite) { if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); @@ -1682,8 +1712,8 @@ static void pokemonanimfunc_1B(struct Sprite *sprite) { HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.y = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -1695,7 +1725,7 @@ static void pokemonanimfunc_1B(struct Sprite *sprite) sprite->data[2]++; } -static void sub_81804F8(struct Sprite *sprite) +static void VerticalSlideWobble(struct Sprite *sprite) { s32 var = 0; s16 index = 0; @@ -1707,8 +1737,8 @@ static void sub_81804F8(struct Sprite *sprite) { HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.y = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -1722,14 +1752,14 @@ static void sub_81804F8(struct Sprite *sprite) sprite->data[2]++; } -static void pokemonanimfunc_1C(struct Sprite *sprite) +static void Anim_VerticalSlideWobble(struct Sprite *sprite) { sprite->data[0] = 10; - sub_81804F8(sprite); - sprite->callback = sub_81804F8; + VerticalSlideWobble(sprite); + sprite->callback = VerticalSlideWobble; } -static void sub_81805B0(struct Sprite *sprite) +static void RisingWobble(struct Sprite *sprite) { s32 var = 0; s16 index = 0; @@ -1741,8 +1771,8 @@ static void sub_81805B0(struct Sprite *sprite) { HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.y = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -1756,19 +1786,19 @@ static void sub_81805B0(struct Sprite *sprite) sprite->data[2]++; } -static void pokemonanimfunc_18(struct Sprite *sprite) +static void Anim_RisingWobble(struct Sprite *sprite) { sprite->data[0] = 5; - sub_81805B0(sprite); - sprite->callback = sub_81805B0; + RisingWobble(sprite); + sprite->callback = RisingWobble; } -static void pokemonanimfunc_1D(struct Sprite *sprite) +static void Anim_HorizontalSlideWobble(struct Sprite *sprite) { s32 var; s16 index = 0; - sub_817F70C(sprite); + TryFlipX(sprite); var = 0; if (sprite->data[2] == 0) @@ -1778,25 +1808,23 @@ static void pokemonanimfunc_1D(struct Sprite *sprite) { HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.x = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { - s16 toDiv = 100; - - index = (sprite->data[2] * 256) / toDiv; - var = (sprite->data[2] * 512) / toDiv; + index = (sprite->data[2] * 256) / 100; + var = (sprite->data[2] * 512) / 100; var &= 0xFF; sprite->pos2.x = Sin(index, 8); HandleSetAffineData(sprite, 256, 256, Sin(var, 3276)); } sprite->data[2]++; - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8180714(struct Sprite *sprite) +static void VerticalSquishBounce(struct Sprite *sprite) { s16 posY = 0; @@ -1806,14 +1834,14 @@ static void sub_8180714(struct Sprite *sprite) sprite->data[3] = 0; } - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] > sprite->data[0] * 3) { HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.y = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -1830,17 +1858,17 @@ static void sub_8180714(struct Sprite *sprite) sprite->data[4] = (sprite->data[4] + 128 / sprite->data[0]) & 0xFF; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_00(struct Sprite *sprite) +static void Anim_VerticalSquishBounce(struct Sprite *sprite) { sprite->data[0] = 16; - sub_8180714(sprite); - sprite->callback = sub_8180714; + VerticalSquishBounce(sprite); + sprite->callback = VerticalSquishBounce; } -static void sub_8180828(struct Sprite *sprite) +static void ShrinkGrow(struct Sprite *sprite) { s16 posY = 0; @@ -1848,8 +1876,8 @@ static void sub_8180828(struct Sprite *sprite) { HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.y = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -1865,7 +1893,7 @@ static void sub_8180828(struct Sprite *sprite) } } -static void pokemonanimfunc_13(struct Sprite *sprite) +static void Anim_ShrinkGrow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -1874,7 +1902,7 @@ static void pokemonanimfunc_13(struct Sprite *sprite) sprite->data[6] = 8; } - sub_8180828(sprite); + ShrinkGrow(sprite); } static const s8 sUnknown_0860AD8E[][8][3] = @@ -1901,7 +1929,7 @@ static const s8 sUnknown_0860AD8E[][8][3] = }, }; -static void sub_8180900(struct Sprite *sprite) +static void BounceRotateToSides(struct Sprite *sprite) { s16 var; u8 structId; @@ -1910,12 +1938,12 @@ static void sub_8180900(struct Sprite *sprite) s16 r7; u32 arrId; - sub_817F70C(sprite); + TryFlipX(sprite); structId = sprite->data[0]; - var = sUnknown_03001240[structId].field_6; - r9 = sUnknown_0860AD8E[sUnknown_03001240[structId].field_8][sprite->data[4]][0]; - r10 = sUnknown_0860AD8E[sUnknown_03001240[structId].field_8][sprite->data[4]][1] - r9; - arrId = sUnknown_03001240[structId].field_8; + var = sAnims[structId].field_6; + r9 = sUnknown_0860AD8E[sAnims[structId].field_8][sprite->data[4]][0]; + r10 = sUnknown_0860AD8E[sAnims[structId].field_8][sprite->data[4]][1] - r9; + arrId = sAnims[structId].field_8; r7 = sprite->data[3]; if (sprite->data[2] == 0) @@ -1929,8 +1957,8 @@ static void sub_8180900(struct Sprite *sprite) HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.x = 0; sprite->pos2.y = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -1953,140 +1981,70 @@ static void sub_8180900(struct Sprite *sprite) } } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_05(struct Sprite *sprite) +static void Anim_BounceRotateToSides(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); - sUnknown_03001240[id].field_6 = 4096; - sUnknown_03001240[id].field_8 = sprite->data[6]; - sub_8180900(sprite); - sprite->callback = sub_8180900; + u8 id = sprite->data[0] = AddNewAnim(); + sAnims[id].field_6 = 4096; + sAnims[id].field_8 = sprite->data[6]; + BounceRotateToSides(sprite); + sprite->callback = BounceRotateToSides; } -static void pokemonanimfunc_20(struct Sprite *sprite) +static void Anim_GlowOrange(struct Sprite *sprite) { - if (sprite->data[2] == 0) - sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; - - if (sprite->data[2] > 128) - { - BlendPalette(sprite->data[7], 0x10, 0, RGB(31, 22, 0)); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; - } - else - { - sprite->data[6] = Sin(sprite->data[2], 12); - BlendPalette(sprite->data[7], 0x10, sprite->data[6], RGB(31, 22, 0)); - } - - sprite->data[2] += 2; + GlowColor(RGB(31, 22, 0), 12, 2); } -static void pokemonanimfunc_21(struct Sprite *sprite) +static void Anim_GlowRed(struct Sprite *sprite) { - if (sprite->data[2] == 0) - sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; - - if (sprite->data[2] > 128) - { - BlendPalette(sprite->data[7], 0x10, 0, RGB_RED); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; - } - else - { - sprite->data[6] = Sin(sprite->data[2], 12); - BlendPalette(sprite->data[7], 0x10, sprite->data[6], RGB_RED); - } - - sprite->data[2] += 2; + GlowColor(RGB_RED, 12, 2); } -static void pokemonanimfunc_22(struct Sprite *sprite) +static void Anim_GlowBlue(struct Sprite *sprite) { - if (sprite->data[2] == 0) - sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; - - if (sprite->data[2] > 128) - { - BlendPalette(sprite->data[7], 0x10, 0, RGB_BLUE); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; - } - else - { - sprite->data[6] = Sin(sprite->data[2], 12); - BlendPalette(sprite->data[7], 0x10, sprite->data[6], RGB_BLUE); - } - - sprite->data[2] += 2; + GlowColor(RGB_BLUE, 12, 2); } -static void pokemonanimfunc_23(struct Sprite *sprite) +static void Anim_GlowYellow(struct Sprite *sprite) { - if (sprite->data[2] == 0) - sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; - - if (sprite->data[2] > 128) - { - BlendPalette(sprite->data[7], 0x10, 0, RGB_YELLOW); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; - } - else - { - sprite->data[6] = Sin(sprite->data[2], 12); - BlendPalette(sprite->data[7], 0x10, sprite->data[6], RGB_YELLOW); - } - - sprite->data[2] += 2; + GlowColor(RGB_YELLOW, 12, 2); } -static void pokemonanimfunc_24(struct Sprite *sprite) +static void Anim_GlowPurple(struct Sprite *sprite) { - if (sprite->data[2] == 0) - sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; - - if (sprite->data[2] > 128) - { - BlendPalette(sprite->data[7], 0x10, 0, RGB(24, 0, 24)); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; - } - else - { - sprite->data[6] = Sin(sprite->data[2], 12); - BlendPalette(sprite->data[7], 0x10, sprite->data[6], RGB(24, 0, 24)); - } - - sprite->data[2] += 2; + GlowColor(RGB(24, 0, 24), 12, 2); } -static void sub_8180CB4(struct Sprite *sprite); -static void sub_8180CE8(struct Sprite *sprite); -static void sub_8180D44(struct Sprite *sprite); -static void sub_8180DC0(struct Sprite *sprite); -static void sub_8180E28(struct Sprite *sprite); +static void BackAndLunge_0(struct Sprite *sprite); +static void BackAndLunge_1(struct Sprite *sprite); +static void BackAndLunge_2(struct Sprite *sprite); +static void BackAndLunge_3(struct Sprite *sprite); +static void BackAndLunge_4(struct Sprite *sprite); -static void pokemonanimfunc_25(struct Sprite *sprite) +static void Anim_BackAndLunge(struct Sprite *sprite) { HandleStartAffineAnim(sprite); - sprite->callback = sub_8180CB4; + sprite->callback = BackAndLunge_0; } -static void sub_8180CB4(struct Sprite *sprite) +static void BackAndLunge_0(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (++sprite->pos2.x > 7) { sprite->pos2.x = 8; sprite->data[7] = 2; - sprite->callback = sub_8180CE8; + sprite->callback = BackAndLunge_1; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8180CE8(struct Sprite *sprite) +static void BackAndLunge_1(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x -= sprite->data[7]; sprite->data[7]++; @@ -2106,17 +2064,17 @@ static void sub_8180CE8(struct Sprite *sprite) while (subResult > -8); sprite->data[5] = 1; - sprite->callback = sub_8180D44; + sprite->callback = BackAndLunge_2; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8180D44(struct Sprite *sprite) +static void BackAndLunge_2(struct Sprite *sprite) { u8 rotation; - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x -= sprite->data[7]; sprite->data[7]++; rotation = (sprite->data[5] * 6) / sprite->data[6]; @@ -2132,15 +2090,15 @@ static void sub_8180D44(struct Sprite *sprite) sprite->data[4] = 2; sprite->data[3] = 0; sprite->data[2] = rotation; - sprite->callback = sub_8180DC0; + sprite->callback = BackAndLunge_3; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8180DC0(struct Sprite *sprite) +static void BackAndLunge_3(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[3] > 11) { @@ -2150,7 +2108,7 @@ static void sub_8180DC0(struct Sprite *sprite) HandleSetAffineData(sprite, 256, 256, sprite->data[2] << 8); if (sprite->data[2] == 0) - sprite->callback = sub_8180E28; + sprite->callback = BackAndLunge_4; } else { @@ -2159,38 +2117,38 @@ static void sub_8180DC0(struct Sprite *sprite) sprite->data[3]++; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8180E28(struct Sprite *sprite) +static void BackAndLunge_4(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x += 2; if (sprite->pos2.x > 0) { sprite->pos2.x = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8180E78(struct Sprite *sprite); -static void sub_8180ED0(struct Sprite *sprite); -static void sub_8180F2C(struct Sprite *sprite); +static void BackFlip_0(struct Sprite *sprite); +static void BackFlip_1(struct Sprite *sprite); +static void BackFlip_2(struct Sprite *sprite); -static void pokemonanimfunc_26(struct Sprite *sprite) +static void Anim_BackFlip(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[3] = 0; - sprite->callback = sub_8180E78; + sprite->callback = BackFlip_0; } -static void sub_8180E78(struct Sprite *sprite) +static void BackFlip_0(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x++; sprite->pos2.y--; @@ -2201,15 +2159,15 @@ static void sub_8180E78(struct Sprite *sprite) sprite->pos2.x = 8; sprite->pos2.y = -8; sprite->data[4] = 0; - sprite->callback = sub_8180ED0; + sprite->callback = BackFlip_1; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8180ED0(struct Sprite *sprite) +static void BackFlip_1(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x = Cos(sprite->data[4], 16) - 8; sprite->pos2.y = Sin(sprite->data[4], 16) - 8; @@ -2217,18 +2175,18 @@ static void sub_8180ED0(struct Sprite *sprite) { sprite->data[2] = 160; sprite->data[3] = 10; - sprite->callback = sub_8180F2C; + sprite->callback = BackFlip_2; } sprite->data[4] += 8; if (sprite->data[4] > 64) sprite->data[4] = 64; - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8180F2C(struct Sprite *sprite) +static void BackFlip_2(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[3] > 0) { @@ -2248,15 +2206,15 @@ static void sub_8180F2C(struct Sprite *sprite) { sprite->pos2.x = 0; sprite->pos2.y = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_27(struct Sprite *sprite) +static void Anim_Flicker(struct Sprite *sprite) { if (sprite->data[3] > 0) { @@ -2264,30 +2222,30 @@ static void pokemonanimfunc_27(struct Sprite *sprite) } else { - sprite->data[4] = (sprite->data[4] == 0) ? 1 : 0; + sprite->data[4] = (sprite->data[4] == 0) ? TRUE : FALSE; sprite->invisible = sprite->data[4]; if (++sprite->data[2] > 19) { sprite->invisible = FALSE; - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; } sprite->data[3] = 2; } } -static void sub_8181024(struct Sprite *sprite); -static void sub_8181068(struct Sprite *sprite); -static void sub_81810C4(struct Sprite *sprite); +static void BackFlipBig_0(struct Sprite *sprite); +static void BackFlipBig_1(struct Sprite *sprite); +static void BackFlipBig_2(struct Sprite *sprite); -static void pokemonanimfunc_28(struct Sprite *sprite) +static void Anim_BackFlipBig(struct Sprite *sprite) { HandleStartAffineAnim(sprite); - sprite->callback = sub_8181024; + sprite->callback = BackFlipBig_0; } -static void sub_8181024(struct Sprite *sprite) +static void BackFlipBig_0(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x--; sprite->pos2.y++; @@ -2295,18 +2253,18 @@ static void sub_8181024(struct Sprite *sprite) { sprite->pos2.x = -16; sprite->pos2.y = 16; - sprite->callback = sub_8181068; + sprite->callback = BackFlipBig_1; sprite->data[2] = 160; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8181068(struct Sprite *sprite) +static void BackFlipBig_1(struct Sprite *sprite) { u32 rotation; - sub_817F70C(sprite); + TryFlipX(sprite); sprite->data[2] -= 4; sprite->pos2.x = Cos(sprite->data[2], 22); sprite->pos2.y = -(Sin(sprite->data[2], 22)); @@ -2314,54 +2272,54 @@ static void sub_8181068(struct Sprite *sprite) HandleSetAffineData(sprite, 256, 256, rotation * 512); if (sprite->data[2] <= 32) - sprite->callback = sub_81810C4; + sprite->callback = BackFlipBig_2; - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_81810C4(struct Sprite *sprite) +static void BackFlipBig_2(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x--; sprite->pos2.y++; if (sprite->pos2.x <= 0) { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8181110(struct Sprite *sprite); -static void sub_8181144(struct Sprite *sprite); -static void sub_81811A4(struct Sprite *sprite); +static void FrontFlip_0(struct Sprite *sprite); +static void FrontFlip_1(struct Sprite *sprite); +static void FrontFlip_2(struct Sprite *sprite); -static void pokemonanimfunc_29(struct Sprite *sprite) +static void Anim_FrontFlip(struct Sprite *sprite) { HandleStartAffineAnim(sprite); - sprite->callback = sub_8181110; + sprite->callback = FrontFlip_0; } -static void sub_8181110(struct Sprite *sprite) +static void FrontFlip_0(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x++; sprite->pos2.y--; if (sprite->pos2.x > 15) { sprite->data[2] = 0; - sprite->callback = sub_8181144; + sprite->callback = FrontFlip_1; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8181144(struct Sprite *sprite) +static void FrontFlip_1(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->data[2] += 16; if (sprite->pos2.x <= -16) @@ -2369,7 +2327,7 @@ static void sub_8181144(struct Sprite *sprite) sprite->pos2.x = -16; sprite->pos2.y = 16; sprite->data[2] = 0; - sprite->callback = sub_81811A4; + sprite->callback = FrontFlip_2; } else { @@ -2378,12 +2336,12 @@ static void sub_8181144(struct Sprite *sprite) } HandleSetAffineData(sprite, 256, 256, sprite->data[2] << 8); - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_81811A4(struct Sprite *sprite) +static void FrontFlip_2(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x++; sprite->pos2.y--;; @@ -2391,37 +2349,37 @@ static void sub_81811A4(struct Sprite *sprite) { sprite->pos2.x = 0; sprite->pos2.y = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8181214(struct Sprite *sprite); +static void TumblingFrontFlip(struct Sprite *sprite); -static void pokemonanimfunc_2A(struct Sprite *sprite) +static void Anim_TumblingFrontFlip(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); - sUnknown_03001240[id].field_2 = 2; - sub_8181214(sprite); - sprite->callback = sub_8181214; + u8 id = sprite->data[0] = AddNewAnim(); + sAnims[id].field_2 = 2; + TumblingFrontFlip(sprite); + sprite->callback = TumblingFrontFlip; } -static void sub_8181214(struct Sprite *sprite) +static void TumblingFrontFlip(struct Sprite *sprite) { - if (sUnknown_03001240[sprite->data[0]].field_0 != 0) + if (sAnims[sprite->data[0]].field_0 != 0) { - sUnknown_03001240[sprite->data[0]].field_0--; + sAnims[sprite->data[0]].field_0--; } else { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] == 0) { sprite->data[2]++; HandleStartAffineAnim(sprite); - sprite->data[7] = sUnknown_03001240[sprite->data[0]].field_2; + sprite->data[7] = sAnims[sprite->data[0]].field_2; sprite->data[3] = -1; sprite->data[4] = -1; sprite->data[5] = 0; @@ -2448,38 +2406,38 @@ static void sub_8181214(struct Sprite *sprite) { sprite->pos2.x = 0; sprite->pos2.y = 0; - if (sUnknown_03001240[sprite->data[0]].field_4 > 1) + if (sAnims[sprite->data[0]].field_4 > 1) { - sUnknown_03001240[sprite->data[0]].field_4--; + sAnims[sprite->data[0]].field_4--; sprite->data[5] = 0; sprite->data[6] = 0; - sUnknown_03001240[sprite->data[0]].field_0 = 10; + sAnims[sprite->data[0]].field_0 = 10; } else { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } } HandleSetAffineData(sprite, 256, 256, sprite->data[6] << 8); - sub_817F70C(sprite); + TryFlipX(sprite); } } -static void sub_8181370(struct Sprite *sprite); +static void Figure8(struct Sprite *sprite); -static void pokemonanimfunc_2B(struct Sprite *sprite) +static void Anim_Figure8(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[6] = 0; sprite->data[7] = 0; - sprite->callback = sub_8181370; + sprite->callback = Figure8; } -static void sub_8181370(struct Sprite *sprite) +static void Figure8(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->data[6] += 4; sprite->pos2.x = -(Sin(sprite->data[6], 16)); sprite->pos2.y = -(Sin((sprite->data[6] * 2) & 0xFF, 8)); @@ -2499,13 +2457,13 @@ static void sub_8181370(struct Sprite *sprite) sprite->pos2.x = 0; sprite->pos2.y = 0; HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_2C(struct Sprite *sprite) +static void Anim_FlashYellow(struct Sprite *sprite) { if (++sprite->data[2] == 1) { @@ -2515,23 +2473,23 @@ static void pokemonanimfunc_2C(struct Sprite *sprite) sprite->data[4] = 0; } - if (sUnknown_0860AA64[sprite->data[6]][1] == 0xFF) + if (sFlashYellowData[sprite->data[6]][1] == (u8)-1) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; } else { if (sprite->data[4] == 1) { - if (sUnknown_0860AA64[sprite->data[6]][0] != 0) - BlendPalette(sprite->data[7], 0x10, 0x10, RGB_YELLOW); + if (sFlashYellowData[sprite->data[6]][0]) + BlendPalette(sprite->data[7], 16, 16, RGB_YELLOW); else - BlendPalette(sprite->data[7], 0x10, 0, RGB_YELLOW); + BlendPalette(sprite->data[7], 16, 0, RGB_YELLOW); sprite->data[4] = 0; } - if (sUnknown_0860AA64[sprite->data[6]][1] == sprite->data[5]) + if (sFlashYellowData[sprite->data[6]][1] == sprite->data[5]) { sprite->data[4] = 1; sprite->data[5] = 0; @@ -2544,101 +2502,101 @@ static void pokemonanimfunc_2C(struct Sprite *sprite) } } -static void sub_81814D4(struct Sprite *sprite) +static void SwingConcave(struct Sprite *sprite) { if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); - sub_817F70C(sprite); - if (sprite->data[2] > sUnknown_03001240[sprite->data[0]].field_8) + TryFlipX(sprite); + if (sprite->data[2] > sAnims[sprite->data[0]].field_8) { HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.x = 0; - if (sUnknown_03001240[sprite->data[0]].field_4 > 1) + if (sAnims[sprite->data[0]].field_4 > 1) { - sUnknown_03001240[sprite->data[0]].field_4--; + sAnims[sprite->data[0]].field_4--; sprite->data[2] = 0; } else { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } } else { - s16 index = (sprite->data[2] * 256) / sUnknown_03001240[sprite->data[0]].field_8; + s16 index = (sprite->data[2] * 256) / sAnims[sprite->data[0]].field_8; sprite->pos2.x = -(Sin(index, 10)); HandleSetAffineData(sprite, 256, 256, Sin(index, 3276)); } sprite->data[2]++; - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_2D(struct Sprite *sprite) +static void Anim_SwingConcave_FastShort(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); - sUnknown_03001240[id].field_8 = 50; - sub_81814D4(sprite); - sprite->callback = sub_81814D4; + u8 id = sprite->data[0] = AddNewAnim(); + sAnims[id].field_8 = 50; + SwingConcave(sprite); + sprite->callback = SwingConcave; } -static void sub_81815D4(struct Sprite *sprite) +static void SwingConvex(struct Sprite *sprite) { if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); - sub_817F70C(sprite); - if (sprite->data[2] > sUnknown_03001240[sprite->data[0]].field_8) + TryFlipX(sprite); + if (sprite->data[2] > sAnims[sprite->data[0]].field_8) { HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.x = 0; - if (sUnknown_03001240[sprite->data[0]].field_4 > 1) + if (sAnims[sprite->data[0]].field_4 > 1) { - sUnknown_03001240[sprite->data[0]].field_4--; + sAnims[sprite->data[0]].field_4--; sprite->data[2] = 0; } else { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } } else { - s16 index = (sprite->data[2] * 256) / sUnknown_03001240[sprite->data[0]].field_8; + s16 index = (sprite->data[2] * 256) / sAnims[sprite->data[0]].field_8; sprite->pos2.x = -(Sin(index, 10)); HandleSetAffineData(sprite, 256, 256, -(Sin(index, 3276))); } sprite->data[2]++; - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_2E(struct Sprite *sprite) +static void Anim_SwingConvex_FastShort(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); - sUnknown_03001240[id].field_8 = 50; - sub_81815D4(sprite); - sprite->callback = sub_81815D4; + u8 id = sprite->data[0] = AddNewAnim(); + sAnims[id].field_8 = 50; + SwingConvex(sprite); + sprite->callback = SwingConvex; } -static void sub_8181708(struct Sprite *sprite); -static void sub_8181770(struct Sprite *sprite); -static void sub_8181794(struct Sprite *sprite); +static void RotateUpSlamDown_0(struct Sprite *sprite); +static void RotateUpSlamDown_1(struct Sprite *sprite); +static void RotateUpSlamDown_2(struct Sprite *sprite); -static void pokemonanimfunc_2F(struct Sprite *sprite) +static void Anim_RotateUpSlamDown(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[6] = -(14 * sprite->centerToCornerVecX / 10); sprite->data[7] = 128; - sprite->callback = sub_8181708; + sprite->callback = RotateUpSlamDown_0; } -static void sub_8181708(struct Sprite *sprite) +static void RotateUpSlamDown_0(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->data[7]--; sprite->pos2.x = Cos(sprite->data[7], sprite->data[6]) + sprite->data[6]; @@ -2649,26 +2607,26 @@ static void sub_8181708(struct Sprite *sprite) { sprite->data[7] = 120; sprite->data[3] = 0; - sprite->callback = sub_8181770; + sprite->callback = RotateUpSlamDown_1; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8181770(struct Sprite *sprite) +static void RotateUpSlamDown_1(struct Sprite *sprite) { if (sprite->data[3] == 20) { - sprite->callback = sub_8181794; + sprite->callback = RotateUpSlamDown_2; sprite->data[3] = 0; } sprite->data[3]++; } -static void sub_8181794(struct Sprite *sprite) +static void RotateUpSlamDown_2(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->data[7] += 2; sprite->pos2.x = Cos(sprite->data[7], sprite->data[6]) + sprite->data[6]; @@ -2681,18 +2639,18 @@ static void sub_8181794(struct Sprite *sprite) sprite->pos2.y = 0; HandleSetAffineData(sprite, 256, 256, 0); sprite->data[2] = 0; - sub_817F77C(sprite); - sprite->callback = pokemonanimfunc_10; + ResetSpriteAfterAnim(sprite); + sprite->callback = Anim_VerticalShake; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8181810(struct Sprite *sprite) +static void DeepVerticalSquishBounce(struct Sprite *sprite) { - if (sUnknown_03001240[sprite->data[0]].field_0 != 0) + if (sAnims[sprite->data[0]].field_0 != 0) { - sUnknown_03001240[sprite->data[0]].field_0--; + sAnims[sprite->data[0]].field_0--; } else { @@ -2724,41 +2682,41 @@ static void sub_8181810(struct Sprite *sprite) HandleSetAffineData(sprite, 256 + sprite->data[6], 256 - sprite->data[7], 0); if (sprite->data[4] == 128) { - if (sUnknown_03001240[sprite->data[0]].field_4 > 1) + if (sAnims[sprite->data[0]].field_4 > 1) { - sUnknown_03001240[sprite->data[0]].field_4--; - sUnknown_03001240[sprite->data[0]].field_0 = 10; + sAnims[sprite->data[0]].field_4--; + sAnims[sprite->data[0]].field_0 = 10; sprite->data[4] = 0; sprite->data[5] = 0; } else { HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } } } - sprite->data[4] += sUnknown_03001240[sprite->data[0]].field_6; + sprite->data[4] += sAnims[sprite->data[0]].field_6; } } -static void pokemonanimfunc_30(struct Sprite *sprite) +static void Anim_DeepVerticalSquishBounce(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); - sUnknown_03001240[id].field_6 = 4; - sub_8181810(sprite); - sprite->callback = sub_8181810; + u8 id = sprite->data[0] = AddNewAnim(); + sAnims[id].field_6 = 4; + DeepVerticalSquishBounce(sprite); + sprite->callback = DeepVerticalSquishBounce; } -static void pokemonanimfunc_31(struct Sprite *sprite) +static void Anim_HorizontalJumps(struct Sprite *sprite) { s32 counter = sprite->data[2]; - sub_817F70C(sprite); + TryFlipX(sprite); if (counter > 512) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.x = 0; sprite->pos2.y = 0; } @@ -2784,61 +2742,61 @@ static void pokemonanimfunc_31(struct Sprite *sprite) } sprite->data[2] += 12; - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8181ABC(struct Sprite *sprite); -static void sub_8181B4C(struct Sprite *sprite); -static void sub_8181C2C(struct Sprite *sprite); +static void HorizontalJumpsVerticalStretch_0(struct Sprite *sprite); +static void HorizontalJumpsVerticalStretch_1(struct Sprite *sprite); +static void HorizontalJumpsVerticalStretch_2(struct Sprite *sprite); -static void pokemonanimfunc_32(struct Sprite *sprite) +static void Anim_HorizontalJumpsVerticalStretch(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); - sUnknown_03001240[id].field_8 = -1; + u8 id = sprite->data[0] = AddNewAnim(); + sAnims[id].field_8 = -1; HandleStartAffineAnim(sprite); sprite->data[3] = 0; - sub_8181ABC(sprite); - sprite->callback = sub_8181ABC; + HorizontalJumpsVerticalStretch_0(sprite); + sprite->callback = HorizontalJumpsVerticalStretch_0; } -static void sub_8181ABC(struct Sprite *sprite) +static void HorizontalJumpsVerticalStretch_0(struct Sprite *sprite) { - if (sUnknown_03001240[sprite->data[0]].field_0 != 0) + if (sAnims[sprite->data[0]].field_0 != 0) { - sUnknown_03001240[sprite->data[0]].field_0--; + sAnims[sprite->data[0]].field_0--; } else { s32 counter; - sub_817F70C(sprite); + TryFlipX(sprite); counter = sprite->data[2]; if (sprite->data[2] > 128) { sprite->data[2] = 0; - sprite->callback = sub_8181B4C; + sprite->callback = HorizontalJumpsVerticalStretch_1; } else { - s32 var = 8 * sUnknown_03001240[sprite->data[0]].field_8; + s32 var = 8 * sAnims[sprite->data[0]].field_8; sprite->pos2.x = var * (counter % 128) / 128; sprite->pos2.y = -(Sin(counter % 128, 8)); sprite->data[2] += 12; } - sub_817F70C(sprite); + TryFlipX(sprite); } } -static void sub_8181B4C(struct Sprite *sprite) +static void HorizontalJumpsVerticalStretch_1(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] > 48) { HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.y = 0; sprite->data[2] = 0; - sprite->callback = sub_8181C2C; + sprite->callback = HorizontalJumpsVerticalStretch_2; } else { @@ -2847,7 +2805,7 @@ static void sub_8181B4C(struct Sprite *sprite) if (sprite->data[2] >= 16 && sprite->data[2] <= 31) { sprite->data[3] += 8; - sprite->pos2.x -= sUnknown_03001240[sprite->data[0]].field_8; + sprite->pos2.x -= sAnims[sprite->data[0]].field_8; } yDelta = 0; @@ -2861,30 +2819,30 @@ static void sub_8181B4C(struct Sprite *sprite) sprite->data[4] &= 0xFF; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8181C2C(struct Sprite *sprite) +static void HorizontalJumpsVerticalStretch_2(struct Sprite *sprite) { s32 counter; - sub_817F70C(sprite); + TryFlipX(sprite); counter = sprite->data[2]; if (counter > 128) { - if (sUnknown_03001240[sprite->data[0]].field_4 > 1) + if (sAnims[sprite->data[0]].field_4 > 1) { - sUnknown_03001240[sprite->data[0]].field_4--; - sUnknown_03001240[sprite->data[0]].field_0 = 10; + sAnims[sprite->data[0]].field_4--; + sAnims[sprite->data[0]].field_0 = 10; sprite->data[3] = 0; sprite->data[2] = 0; sprite->data[4] = 0; - sprite->callback = sub_8181ABC; + sprite->callback = HorizontalJumpsVerticalStretch_0; } else { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } sprite->pos2.x = 0; @@ -2892,17 +2850,17 @@ static void sub_8181C2C(struct Sprite *sprite) } else { - s32 var = sUnknown_03001240[sprite->data[0]].field_8; + s32 var = sAnims[sprite->data[0]].field_8; sprite->pos2.x = var * ((counter % 128) * 8) / 128 + 8 * -var; sprite->pos2.y = -(Sin(counter % 128, 8)); } sprite->data[2] += 12; - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8181CE8(struct Sprite *sprite) +static void RotateToSides(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -2910,25 +2868,25 @@ static void sub_8181CE8(struct Sprite *sprite) sprite->data[2]++; } - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[7] > 254) { sprite->pos2.x = 0; sprite->pos2.y = 0; HandleSetAffineData(sprite, 256, 256, 0); - if (sUnknown_03001240[sprite->data[0]].field_4 > 1) + if (sAnims[sprite->data[0]].field_4 > 1) { - sUnknown_03001240[sprite->data[0]].field_4--; + sAnims[sprite->data[0]].field_4--; sprite->data[2] = 0; sprite->data[7] = 0; } else { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } - sub_817F70C(sprite); + TryFlipX(sprite); } else { @@ -2937,20 +2895,20 @@ static void sub_8181CE8(struct Sprite *sprite) sprite->pos2.x = -(Sin(sprite->data[7], 16)); rotation = Sin(sprite->data[7], 32); HandleSetAffineData(sprite, 256, 256, rotation << 8); - sprite->data[7] += sUnknown_03001240[sprite->data[0]].field_6; - sub_817F70C(sprite); + sprite->data[7] += sAnims[sprite->data[0]].field_6; + TryFlipX(sprite); } } -static void pokemonanimfunc_33(struct Sprite *sprite) +static void Anim_RotateToSides_Fast(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); - sUnknown_03001240[id].field_6 = 4; - sub_8181CE8(sprite); - sprite->callback = sub_8181CE8; + u8 id = sprite->data[0] = AddNewAnim(); + sAnims[id].field_6 = 4; + RotateToSides(sprite); + sprite->callback = RotateToSides; } -static void pokemonanimfunc_34(struct Sprite *sprite) +static void Anim_RotateUpToSides(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -2958,15 +2916,15 @@ static void pokemonanimfunc_34(struct Sprite *sprite) sprite->data[2]++; } - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[7] > 254) { sprite->pos2.x = 0; sprite->pos2.y = 0; HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; - sub_817F70C(sprite); + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; + TryFlipX(sprite); } else { @@ -2977,11 +2935,11 @@ static void pokemonanimfunc_34(struct Sprite *sprite) rotation = Sin(sprite->data[7], 32); HandleSetAffineData(sprite, 256, 256, rotation << 8); sprite->data[7] += 8; - sub_817F70C(sprite); + TryFlipX(sprite); } } -static void pokemonanimfunc_35(struct Sprite *sprite) +static void Anim_FlickerIncreasing(struct Sprite *sprite) { if (sprite->data[2] == 0) sprite->data[7] = 0; @@ -3001,28 +2959,28 @@ static void pokemonanimfunc_35(struct Sprite *sprite) if (sprite->data[2] > 10) { sprite->invisible = FALSE; - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; } } -static void sub_8181F14(struct Sprite *sprite); -static void sub_8181F50(struct Sprite *sprite); -static void sub_8181FC0(struct Sprite *sprite); +static void TipHopForward_0(struct Sprite *sprite); +static void TipHopForward_1(struct Sprite *sprite); +static void TipHopForward_2(struct Sprite *sprite); -static void pokemonanimfunc_36(struct Sprite *sprite) +static void Anim_TipHopForward(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[7] = 0; - sprite->callback = sub_8181F14; + sprite->callback = TipHopForward_0; } -static void sub_8181F14(struct Sprite *sprite) +static void TipHopForward_0(struct Sprite *sprite) { if (sprite->data[7] > 31) { sprite->data[7] = 32; sprite->data[2] = 0; - sprite->callback = sub_8181F50; + sprite->callback = TipHopForward_1; } else { @@ -3032,12 +2990,12 @@ static void sub_8181F14(struct Sprite *sprite) HandleSetAffineData(sprite, 256, 256, sprite->data[7] << 8); } -static void sub_8181F50(struct Sprite *sprite) +static void TipHopForward_1(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] > 512) { - sprite->callback = sub_8181FC0; + sprite->callback = TipHopForward_2; sprite->data[6] = 0; } else @@ -3047,19 +3005,19 @@ static void sub_8181F50(struct Sprite *sprite) sprite->data[2] += 12; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8181FC0(struct Sprite *sprite) +static void TipHopForward_2(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->data[7] -= 2; if (sprite->data[7] < 0) { sprite->data[7] = 0; sprite->pos2.x = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -3067,10 +3025,10 @@ static void sub_8181FC0(struct Sprite *sprite) } HandleSetAffineData(sprite, 256, 256, sprite->data[7] << 8); - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_37(struct Sprite *sprite) +static void Anim_PivotShake(struct Sprite *sprite) { u16 rotation; @@ -3081,14 +3039,14 @@ static void pokemonanimfunc_37(struct Sprite *sprite) sprite->data[7] = 0; } - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[7] > 255) { sprite->pos2.x = 0; sprite->pos2.y = 0; sprite->data[7] = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -3099,31 +3057,31 @@ static void pokemonanimfunc_37(struct Sprite *sprite) rotation = Sin(sprite->data[7] % 128, 16); HandleSetAffineData(sprite, 256, 256, rotation << 8); - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_81820FC(struct Sprite *sprite); -static void sub_818216C(struct Sprite *sprite); -static void sub_81821CC(struct Sprite *sprite); -static void sub_8182248(struct Sprite *sprite); +static void TipAndShake_0(struct Sprite *sprite); +static void TipAndShake_1(struct Sprite *sprite); +static void TipAndShake_2(struct Sprite *sprite); +static void TipAndShake_3(struct Sprite *sprite); -static void pokemonanimfunc_38(struct Sprite *sprite) +static void Anim_TipAndShake(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[7] = 0; sprite->data[4] = 0; - sprite->callback = sub_81820FC; + sprite->callback = TipAndShake_0; } -static void sub_81820FC(struct Sprite *sprite) +static void TipAndShake_0(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[7] > 24) { if (++sprite->data[4] > 4) { sprite->data[4] = 0; - sprite->callback = sub_818216C; + sprite->callback = TipAndShake_1; } } else @@ -3134,16 +3092,16 @@ static void sub_81820FC(struct Sprite *sprite) } HandleSetAffineData(sprite, 256, 256, -(sprite->data[7]) << 8); - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_818216C(struct Sprite *sprite) +static void TipAndShake_1(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[7] > 32) { sprite->data[6] = 1; - sprite->callback = sub_81821CC; + sprite->callback = TipAndShake_2; } else { @@ -3153,17 +3111,17 @@ static void sub_818216C(struct Sprite *sprite) } HandleSetAffineData(sprite, 256, 256, -(sprite->data[7]) << 8); - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_81821CC(struct Sprite *sprite) +static void TipAndShake_2(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->data[7] += (sprite->data[6] * 4); if (sprite->data[5] > 9) { sprite->data[7] = 32; - sprite->callback = sub_8182248; + sprite->callback = TipAndShake_3; } sprite->pos2.x = Sin(sprite->data[7], 8); @@ -3175,17 +3133,17 @@ static void sub_81821CC(struct Sprite *sprite) } HandleSetAffineData(sprite, 256, 256, -(sprite->data[7]) << 8); - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8182248(struct Sprite *sprite) +static void TipAndShake_3(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[7] <= 0) { sprite->data[7] = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -3195,15 +3153,15 @@ static void sub_8182248(struct Sprite *sprite) } HandleSetAffineData(sprite, 256, 256, -(sprite->data[7]) << 8); - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_39(struct Sprite *sprite) +static void Anim_VibrateToCorners(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] > 40) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.x = 0; } else @@ -3227,12 +3185,12 @@ static void pokemonanimfunc_39(struct Sprite *sprite) } sprite->data[2]++; - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_3A(struct Sprite *sprite) +static void Anim_GrowInStages(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] == 0) { HandleStartAffineAnim(sprite); @@ -3262,8 +3220,8 @@ static void pokemonanimfunc_3A(struct Sprite *sprite) { sprite->data[7] = 64; HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } var = Cos(sprite->data[7], 64); } @@ -3295,10 +3253,10 @@ static void pokemonanimfunc_3A(struct Sprite *sprite) HandleSetAffineData(sprite, 256 - var, 256 - var, 0); } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_3B(struct Sprite *sprite) +static void Anim_VerticalSpring(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -3311,8 +3269,8 @@ static void pokemonanimfunc_3B(struct Sprite *sprite) { sprite->pos2.y = 0; HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -3325,7 +3283,7 @@ static void pokemonanimfunc_3B(struct Sprite *sprite) } } -static void pokemonanimfunc_3C(struct Sprite *sprite) +static void Anim_VerticalRepeatedSpring(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -3338,8 +3296,8 @@ static void pokemonanimfunc_3C(struct Sprite *sprite) { sprite->pos2.y = 0; HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -3352,18 +3310,18 @@ static void pokemonanimfunc_3C(struct Sprite *sprite) } } -static void sub_81825F8(struct Sprite *sprite); -static void sub_8182648(struct Sprite *sprite); -static void sub_81826F8(struct Sprite *sprite); +static void SpringRising_0(struct Sprite *sprite); +static void SpringRising_1(struct Sprite *sprite); +static void SpringRising_2(struct Sprite *sprite); -static void pokemonanimfunc_3D(struct Sprite *sprite) +static void Anim_SpringRising(struct Sprite *sprite) { HandleStartAffineAnim(sprite); - sprite->callback = sub_81825F8; + sprite->callback = SpringRising_0; sprite->data[7] = 0; } -static void sub_81825F8(struct Sprite *sprite) +static void SpringRising_0(struct Sprite *sprite) { s16 yScale; @@ -3372,7 +3330,7 @@ static void sub_81825F8(struct Sprite *sprite) { sprite->data[7] = 0; sprite->data[6] = 0; - sprite->callback = sub_8182648; + sprite->callback = SpringRising_1; yScale = Sin(64, 128); // 128 * 1 = 128 } else @@ -3383,7 +3341,7 @@ static void sub_81825F8(struct Sprite *sprite) HandleSetAffineData(sprite, 256, 256 + yScale, 0); } -static void sub_8182648(struct Sprite *sprite) +static void SpringRising_1(struct Sprite *sprite) { s16 yScale; @@ -3417,11 +3375,11 @@ static void sub_8182648(struct Sprite *sprite) if (sprite->data[6] == 3) { sprite->data[7] = 0; - sprite->callback = sub_81826F8; + sprite->callback = SpringRising_2; } } -static void sub_81826F8(struct Sprite *sprite) +static void SpringRising_2(struct Sprite *sprite) { s16 yScale; @@ -3430,8 +3388,8 @@ static void sub_81826F8(struct Sprite *sprite) sprite->pos2.y = -(Cos(sprite->data[7], 12)); if (sprite->data[7] > 63) { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; sprite->pos2.y = 0; HandleSetAffineData(sprite, 256, 256, 0); } @@ -3439,13 +3397,13 @@ static void sub_81826F8(struct Sprite *sprite) HandleSetAffineData(sprite, 256, 256 + yScale, 0); } -static void sub_8182764(struct Sprite *sprite) +static void HorizontalSpring(struct Sprite *sprite) { if (sprite->data[7] > sprite->data[5]) { sprite->pos2.x = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; HandleSetAffineData(sprite, 256, 256, 0); } else @@ -3459,7 +3417,7 @@ static void sub_8182764(struct Sprite *sprite) } } -static void pokemonanimfunc_3E(struct Sprite *sprite) +static void Anim_HorizontalSpring(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -3471,16 +3429,16 @@ static void pokemonanimfunc_3E(struct Sprite *sprite) sprite->data[4] = 8; } - sub_8182764(sprite); + HorizontalSpring(sprite); } -static void sub_8182830(struct Sprite *sprite) +static void HorizontalRepeatedSpring(struct Sprite *sprite) { if (sprite->data[7] > sprite->data[5]) { sprite->pos2.x = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; HandleSetAffineData(sprite, 256, 256, 0); } else @@ -3494,7 +3452,7 @@ static void sub_8182830(struct Sprite *sprite) } } -static void pokemonanimfunc_3F(struct Sprite *sprite) +static void Anim_HorizontalRepeatedSpring_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -3506,12 +3464,12 @@ static void pokemonanimfunc_3F(struct Sprite *sprite) sprite->data[4] = 16; } - sub_8182830(sprite); + HorizontalRepeatedSpring(sprite); } -static void pokemonanimfunc_40(struct Sprite *sprite) +static void Anim_HorizontalSlideShrink(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] == 0) { HandleStartAffineAnim(sprite); @@ -3522,9 +3480,9 @@ static void pokemonanimfunc_40(struct Sprite *sprite) if (sprite->data[7] > 512) { sprite->pos2.x = 0; - sub_817F77C(sprite); + ResetSpriteAfterAnim(sprite); HandleSetAffineData(sprite, 256, 256, 0); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; } else { @@ -3536,12 +3494,12 @@ static void pokemonanimfunc_40(struct Sprite *sprite) HandleSetAffineData(sprite, 256 + scale, 256 + scale, 0); } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_41(struct Sprite *sprite) +static void Anim_LungeGrow(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] == 0) { HandleStartAffineAnim(sprite); @@ -3552,9 +3510,9 @@ static void pokemonanimfunc_41(struct Sprite *sprite) if (sprite->data[7] > 512) { sprite->pos2.x = 0; - sub_817F77C(sprite); + ResetSpriteAfterAnim(sprite); HandleSetAffineData(sprite, 256, 256, 0); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; } else { @@ -3566,12 +3524,12 @@ static void pokemonanimfunc_41(struct Sprite *sprite) HandleSetAffineData(sprite, 256 + scale, 256 + scale, 0); } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_42(struct Sprite *sprite) +static void Anim_CircleIntoBackground(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] == 0) { HandleStartAffineAnim(sprite); @@ -3582,9 +3540,9 @@ static void pokemonanimfunc_42(struct Sprite *sprite) if (sprite->data[7] > 512) { sprite->pos2.x = 0; - sub_817F77C(sprite); + ResetSpriteAfterAnim(sprite); HandleSetAffineData(sprite, 256, 256, 0); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; } else { @@ -3596,15 +3554,15 @@ static void pokemonanimfunc_42(struct Sprite *sprite) HandleSetAffineData(sprite, 256 + scale, 256 + scale, 0); } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_43(struct Sprite *sprite) +static void Anim_RapidHorizontalHops(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] > 2048) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->data[6] = 0; } else @@ -3630,12 +3588,12 @@ static void pokemonanimfunc_43(struct Sprite *sprite) sprite->data[2] += 24; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_44(struct Sprite *sprite) +static void Anim_FourPetal(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] == 0) { sprite->data[6] = 0; @@ -3683,64 +3641,64 @@ static void pokemonanimfunc_44(struct Sprite *sprite) default: sprite->pos2.x = 0; sprite->pos2.y = 0; - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; break; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_45(struct Sprite *sprite) +static void Anim_VerticalSquishBounce_Slow(struct Sprite *sprite) { sprite->data[0] = 32; - sub_8180714(sprite); - sprite->callback = sub_8180714; + VerticalSquishBounce(sprite); + sprite->callback = VerticalSquishBounce; } -static void pokemonanimfunc_46(struct Sprite *sprite) +static void Anim_HorizontalSlide_Slow(struct Sprite *sprite) { sprite->data[0] = 80; - sub_817F8FC(sprite); - sprite->callback = sub_817F8FC; + HorizontalSlide(sprite); + sprite->callback = HorizontalSlide; } -static void pokemonanimfunc_47(struct Sprite *sprite) +static void Anim_VerticalSlide_Slow(struct Sprite *sprite) { sprite->data[0] = 80; - sub_817F978(sprite); - sprite->callback = sub_817F978; + VerticalSlide(sprite); + sprite->callback = VerticalSlide; } -static void pokemonanimfunc_48(struct Sprite *sprite) +static void Anim_BounceRotateToSides_Small(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_6 = 2048; - sUnknown_03001240[id].field_8 = sprite->data[6]; - sub_8180900(sprite); - sprite->callback = sub_8180900; + sAnims[id].field_6 = 2048; + sAnims[id].field_8 = sprite->data[6]; + BounceRotateToSides(sprite); + sprite->callback = BounceRotateToSides; } -static void pokemonanimfunc_49(struct Sprite *sprite) +static void Anim_BounceRotateToSides_Slow(struct Sprite *sprite) { sprite->data[6] = 1; - pokemonanimfunc_05(sprite); + Anim_BounceRotateToSides(sprite); } -static void pokemonanimfunc_4A(struct Sprite *sprite) +static void Anim_BounceRotateToSides_SmallSlow(struct Sprite *sprite) { sprite->data[6] = 1; - pokemonanimfunc_48(sprite); + Anim_BounceRotateToSides_Small(sprite); } -static void pokemonanimfunc_4B(struct Sprite *sprite) +static void Anim_ZigzagSlow(struct Sprite *sprite) { if (sprite->data[2] == 0) sprite->data[0] = 0; if (sprite->data[0] <= 0) { - sub_817FC20(sprite); + Zigzag(sprite); sprite->data[0] = 1; } else @@ -3749,169 +3707,170 @@ static void pokemonanimfunc_4B(struct Sprite *sprite) } } -static void pokemonanimfunc_4C(struct Sprite *sprite) +static void Anim_HorizontalShake_Slow(struct Sprite *sprite) { sprite->data[0] = 30; sprite->data[7] = 3; - sub_817FCDC(sprite); - sprite->callback = sub_817FCDC; + HorizontalShake(sprite); + sprite->callback = HorizontalShake; } -static void pokemonanimfunc_4D(struct Sprite *sprite) +static void Anim_VertialShake_Slow(struct Sprite *sprite) { sprite->data[0] = 30; - sub_817FD44(sprite); - sprite->callback = sub_817FD44; + VerticalShake(sprite); + sprite->callback = VerticalShake; } -static void pokemonanimfunc_4E(struct Sprite *sprite) +static void Anim_Twist_Twice(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_6 = 1024; - sUnknown_03001240[id].field_0 = 0; - sUnknown_03001240[id].field_4 = 2; - sub_817FE30(sprite); - sprite->callback = sub_817FE30; + sAnims[id].field_6 = 1024; + sAnims[id].field_0 = 0; + sAnims[id].field_4 = 2; + Twist(sprite); + sprite->callback = Twist; } -static void pokemonanimfunc_4F(struct Sprite *sprite) +static void Anim_CircleCounterclockwise_Slow(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_6 = 512; - sUnknown_03001240[id].field_8 = 3; - sUnknown_03001240[id].field_2 = 12; - sub_817FFF0(sprite); - sprite->callback = sub_817FFF0; + sAnims[id].field_6 = 512; + sAnims[id].field_8 = 3; + sAnims[id].field_2 = 12; + CircleCounterclockwise(sprite); + sprite->callback = CircleCounterclockwise; } -static void pokemonanimfunc_50(struct Sprite *sprite) +static void Anim_VerticalShakeTwice_Slow(struct Sprite *sprite) { sprite->data[0] = 24; - sub_818031C(sprite); - sprite->callback = sub_818031C; + VerticalShakeTwice(sprite); + sprite->callback = VerticalShakeTwice; } -static void pokemonanimfunc_51(struct Sprite *sprite) +static void Anim_VerticalSlideWobble_Small(struct Sprite *sprite) { sprite->data[0] = 5; - sub_81804F8(sprite); - sprite->callback = sub_81804F8; + VerticalSlideWobble(sprite); + sprite->callback = VerticalSlideWobble; } -static void pokemonanimfunc_52(struct Sprite *sprite) +static void Anim_VerticalJumps_Small(struct Sprite *sprite) { sprite->data[0] = 3; - sub_817F9F4(sprite); - sprite->callback = sub_817F9F4; + VerticalJumps(sprite); + sprite->callback = VerticalJumps; } -static void pokemonanimfunc_53(struct Sprite *sprite) +static void Anim_Spin(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_0 = 60; - sUnknown_03001240[id].field_8 = 30; - sub_817FF3C(sprite); - sprite->callback = sub_817FF3C; + sAnims[id].field_0 = 60; + sAnims[id].field_8 = 30; + Spin(sprite); + sprite->callback = Spin; } -static void pokemonanimfunc_54(struct Sprite *sprite) +static void Anim_TumblingFrontFlip_Twice(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_2 = 1; - sUnknown_03001240[id].field_4 = 2; - sub_8181214(sprite); - sprite->callback = sub_8181214; + sAnims[id].field_2 = 1; + sAnims[id].field_4 = 2; + TumblingFrontFlip(sprite); + sprite->callback = TumblingFrontFlip; } -static void pokemonanimfunc_55(struct Sprite *sprite) +static void Anim_DeepVerticalSquishBounce_Twice(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_6 = 4; - sUnknown_03001240[id].field_4 = 2; - sub_8181810(sprite); - sprite->callback = sub_8181810; + sAnims[id].field_6 = 4; + sAnims[id].field_4 = 2; + DeepVerticalSquishBounce(sprite); + sprite->callback = DeepVerticalSquishBounce; } -static void pokemonanimfunc_56(struct Sprite *sprite) +static void Anim_HorizontalJumpsVerticalStretch_Twice(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_8 = 1; - sUnknown_03001240[id].field_4 = 2; + sAnims[id].field_8 = 1; + sAnims[id].field_4 = 2; HandleStartAffineAnim(sprite); sprite->data[3] = 0; - sub_8181ABC(sprite); - sprite->callback = sub_8181ABC; + HorizontalJumpsVerticalStretch_0(sprite); + sprite->callback = HorizontalJumpsVerticalStretch_0; } -static void pokemonanimfunc_07(struct Sprite *sprite) +static void Anim_RotateToSides(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_6 = 2; - sub_8181CE8(sprite); - sprite->callback = sub_8181CE8; + sAnims[id].field_6 = 2; + RotateToSides(sprite); + sprite->callback = RotateToSides; } -static void pokemonanimfunc_08(struct Sprite *sprite) +static void Anim_RotateToSides_Twice(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_6 = 4; - sUnknown_03001240[id].field_4 = 2; - sub_8181CE8(sprite); - sprite->callback = sub_8181CE8; + sAnims[id].field_6 = 4; + sAnims[id].field_4 = 2; + RotateToSides(sprite); + sprite->callback = RotateToSides; } -static void pokemonanimfunc_0B(struct Sprite *sprite) +static void Anim_SwingConcave(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_8 = 100; - sub_81814D4(sprite); - sprite->callback = sub_81814D4; + sAnims[id].field_8 = 100; + SwingConcave(sprite); + sprite->callback = SwingConcave; } -static void pokemonanimfunc_0C(struct Sprite *sprite) +static void Anim_SwingConcave_Fast(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_8 = 50; - sUnknown_03001240[id].field_4 = 2; - sub_81814D4(sprite); - sprite->callback = sub_81814D4; + sAnims[id].field_8 = 50; + sAnims[id].field_4 = 2; + SwingConcave(sprite); + sprite->callback = SwingConcave; } -static void pokemonanimfunc_0D(struct Sprite *sprite) +static void Anim_SwingConvex(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_8 = 100; - sub_81815D4(sprite); - sprite->callback = sub_81815D4; + sAnims[id].field_8 = 100; + SwingConvex(sprite); + sprite->callback = SwingConvex; } -static void pokemonanimfunc_0E(struct Sprite *sprite) +static void Anim_SwingConvex_Fast(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_8 = 50; - sUnknown_03001240[id].field_4 = 2; - sub_81815D4(sprite); - sprite->callback = sub_81815D4; + sAnims[id].field_8 = 50; + sAnims[id].field_4 = 2; + SwingConvex(sprite); + sprite->callback = SwingConvex; } -static void sub_8183140(struct Sprite *sprite) +// Very similar to VerticalShake, used by back animations only +static void VerticalShakeBack(struct Sprite *sprite) { s32 counter = sprite->data[2]; if (counter > 2304) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.y = 0; } else @@ -3922,28 +3881,28 @@ static void sub_8183140(struct Sprite *sprite) sprite->data[2] += sprite->data[0]; } -static void pokemonanimfunc_57(struct Sprite *sprite) +static void Anim_VerticalShakeBack(struct Sprite *sprite) { sprite->data[0] = 60; sprite->data[7] = 3; - sub_8183140(sprite); - sprite->callback = sub_8183140; + VerticalShakeBack(sprite); + sprite->callback = VerticalShakeBack; } -static void pokemonanimfunc_58(struct Sprite *sprite) +static void Anim_VerticalShakeBack_Slow(struct Sprite *sprite) { sprite->data[0] = 30; sprite->data[7] = 3; - sub_8183140(sprite); - sprite->callback = sub_8183140; + VerticalShakeBack(sprite); + sprite->callback = VerticalShakeBack; } -static void pokemonanimfunc_59(struct Sprite *sprite) +static void Anim_VerticalShakeHorizontalSlide_Slow(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] > 2048) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->data[6] = 0; } else @@ -3969,10 +3928,10 @@ static void pokemonanimfunc_59(struct Sprite *sprite) sprite->data[2] += 24; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_81832C8(struct Sprite *sprite) +static void VerticalStretchBothEnds(struct Sprite *sprite) { s16 index1 = 0, index2 = 0; @@ -3983,8 +3942,8 @@ static void sub_81832C8(struct Sprite *sprite) HandleSetAffineData(sprite, 256, 256, 0); if (sprite->data[4] <= 1) { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -4006,7 +3965,7 @@ static void sub_81832C8(struct Sprite *sprite) index1 = sprite->data[7] & 0xFF; } - if (sprite->data[1] == 0) + if (!sprite->sDontFlip) xScale = -256 - Sin(index2, 16); else xScale = 256 + Sin(index2, 16); @@ -4018,7 +3977,7 @@ static void sub_81832C8(struct Sprite *sprite) } } -static void pokemonanimfunc_5A(struct Sprite *sprite) +static void Anim_VerticalStretchBothEnds_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4031,10 +3990,10 @@ static void pokemonanimfunc_5A(struct Sprite *sprite) sprite->data[7] = 0; } - sub_81832C8(sprite); + VerticalStretchBothEnds(sprite); } -static void sub_8183418(struct Sprite *sprite) +static void HorizontalStretchFar(struct Sprite *sprite) { s16 index1 = 0, index2; @@ -4044,8 +4003,8 @@ static void sub_8183418(struct Sprite *sprite) HandleSetAffineData(sprite, 256, 256, 0); if (sprite->data[4] <= 1) { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -4069,7 +4028,7 @@ static void sub_8183418(struct Sprite *sprite) amplitude = sprite->data[3]; - if (sprite->data[1] == 0) + if (!sprite->sDontFlip) xScale = -256 + Sin(index2, amplitude) + Sin(index1, amplitude / 5 * 2); else xScale = 256 - Sin(index2, amplitude) - Sin(index1, amplitude / 5 * 2); @@ -4079,7 +4038,7 @@ static void sub_8183418(struct Sprite *sprite) } } -static void pokemonanimfunc_5B(struct Sprite *sprite) +static void Anim_HorizontalStretchFar_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4092,29 +4051,29 @@ static void pokemonanimfunc_5B(struct Sprite *sprite) sprite->data[7] = 0; } - sub_8183418(sprite); + HorizontalStretchFar(sprite); } -static void sub_8183574(struct Sprite *sprite) +static void VerticalShakeLowTwice(struct Sprite *sprite) { u8 var6, var7; u8 var8 = sprite->data[2]; u8 var9 = sprite->data[6]; u8 var5 = sUnknown_0860AA80[sprite->data[5]][0]; u8 var2 = var5; - if (var5 != 0xFF) + if (var5 != (u8)-1) var5 = sprite->data[7]; else - var5 = 0xFF; // needed to match + var5 = (u8)-1; // needed to match var6 = sUnknown_0860AA80[sprite->data[5]][1]; var7 = 0; - if (var2 != 0xFE) + if (var2 != (u8)-2) var7 = (var6 - var9) * var5 / var6; - if (var5 == 0xFF) + if (var5 == (u8)-1) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.y = 0; } else @@ -4133,34 +4092,35 @@ static void sub_8183574(struct Sprite *sprite) } } -static void pokemonanimfunc_5C(struct Sprite *sprite) +// Very similar in appearance to Anim_VerticalShakeTwice (especially the fast variant), but deeper +static void Anim_VerticalShakeLowTwice(struct Sprite *sprite) { sprite->data[0] = 40; sprite->data[7] = 6; - sub_8183574(sprite); - sprite->callback = sub_8183574; + VerticalShakeLowTwice(sprite); + sprite->callback = VerticalShakeLowTwice; } -static void pokemonanimfunc_5D(struct Sprite *sprite) +static void Anim_HorizontalShake_Fast(struct Sprite *sprite) { sprite->data[0] = 70; sprite->data[7] = 6; - sub_817FCDC(sprite); - sprite->callback = sub_817FCDC; + HorizontalShake(sprite); + sprite->callback = HorizontalShake; } -static void pokemonanimfunc_5E(struct Sprite *sprite) +static void Anim_HorizontalSlide_Fast(struct Sprite *sprite) { sprite->data[0] = 20; - sub_817F8FC(sprite); - sprite->callback = sub_817F8FC; + HorizontalSlide(sprite); + sprite->callback = HorizontalSlide; } -static void pokemonanimfunc_5F(struct Sprite *sprite) +static void Anim_HorizontalVibrate_Fast(struct Sprite *sprite) { if (sprite->data[2] > 40) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.x = 0; } else @@ -4177,11 +4137,11 @@ static void pokemonanimfunc_5F(struct Sprite *sprite) sprite->data[2]++; } -static void pokemonanimfunc_60(struct Sprite *sprite) +static void Anim_HorizontalVibrate_Fastest(struct Sprite *sprite) { if (sprite->data[2] > 40) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.x = 0; } else @@ -4198,42 +4158,42 @@ static void pokemonanimfunc_60(struct Sprite *sprite) sprite->data[2]++; } -static void pokemonanimfunc_61(struct Sprite *sprite) +static void Anim_VerticalShakeBack_Fast(struct Sprite *sprite) { sprite->data[0] = 70; sprite->data[7] = 6; - sub_8183140(sprite); - sprite->callback = sub_8183140; + VerticalShakeBack(sprite); + sprite->callback = VerticalShakeBack; } -static void pokemonanimfunc_62(struct Sprite *sprite) +static void Anim_VerticalShakeLowTwice_Slow(struct Sprite *sprite) { sprite->data[0] = 24; sprite->data[7] = 6; - sub_8183574(sprite); - sprite->callback = sub_8183574; + VerticalShakeLowTwice(sprite); + sprite->callback = VerticalShakeLowTwice; } -static void pokemonanimfunc_63(struct Sprite *sprite) +static void Anim_VerticalShakeLowTwice_Fast(struct Sprite *sprite) { sprite->data[0] = 56; sprite->data[7] = 9; - sub_8183574(sprite); - sprite->callback = sub_8183574; + VerticalShakeLowTwice(sprite); + sprite->callback = VerticalShakeLowTwice; } -static void pokemonanimfunc_64(struct Sprite *sprite) +static void Anim_CircleCounterclockwise_Long(struct Sprite *sprite) { - u8 id = sprite->data[0] = sub_817F758(); + u8 id = sprite->data[0] = AddNewAnim(); - sUnknown_03001240[id].field_6 = 1024; - sUnknown_03001240[id].field_8 = 6; - sUnknown_03001240[id].field_2 = 24; - sub_817FFF0(sprite); - sprite->callback = sub_817FFF0; + sAnims[id].field_6 = 1024; + sAnims[id].field_8 = 6; + sAnims[id].field_2 = 24; + CircleCounterclockwise(sprite); + sprite->callback = CircleCounterclockwise; } -static void sub_81837DC(struct Sprite *sprite) +static void GrowStutter(struct Sprite *sprite) { s16 index1 = 0, index2 = 0; if (sprite->data[5] > sprite->data[6]) @@ -4243,8 +4203,8 @@ static void sub_81837DC(struct Sprite *sprite) HandleSetAffineData(sprite, 256, 256, 0); if (sprite->data[4] <= 1) { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -4268,7 +4228,7 @@ static void sub_81837DC(struct Sprite *sprite) amplitude = sprite->data[3]; - if (sprite->data[1] == 0) + if (!sprite->sDontFlip) xScale = Sin(index2, amplitude) + (Sin(index1, amplitude / 5 * 2) - 256); else xScale = 256 - Sin(index1, amplitude / 5 * 2) - Sin(index2, amplitude); @@ -4279,7 +4239,7 @@ static void sub_81837DC(struct Sprite *sprite) } } -static void pokemonanimfunc_65(struct Sprite *sprite) +static void Anim_GrowStutter_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4292,15 +4252,15 @@ static void pokemonanimfunc_65(struct Sprite *sprite) sprite->data[7] = 0; } - sub_81837DC(sprite); + GrowStutter(sprite); } -static void pokemonanimfunc_66(struct Sprite *sprite) +static void Anim_VerticalShakeHorizontalSlide(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] > 2048) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->data[6] = 0; } else @@ -4326,15 +4286,15 @@ static void pokemonanimfunc_66(struct Sprite *sprite) sprite->data[2] += 48; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_67(struct Sprite *sprite) +static void Anim_VerticalShakeHorizontalSlide_Fast(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] > 2048) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->data[6] = 0; } else @@ -4360,7 +4320,7 @@ static void pokemonanimfunc_67(struct Sprite *sprite) sprite->data[2] += 64; } - sub_817F70C(sprite); + TryFlipX(sprite); } static const s8 sUnknown_0860ADBE[][3] = @@ -4372,9 +4332,9 @@ static const s8 sUnknown_0860ADBE[][3] = {0, 0, 0} }; -static void sub_8183B4C(struct Sprite *sprite) +static void TriangleDown(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] == 0) sprite->data[3] = 0; @@ -4387,7 +4347,7 @@ static void sub_8183B4C(struct Sprite *sprite) if (sUnknown_0860ADBE[sprite->data[3]][2] / sprite->data[5] == 0) { if (--sprite->data[6] == 0) - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; else sprite->data[2] = 0; } @@ -4395,44 +4355,44 @@ static void sub_8183B4C(struct Sprite *sprite) { s32 amplitude = sprite->data[5]; sprite->pos2.x += (sUnknown_0860ADBE[sprite->data[3]][0] * amplitude); - sprite->pos2.y += (sUnknown_0860ADBE[sprite->data[3]][1] * sprite->data[5]); // what's the point of the var if you're not reusing it? + sprite->pos2.y += (sUnknown_0860ADBE[sprite->data[3]][1] * sprite->data[5]); sprite->data[2]++; - sub_817F70C(sprite); + TryFlipX(sprite); } } -static void pokemonanimfunc_68(struct Sprite *sprite) +static void Anim_TriangleDown_Slow(struct Sprite *sprite) { sprite->data[5] = 1; sprite->data[6] = 1; - sub_8183B4C(sprite); - sprite->callback = sub_8183B4C; + TriangleDown(sprite); + sprite->callback = TriangleDown; } -static void pokemonanimfunc_69(struct Sprite *sprite) +static void Anim_TriangleDown(struct Sprite *sprite) { sprite->data[5] = 2; sprite->data[6] = 1; - sub_8183B4C(sprite); - sprite->callback = sub_8183B4C; + TriangleDown(sprite); + sprite->callback = TriangleDown; } -static void pokemonanimfunc_6A(struct Sprite *sprite) +static void Anim_TriangleDown_Fast(struct Sprite *sprite) { sprite->data[5] = 2; sprite->data[6] = 2; - sub_8183B4C(sprite); - sprite->callback = sub_8183B4C; + TriangleDown(sprite); + sprite->callback = TriangleDown; } -static void sub_8183C6C(struct Sprite *sprite) +static void Grow(struct Sprite *sprite) { if (sprite->data[7] > 255) { if (sprite->data[5] <= 1) { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; HandleSetAffineData(sprite, 256, 256, 0); } else @@ -4454,9 +4414,9 @@ static void sub_8183C6C(struct Sprite *sprite) } } -static void pokemonanimfunc_6B(struct Sprite *sprite) +static void Anim_Grow(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] == 0) { HandleStartAffineAnim(sprite); @@ -4466,13 +4426,13 @@ static void pokemonanimfunc_6B(struct Sprite *sprite) sprite->data[5] = 1; } - sub_8183C6C(sprite); - sub_817F70C(sprite); + Grow(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_6C(struct Sprite *sprite) +static void Anim_Grow_Twice(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[2] == 0) { HandleStartAffineAnim(sprite); @@ -4482,11 +4442,11 @@ static void pokemonanimfunc_6C(struct Sprite *sprite) sprite->data[5] = 2; } - sub_8183C6C(sprite); - sub_817F70C(sprite); + Grow(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_6D(struct Sprite *sprite) +static void Anim_HorizontalSpring_Fast(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4498,10 +4458,10 @@ static void pokemonanimfunc_6D(struct Sprite *sprite) sprite->data[4] = 16; } - sub_8182764(sprite); + HorizontalSpring(sprite); } -static void pokemonanimfunc_6E(struct Sprite *sprite) +static void Anim_HorizontalSpring_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4513,10 +4473,10 @@ static void pokemonanimfunc_6E(struct Sprite *sprite) sprite->data[4] = 16; } - sub_8182764(sprite); + HorizontalSpring(sprite); } -static void pokemonanimfunc_6F(struct Sprite *sprite) +static void Anim_HorizontalRepeatedSpring_Fast(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4528,10 +4488,10 @@ static void pokemonanimfunc_6F(struct Sprite *sprite) sprite->data[4] = 16; } - sub_8182830(sprite); + HorizontalRepeatedSpring(sprite); } -static void pokemonanimfunc_70(struct Sprite *sprite) +static void Anim_HorizontalRepeatedSpring(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4543,10 +4503,10 @@ static void pokemonanimfunc_70(struct Sprite *sprite) sprite->data[4] = 8; } - sub_8182830(sprite); + HorizontalRepeatedSpring(sprite); } -static void pokemonanimfunc_71(struct Sprite *sprite) +static void Anim_ShrinkGrow_Fast(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4555,10 +4515,10 @@ static void pokemonanimfunc_71(struct Sprite *sprite) sprite->data[6] = 8; } - sub_8180828(sprite); + ShrinkGrow(sprite); } -static void pokemonanimfunc_72(struct Sprite *sprite) +static void Anim_ShrinkGrow_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4567,10 +4527,10 @@ static void pokemonanimfunc_72(struct Sprite *sprite) sprite->data[6] = 4; } - sub_8180828(sprite); + ShrinkGrow(sprite); } -static void pokemonanimfunc_73(struct Sprite *sprite) +static void Anim_VerticalStretchBothEnds(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4582,10 +4542,10 @@ static void pokemonanimfunc_73(struct Sprite *sprite) sprite->data[7] = 0; } - sub_81832C8(sprite); + VerticalStretchBothEnds(sprite); } -static void pokemonanimfunc_74(struct Sprite *sprite) +static void Anim_VerticalStretchBothEnds_Twice(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4597,10 +4557,10 @@ static void pokemonanimfunc_74(struct Sprite *sprite) sprite->data[7] = 0; } - sub_81832C8(sprite); + VerticalStretchBothEnds(sprite); } -static void pokemonanimfunc_75(struct Sprite *sprite) +static void Anim_HorizontalStretchFar_Twice(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4613,10 +4573,10 @@ static void pokemonanimfunc_75(struct Sprite *sprite) sprite->data[7] = 0; } - sub_8183418(sprite); + HorizontalStretchFar(sprite); } -static void pokemonanimfunc_76(struct Sprite *sprite) +static void Anim_HorizontalStretchFar(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4629,10 +4589,10 @@ static void pokemonanimfunc_76(struct Sprite *sprite) sprite->data[7] = 0; } - sub_8183418(sprite); + HorizontalStretchFar(sprite); } -static void pokemonanimfunc_77(struct Sprite *sprite) +static void Anim_GrowStutter_Twice(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4645,10 +4605,10 @@ static void pokemonanimfunc_77(struct Sprite *sprite) sprite->data[7] = 0; } - sub_81837DC(sprite); + GrowStutter(sprite); } -static void pokemonanimfunc_78(struct Sprite *sprite) +static void Anim_GrowStutter(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4661,16 +4621,16 @@ static void pokemonanimfunc_78(struct Sprite *sprite) sprite->data[7] = 0; } - sub_81837DC(sprite); + GrowStutter(sprite); } -static void sub_8183FA8(struct Sprite *sprite) +static void ConcaveArc(struct Sprite *sprite) { if (sprite->data[7] > 255) { if (sprite->data[6] <= 1) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; sprite->pos2.x = 0; sprite->pos2.y = 0; } @@ -4692,7 +4652,7 @@ static void sub_8183FA8(struct Sprite *sprite) } } -static void pokemonanimfunc_79(struct Sprite *sprite) +static void Anim_ConcaveArcLarge_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4704,10 +4664,10 @@ static void pokemonanimfunc_79(struct Sprite *sprite) sprite->data[3] = 4; } - sub_8183FA8(sprite); + ConcaveArc(sprite); } -static void pokemonanimfunc_7A(struct Sprite *sprite) +static void Anim_ConcaveArcLarge(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4719,10 +4679,10 @@ static void pokemonanimfunc_7A(struct Sprite *sprite) sprite->data[3] = 6; } - sub_8183FA8(sprite); + ConcaveArc(sprite); } -static void pokemonanimfunc_7B(struct Sprite *sprite) +static void Anim_ConcaveArcLarge_Twice(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4734,16 +4694,16 @@ static void pokemonanimfunc_7B(struct Sprite *sprite) sprite->data[3] = 8; } - sub_8183FA8(sprite); + ConcaveArc(sprite); } -static void sub_81840C4(struct Sprite *sprite) +static void ConvexDoubleArc(struct Sprite *sprite) { if (sprite->data[7] > 256) { if (sprite->data[6] <= sprite->data[4]) { - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; } else { @@ -4783,7 +4743,7 @@ static void sub_81840C4(struct Sprite *sprite) } } -static void pokemonanimfunc_7C(struct Sprite *sprite) +static void Anim_ConvexDoubleArc_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4795,10 +4755,10 @@ static void pokemonanimfunc_7C(struct Sprite *sprite) sprite->data[3] = 4; } - sub_81840C4(sprite); + ConvexDoubleArc(sprite); } -static void pokemonanimfunc_7D(struct Sprite *sprite) +static void Anim_ConvexDoubleArc(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4810,10 +4770,10 @@ static void pokemonanimfunc_7D(struct Sprite *sprite) sprite->data[3] = 6; } - sub_81840C4(sprite); + ConvexDoubleArc(sprite); } -static void pokemonanimfunc_7E(struct Sprite *sprite) +static void Anim_ConvexDoubleArc_Twice(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4825,10 +4785,10 @@ static void pokemonanimfunc_7E(struct Sprite *sprite) sprite->data[3] = 8; } - sub_81840C4(sprite); + ConvexDoubleArc(sprite); } -static void pokemonanimfunc_7F(struct Sprite *sprite) +static void Anim_ConcaveArcSmall_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4840,10 +4800,10 @@ static void pokemonanimfunc_7F(struct Sprite *sprite) sprite->data[3] = 4; } - sub_8183FA8(sprite); + ConcaveArc(sprite); } -static void pokemonanimfunc_80(struct Sprite *sprite) +static void Anim_ConcaveArcSmall(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4855,10 +4815,10 @@ static void pokemonanimfunc_80(struct Sprite *sprite) sprite->data[3] = 6; } - sub_8183FA8(sprite); + ConcaveArc(sprite); } -static void pokemonanimfunc_81(struct Sprite *sprite) +static void Anim_ConcaveArcSmall_Twice(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4870,7 +4830,7 @@ static void pokemonanimfunc_81(struct Sprite *sprite) sprite->data[3] = 8; } - sub_8183FA8(sprite); + ConcaveArc(sprite); } static void sub_8184290(struct Sprite *sprite) @@ -4881,7 +4841,7 @@ static void sub_8184290(struct Sprite *sprite) HandleSetAffineData(sprite, 256, 256, sprite->data[6]); } -static void pokemonanimfunc_82(struct Sprite *sprite) +static void Anim_HorizontalDip(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4901,8 +4861,8 @@ static void pokemonanimfunc_82(struct Sprite *sprite) sprite->data[0]++; if (sprite->data[3] <= sprite->data[0]) { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; return; } else @@ -4918,7 +4878,7 @@ static void pokemonanimfunc_82(struct Sprite *sprite) sprite->data[2]++; } -static void pokemonanimfunc_83(struct Sprite *sprite) +static void Anim_HorizontalDip_Fast(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4938,8 +4898,8 @@ static void pokemonanimfunc_83(struct Sprite *sprite) sprite->data[0]++; if (sprite->data[3] <= sprite->data[0]) { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; return; } else @@ -4955,7 +4915,7 @@ static void pokemonanimfunc_83(struct Sprite *sprite) sprite->data[2]++; } -static void pokemonanimfunc_84(struct Sprite *sprite) +static void Anim_HorizontalDip_Twice(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4975,8 +4935,8 @@ static void pokemonanimfunc_84(struct Sprite *sprite) sprite->data[0]++; if (sprite->data[3] <= sprite->data[0]) { - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; return; } else @@ -4992,14 +4952,14 @@ static void pokemonanimfunc_84(struct Sprite *sprite) sprite->data[2]++; } -static void sub_8184468(struct Sprite *sprite) +static void ShrinkGrowVibrate(struct Sprite *sprite) { if (sprite->data[2] > sprite->data[7]) { sprite->pos2.y = 0; HandleSetAffineData(sprite, 256, 256, 0); - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } else { @@ -5032,7 +4992,7 @@ static void sub_8184468(struct Sprite *sprite) sprite->data[2]++; } -static void pokemonanimfunc_85(struct Sprite *sprite) +static void Anim_ShrinkGrowVibrate_Fast(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -5042,10 +5002,10 @@ static void pokemonanimfunc_85(struct Sprite *sprite) sprite->data[7] = 80; } - sub_8184468(sprite); + ShrinkGrowVibrate(sprite); } -static void pokemonanimfunc_86(struct Sprite *sprite) +static void Anim_ShrinkGrowVibrate(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -5055,10 +5015,10 @@ static void pokemonanimfunc_86(struct Sprite *sprite) sprite->data[7] = 40; } - sub_8184468(sprite); + ShrinkGrowVibrate(sprite); } -static void pokemonanimfunc_87(struct Sprite *sprite) +static void Anim_ShrinkGrowVibrate_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -5068,59 +5028,59 @@ static void pokemonanimfunc_87(struct Sprite *sprite) sprite->data[7] = 80; } - sub_8184468(sprite); + ShrinkGrowVibrate(sprite); } -static void sub_8184610(struct Sprite *sprite); -static void sub_8184640(struct Sprite *sprite); -static void sub_8184678(struct Sprite *sprite); -static void sub_81846B8(struct Sprite *sprite); +static void JoltRight_0(struct Sprite *sprite); +static void JoltRight_1(struct Sprite *sprite); +static void JoltRight_2(struct Sprite *sprite); +static void JoltRight_3(struct Sprite *sprite); -static void sub_81845D4(struct Sprite *sprite) +static void JoltRight(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x -= sprite->data[2]; if (sprite->pos2.x <= -sprite->data[6]) { sprite->pos2.x = -sprite->data[6]; sprite->data[7] = 2; - sprite->callback = sub_8184610; + sprite->callback = JoltRight_0; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8184610(struct Sprite *sprite) +static void JoltRight_0(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x += sprite->data[7]; sprite->data[7]++; if (sprite->pos2.x >= 0) - sprite->callback = sub_8184640; + sprite->callback = JoltRight_1; - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8184640(struct Sprite *sprite) +static void JoltRight_1(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x += sprite->data[7]; sprite->data[7]++; if (sprite->pos2.x > sprite->data[6]) { sprite->pos2.x = sprite->data[6]; - sprite->callback = sub_8184678; + sprite->callback = JoltRight_2; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_8184678(struct Sprite *sprite) +static void JoltRight_2(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[3] >= sprite->data[5]) { - sprite->callback = sub_81846B8; + sprite->callback = JoltRight_3; } else { @@ -5129,24 +5089,24 @@ static void sub_8184678(struct Sprite *sprite) sprite->data[3]++; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void sub_81846B8(struct Sprite *sprite) +static void JoltRight_3(struct Sprite *sprite) { - sub_817F70C(sprite); + TryFlipX(sprite); sprite->pos2.x -= 2; if (sprite->pos2.x <= 0) { sprite->pos2.x = 0; - sub_817F77C(sprite); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + ResetSpriteAfterAnim(sprite); + sprite->callback = WaitAnimEnd; } - sub_817F70C(sprite); + TryFlipX(sprite); } -static void pokemonanimfunc_88(struct Sprite *sprite) +static void Anim_JoltRight_Fast(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[7] = 4; @@ -5155,10 +5115,10 @@ static void pokemonanimfunc_88(struct Sprite *sprite) sprite->data[4] = 4; sprite->data[3] = 0; sprite->data[2] = 2; - sprite->callback = sub_81845D4; + sprite->callback = JoltRight; } -static void pokemonanimfunc_89(struct Sprite *sprite) +static void Anim_JoltRight(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[7] = 2; @@ -5167,10 +5127,10 @@ static void pokemonanimfunc_89(struct Sprite *sprite) sprite->data[4] = 2; sprite->data[3] = 0; sprite->data[2] = 1; - sprite->callback = sub_81845D4; + sprite->callback = JoltRight; } -static void pokemonanimfunc_8A(struct Sprite *sprite) +static void Anim_JoltRight_Slow(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[7] = 0; @@ -5179,7 +5139,7 @@ static void pokemonanimfunc_8A(struct Sprite *sprite) sprite->data[4] = 2; sprite->data[3] = 0; sprite->data[2] = 1; - sprite->callback = sub_81845D4; + sprite->callback = JoltRight; } static void sub_8184770(struct Sprite *sprite) @@ -5265,23 +5225,23 @@ static const struct YellowBlendStruct *const sUnknown_0860AE7C[] = sUnknown_0860AE54 }; -static void BackAnimBlendYellow(struct Sprite *sprite) +static void ShakeFlashYellow(struct Sprite *sprite) { const struct YellowBlendStruct *array = sUnknown_0860AE7C[sprite->data[3]]; sub_8184770(sprite); if (array[sprite->data[6]].field_1 == 0xFF) { sprite->pos2.x = 0; - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->callback = WaitAnimEnd; } else { if (sprite->data[4] == 1) { if (array[sprite->data[6]].field_0 != 0) - BlendPalette(sprite->data[7], 0x10, 0x10, RGB_YELLOW); + BlendPalette(sprite->data[7], 16, 16, RGB_YELLOW); else - BlendPalette(sprite->data[7], 0x10, 0, RGB_YELLOW); + BlendPalette(sprite->data[7], 16, 0, RGB_YELLOW); sprite->data[4] = 0; } @@ -5299,7 +5259,7 @@ static void BackAnimBlendYellow(struct Sprite *sprite) } } -static void pokemonanimfunc_8B(struct Sprite *sprite) +static void Anim_ShakeFlashYellow_Fast(struct Sprite *sprite) { if (++sprite->data[2] == 1) { @@ -5310,10 +5270,10 @@ static void pokemonanimfunc_8B(struct Sprite *sprite) sprite->data[3] = 0; } - BackAnimBlendYellow(sprite); + ShakeFlashYellow(sprite); } -static void pokemonanimfunc_8C(struct Sprite *sprite) +static void Anim_ShakeFlashYellow(struct Sprite *sprite) { if (++sprite->data[2] == 1) { @@ -5324,10 +5284,10 @@ static void pokemonanimfunc_8C(struct Sprite *sprite) sprite->data[3] = 1; } - BackAnimBlendYellow(sprite); + ShakeFlashYellow(sprite); } -static void pokemonanimfunc_8D(struct Sprite *sprite) +static void Anim_ShakeFlashYellow_Slow(struct Sprite *sprite) { if (++sprite->data[2] == 1) { @@ -5338,33 +5298,43 @@ static void pokemonanimfunc_8D(struct Sprite *sprite) sprite->data[3] = 2; } - BackAnimBlendYellow(sprite); + ShakeFlashYellow(sprite); } -static void BackAnimBlend(struct Sprite *sprite) +enum { + SHAKEGLOW_RED, + SHAKEGLOW_GREEN, + SHAKEGLOW_BLUE, + SHAKEGLOW_BLACK +}; + +static void ShakeGlow_Blend(struct Sprite *sprite) { static const u16 sColors[] = { - RGB_RED, RGB_GREEN, RGB_BLUE, RGB_BLACK + [SHAKEGLOW_RED] = RGB_RED, + [SHAKEGLOW_GREEN] = RGB_GREEN, + [SHAKEGLOW_BLUE] = RGB_BLUE, + [SHAKEGLOW_BLACK] = RGB_BLACK }; if (sprite->data[2] > 127) { - BlendPalette(sprite->data[7], 0x10, 0, RGB_RED); - sprite->callback = SpriteCB_SetDummyOnAnimEnd; + BlendPalette(sprite->data[7], 16, 0, RGB_RED); + sprite->callback = WaitAnimEnd; } else { sprite->data[6] = Sin(sprite->data[2], 12); - BlendPalette(sprite->data[7], 0x10, sprite->data[6], sColors[sprite->data[1]]); + BlendPalette(sprite->data[7], 16, sprite->data[6], sColors[sprite->data[1]]); } } -static void sub_8184934(struct Sprite *sprite) +static void ShakeGlow_Move(struct Sprite *sprite) { if (sprite->data[3] < sprite->data[4]) { - sub_817F70C(sprite); + TryFlipX(sprite); if (sprite->data[5] > sprite->data[0]) { if (++sprite->data[3] < sprite->data[4]) @@ -5379,11 +5349,11 @@ static void sub_8184934(struct Sprite *sprite) sprite->data[5]++; } - sub_817F70C(sprite); + TryFlipX(sprite); } } -static void pokemonanimfunc_8E(struct Sprite *sprite) +static void Anim_ShakeGlowRed_Fast(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -5392,19 +5362,19 @@ static void pokemonanimfunc_8E(struct Sprite *sprite) sprite->data[5] = 0; sprite->data[4] = 2; sprite->data[3] = 0; - sprite->data[1] = 0; + sprite->data[1] = SHAKEGLOW_RED; } if (sprite->data[2] % 2 == 0) - BackAnimBlend(sprite); + ShakeGlow_Blend(sprite); if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) - sub_8184934(sprite); + ShakeGlow_Move(sprite); sprite->data[2]++; } -static void pokemonanimfunc_8F(struct Sprite *sprite) +static void Anim_ShakeGlowRed(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -5413,19 +5383,19 @@ static void pokemonanimfunc_8F(struct Sprite *sprite) sprite->data[5] = 0; sprite->data[4] = 1; sprite->data[3] = 0; - sprite->data[1] = 0; + sprite->data[1] = SHAKEGLOW_RED; } if (sprite->data[2] % 2 == 0) - BackAnimBlend(sprite); + ShakeGlow_Blend(sprite); if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) - sub_8184934(sprite); + ShakeGlow_Move(sprite); sprite->data[2]++; } -static void pokemonanimfunc_90(struct Sprite *sprite) +static void Anim_ShakeGlowRed_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -5434,19 +5404,19 @@ static void pokemonanimfunc_90(struct Sprite *sprite) sprite->data[5] = 0; sprite->data[4] = 1; sprite->data[3] = 0; - sprite->data[1] = 0; + sprite->data[1] = SHAKEGLOW_RED; } if (sprite->data[2] % 2 == 0) - BackAnimBlend(sprite); + ShakeGlow_Blend(sprite); if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) - sub_8184934(sprite); + ShakeGlow_Move(sprite); sprite->data[2]++; } -static void pokemonanimfunc_91(struct Sprite *sprite) +static void Anim_ShakeGlowGreen_Fast(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -5455,19 +5425,19 @@ static void pokemonanimfunc_91(struct Sprite *sprite) sprite->data[5] = 0; sprite->data[4] = 2; sprite->data[3] = 0; - sprite->data[1] = 1; + sprite->data[1] = SHAKEGLOW_GREEN; } if (sprite->data[2] % 2 == 0) - BackAnimBlend(sprite); + ShakeGlow_Blend(sprite); if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) - sub_8184934(sprite); + ShakeGlow_Move(sprite); sprite->data[2]++; } -static void pokemonanimfunc_92(struct Sprite *sprite) +static void Anim_ShakeGlowGreen(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -5476,19 +5446,19 @@ static void pokemonanimfunc_92(struct Sprite *sprite) sprite->data[5] = 0; sprite->data[4] = 1; sprite->data[3] = 0; - sprite->data[1] = 1; + sprite->data[1] = SHAKEGLOW_GREEN; } if (sprite->data[2] % 2 == 0) - BackAnimBlend(sprite); + ShakeGlow_Blend(sprite); if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) - sub_8184934(sprite); + ShakeGlow_Move(sprite); sprite->data[2]++; } -static void pokemonanimfunc_93(struct Sprite *sprite) +static void Anim_ShakeGlowGreen_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -5497,19 +5467,19 @@ static void pokemonanimfunc_93(struct Sprite *sprite) sprite->data[5] = 0; sprite->data[4] = 1; sprite->data[3] = 0; - sprite->data[1] = 1; + sprite->data[1] = SHAKEGLOW_GREEN; } if (sprite->data[2] % 2 == 0) - BackAnimBlend(sprite); + ShakeGlow_Blend(sprite); if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) - sub_8184934(sprite); + ShakeGlow_Move(sprite); sprite->data[2]++; } -static void pokemonanimfunc_94(struct Sprite *sprite) +static void Anim_ShakeGlowBlue_Fast(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -5518,19 +5488,19 @@ static void pokemonanimfunc_94(struct Sprite *sprite) sprite->data[5] = 0; sprite->data[4] = 2; sprite->data[3] = 0; - sprite->data[1] = 2; + sprite->data[1] = SHAKEGLOW_BLUE; } if (sprite->data[2] % 2 == 0) - BackAnimBlend(sprite); + ShakeGlow_Blend(sprite); if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) - sub_8184934(sprite); + ShakeGlow_Move(sprite); sprite->data[2]++; } -static void pokemonanimfunc_95(struct Sprite *sprite) +static void Anim_ShakeGlowBlue(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -5539,19 +5509,19 @@ static void pokemonanimfunc_95(struct Sprite *sprite) sprite->data[5] = 0; sprite->data[4] = 1; sprite->data[3] = 0; - sprite->data[1] = 2; + sprite->data[1] = SHAKEGLOW_BLUE; } if (sprite->data[2] % 2 == 0) - BackAnimBlend(sprite); + ShakeGlow_Blend(sprite); if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) - sub_8184934(sprite); + ShakeGlow_Move(sprite); sprite->data[2]++; } -static void pokemonanimfunc_96(struct Sprite *sprite) +static void Anim_ShakeGlowBlue_Slow(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -5560,19 +5530,19 @@ static void pokemonanimfunc_96(struct Sprite *sprite) sprite->data[5] = 0; sprite->data[4] = 1; sprite->data[3] = 0; - sprite->data[1] = 2; + sprite->data[1] = SHAKEGLOW_BLUE; } if (sprite->data[2] % 2 == 0) - BackAnimBlend(sprite); + ShakeGlow_Blend(sprite); if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) - sub_8184934(sprite); + ShakeGlow_Move(sprite); sprite->data[2]++; } -static void SpriteCB_SetDummyOnAnimEnd(struct Sprite *sprite) +static void WaitAnimEnd(struct Sprite *sprite) { if (sprite->animEnded) sprite->callback = SpriteCallbackDummy; diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 7dcfd7b99..b8279c253 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -175,7 +175,7 @@ static EWRAM_DATA struct PokemonSummaryScreenData } *sMonSummaryScreen = NULL; EWRAM_DATA u8 gLastViewedMonIndex = 0; static EWRAM_DATA u8 sMoveSlotToReplace = 0; -ALIGNED(4) static EWRAM_DATA u8 sUnknownTaskId = 0; +ALIGNED(4) static EWRAM_DATA u8 sAnimDelayTaskId = 0; // forward declarations static bool8 LoadGraphics(void); @@ -296,6 +296,7 @@ static void SpriteCb_MoveSelector(struct Sprite *sprite); static void DestroyMoveSelectorSprites(u8 firstArrayId); static void SetMainMoveSelectorColor(u8 whichColor); static void KeepMoveSelectorVisible(u8 firstSpriteId); +static void SummaryScreen_DestroyAnimDelayTask(void); // const rom data #include "data/text/move_descriptions.h" @@ -1094,7 +1095,7 @@ void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, } sMonSummaryScreen->currPageIndex = sMonSummaryScreen->minPageIndex; - SummaryScreen_SetUnknownTaskId(0xFF); + SummaryScreen_SetAnimDelayTaskId(TASK_NONE); if (gMonSpritesGfxPtr == NULL) sub_806F2AC(0, 0); @@ -1480,7 +1481,7 @@ static void CloseSummaryScreen(u8 taskId) { SetMainCallback2(sMonSummaryScreen->callback); gLastViewedMonIndex = sMonSummaryScreen->curMonIndex; - SummaryScreen_DestroyUnknownTask(); + SummaryScreen_DestroyAnimDelayTask(); ResetSpriteData(); FreeAllSpritePalettes(); StopCryAndClearCrySongs(); @@ -1598,7 +1599,7 @@ static void Task_ChangeSummaryMon(u8 taskId) StopCryAndClearCrySongs(); break; case 1: - SummaryScreen_DestroyUnknownTask(); + SummaryScreen_DestroyAnimDelayTask(); DestroySpriteAndFreeResources(&gSprites[sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_MON]]); break; case 2: @@ -3933,17 +3934,19 @@ static void SpriteCB_Pokemon(struct Sprite *sprite) } } -void SummaryScreen_SetUnknownTaskId(u8 taskId) +// Track and then destroy Task_PokemonSummaryAnimateAfterDelay +// Normally destroys itself but it can be interrupted before the animation starts +void SummaryScreen_SetAnimDelayTaskId(u8 taskId) { - sUnknownTaskId = taskId; + sAnimDelayTaskId = taskId; } -void SummaryScreen_DestroyUnknownTask(void) +static void SummaryScreen_DestroyAnimDelayTask(void) { - if (sUnknownTaskId != TASK_NONE) + if (sAnimDelayTaskId != TASK_NONE) { - DestroyTask(sUnknownTaskId); - sUnknownTaskId = TASK_NONE; + DestroyTask(sAnimDelayTaskId); + sAnimDelayTaskId = TASK_NONE; } } From fb24336e8f3c3dfbc9fc03ab09a4fd3b5295536d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 10 Apr 2021 01:28:45 -0400 Subject: [PATCH 28/63] Pokemon animation misc cleanup --- src/pokemon_animation.c | 428 ++++++++++++++++++++-------------------- 1 file changed, 214 insertions(+), 214 deletions(-) diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index 5c5cdde7b..14a17437c 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -21,7 +21,7 @@ Vertical and Horizontal are frequently shortened to V and H. Every front animation uses 1 of these ANIMs, and every back animation - uses a BACK_ANIM_* that refers to a set of 3 ANIM functions. Which of + uses a BACK_ANIM_* that refers to a set of 3 ANIM functions. Which of the 3 that gets used depends on the Pokémon's nature (see sBackAnimationIds). The table linking species to a BACK_ANIM is in this file (sSpeciesToBackAnimSet) @@ -38,11 +38,17 @@ struct PokemonAnimData { - u16 field_0; - s16 field_2; - s16 field_4; - s16 field_6; - s16 field_8; + u16 delay; + s16 speed; // Only used by 2 sets of animations + s16 runs; // Number of times to do the animation + s16 rotation; + s16 data; // General use +}; + +struct YellowFlashData +{ + bool8 isYellow; + u8 time; }; static void Anim_VerticalSquishBounce(struct Sprite *sprite); @@ -593,7 +599,8 @@ static const u8 sSpeciesToBackAnimSet[] = [SPECIES_CHIMECHO] = BACK_ANIM_CONVEX_DOUBLE_ARC, }; -static const u8 sFlashYellowData[][2] = +// Equivalent to struct YellowFlashData, but doesn't match as a struct +static const u8 sYellowFlashData[][2] = { {FALSE, 5}, { TRUE, 1}, @@ -611,7 +618,7 @@ static const u8 sFlashYellowData[][2] = {FALSE, -1} }; -static const u8 sUnknown_0860AA80[][2] = +static const u8 sVerticalShakeData[][2] = { { 6, 30}, {-2, 15}, @@ -835,30 +842,29 @@ static const u8 sBackAnimNatureModTable[NUM_NATURES] = [NATURE_QUIRKY] = 1, }; -static const union AffineAnimCmd sSpriteAffineAnim_860AD48[] = +static const union AffineAnimCmd sMonAffineAnim_0[] = { AFFINEANIMCMD_FRAME(256, 256, 0, 0), AFFINEANIMCMDTYPE_END }; -static const union AffineAnimCmd sSpriteAffineAnim_860AD58[] = +static const union AffineAnimCmd sMonAffineAnim_1[] = { AFFINEANIMCMD_FRAME(-256, 256, 0, 0), AFFINEANIMCMDTYPE_END }; -static const union AffineAnimCmd *const sSpriteAffineAnimTable_860AD68[] = +static const union AffineAnimCmd *const sMonAffineAnims[] = { - sSpriteAffineAnim_860AD48, - sSpriteAffineAnim_860AD58 + sMonAffineAnim_0, + sMonAffineAnim_1 }; -// code static void MonAnimDummySpriteCallback(struct Sprite *sprite) { } -static void sub_817F3F0(struct Sprite *sprite, u16 index, s16 amplitudeX, s16 amplitudeY) +static void SetPosForRotation(struct Sprite *sprite, u16 index, s16 amplitudeX, s16 amplitudeY) { s16 xAdder, yAdder; @@ -996,7 +1002,7 @@ static void SetAffineData(struct Sprite *sprite, s16 xScale, s16 yScale, u16 rot static void HandleStartAffineAnim(struct Sprite *sprite) { sprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; - sprite->affineAnims = sSpriteAffineAnimTable_860AD68; + sprite->affineAnims = sMonAffineAnims; if (sIsSummaryAnim == TRUE) InitSpriteAffineAnim(sprite); @@ -1035,11 +1041,11 @@ static bool32 InitAnimData(u8 id) } else { - sAnims[id].field_6 = 0; - sAnims[id].field_0 = 0; - sAnims[id].field_4 = 1; - sAnims[id].field_2 = 0; - sAnims[id].field_8 = 0; + sAnims[id].rotation = 0; + sAnims[id].delay = 0; + sAnims[id].runs = 1; + sAnims[id].speed = 0; + sAnims[id].data = 0; return TRUE; } } @@ -1414,26 +1420,26 @@ static void Twist(struct Sprite *sprite) { s16 id = sprite->data[0]; - if (sAnims[id].field_0 != 0) + if (sAnims[id].delay != 0) { - sAnims[id].field_0--; + sAnims[id].delay--; } else { - if (sprite->data[2] == 0 && sAnims[id].field_8 == 0) + if (sprite->data[2] == 0 && sAnims[id].data == 0) { HandleStartAffineAnim(sprite); - sAnims[id].field_8++; + sAnims[id].data++; } - if (sprite->data[2] > sAnims[id].field_6) + if (sprite->data[2] > sAnims[id].rotation) { HandleSetAffineData(sprite, 256, 256, 0); - if (sAnims[id].field_4 > 1) + if (sAnims[id].runs > 1) { - sAnims[id].field_4--; - sAnims[id].field_0 = 10; + sAnims[id].runs--; + sAnims[id].delay = 10; sprite->data[2] = 0; } else @@ -1456,8 +1462,8 @@ static void Anim_Twist(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_6 = 512; - sAnims[id].field_0 = 0; + sAnims[id].rotation = 512; + sAnims[id].delay = 0; Twist(sprite); sprite->callback = Twist; } @@ -1469,7 +1475,7 @@ static void Spin(struct Sprite *sprite) if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); - if (sprite->data[2] > sAnims[id].field_0) + if (sprite->data[2] > sAnims[id].delay) { HandleSetAffineData(sprite, 256, 256, 0); ResetSpriteAfterAnim(sprite); @@ -1477,7 +1483,7 @@ static void Spin(struct Sprite *sprite) } else { - sprite->data[6] = (65536 / sAnims[id].field_8) * sprite->data[2]; + sprite->data[6] = (65536 / sAnims[id].data) * sprite->data[2]; HandleSetAffineData(sprite, 256, 256, sprite->data[6]); } @@ -1488,8 +1494,8 @@ static void Anim_Spin_Long(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_0 = 60; - sAnims[id].field_8 = 20; + sAnims[id].delay = 60; + sAnims[id].data = 20; Spin(sprite); sprite->callback = Spin; } @@ -1500,7 +1506,7 @@ static void CircleCounterclockwise(struct Sprite *sprite) TryFlipX(sprite); - if (sprite->data[2] > sAnims[id].field_6) + if (sprite->data[2] > sAnims[id].rotation) { sprite->pos2.x = 0; sprite->pos2.y = 0; @@ -1510,11 +1516,11 @@ static void CircleCounterclockwise(struct Sprite *sprite) { s16 index = (sprite->data[2] + 192) % 256; - sprite->pos2.x = -(Cos(index, sAnims[id].field_8 * 2)); - sprite->pos2.y = Sin(index, sAnims[id].field_8) + sAnims[id].field_8; + sprite->pos2.x = -(Cos(index, sAnims[id].data * 2)); + sprite->pos2.y = Sin(index, sAnims[id].data) + sAnims[id].data; } - sprite->data[2] += sAnims[id].field_2; + sprite->data[2] += sAnims[id].speed; TryFlipX(sprite); } @@ -1522,9 +1528,9 @@ static void Anim_CircleCounterclockwise(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_6 = 512; - sAnims[id].field_8 = 6; - sAnims[id].field_2 = 24; + sAnims[id].rotation = 512; + sAnims[id].data = 6; + sAnims[id].speed = 24; CircleCounterclockwise(sprite); sprite->callback = CircleCounterclockwise; } @@ -1632,8 +1638,8 @@ static void VerticalShakeTwice(struct Sprite *sprite) { u8 index = sprite->data[2]; u8 var7 = sprite->data[6]; - u8 var5 = sUnknown_0860AA80[sprite->data[5]][0]; - u8 var6 = sUnknown_0860AA80[sprite->data[5]][1]; + u8 var5 = sVerticalShakeData[sprite->data[5]][0]; + u8 var6 = sVerticalShakeData[sprite->data[5]][1]; u8 amplitude = 0; if (var5 != (u8)-2) @@ -1905,27 +1911,27 @@ static void Anim_ShrinkGrow(struct Sprite *sprite) ShrinkGrow(sprite); } -static const s8 sUnknown_0860AD8E[][8][3] = +static const s8 sBounceRotateToSidesData[][8][3] = { { - {0, 8, 8}, - {8, -8, 12}, - {-8, 8, 12}, - {8, -8, 12}, - {-8, 8, 12}, - {8, -8, 12}, - {-8, 0, 12}, - {0, 0, 0} + { 0, 8, 8}, + { 8, -8, 12}, + {-8, 8, 12}, + { 8, -8, 12}, + {-8, 8, 12}, + { 8, -8, 12}, + {-8, 0, 12}, + { 0, 0, 0} }, { - {0, 8, 16}, - {8, -8, 24}, - {-8, 8, 24}, - {8, -8, 24}, - {-8, 8, 24}, - {8, -8, 24}, - {-8, 0, 24}, - {0, 0, 0} + { 0, 8, 16}, + { 8, -8, 24}, + {-8, 8, 24}, + { 8, -8, 24}, + {-8, 8, 24}, + { 8, -8, 24}, + {-8, 0, 24}, + { 0, 0, 0} }, }; @@ -1940,10 +1946,10 @@ static void BounceRotateToSides(struct Sprite *sprite) TryFlipX(sprite); structId = sprite->data[0]; - var = sAnims[structId].field_6; - r9 = sUnknown_0860AD8E[sAnims[structId].field_8][sprite->data[4]][0]; - r10 = sUnknown_0860AD8E[sAnims[structId].field_8][sprite->data[4]][1] - r9; - arrId = sAnims[structId].field_8; + var = sAnims[structId].rotation; + r9 = sBounceRotateToSidesData[sAnims[structId].data][sprite->data[4]][0]; + r10 = sBounceRotateToSidesData[sAnims[structId].data][sprite->data[4]][1] - r9; + arrId = sAnims[structId].data; r7 = sprite->data[3]; if (sprite->data[2] == 0) @@ -1952,7 +1958,7 @@ static void BounceRotateToSides(struct Sprite *sprite) sprite->data[2]++; } - if (sUnknown_0860AD8E[arrId][sprite->data[4]][2] == 0) + if (sBounceRotateToSidesData[arrId][sprite->data[4]][2] == 0) { HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.x = 0; @@ -1964,13 +1970,13 @@ static void BounceRotateToSides(struct Sprite *sprite) { u16 rotation; - sprite->pos2.y = -(Sin(r7 * 128 / sUnknown_0860AD8E[arrId][sprite->data[4]][2], 10)); - sprite->pos2.x = (r10 * r7 / sUnknown_0860AD8E[arrId][sprite->data[4]][2]) + r9; + sprite->pos2.y = -(Sin(r7 * 128 / sBounceRotateToSidesData[arrId][sprite->data[4]][2], 10)); + sprite->pos2.x = (r10 * r7 / sBounceRotateToSidesData[arrId][sprite->data[4]][2]) + r9; rotation = -(var * sprite->pos2.x) / 8; HandleSetAffineData(sprite, 256, 256, rotation); - if (r7 == sUnknown_0860AD8E[arrId][sprite->data[4]][2]) + if (r7 == sBounceRotateToSidesData[arrId][sprite->data[4]][2]) { sprite->data[4]++; sprite->data[3] = 0; @@ -1987,8 +1993,8 @@ static void BounceRotateToSides(struct Sprite *sprite) static void Anim_BounceRotateToSides(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_6 = 4096; - sAnims[id].field_8 = sprite->data[6]; + sAnims[id].rotation = 4096; + sAnims[id].data = sprite->data[6]; BounceRotateToSides(sprite); sprite->callback = BounceRotateToSides; } @@ -2361,16 +2367,16 @@ static void TumblingFrontFlip(struct Sprite *sprite); static void Anim_TumblingFrontFlip(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_2 = 2; + sAnims[id].speed = 2; TumblingFrontFlip(sprite); sprite->callback = TumblingFrontFlip; } static void TumblingFrontFlip(struct Sprite *sprite) { - if (sAnims[sprite->data[0]].field_0 != 0) + if (sAnims[sprite->data[0]].delay != 0) { - sAnims[sprite->data[0]].field_0--; + sAnims[sprite->data[0]].delay--; } else { @@ -2379,7 +2385,7 @@ static void TumblingFrontFlip(struct Sprite *sprite) { sprite->data[2]++; HandleStartAffineAnim(sprite); - sprite->data[7] = sAnims[sprite->data[0]].field_2; + sprite->data[7] = sAnims[sprite->data[0]].speed; sprite->data[3] = -1; sprite->data[4] = -1; sprite->data[5] = 0; @@ -2406,12 +2412,12 @@ static void TumblingFrontFlip(struct Sprite *sprite) { sprite->pos2.x = 0; sprite->pos2.y = 0; - if (sAnims[sprite->data[0]].field_4 > 1) + if (sAnims[sprite->data[0]].runs > 1) { - sAnims[sprite->data[0]].field_4--; + sAnims[sprite->data[0]].runs--; sprite->data[5] = 0; sprite->data[6] = 0; - sAnims[sprite->data[0]].field_0 = 10; + sAnims[sprite->data[0]].delay = 10; } else { @@ -2473,7 +2479,7 @@ static void Anim_FlashYellow(struct Sprite *sprite) sprite->data[4] = 0; } - if (sFlashYellowData[sprite->data[6]][1] == (u8)-1) + if (sYellowFlashData[sprite->data[6]][1] == (u8)-1) { sprite->callback = WaitAnimEnd; } @@ -2481,7 +2487,7 @@ static void Anim_FlashYellow(struct Sprite *sprite) { if (sprite->data[4] == 1) { - if (sFlashYellowData[sprite->data[6]][0]) + if (sYellowFlashData[sprite->data[6]][0]) BlendPalette(sprite->data[7], 16, 16, RGB_YELLOW); else BlendPalette(sprite->data[7], 16, 0, RGB_YELLOW); @@ -2489,7 +2495,7 @@ static void Anim_FlashYellow(struct Sprite *sprite) sprite->data[4] = 0; } - if (sFlashYellowData[sprite->data[6]][1] == sprite->data[5]) + if (sYellowFlashData[sprite->data[6]][1] == sprite->data[5]) { sprite->data[4] = 1; sprite->data[5] = 0; @@ -2508,13 +2514,13 @@ static void SwingConcave(struct Sprite *sprite) HandleStartAffineAnim(sprite); TryFlipX(sprite); - if (sprite->data[2] > sAnims[sprite->data[0]].field_8) + if (sprite->data[2] > sAnims[sprite->data[0]].data) { HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.x = 0; - if (sAnims[sprite->data[0]].field_4 > 1) + if (sAnims[sprite->data[0]].runs > 1) { - sAnims[sprite->data[0]].field_4--; + sAnims[sprite->data[0]].runs--; sprite->data[2] = 0; } else @@ -2525,7 +2531,7 @@ static void SwingConcave(struct Sprite *sprite) } else { - s16 index = (sprite->data[2] * 256) / sAnims[sprite->data[0]].field_8; + s16 index = (sprite->data[2] * 256) / sAnims[sprite->data[0]].data; sprite->pos2.x = -(Sin(index, 10)); HandleSetAffineData(sprite, 256, 256, Sin(index, 3276)); } @@ -2537,7 +2543,7 @@ static void SwingConcave(struct Sprite *sprite) static void Anim_SwingConcave_FastShort(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_8 = 50; + sAnims[id].data = 50; SwingConcave(sprite); sprite->callback = SwingConcave; } @@ -2548,13 +2554,13 @@ static void SwingConvex(struct Sprite *sprite) HandleStartAffineAnim(sprite); TryFlipX(sprite); - if (sprite->data[2] > sAnims[sprite->data[0]].field_8) + if (sprite->data[2] > sAnims[sprite->data[0]].data) { HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.x = 0; - if (sAnims[sprite->data[0]].field_4 > 1) + if (sAnims[sprite->data[0]].runs > 1) { - sAnims[sprite->data[0]].field_4--; + sAnims[sprite->data[0]].runs--; sprite->data[2] = 0; } else @@ -2565,7 +2571,7 @@ static void SwingConvex(struct Sprite *sprite) } else { - s16 index = (sprite->data[2] * 256) / sAnims[sprite->data[0]].field_8; + s16 index = (sprite->data[2] * 256) / sAnims[sprite->data[0]].data; sprite->pos2.x = -(Sin(index, 10)); HandleSetAffineData(sprite, 256, 256, -(Sin(index, 3276))); } @@ -2577,7 +2583,7 @@ static void SwingConvex(struct Sprite *sprite) static void Anim_SwingConvex_FastShort(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_8 = 50; + sAnims[id].data = 50; SwingConvex(sprite); sprite->callback = SwingConvex; } @@ -2648,9 +2654,9 @@ static void RotateUpSlamDown_2(struct Sprite *sprite) static void DeepVerticalSquishBounce(struct Sprite *sprite) { - if (sAnims[sprite->data[0]].field_0 != 0) + if (sAnims[sprite->data[0]].delay != 0) { - sAnims[sprite->data[0]].field_0--; + sAnims[sprite->data[0]].delay--; } else { @@ -2682,10 +2688,10 @@ static void DeepVerticalSquishBounce(struct Sprite *sprite) HandleSetAffineData(sprite, 256 + sprite->data[6], 256 - sprite->data[7], 0); if (sprite->data[4] == 128) { - if (sAnims[sprite->data[0]].field_4 > 1) + if (sAnims[sprite->data[0]].runs > 1) { - sAnims[sprite->data[0]].field_4--; - sAnims[sprite->data[0]].field_0 = 10; + sAnims[sprite->data[0]].runs--; + sAnims[sprite->data[0]].delay = 10; sprite->data[4] = 0; sprite->data[5] = 0; } @@ -2698,14 +2704,14 @@ static void DeepVerticalSquishBounce(struct Sprite *sprite) } } - sprite->data[4] += sAnims[sprite->data[0]].field_6; + sprite->data[4] += sAnims[sprite->data[0]].rotation; } } static void Anim_DeepVerticalSquishBounce(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_6 = 4; + sAnims[id].rotation = 4; DeepVerticalSquishBounce(sprite); sprite->callback = DeepVerticalSquishBounce; } @@ -2752,7 +2758,7 @@ static void HorizontalJumpsVerticalStretch_2(struct Sprite *sprite); static void Anim_HorizontalJumpsVerticalStretch(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_8 = -1; + sAnims[id].data = -1; HandleStartAffineAnim(sprite); sprite->data[3] = 0; HorizontalJumpsVerticalStretch_0(sprite); @@ -2761,9 +2767,9 @@ static void Anim_HorizontalJumpsVerticalStretch(struct Sprite *sprite) static void HorizontalJumpsVerticalStretch_0(struct Sprite *sprite) { - if (sAnims[sprite->data[0]].field_0 != 0) + if (sAnims[sprite->data[0]].delay != 0) { - sAnims[sprite->data[0]].field_0--; + sAnims[sprite->data[0]].delay--; } else { @@ -2778,7 +2784,7 @@ static void HorizontalJumpsVerticalStretch_0(struct Sprite *sprite) } else { - s32 var = 8 * sAnims[sprite->data[0]].field_8; + s32 var = 8 * sAnims[sprite->data[0]].data; sprite->pos2.x = var * (counter % 128) / 128; sprite->pos2.y = -(Sin(counter % 128, 8)); sprite->data[2] += 12; @@ -2805,7 +2811,7 @@ static void HorizontalJumpsVerticalStretch_1(struct Sprite *sprite) if (sprite->data[2] >= 16 && sprite->data[2] <= 31) { sprite->data[3] += 8; - sprite->pos2.x -= sAnims[sprite->data[0]].field_8; + sprite->pos2.x -= sAnims[sprite->data[0]].data; } yDelta = 0; @@ -2830,10 +2836,10 @@ static void HorizontalJumpsVerticalStretch_2(struct Sprite *sprite) counter = sprite->data[2]; if (counter > 128) { - if (sAnims[sprite->data[0]].field_4 > 1) + if (sAnims[sprite->data[0]].runs > 1) { - sAnims[sprite->data[0]].field_4--; - sAnims[sprite->data[0]].field_0 = 10; + sAnims[sprite->data[0]].runs--; + sAnims[sprite->data[0]].delay = 10; sprite->data[3] = 0; sprite->data[2] = 0; sprite->data[4] = 0; @@ -2850,7 +2856,7 @@ static void HorizontalJumpsVerticalStretch_2(struct Sprite *sprite) } else { - s32 var = sAnims[sprite->data[0]].field_8; + s32 var = sAnims[sprite->data[0]].data; sprite->pos2.x = var * ((counter % 128) * 8) / 128 + 8 * -var; sprite->pos2.y = -(Sin(counter % 128, 8)); @@ -2874,9 +2880,9 @@ static void RotateToSides(struct Sprite *sprite) sprite->pos2.x = 0; sprite->pos2.y = 0; HandleSetAffineData(sprite, 256, 256, 0); - if (sAnims[sprite->data[0]].field_4 > 1) + if (sAnims[sprite->data[0]].runs > 1) { - sAnims[sprite->data[0]].field_4--; + sAnims[sprite->data[0]].runs--; sprite->data[2] = 0; sprite->data[7] = 0; } @@ -2895,7 +2901,7 @@ static void RotateToSides(struct Sprite *sprite) sprite->pos2.x = -(Sin(sprite->data[7], 16)); rotation = Sin(sprite->data[7], 32); HandleSetAffineData(sprite, 256, 256, rotation << 8); - sprite->data[7] += sAnims[sprite->data[0]].field_6; + sprite->data[7] += sAnims[sprite->data[0]].rotation; TryFlipX(sprite); } } @@ -2903,7 +2909,7 @@ static void RotateToSides(struct Sprite *sprite) static void Anim_RotateToSides_Fast(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_6 = 4; + sAnims[id].rotation = 4; RotateToSides(sprite); sprite->callback = RotateToSides; } @@ -3673,8 +3679,8 @@ static void Anim_BounceRotateToSides_Small(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_6 = 2048; - sAnims[id].field_8 = sprite->data[6]; + sAnims[id].rotation = 2048; + sAnims[id].data = sprite->data[6]; BounceRotateToSides(sprite); sprite->callback = BounceRotateToSides; } @@ -3726,9 +3732,9 @@ static void Anim_Twist_Twice(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_6 = 1024; - sAnims[id].field_0 = 0; - sAnims[id].field_4 = 2; + sAnims[id].rotation = 1024; + sAnims[id].delay = 0; + sAnims[id].runs = 2; Twist(sprite); sprite->callback = Twist; } @@ -3737,9 +3743,9 @@ static void Anim_CircleCounterclockwise_Slow(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_6 = 512; - sAnims[id].field_8 = 3; - sAnims[id].field_2 = 12; + sAnims[id].rotation = 512; + sAnims[id].data = 3; + sAnims[id].speed = 12; CircleCounterclockwise(sprite); sprite->callback = CircleCounterclockwise; } @@ -3769,8 +3775,8 @@ static void Anim_Spin(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_0 = 60; - sAnims[id].field_8 = 30; + sAnims[id].delay = 60; + sAnims[id].data = 30; Spin(sprite); sprite->callback = Spin; } @@ -3779,8 +3785,8 @@ static void Anim_TumblingFrontFlip_Twice(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_2 = 1; - sAnims[id].field_4 = 2; + sAnims[id].speed = 1; + sAnims[id].runs = 2; TumblingFrontFlip(sprite); sprite->callback = TumblingFrontFlip; } @@ -3789,8 +3795,8 @@ static void Anim_DeepVerticalSquishBounce_Twice(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_6 = 4; - sAnims[id].field_4 = 2; + sAnims[id].rotation = 4; + sAnims[id].runs = 2; DeepVerticalSquishBounce(sprite); sprite->callback = DeepVerticalSquishBounce; } @@ -3799,8 +3805,8 @@ static void Anim_HorizontalJumpsVerticalStretch_Twice(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_8 = 1; - sAnims[id].field_4 = 2; + sAnims[id].data = 1; + sAnims[id].runs = 2; HandleStartAffineAnim(sprite); sprite->data[3] = 0; HorizontalJumpsVerticalStretch_0(sprite); @@ -3811,7 +3817,7 @@ static void Anim_RotateToSides(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_6 = 2; + sAnims[id].rotation = 2; RotateToSides(sprite); sprite->callback = RotateToSides; } @@ -3820,8 +3826,8 @@ static void Anim_RotateToSides_Twice(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_6 = 4; - sAnims[id].field_4 = 2; + sAnims[id].rotation = 4; + sAnims[id].runs = 2; RotateToSides(sprite); sprite->callback = RotateToSides; } @@ -3830,7 +3836,7 @@ static void Anim_SwingConcave(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_8 = 100; + sAnims[id].data = 100; SwingConcave(sprite); sprite->callback = SwingConcave; } @@ -3839,8 +3845,8 @@ static void Anim_SwingConcave_Fast(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_8 = 50; - sAnims[id].field_4 = 2; + sAnims[id].data = 50; + sAnims[id].runs = 2; SwingConcave(sprite); sprite->callback = SwingConcave; } @@ -3849,7 +3855,7 @@ static void Anim_SwingConvex(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_8 = 100; + sAnims[id].data = 100; SwingConvex(sprite); sprite->callback = SwingConvex; } @@ -3858,8 +3864,8 @@ static void Anim_SwingConvex_Fast(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_8 = 50; - sAnims[id].field_4 = 2; + sAnims[id].data = 50; + sAnims[id].runs = 2; SwingConvex(sprite); sprite->callback = SwingConvex; } @@ -4059,14 +4065,14 @@ static void VerticalShakeLowTwice(struct Sprite *sprite) u8 var6, var7; u8 var8 = sprite->data[2]; u8 var9 = sprite->data[6]; - u8 var5 = sUnknown_0860AA80[sprite->data[5]][0]; + u8 var5 = sVerticalShakeData[sprite->data[5]][0]; u8 var2 = var5; if (var5 != (u8)-1) var5 = sprite->data[7]; else var5 = (u8)-1; // needed to match - var6 = sUnknown_0860AA80[sprite->data[5]][1]; + var6 = sVerticalShakeData[sprite->data[5]][1]; var7 = 0; if (var2 != (u8)-2) var7 = (var6 - var9) * var5 / var6; @@ -4186,9 +4192,9 @@ static void Anim_CircleCounterclockwise_Long(struct Sprite *sprite) { u8 id = sprite->data[0] = AddNewAnim(); - sAnims[id].field_6 = 1024; - sAnims[id].field_8 = 6; - sAnims[id].field_2 = 24; + sAnims[id].rotation = 1024; + sAnims[id].data = 6; + sAnims[id].speed = 24; CircleCounterclockwise(sprite); sprite->callback = CircleCounterclockwise; } @@ -4323,7 +4329,7 @@ static void Anim_VerticalShakeHorizontalSlide_Fast(struct Sprite *sprite) TryFlipX(sprite); } -static const s8 sUnknown_0860ADBE[][3] = +static const s8 sTriangleDownData[][3] = { // x y timer {1, 1, 12}, @@ -4338,13 +4344,13 @@ static void TriangleDown(struct Sprite *sprite) if (sprite->data[2] == 0) sprite->data[3] = 0; - if (sUnknown_0860ADBE[sprite->data[3]][2] / sprite->data[5] == sprite->data[2]) + if (sTriangleDownData[sprite->data[3]][2] / sprite->data[5] == sprite->data[2]) { sprite->data[3]++; sprite->data[2] = 0; } - if (sUnknown_0860ADBE[sprite->data[3]][2] / sprite->data[5] == 0) + if (sTriangleDownData[sprite->data[3]][2] / sprite->data[5] == 0) { if (--sprite->data[6] == 0) sprite->callback = WaitAnimEnd; @@ -4354,8 +4360,8 @@ static void TriangleDown(struct Sprite *sprite) else { s32 amplitude = sprite->data[5]; - sprite->pos2.x += (sUnknown_0860ADBE[sprite->data[3]][0] * amplitude); - sprite->pos2.y += (sUnknown_0860ADBE[sprite->data[3]][1] * sprite->data[5]); + sprite->pos2.x += (sTriangleDownData[sprite->data[3]][0] * amplitude); + sprite->pos2.y += (sTriangleDownData[sprite->data[3]][1] * sprite->data[5]); // Not using amplitude here. No reason for this. sprite->data[2]++; TryFlipX(sprite); } @@ -4833,11 +4839,11 @@ static void Anim_ConcaveArcSmall_Twice(struct Sprite *sprite) ConcaveArc(sprite); } -static void sub_8184290(struct Sprite *sprite) +static void SetHorizontalDip(struct Sprite *sprite) { u16 index = Sin((sprite->data[2] * 128) / sprite->data[7], sprite->data[5]); sprite->data[6] = -(index << 8); - sub_817F3F0(sprite, index, sprite->data[4], 0); + SetPosForRotation(sprite, index, sprite->data[4], 0); HandleSetAffineData(sprite, 256, 256, sprite->data[6]); } @@ -4872,7 +4878,7 @@ static void Anim_HorizontalDip(struct Sprite *sprite) } else { - sub_8184290(sprite); + SetHorizontalDip(sprite); } sprite->data[2]++; @@ -4909,7 +4915,7 @@ static void Anim_HorizontalDip_Fast(struct Sprite *sprite) } else { - sub_8184290(sprite); + SetHorizontalDip(sprite); } sprite->data[2]++; @@ -4946,7 +4952,7 @@ static void Anim_HorizontalDip_Twice(struct Sprite *sprite) } else { - sub_8184290(sprite); + SetHorizontalDip(sprite); } sprite->data[2]++; @@ -5142,7 +5148,7 @@ static void Anim_JoltRight_Slow(struct Sprite *sprite) sprite->callback = JoltRight; } -static void sub_8184770(struct Sprite *sprite) +static void SetShakeFlashYellowPos(struct Sprite *sprite) { sprite->pos2.x = sprite->data[1]; if (sprite->data[0] > 1) @@ -5156,80 +5162,74 @@ static void sub_8184770(struct Sprite *sprite) } } -struct YellowBlendStruct +static const struct YellowFlashData sShakeYellowFlashData_Fast[] = { - u8 field_0; - u8 field_1; + {FALSE, 1}, + { TRUE, 2}, + {FALSE, 15}, + { TRUE, 1}, + {FALSE, 15}, + { TRUE, 1}, + {FALSE, 15}, + { TRUE, 1}, + {FALSE, 1}, + { TRUE, 1}, + {FALSE, 1}, + { TRUE, 1}, + {FALSE, 1}, + { TRUE, 1}, + {FALSE, 1}, + { TRUE, 1}, + {FALSE, 1}, + { TRUE, 1}, + {FALSE, 1}, + {FALSE, -1} }; -static const struct YellowBlendStruct sUnknown_0860ADCC[] = +static const struct YellowFlashData sShakeYellowFlashData_Normal[] = { - {0, 1}, - {1, 2}, - {0, 15}, - {1, 1}, - {0, 15}, - {1, 1}, - {0, 15}, - {1, 1}, - {0, 1}, - {1, 1}, - {0, 1}, - {1, 1}, - {0, 1}, - {1, 1}, - {0, 1}, - {1, 1}, - {0, 1}, - {1, 1}, - {0, 1}, - {0, 0xFF} + {FALSE, 5}, + { TRUE, 1}, + {FALSE, 15}, + { TRUE, 4}, + {FALSE, 2}, + { TRUE, 2}, + {FALSE, 2}, + { TRUE, 2}, + {FALSE, 2}, + { TRUE, 2}, + {FALSE, 2}, + { TRUE, 2}, + {FALSE, 2}, + {FALSE, -1} }; -static const struct YellowBlendStruct sUnknown_0860AE1C[] = +static const struct YellowFlashData sShakeYellowFlashData_Slow[] = { - {0, 5}, - {1, 1}, - {0, 15}, - {1, 4}, - {0, 2}, - {1, 2}, - {0, 2}, - {1, 2}, - {0, 2}, - {1, 2}, - {0, 2}, - {1, 2}, - {0, 2}, - {0, 0xFF} + {FALSE, 1}, + { TRUE, 1}, + {FALSE, 20}, + { TRUE, 1}, + {FALSE, 20}, + { TRUE, 1}, + {FALSE, 20}, + { TRUE, 1}, + {FALSE, 1}, + {FALSE, -1} }; -static const struct YellowBlendStruct sUnknown_0860AE54[] = +static const struct YellowFlashData *const sShakeYellowFlashData[] = { - {0, 1}, - {1, 1}, - {0, 20}, - {1, 1}, - {0, 20}, - {1, 1}, - {0, 20}, - {1, 1}, - {0, 1}, - {0, 0xFF} -}; - -static const struct YellowBlendStruct *const sUnknown_0860AE7C[] = -{ - sUnknown_0860ADCC, - sUnknown_0860AE1C, - sUnknown_0860AE54 + sShakeYellowFlashData_Fast, + sShakeYellowFlashData_Normal, + sShakeYellowFlashData_Slow }; static void ShakeFlashYellow(struct Sprite *sprite) { - const struct YellowBlendStruct *array = sUnknown_0860AE7C[sprite->data[3]]; - sub_8184770(sprite); - if (array[sprite->data[6]].field_1 == 0xFF) + const struct YellowFlashData *array = sShakeYellowFlashData[sprite->data[3]]; + SetShakeFlashYellowPos(sprite); + if (array[sprite->data[6]].time == (u8)-1) { sprite->pos2.x = 0; sprite->callback = WaitAnimEnd; @@ -5238,7 +5238,7 @@ static void ShakeFlashYellow(struct Sprite *sprite) { if (sprite->data[4] == 1) { - if (array[sprite->data[6]].field_0 != 0) + if (array[sprite->data[6]].isYellow) BlendPalette(sprite->data[7], 16, 16, RGB_YELLOW); else BlendPalette(sprite->data[7], 16, 0, RGB_YELLOW); @@ -5246,7 +5246,7 @@ static void ShakeFlashYellow(struct Sprite *sprite) sprite->data[4] = 0; } - if (array[sprite->data[6]].field_1 == sprite->data[5]) + if (array[sprite->data[6]].time == sprite->data[5]) { sprite->data[4] = 1; sprite->data[5] = 0; From 2166e337a1136355e207e99b2dd70df70764c665 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 11 Apr 2021 13:21:22 -0400 Subject: [PATCH 29/63] Label unused move anims --- src/battle_anim_dark.c | 46 +++++++++++++++++++------------------- src/battle_anim_electric.c | 38 +++++++++++++++---------------- src/battle_anim_fight.c | 8 +++---- src/battle_anim_fire.c | 34 ++++++++++++++-------------- src/battle_anim_flying.c | 25 +++++++++++---------- src/battle_anim_ice.c | 26 ++++++++++----------- 6 files changed, 89 insertions(+), 88 deletions(-) diff --git a/src/battle_anim_dark.c b/src/battle_anim_dark.c index 19e8c9523..c2bfe269b 100644 --- a/src/battle_anim_dark.c +++ b/src/battle_anim_dark.c @@ -9,24 +9,24 @@ #include "util.h" #include "constants/rgb.h" -static void sub_81138D4(struct Sprite *); +static void AnimUnusedBagSteal(struct Sprite *); +static void AnimUnusedBagSteal_Step(struct Sprite *); static void AnimBite(struct Sprite *); static void AnimTearDrop(struct Sprite *); static void AnimClawSlash(struct Sprite *); static void AnimTask_AttackerFadeToInvisible_Step(u8); static void AnimTask_AttackerFadeFromInvisible_Step(u8); -static void sub_8113950(struct Sprite *); static void AnimBite_Step1(struct Sprite *); static void AnimBite_Step2(struct Sprite *); static void AnimTearDrop_Step(struct Sprite *); static void AnimTask_MoveAttackerMementoShadow_Step(u8); static void AnimTask_MoveTargetMementoShadow_Step(u8); -static void sub_8114244(struct Task *); -static void sub_8114374(u8); +static void DoMementoShadowEffect(struct Task *); +static void SetAllBattlersSpritePriority(u8); static void AnimTask_MetallicShine_Step(u8); // Unused -const struct SpriteTemplate gUnknown_08596FC8 = +static const struct SpriteTemplate sUnusedBagStealSpriteTemplate = { .tileTag = ANIM_TAG_TIED_BAG, .paletteTag = ANIM_TAG_TIED_BAG, @@ -34,7 +34,7 @@ const struct SpriteTemplate gUnknown_08596FC8 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81138D4, + .callback = AnimUnusedBagSteal, }; static const union AffineAnimCmd sAffineAnim_Bite_0[] = @@ -268,7 +268,7 @@ void AnimTask_InitAttackerFadeFromInvisible(u8 taskId) DestroyAnimVisualTask(taskId); } -static void sub_81138D4(struct Sprite *sprite) +static void AnimUnusedBagSteal(struct Sprite *sprite) { sprite->data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); @@ -279,11 +279,11 @@ static void sub_81138D4(struct Sprite *sprite) sprite->data[3] = -sprite->data[1]; sprite->data[4] = -sprite->data[2]; sprite->data[6] = 0xFFD8; - sprite->callback = sub_8113950; + sprite->callback = AnimUnusedBagSteal_Step; sprite->callback(sprite); } -static void sub_8113950(struct Sprite *sprite) +static void AnimUnusedBagSteal_Step(struct Sprite *sprite) { sprite->data[3] += sprite->data[1]; sprite->data[4] += sprite->data[2]; @@ -430,7 +430,7 @@ void AnimTask_MoveAttackerMementoShadow(u8 taskId) scanlineParams.dmaDest = ®_BG1VOFS; var0 = WINOUT_WIN01_BG1; if (!IsContest()) - gBattle_BG2_X += 240; + gBattle_BG2_X += DISPLAY_WIDTH; } else { @@ -440,7 +440,7 @@ void AnimTask_MoveAttackerMementoShadow(u8 taskId) scanlineParams.dmaDest = ®_BG2VOFS; var0 = WINOUT_WIN01_BG2; if (!IsContest()) - gBattle_BG1_X += 240; + gBattle_BG1_X += DISPLAY_WIDTH; } scanlineParams.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT; @@ -451,7 +451,7 @@ void AnimTask_MoveAttackerMementoShadow(u8 taskId) task->data[0] = 0; task->data[1] = 0; task->data[2] = 0; - sub_8114374(3); + SetAllBattlersSpritePriority(3); for (i = 0; i < 112; i++) { gScanlineEffectRegBuffers[0][i] = task->data[10]; @@ -462,7 +462,7 @@ void AnimTask_MoveAttackerMementoShadow(u8 taskId) SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | (var0 ^ (WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR))); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); gBattle_WIN0H = (task->data[14] << 8) | task->data[15]; - gBattle_WIN0V = 160; + gBattle_WIN0V = DISPLAY_HEIGHT; task->func = AnimTask_MoveAttackerMementoShadow_Step; } @@ -496,14 +496,14 @@ static void AnimTask_MoveAttackerMementoShadow_Step(u8 taskId) break; case 1: task->data[4] -= 8; - sub_8114244(task); + DoMementoShadowEffect(task); if (task->data[4] < task->data[8]) task->data[0]++; break; case 2: task->data[4] -= 8; - sub_8114244(task); + DoMementoShadowEffect(task); task->data[14] += 4; task->data[15] -= 4; @@ -550,12 +550,12 @@ void AnimTask_MoveTargetMementoShadow(u8 taskId) if (task->data[3] == 1) { SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); - gBattle_BG2_X += 240; + gBattle_BG2_X += DISPLAY_WIDTH; } else { SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG2); - gBattle_BG1_X += 240; + gBattle_BG1_X += DISPLAY_WIDTH; } task->data[0]++; @@ -574,7 +574,7 @@ void AnimTask_MoveTargetMementoShadow(u8 taskId) FillPalette(0, 9 * 16, 32); } - sub_8114374(3); + SetAllBattlersSpritePriority(3); task->data[0]++; break; case 2: @@ -622,7 +622,7 @@ void AnimTask_MoveTargetMementoShadow(u8 taskId) SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); gBattle_WIN0H = (task->data[14] << 8) | task->data[15]; - gBattle_WIN0V = 160; + gBattle_WIN0V = DISPLAY_HEIGHT; task->data[0] = 0; task->data[1] = 0; @@ -644,7 +644,7 @@ static void AnimTask_MoveTargetMementoShadow_Step(u8 taskId) if (task->data[5] >= task->data[7]) task->data[5] = task->data[7]; - sub_8114244(task); + DoMementoShadowEffect(task); if (task->data[5] == task->data[7]) task->data[0]++; break; @@ -664,7 +664,7 @@ static void AnimTask_MoveTargetMementoShadow_Step(u8 taskId) if (task->data[4] >= task->data[6]) task->data[4] = task->data[6]; - sub_8114244(task); + DoMementoShadowEffect(task); if (task->data[4] == task->data[6] && task->data[1]) { task->data[1] = 0; @@ -706,7 +706,7 @@ static void AnimTask_MoveTargetMementoShadow_Step(u8 taskId) } } -static void sub_8114244(struct Task *task) +static void DoMementoShadowEffect(struct Task *task) { int var0, var1; s16 var2; @@ -757,7 +757,7 @@ static void sub_8114244(struct Task *task) } } -static void sub_8114374(u8 priority) +static void SetAllBattlersSpritePriority(u8 priority) { u16 i; diff --git a/src/battle_anim_electric.c b/src/battle_anim_electric.c index 1e24f8a16..2c5c7e0f1 100644 --- a/src/battle_anim_electric.c +++ b/src/battle_anim_electric.c @@ -7,9 +7,9 @@ static void AnimLightning(struct Sprite *); static void AnimLightning_Step(struct Sprite *); -static void AnimUnused_0810A214(struct Sprite *); -static void AnimUnused_0810A214_Step(struct Sprite *); -static void AnimUnused_0810A274(struct Sprite *); +static void AnimUnusedSpinningFist(struct Sprite *); +static void AnimUnusedSpinningFist_Step(struct Sprite *); +static void AnimUnusedCirclingShock(struct Sprite *); static void AnimSparkElectricity(struct Sprite *); static void AnimZapCannonSpark(struct Sprite *); static void AnimZapCannonSpark_Step(struct Sprite *); @@ -63,7 +63,7 @@ const struct SpriteTemplate gLightningSpriteTemplate = .callback = AnimLightning, }; -static const union AffineAnimCmd sAnim_Unused_085956D8[] = +static const union AffineAnimCmd sAffineAnim_UnusedSpinningFist[] = { AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 20), @@ -71,24 +71,24 @@ static const union AffineAnimCmd sAnim_Unused_085956D8[] = AFFINEANIMCMD_END, }; -static const union AffineAnimCmd *const sAnims_Unused_085956F8[] = +static const union AffineAnimCmd *const sAffineAnims_UnusedSpinningFist[] = { - sAnim_Unused_085956D8, + sAffineAnim_UnusedSpinningFist, }; // Unused -const struct SpriteTemplate gUnusedSpriteTemplate_085956FC = +static const struct SpriteTemplate sUnusedSpinningFistSpriteTemplate = { .tileTag = ANIM_TAG_HANDS_AND_FEET, .paletteTag = ANIM_TAG_HANDS_AND_FEET, .oam = &gOamData_AffineNormal_ObjNormal_32x32, .anims = gDummySpriteAnimTable, .images = NULL, - .affineAnims = sAnims_Unused_085956F8, - .callback = AnimUnused_0810A214, + .affineAnims = sAffineAnims_UnusedSpinningFist, + .callback = AnimUnusedSpinningFist, }; -static const union AnimCmd sAnim_Unused_08595714[] = +static const union AnimCmd sAnim_UnusedCirclingShock[] = { ANIMCMD_FRAME(0, 5), ANIMCMD_FRAME(16, 5), @@ -99,21 +99,21 @@ static const union AnimCmd sAnim_Unused_08595714[] = ANIMCMD_JUMP(0), }; -static const union AnimCmd *const sAnims_Unused_08595730[] = +static const union AnimCmd *const sAnims_UnusedCirclingShock[] = { - sAnim_Unused_08595714, + sAnim_UnusedCirclingShock, }; // Unused -const struct SpriteTemplate gUnusedSpriteTemplate_08595734 = +static const struct SpriteTemplate sUnusedCirclingShockSpriteTemplate = { .tileTag = ANIM_TAG_SHOCK, .paletteTag = ANIM_TAG_SHOCK, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_Unused_08595730, + .anims = sAnims_UnusedCirclingShock, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimUnused_0810A274, + .callback = AnimUnusedCirclingShock, }; const struct SpriteTemplate gSparkElectricitySpriteTemplate = @@ -473,23 +473,23 @@ static void AnimLightning_Step(struct Sprite *sprite) DestroyAnimSprite(sprite); } -static void AnimUnused_0810A214(struct Sprite *sprite) +static void AnimUnusedSpinningFist(struct Sprite *sprite) { if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) sprite->pos1.x -= gBattleAnimArgs[0]; else sprite->pos1.x += gBattleAnimArgs[0]; - sprite->callback = AnimUnused_0810A214_Step; + sprite->callback = AnimUnusedSpinningFist_Step; } -static void AnimUnused_0810A214_Step(struct Sprite *sprite) +static void AnimUnusedSpinningFist_Step(struct Sprite *sprite) { if (sprite->affineAnimEnded) DestroySpriteAndMatrix(sprite); } -static void AnimUnused_0810A274(struct Sprite *sprite) +static void AnimUnusedCirclingShock(struct Sprite *sprite) { sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); diff --git a/src/battle_anim_fight.c b/src/battle_anim_fight.c index 328f178ae..b3399901e 100644 --- a/src/battle_anim_fight.c +++ b/src/battle_anim_fight.c @@ -6,7 +6,7 @@ #include "trig.h" #include "constants/rgb.h" -static void AnimUnused_080B08A0(struct Sprite *); +static void AnimUnusedHumanoidFoot(struct Sprite *); static void AnimSlideHandOrFootToTarget(struct Sprite *); static void AnimJumpKick(struct Sprite *); static void AnimBasicFistOrFoot(struct Sprite *); @@ -40,7 +40,7 @@ static void AnimSpinningKickOrPunchFinish(struct Sprite *); extern struct SpriteTemplate gBasicHitSplatSpriteTemplate; // Unused -const struct SpriteTemplate gUnusedSpriteTemplate_08595E14 = +static const struct SpriteTemplate sUnusedHumanoidFootSpriteTemplate = { .tileTag = ANIM_TAG_HUMANOID_FOOT, .paletteTag = ANIM_TAG_HUMANOID_FOOT, @@ -48,7 +48,7 @@ const struct SpriteTemplate gUnusedSpriteTemplate_08595E14 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimUnused_080B08A0, + .callback = AnimUnusedHumanoidFoot, }; static const union AnimCmd sAnim_Fist[] = @@ -409,7 +409,7 @@ const struct SpriteTemplate gFocusPunchFistSpriteTemplate = .callback = AnimFocusPunchFist, }; -static void AnimUnused_080B08A0(struct Sprite *sprite) +static void AnimUnusedHumanoidFoot(struct Sprite *sprite) { SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; diff --git a/src/battle_anim_fire.c b/src/battle_anim_fire.c index 5b43f4276..e18d72c31 100644 --- a/src/battle_anim_fire.c +++ b/src/battle_anim_fire.c @@ -12,8 +12,8 @@ static void AnimFireSpread(struct Sprite *); static void AnimFirePlume(struct Sprite *); static void AnimLargeFlame(struct Sprite *); static void AnimLargeFlame_Step(struct Sprite *); -static void AnimUnused_8109064(struct Sprite *); -static void AnimUnused_8109064_Step(struct Sprite *); +static void AnimUnusedSmallEmber(struct Sprite *); +static void AnimUnusedSmallEmber_Step(struct Sprite *); static void AnimSunlight(struct Sprite *); static void AnimEmberFlare(struct Sprite *); static void AnimBurnFlame(struct Sprite *); @@ -162,7 +162,7 @@ const struct SpriteTemplate gFirePlumeSpriteTemplate = }; // Unused -const struct SpriteTemplate gUnusedSpriteTemplate_08595440 = +static const struct SpriteTemplate sUnusedEmberFirePlumeSpriteTemplate = { .tileTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_SMALL_EMBER, @@ -173,7 +173,7 @@ const struct SpriteTemplate gUnusedSpriteTemplate_08595440 = .callback = AnimFirePlume, }; -static const union AnimCmd sAnim_Unused_08595458[] = +static const union AnimCmd sAnim_UnusedSmallEmber[] = { ANIMCMD_FRAME(16, 6), ANIMCMD_FRAME(32, 6), @@ -181,21 +181,21 @@ static const union AnimCmd sAnim_Unused_08595458[] = ANIMCMD_JUMP(0), }; -static const union AnimCmd *const sAnims_Unused_08595468[] = +static const union AnimCmd *const sAnims_UnusedSmallEmber[] = { - sAnim_Unused_08595458, + sAnim_UnusedSmallEmber, }; // Unused -const struct SpriteTemplate gUnusedSpriteTemplate_0859546C = +static const struct SpriteTemplate sUnusedSmallEmberSpriteTemplate = { .tileTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_SMALL_EMBER, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_Unused_08595468, + .anims = sAnims_UnusedSmallEmber, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimUnused_8109064, + .callback = AnimUnusedSmallEmber, }; static const union AffineAnimCmd sAffineAnim_SunlightRay[] = @@ -292,23 +292,23 @@ static const union AnimCmd *const sAnims_FireBlastCross[] = sAnim_FireBlastCross, }; -static const union AffineAnimCmd sAnim_Unused_08595544[] = +static const union AffineAnimCmd sAffineAnim_Unused_0[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 1), AFFINEANIMCMD_END, }; -static const union AffineAnimCmd sAnim_Unused_08595554[] = +static const union AffineAnimCmd sAffineAnim_Unused_1[] = { AFFINEANIMCMD_FRAME(0xA0, 0xA0, 0, 0), AFFINEANIMCMD_END, }; // Unused -static const union AffineAnimCmd *const sAnims_Unused_08595564[] = +static const union AffineAnimCmd *const sAffineAnims_Unused[] = { - sAnim_Unused_08595544, - sAnim_Unused_08595554, + sAffineAnim_Unused_0, + sAffineAnim_Unused_1, }; const struct SpriteTemplate gFireBlastCrossSpriteTemplate = @@ -548,7 +548,7 @@ static void AnimLargeFlame_Step(struct Sprite *sprite) DestroySpriteAndMatrix(sprite); } -static void AnimUnused_8109064(struct Sprite *sprite) +static void AnimUnusedSmallEmber(struct Sprite *sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); @@ -570,10 +570,10 @@ static void AnimUnused_8109064(struct Sprite *sprite) sprite->data[4] = gBattleAnimArgs[6]; sprite->data[5] = 0; - sprite->callback = AnimUnused_8109064_Step; + sprite->callback = AnimUnusedSmallEmber_Step; } -static void AnimUnused_8109064_Step(struct Sprite *sprite) +static void AnimUnusedSmallEmber_Step(struct Sprite *sprite) { if (sprite->data[3]) { diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index 060149a9e..bd6a494c8 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -20,7 +20,7 @@ static void AnimFlyBallAttack_Step(struct Sprite *); static void AnimFallingFeather(struct Sprite *); static void AnimFallingFeather_Step(struct Sprite *); static void AnimWhirlwindLine_Step(struct Sprite *); -static void AnimUnused_810EA4C(struct Sprite *); +static void AnimUnusedBubbleThrow(struct Sprite *); static void AnimWhirlwindLine(struct Sprite *); static void AnimBounceBallShrink(struct Sprite *); static void AnimBounceBallLand(struct Sprite *); @@ -30,8 +30,8 @@ static void AnimDiveBall_Step2(struct Sprite *); static void AnimDiveWaterSplash(struct Sprite *); static void AnimSprayWaterDroplet(struct Sprite *); static void AnimSprayWaterDroplet_Step(struct Sprite *); -static void AnimUnused_810F004(struct Sprite *); -static void AnimUnused_810F004_Step(struct Sprite *); +static void AnimUnusedFlashingLight(struct Sprite *); +static void AnimUnusedFlashingLight_Step(struct Sprite *); static void AnimSkyAttackBird(struct Sprite *); static void AnimSkyAttackBird_Step(struct Sprite *); static void AnimTask_AnimateGustTornadoPalette_Step(u8); @@ -180,7 +180,7 @@ const struct SpriteTemplate gFallingFeatherSpriteTemplate = }; // Unused -const struct SpriteTemplate gUnusedSpriteTemplate_085963A0 = +static const struct SpriteTemplate sUnusedBubbleThrowSpriteTemplate = { .tileTag = ANIM_TAG_SMALL_BUBBLES, .paletteTag = ANIM_TAG_SMALL_BUBBLES, @@ -188,7 +188,7 @@ const struct SpriteTemplate gUnusedSpriteTemplate_085963A0 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimUnused_810EA4C, + .callback = AnimUnusedBubbleThrow, }; static const union AnimCmd sAnim_WhirlwindLines[] = @@ -327,7 +327,7 @@ const struct SpriteTemplate gSprayWaterDropletSpriteTemplate = }; // Unused -const struct SpriteTemplate gUnusedSpriteTemplate_085964FC = +static const struct SpriteTemplate sUnusedFlashingLightSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, @@ -335,7 +335,7 @@ const struct SpriteTemplate gUnusedSpriteTemplate_085964FC = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimUnused_810F004, + .callback = AnimUnusedFlashingLight, }; const struct SpriteTemplate gSkyAttackBirdSpriteTemplate = @@ -892,7 +892,7 @@ static void AnimFallingFeather_Step(struct Sprite *sprite) } } -static void AnimUnused_810EA4C(struct Sprite *sprite) +static void AnimUnusedBubbleThrow(struct Sprite *sprite) { sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); @@ -1158,14 +1158,14 @@ static void AnimSprayWaterDroplet_Step(struct Sprite *sprite) DestroyAnimSprite(sprite); } -static void AnimUnused_810F004(struct Sprite *sprite) +static void AnimUnusedFlashingLight(struct Sprite *sprite) { sprite->data[6] = 0; sprite->data[7] = 64; - sprite->callback = AnimUnused_810F004_Step; + sprite->callback = AnimUnusedFlashingLight_Step; } -static void AnimUnused_810F004_Step(struct Sprite *sprite) +static void AnimUnusedFlashingLight_Step(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -1220,7 +1220,8 @@ void AnimSkyAttackBird_Step(struct Sprite *sprite) DestroySpriteAndMatrix(sprite); } -void AnimTask_Unused_810F184(u8 taskId) +// Unused +static void AnimTask_SetAttackerVisibility(u8 taskId) { if (gBattleAnimArgs[0] == 0) { diff --git a/src/battle_anim_ice.c b/src/battle_anim_ice.c index 53aa14cff..659cd0cb8 100644 --- a/src/battle_anim_ice.c +++ b/src/battle_anim_ice.c @@ -20,8 +20,8 @@ struct HailStruct { s32 unk3:4; }; -static void AnimUnused_810B6C4(struct Sprite *); -static void AnimUnused_810B6C4_Step(struct Sprite *); +static void AnimUnusedIceCrystalThrow(struct Sprite *); +static void AnimUnusedIceCrystalThrow_Step(struct Sprite *); static void AnimIcePunchSwirlingParticle(struct Sprite *); static void AnimIceBeamParticle(struct Sprite *); static void AnimIceEffectParticle(struct Sprite *); @@ -62,7 +62,7 @@ static const union AnimCmd *const sAnims_Unused_08595A54[] = }; // Unused -const struct SpriteTemplate gUnusedSpriteTemplate_08595A58 = +static const struct SpriteTemplate sUnusedIceCrystalThrowSpriteTemplate = { .tileTag = ANIM_TAG_ICE_CRYSTALS, .paletteTag = ANIM_TAG_ICE_CRYSTALS, @@ -70,10 +70,10 @@ const struct SpriteTemplate gUnusedSpriteTemplate_08595A58 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimUnused_810B6C4, + .callback = AnimUnusedIceCrystalThrow, }; -static const union AnimCmd sAnim_Unused_08595A70[] = +static const union AnimCmd sAnim_IceCrystalLargeChunk[] = { ANIMCMD_FRAME(0, 1), ANIMCMD_END, @@ -110,10 +110,10 @@ static const union AnimCmd sAnim_SmallBubblePair[] = ANIMCMD_JUMP(0), }; -// Unused -static const union AnimCmd *const sAnims_Unused_08595AA4[] = +// Unused, contains just the top left corner of the large ice crystal +static const union AnimCmd *const sAnims_IceCrystalLargeChunk[] = { - sAnim_Unused_08595A70, + sAnim_IceCrystalLargeChunk, }; static const union AnimCmd *const sAnims_IceCrystalLarge[] = @@ -524,7 +524,7 @@ const struct SpriteTemplate gIceBallImpactShardSpriteTemplate = }; // Unused -static void AnimUnused_810B6C4(struct Sprite *sprite) +static void AnimUnusedIceCrystalThrow(struct Sprite *sprite) { s16 targetX, targetY, attackerX, attackerY; @@ -540,13 +540,13 @@ static void AnimUnused_810B6C4(struct Sprite *sprite) sprite->data[4] = gBattleAnimArgs[3] + targetY; sub_80A64EC(sprite); - for (;(targetX >= -32 && targetX <= 272) && (targetY >= -32 && targetY <= 192); + for (;(targetX >= -32 && targetX <= DISPLAY_WIDTH + 32) && (targetY >= -32 && targetY <= DISPLAY_HEIGHT + 32); targetX += sprite->data[1], targetY += sprite->data[2]) ; sprite->data[1] = -sprite->data[1]; sprite->data[2] = -sprite->data[2]; - for (;(attackerX >= -32 && attackerX <= 272) && (attackerY >= -32 && attackerY <= 192); + for (;(attackerX >= -32 && attackerX <= DISPLAY_WIDTH + 32) && (attackerY >= -32 && attackerY <= DISPLAY_HEIGHT + 32); attackerX += sprite->data[1], attackerY += sprite->data[2]) ; @@ -560,10 +560,10 @@ static void AnimUnused_810B6C4(struct Sprite *sprite) sub_80A64EC(sprite); sprite->data[3] = gBattleAnimArgs[5]; sprite->data[4] = gBattleAnimArgs[6]; - sprite->callback = AnimUnused_810B6C4_Step; + sprite->callback = AnimUnusedIceCrystalThrow_Step; } -static void AnimUnused_810B6C4_Step(struct Sprite *sprite) +static void AnimUnusedIceCrystalThrow_Step(struct Sprite *sprite) { if (sprite->data[0] != 0) { From c786a9b20c7d70546523a13406d7871f5fa5be2b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 11 Apr 2021 16:23:10 -0400 Subject: [PATCH 30/63] Document pokeblock menu --- include/item_menu_icons.h | 6 +- include/menu_helpers.h | 10 +- include/pokeblock.h | 3 +- src/battle_pyramid_bag.c | 32 +-- src/item_menu.c | 14 +- src/item_menu_icons.c | 12 +- src/lilycove_lady.c | 2 +- src/menu_helpers.c | 60 +++-- src/player_pc.c | 20 +- src/pokeblock.c | 508 ++++++++++++++++++++------------------ src/pokeblock_feed.c | 8 +- 11 files changed, 351 insertions(+), 324 deletions(-) diff --git a/include/item_menu_icons.h b/include/item_menu_icons.h index 7ff6ace94..50e11dfd9 100644 --- a/include/item_menu_icons.h +++ b/include/item_menu_icons.h @@ -14,9 +14,9 @@ void ShakeBagSprite(void); void AddSwitchPocketRotatingBallSprite(s16 rotationDirection); void AddBagItemIconSprite(u16 itemId, u8 id); void RemoveBagItemIconSprite(u8 id); -void sub_80D4FAC(void); -void sub_80D4FC8(u8 arg0); -void sub_80D4FEC(u8 arg0); +void CreateItemMenuSwapLine(void); +void SetItemMenuSwapLineInvisibility(bool8 invisible); +void UpdateItemMenuSwapLinePos(u8 y); u8 CreateBerryTagSprite(u8 id, s16 x, s16 y); void FreeBerryTagSpritePalette(void); u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine); diff --git a/include/menu_helpers.h b/include/menu_helpers.h index 4557ebbb1..c4401354b 100644 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -35,10 +35,10 @@ bool8 MenuHelpers_CallLinkSomething(void); void sub_812220C(struct ItemSlot *slots, u8 count, u8 *arg2, u8 *usedSlotsCount, u8 maxUsedSlotsCount); void sub_812225C(u16 *scrollOffset, u16 *cursorPos, u8 maxShownItems, u8 numItems); void sub_8122298(u16 *arg0, u16 *arg1, u8 arg2, u8 arg3, u8 arg4); -void LoadListMenuArrowsGfx(void); -void sub_8122344(u8 *spriteIds, u8 count); -void sub_81223B0(u8 *spriteIds, u8 count); -void sub_81223FC(u8 *spriteIds, u8 count, bool8 invisible); -void sub_8122448(u8 *spriteIds, u8 count, s16 x, u16 y); +void LoadListMenuSwapLineGfx(void); +void CreateSwapLineSprites(u8 *spriteIds, u8 count); +void DestroySwapLineSprites(u8 *spriteIds, u8 count); +void SetSwapLineSpritesInvisibility(u8 *spriteIds, u8 count, bool8 invisible); +void UpdateSwapLineSpritesPos(u8 *spriteIds, u8 count, s16 x, u16 y); #endif //GUARD_MENU_HELPERS_H diff --git a/include/pokeblock.h b/include/pokeblock.h index c82e99d8f..4c5a40488 100644 --- a/include/pokeblock.h +++ b/include/pokeblock.h @@ -4,8 +4,7 @@ #include "constants/berry.h" #include "constants/pokemon.h" -#define GFX_TAG_POKEBLOCK 14818 -#define GFX_TAG_POKEBLOCK_CASE 14800 +#define TAG_POKEBLOCK 14818 enum { diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index f39bbf522..23f2f9653 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -63,7 +63,7 @@ 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 CreateSwapLine(void); static void sub_81C6E98(void); static void sub_81C6F20(void); static void sub_81C6404(void); @@ -84,8 +84,8 @@ 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 UpdateSwapLinePos(u8 y); +static void SetSwapLineInvisibility(bool8 invisible); static void sub_81C6F68(struct Sprite *sprite); static void BagAction_UseOnField(u8 taskId); static void BagAction_Toss(u8 taskId); @@ -489,7 +489,7 @@ static bool8 sub_81C5078(void) gMain.state++; break; case 14: - sub_81C700C(); + CreateSwapLine(); gMain.state++; break; case 15: @@ -555,7 +555,7 @@ static bool8 sub_81C5238(void) gPyramidBagResources->state++; break; default: - LoadListMenuArrowsGfx(); + LoadListMenuSwapLineGfx(); gPyramidBagResources->state = 0; return TRUE; } @@ -1268,7 +1268,7 @@ static void Task_BeginItemSwap(u8 taskId) FillWindowPixelBuffer(1, PIXEL_FILL(0)); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); sub_81C5A98(data[0], 1); - sub_81C704C(data[1]); + UpdateSwapLinePos(data[1]); gTasks[taskId].func = Task_ItemSwapHandleInput; } @@ -1287,8 +1287,8 @@ static void Task_ItemSwapHandleInput(u8 taskId) { s32 id = ListMenu_ProcessInput(data[0]); ListMenuGetScrollAndRow(data[0], &gPyramidBagCursorData.scrollPosition, &gPyramidBagCursorData.cursorPosition); - sub_81C7028(FALSE); - sub_81C704C(gPyramidBagCursorData.cursorPosition); + SetSwapLineInvisibility(FALSE); + UpdateSwapLinePos(gPyramidBagCursorData.cursorPosition); switch (id) { case LIST_NOTHING_CHOSEN: @@ -1324,7 +1324,7 @@ static void PerformItemSwap(u8 taskId) { MovePyramidBagItemSlotInList(data[1], var); gPyramidBagResources->unk814 = 0xFF; - sub_81C7028(TRUE); + SetSwapLineInvisibility(TRUE); DestroyListMenuTask(data[0], scrollOffset, selectedRow); if (data[1] < var) gPyramidBagCursorData.cursorPosition--; @@ -1341,7 +1341,7 @@ static void sub_81C6A14(u8 taskId) u16 *selectedRow = &gPyramidBagCursorData.cursorPosition; gPyramidBagResources->unk814 = 0xFF; - sub_81C7028(TRUE); + SetSwapLineInvisibility(TRUE); DestroyListMenuTask(data[0], scrollOffset, selectedRow); if (data[1] < *scrollOffset + *selectedRow) gPyramidBagCursorData.cursorPosition--; @@ -1545,17 +1545,17 @@ static void sub_81C6FF8(u8 itemSpriteArrayId) sub_81C6E38(itemSpriteArrayId + 1); } -static void sub_81C700C(void) +static void CreateSwapLine(void) { - sub_8122344(&gPyramidBagResources->itemsSpriteIds[3], 8); + CreateSwapLineSprites(&gPyramidBagResources->itemsSpriteIds[3], 8); } -static void sub_81C7028(bool8 invisible) +static void SetSwapLineInvisibility(bool8 invisible) { - sub_81223FC(&gPyramidBagResources->itemsSpriteIds[3], 8, invisible); + SetSwapLineSpritesInvisibility(&gPyramidBagResources->itemsSpriteIds[3], 8, invisible); } -static void sub_81C704C(u8 y) +static void UpdateSwapLinePos(u8 y) { - sub_8122448(&gPyramidBagResources->itemsSpriteIds[3], 8 | 0x80, 120, (y + 1) * 16); + UpdateSwapLineSpritesPos(&gPyramidBagResources->itemsSpriteIds[3], 8 | 0x80, 120, (y + 1) * 16); } diff --git a/src/item_menu.c b/src/item_menu.c index 8836c0c63..865f8d8d1 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -707,7 +707,7 @@ bool8 SetupBagMenu(void) gMain.state++; break; case 16: - sub_80D4FAC(); + CreateItemMenuSwapLine(); gMain.state++; break; case 17: @@ -787,7 +787,7 @@ bool8 LoadBagMenu_Graphics(void) gBagMenu->graphicsLoadState++; break; default: - LoadListMenuArrowsGfx(); + LoadListMenuSwapLineGfx(); gBagMenu->graphicsLoadState = 0; return TRUE; } @@ -1373,7 +1373,7 @@ void BagMenu_SwapItems(u8 taskId) StringExpandPlaceholders(gStringVar4, gText_MoveVar1Where); FillWindowPixelBuffer(1, PIXEL_FILL(0)); BagMenu_Print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); - sub_80D4FEC(data[1]); + UpdateItemMenuSwapLinePos(data[1]); BagDestroyPocketSwitchArrowPair(); BagMenu_PrintCursor_(data[0], 2); gTasks[taskId].func = Task_HandleSwappingItemsInput; @@ -1396,8 +1396,8 @@ static void Task_HandleSwappingItemsInput(u8 taskId) { input = ListMenu_ProcessInput(data[0]); ListMenuGetScrollAndRow(data[0], &gBagPositionStruct.scrollPosition[gBagPositionStruct.pocket], &gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]); - sub_80D4FC8(0); - sub_80D4FEC(gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]); + SetItemMenuSwapLineInvisibility(FALSE); + UpdateItemMenuSwapLinePos(gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]); switch (input) { case LIST_NOTHING_CHOSEN: @@ -1435,7 +1435,7 @@ void sub_81AC498(u8 taskId) gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]--; LoadBagItemListBuffers(gBagPositionStruct.pocket); data[0] = ListMenuInit(&gMultiuseListMenuTemplate, *scrollPos, *cursorPos); - sub_80D4FC8(1); + SetItemMenuSwapLineInvisibility(TRUE); CreatePocketSwitchArrowPair(); gTasks[taskId].func = Task_BagMenu_HandleInput; } @@ -1453,7 +1453,7 @@ void sub_81AC590(u8 taskId) gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]--; LoadBagItemListBuffers(gBagPositionStruct.pocket); data[0] = ListMenuInit(&gMultiuseListMenuTemplate, *scrollPos, *cursorPos); - sub_80D4FC8(1); + SetItemMenuSwapLineInvisibility(TRUE); CreatePocketSwitchArrowPair(); gTasks[taskId].func = Task_BagMenu_HandleInput; } diff --git a/src/item_menu_icons.c b/src/item_menu_icons.c index dd0081161..d15409226 100644 --- a/src/item_menu_icons.c +++ b/src/item_menu_icons.c @@ -537,19 +537,19 @@ void RemoveBagItemIconSprite(u8 id) RemoveBagSprite(id + 2); } -void sub_80D4FAC(void) +void CreateItemMenuSwapLine(void) { - sub_8122344(&gBagMenu->spriteId[4], 8); + CreateSwapLineSprites(&gBagMenu->spriteId[4], 8); } -void sub_80D4FC8(u8 arg0) +void SetItemMenuSwapLineInvisibility(bool8 invisible) { - sub_81223FC(&gBagMenu->spriteId[4], 8, arg0); + SetSwapLineSpritesInvisibility(&gBagMenu->spriteId[4], 8, invisible); } -void sub_80D4FEC(u8 arg0) +void UpdateItemMenuSwapLinePos(u8 y) { - sub_8122448(&gBagMenu->spriteId[4], 136, 120, (arg0 + 1) * 16); + UpdateSwapLineSpritesPos(&gBagMenu->spriteId[4], 136, 120, (y + 1) * 16); } static void sub_80D5018(void *mem0, void *mem1) diff --git a/src/lilycove_lady.c b/src/lilycove_lady.c index 22155ffd5..6fa8ba4eb 100644 --- a/src/lilycove_lady.c +++ b/src/lilycove_lady.c @@ -805,7 +805,7 @@ void Script_BufferContestLadyCategoryAndMonName(void) void OpenPokeblockCaseForContestLady(void) { - OpenPokeblockCase(3, CB2_ReturnToField); + OpenPokeblockCase(PBLOCK_CASE_GIVE, CB2_ReturnToField); } void SetContestLadyGivenPokeblock(void) diff --git a/src/menu_helpers.c b/src/menu_helpers.c index e7385a5ed..5a6ac8394 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -18,19 +18,17 @@ #include "constants/items.h" #include "constants/maps.h" -// this file's functions +#define TAG_SWAP_LINE 109 + static void Task_ContinueTaskAfterMessagePrints(u8 taskId); static void Task_CallYesOrNoCallback(u8 taskId); -// EWRAM vars EWRAM_DATA static struct YesNoFuncTable gUnknown_0203A138 = {0}; EWRAM_DATA static u8 gUnknown_0203A140 = 0; -// IWRAM bss vars static TaskFunc gUnknown_0300117C; -// const rom data -static const struct OamData sOamData_859F4E8 = +static const struct OamData sOamData_SwapLine = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, @@ -47,47 +45,47 @@ static const struct OamData sOamData_859F4E8 = .affineParam = 0 }; -static const union AnimCmd sSpriteAnim_859F4F0[] = +static const union AnimCmd sAnim_SwapLine_RightArrow[] = { ANIMCMD_FRAME(0, 0), ANIMCMD_END }; -static const union AnimCmd sSpriteAnim_859F4F8[] = +static const union AnimCmd sAnim_SwapLine_Line[] = { ANIMCMD_FRAME(4, 0), ANIMCMD_END }; -static const union AnimCmd sSpriteAnim_859F500[] = +static const union AnimCmd sAnim_SwapLine_LeftArrow[] = { - ANIMCMD_FRAME(0, 0, 1, 0), + ANIMCMD_FRAME(0, 0, .hFlip = TRUE), ANIMCMD_END }; -static const union AnimCmd *const sSpriteAnimTable_859F508[] = +static const union AnimCmd *const sAnims_SwapLine[] = { - sSpriteAnim_859F4F0, - sSpriteAnim_859F4F8, - sSpriteAnim_859F500 + sAnim_SwapLine_RightArrow, + sAnim_SwapLine_Line, + sAnim_SwapLine_LeftArrow }; -static const struct CompressedSpriteSheet gUnknown_0859F514 = +static const struct CompressedSpriteSheet sSpriteSheet_SwapLine = { - gBagSwapLineGfx, 0x100, 109 + gBagSwapLineGfx, 0x100, TAG_SWAP_LINE }; -static const struct CompressedSpritePalette gUnknown_0859F51C = +static const struct CompressedSpritePalette sSpritePalette_SwapLine = { - gBagSwapLinePal, 109 + gBagSwapLinePal, TAG_SWAP_LINE }; -static const struct SpriteTemplate gUnknown_0859F524 = +static const struct SpriteTemplate sSpriteTemplate_SwapLine = { - .tileTag = 109, - .paletteTag = 109, - .oam = &sOamData_859F4E8, - .anims = sSpriteAnimTable_859F508, + .tileTag = TAG_SWAP_LINE, + .paletteTag = TAG_SWAP_LINE, + .oam = &sOamData_SwapLine, + .anims = sAnims_SwapLine, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, @@ -390,19 +388,19 @@ void sub_8122298(u16 *arg0, u16 *arg1, u8 arg2, u8 arg3, u8 arg4) } } -void LoadListMenuArrowsGfx(void) +void LoadListMenuSwapLineGfx(void) { - LoadCompressedSpriteSheet(&gUnknown_0859F514); - LoadCompressedSpritePalette(&gUnknown_0859F51C); + LoadCompressedSpriteSheet(&sSpriteSheet_SwapLine); + LoadCompressedSpritePalette(&sSpritePalette_SwapLine); } -void sub_8122344(u8 *spriteIds, u8 count) +void CreateSwapLineSprites(u8 *spriteIds, u8 count) { u8 i; for (i = 0; i < count; i++) { - spriteIds[i] = CreateSprite(&gUnknown_0859F524, i * 16, 0, 0); + spriteIds[i] = CreateSprite(&sSpriteTemplate_SwapLine, i * 16, 0, 0); if (i != 0) StartSpriteAnim(&gSprites[spriteIds[i]], 1); @@ -410,7 +408,7 @@ void sub_8122344(u8 *spriteIds, u8 count) } } -void sub_81223B0(u8 *spriteIds, u8 count) +void DestroySwapLineSprites(u8 *spriteIds, u8 count) { u8 i; @@ -423,17 +421,15 @@ void sub_81223B0(u8 *spriteIds, u8 count) } } -void sub_81223FC(u8 *spriteIds, u8 count, bool8 invisible) +void SetSwapLineSpritesInvisibility(u8 *spriteIds, u8 count, bool8 invisible) { u8 i; for (i = 0; i < count; i++) - { gSprites[spriteIds[i]].invisible = invisible; - } } -void sub_8122448(u8 *spriteIds, u8 count, s16 x, u16 y) +void UpdateSwapLineSpritesPos(u8 *spriteIds, u8 count, s16 x, u16 y) { u8 i; bool8 unknownBit = count & 0x80; diff --git a/src/player_pc.c b/src/player_pc.c index a06aad60e..e5c3c5a18 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -112,7 +112,7 @@ static void CopyItemName_PlayerPC(u8 *string, u16 itemId); static void sub_816BC14(void); static void sub_816BFE0(u8 y, u8, u8 speed); static void sub_816BCC4(u8); -static void sub_816C690(u8); +static void UpdateSwapLinePos(u8); static void sub_816C4FC(u8 taskId); static void sub_816C0C8(void); static void sub_816C060(u16 itemId); @@ -558,8 +558,8 @@ static void ItemStorage_WithdrawToss_Helper(u8 taskId, bool8 toss) ItemStorage_SetItemAndMailCount(taskId); sub_816BC14(); FreeAndReserveObjectSpritePalettes(); - LoadListMenuArrowsGfx(); - sub_8122344(gUnknown_0203BCC4->spriteIds, 7); + LoadListMenuSwapLineGfx(); + CreateSwapLineSprites(gUnknown_0203BCC4->spriteIds, 7); ClearDialogWindowAndFrame(0,0); gTasks[taskId].func = ItemStorage_ProcessWithdrawTossInput; } @@ -1186,7 +1186,7 @@ static void ItemStorage_GoBackToPlayerPCMenu(u8 taskId) sub_816C0C8(); ItemStorage_RemoveScrollIndicator(); DestroyListMenuTask(data[5], NULL, NULL); - sub_81223B0(gUnknown_0203BCC4->spriteIds, 7); + DestroySwapLineSprites(gUnknown_0203BCC4->spriteIds, 7); sub_816BC58(); gTasks[taskId].func = ItemStorage_GoBackToPlayerPCMenu_InitStorage; } @@ -1199,7 +1199,7 @@ static void ItemStorage_ItemSwapChoosePrompt(u8 taskId) ListMenuSetUnkIndicatorsStructField(data[5], 16, 1); gUnknown_0203BCC4->unk666 = (playerPCItemPageInfo.itemsAbove + playerPCItemPageInfo.cursorPos); sub_816BFB8(data[5], 0, 0); - sub_816C690(gUnknown_0203BCC4->unk666); + UpdateSwapLinePos(gUnknown_0203BCC4->unk666); CopyItemName(gSaveBlock1Ptr->pcItems[gUnknown_0203BCC4->unk666].itemId, gStringVar1); ItemStorage_PrintItemPcResponse(ItemStorage_GetItemPcResponse(ITEMPC_SWITCH_WHICH_ITEM)); gTasks[taskId].func = sub_816C4FC; @@ -1219,8 +1219,8 @@ static void sub_816C4FC(u8 taskId) } id = ListMenu_ProcessInput(data[5]); ListMenuGetScrollAndRow(data[5], &(playerPCItemPageInfo.itemsAbove), &(playerPCItemPageInfo.cursorPos)); - sub_81223FC(gUnknown_0203BCC4->spriteIds, 7, 0); - sub_816C690(playerPCItemPageInfo.cursorPos); + SetSwapLineSpritesInvisibility(gUnknown_0203BCC4->spriteIds, 7, FALSE); + UpdateSwapLinePos(playerPCItemPageInfo.cursorPos); switch(id) { case LIST_NOTHING_CHOSEN: @@ -1268,16 +1268,16 @@ static void ItemStorage_DoItemSwap(u8 taskId, bool8 a) if (gUnknown_0203BCC4->unk666 < b) playerPCItemPageInfo.cursorPos--; LABEL_SKIP_CURSOR_DECREMENT: - sub_81223FC(gUnknown_0203BCC4->spriteIds, 7, 1); + SetSwapLineSpritesInvisibility(gUnknown_0203BCC4->spriteIds, 7, TRUE); gUnknown_0203BCC4->unk666 = 0xFF; data[5] = ListMenuInit(&gMultiuseListMenuTemplate, playerPCItemPageInfo.itemsAbove, playerPCItemPageInfo.cursorPos); ScheduleBgCopyTilemapToVram(0); gTasks[taskId].func = ItemStorage_ProcessInput; } -static void sub_816C690(u8 a) +static void UpdateSwapLinePos(u8 y) { - sub_8122448(gUnknown_0203BCC4->spriteIds, 7, 128, ((a+1) * 16)); + UpdateSwapLineSpritesPos(gUnknown_0203BCC4->spriteIds, 7, 128, ((y+1) * 16)); } static void sub_816C6BC(u8 windowId, u16 value, u32 mode, u8 x, u8 y, u8 n) diff --git a/src/pokeblock.c b/src/pokeblock.c index 3513e7dd2..7856e7054 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -33,23 +33,46 @@ #include "constants/songs.h" #include "constants/rgb.h" +#define MAX_MENU_ITEMS 9 +#define MENU_MIDPOINT (MAX_MENU_ITEMS / 2) + +#define TILE_HIGHLIGHT_NONE 0x0005 // Tile number for the bg of an unselected menu item +#define TILE_HIGHLIGHT_BLUE 0x1005 // Tile number for the bg of a selected menu item +#define TILE_HIGHLIGHT_RED 0x2005 // Tile number for the bg of a menu item to swap + +#define TAG_POKEBLOCK_CASE 14800 +#define TAG_SCROLL_ARROW 1110 + #define POKEBLOCK_MAX_FEEL 99 -#define FIELD_E75_COUNT 7 + +enum { + WIN_TITLE, + WIN_LIST, + WIN_SPICY, + WIN_DRY, + WIN_SWEET, + WIN_BITTER, + WIN_SOUR, + WIN_FEEL, + WIN_ACTIONS_TALL, + WIN_ACTIONS, + WIN_TOSS_MSG, +}; struct PokeblockMenuStruct { - u8 tilemap[0x800]; + u8 tilemap[BG_SCREEN_SIZE]; void (*callbackOnUse)(void); - const u8 *pokeblockOptionsIds; - u8 optionsNo; + const u8 *pokeblockActionIds; + u8 numActions; u8 caseId; u8 itemsNo; u8 maxShowed; struct ListMenuItem items[POKEBLOCKS_COUNT + 1]; - u8 menuItemsStrings[POKEBLOCKS_COUNT + 1][0x20]; // + 1 because of STOW CASE item + u8 menuItemsStrings[POKEBLOCKS_COUNT + 1][32]; // + 1 because of STOW CASE item u8 pokeblockCaseSpriteId; - u8 field_E75[FIELD_E75_COUNT]; - u8 unkTaskId; + u8 swapLineSpriteIds[7]; + u8 arrowTaskId; bool8 isSwapping; s16 gfxState; u8 unused[8]; @@ -58,8 +81,8 @@ struct PokeblockMenuStruct struct PokeblockSavedData { void (*callback)(void); - u16 lastItemPos; - u16 lastItemPage; + u16 selectedRow; + u16 scrollOffset; }; enum @@ -82,43 +105,41 @@ static bool8 LoadPokeblockMenuGfx(void); static void HandleInitBackgrounds(void); static void HandleInitWindows(void); static void SetMenuItemsCountAndMaxShowed(void); -static void sub_81362E0(void); -static void sub_8136344(void); -static void HandlePokeblockListMenuItems(void); -static void sub_81363BC(void); -static void MovePokeblockMenuCursor(s32 pkblId, bool8 arg1, struct ListMenu *arg2); -static void PutPokeblockInfoText(void); -static void HandlePokeblockMenuCursor(u16 cursorPos, u16 arg1); -static void PutPokeblockListMenuString(u8 *dst, u16 pkblId); -static void Task_HandlePokeblockMenuInput(u8 taskId); -static void PokeblockAction_UseOnField(u8 taskId); -static void PokeblockAction_Toss(u8 taskId); -static void PokeblockAction_Cancel(u8 taskId); -static void PokeblockAction_UseInBattle(u8 taskId); -static void PokeblockAction_UseOnPokeblockFeeder(u8 taskId); -static void PokeblockAction_GiveToContestLady(u8 taskId); -static void TossPokeblockChoice_Yes(u8 taskId); -static void TossPokeblockChoice_No(u8 taskId); -static void Task_FreeDataAndExitPokeblockCase(u8 taskId); -static void Task_HandlePokeblockOptionsInput(u8 taskId); -static void PutPokeblockOptionsWindow(u8 taskId); -static void Task_HandlePokeblocksSwapInput(u8 taskId); -static void sub_8136470(struct Sprite *sprite); -static void sub_8135FCC(s32 pkblId); -static void HandlePokeblocksSwap(u8 taskId, bool8 noSwap); +static void LimitMenuScrollAndRow(void); +static void SetInitialScroll(void); +static void UpdatePokeblockList(void); +static void CreateScrollArrows(void); +static void MovePokeblockMenuCursor(s32, bool8, struct ListMenu *); +static void DrawPokeblockMenuTitleText(void); +static void DrawPokeblockMenuHighlight(u16, u16); +static void PutPokeblockListMenuString(u8 *, u16); +static void Task_HandlePokeblockMenuInput(u8); +static void PokeblockAction_UseOnField(u8); +static void PokeblockAction_Toss(u8); +static void PokeblockAction_Cancel(u8); +static void PokeblockAction_UseInBattle(u8); +static void PokeblockAction_UseOnPokeblockFeeder(u8); +static void PokeblockAction_GiveToContestLady(u8); +static void TossedPokeblockMessage(u8); +static void CloseTossPokeblockWindow(u8); +static void Task_FreeDataAndExitPokeblockCase(u8); +static void Task_HandlePokeblockActionsInput(u8); +static void ShowPokeblockActionsWindow(u8); +static void Task_HandlePokeblocksSwapInput(u8); +static void SpriteCB_ShakePokeblockCase(struct Sprite *); +static void DrawPokeblockInfo(s32); +static void UpdatePokeblockSwapMenu(u8, bool8); static void UsePokeblockOnField(void); static void ReturnToPokeblockCaseOnField(void); -static void CreateTossPokeblockYesNoMenu(u8 taskId); -static void HandleErasePokeblock(u8 taskId); +static void CreateTossPokeblockYesNoMenu(u8); +static void TossPokeblock(u8); -// ram variables EWRAM_DATA static struct PokeblockSavedData sSavedPokeblockData = {0}; EWRAM_DATA static struct PokeblockMenuStruct *sPokeblockMenu = NULL; -// const rom data const s8 gPokeblockFlavorCompatibilityTable[NUM_NATURES * FLAVOR_COUNT] = { - // Cool, Beauty, Cute, Smart, Tough + // Spicy, Dry, Sweet, Bitter, Sour 0, 0, 0, 0, 0, // Hardy 1, 0, 0, 0, -1, // Lonely 1, 0, -1, 0, 0, // Brave @@ -198,12 +219,12 @@ const u8 *const gPokeblockNames[] = static const struct MenuAction sPokeblockMenuActions[] = { - {gMenuText_Use, PokeblockAction_UseOnField}, - {gMenuText_Toss, PokeblockAction_Toss}, - {gText_Cancel2, PokeblockAction_Cancel}, - {gMenuText_Use, PokeblockAction_UseInBattle}, - {gMenuText_Use, PokeblockAction_UseOnPokeblockFeeder}, - {gMenuText_Give2, PokeblockAction_GiveToContestLady}, + [PKBL_USE_ON_FIELD] = {gMenuText_Use, PokeblockAction_UseOnField}, + [PKBL_TOSS] = {gMenuText_Toss, PokeblockAction_Toss}, + [PKBL_CANCEL] = {gText_Cancel2, PokeblockAction_Cancel}, + [PKBL_USE_IN_BATTLE] = {gMenuText_Use, PokeblockAction_UseInBattle}, + [PKBL_USE_ON_FEEDER] = {gMenuText_Use, PokeblockAction_UseOnPokeblockFeeder}, + [PKBL_GIVE_TO_LADY] = {gMenuText_Give2, PokeblockAction_GiveToContestLady}, }; static const u8 sActionsOnField[] = {PKBL_USE_ON_FIELD, PKBL_TOSS, PKBL_CANCEL}; @@ -211,7 +232,7 @@ static const u8 sActionsInBattle[] = {PKBL_USE_IN_BATTLE, PKBL_CANCEL}; static const u8 sActionsOnPokeblockFeeder[] = {PKBL_USE_ON_FEEDER, PKBL_CANCEL}; static const u8 sActionsWhenGivingToLady[] = {PKBL_GIVE_TO_LADY, PKBL_CANCEL}; -static const struct YesNoFuncTable sTossYesNoFuncTable = {TossPokeblockChoice_Yes, TossPokeblockChoice_No}; +static const struct YesNoFuncTable sTossYesNoFuncTable = {TossedPokeblockMessage, CloseTossPokeblockWindow}; static const u8 sContestStatsMonData[] = {MON_DATA_COOL, MON_DATA_BEAUTY, MON_DATA_CUTE, MON_DATA_SMART, MON_DATA_TOUGH}; @@ -259,39 +280,39 @@ static const union AffineAnimCmd *const sSpriteAffineAnimTable_85B26F0[] = const struct CompressedSpriteSheet gPokeblockCase_SpriteSheet = { - gMenuPokeblockDevice_Gfx, 0x800, GFX_TAG_POKEBLOCK_CASE + gMenuPokeblockDevice_Gfx, 0x800, TAG_POKEBLOCK_CASE }; const struct CompressedSpritePalette gPokeblockCase_SpritePal = { - gMenuPokeblockDevice_Pal, GFX_TAG_POKEBLOCK_CASE + gMenuPokeblockDevice_Pal, TAG_POKEBLOCK_CASE }; static const struct SpriteTemplate sSpriteTemplate_PokeblockCase = { - GFX_TAG_POKEBLOCK_CASE, - GFX_TAG_POKEBLOCK_CASE, - &sOamData_PokeblockCase, - sSpriteAnimTable_PokeblockCase, - NULL, - gDummySpriteAffineAnimTable, - SpriteCallbackDummy + .tileTag = TAG_POKEBLOCK_CASE, + .paletteTag = TAG_POKEBLOCK_CASE, + .oam = &sOamData_PokeblockCase, + .anims = sSpriteAnimTable_PokeblockCase, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy }; -static const u8 sTextColorInPokeblockMenu[3] = {0, 2, 3}; +static const u8 sTextColor[3] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}; -static const struct Pokeblock sFavoritePokeblocksTable[] = +static const struct Pokeblock sFavoritePokeblocksTable[FLAVOR_COUNT] = { - { PBLOCK_CLR_RED, 20, 0, 0, 0, 0, 20}, - { PBLOCK_CLR_BLUE, 0, 20, 0, 0, 0, 20}, - { PBLOCK_CLR_PINK, 0, 0, 20, 0, 0, 20}, - { PBLOCK_CLR_GREEN, 0, 0, 0, 20, 0, 20}, - { PBLOCK_CLR_YELLOW, 0, 0, 0, 0, 20, 20} + [FLAVOR_SPICY] = { PBLOCK_CLR_RED, 20, 0, 0, 0, 0, 20}, + [FLAVOR_DRY] = { PBLOCK_CLR_BLUE, 0, 20, 0, 0, 0, 20}, + [FLAVOR_SWEET] = { PBLOCK_CLR_PINK, 0, 0, 20, 0, 0, 20}, + [FLAVOR_BITTER] = { PBLOCK_CLR_GREEN, 0, 0, 0, 20, 0, 20}, + [FLAVOR_SOUR] = { PBLOCK_CLR_YELLOW, 0, 0, 0, 0, 20, 20} }; -static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = +static const struct WindowTemplate sWindowTemplates[] = { - { + [WIN_TITLE] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 1, @@ -300,7 +321,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .paletteNum = 15, .baseBlock = 0x1E }, - { + [WIN_LIST] = { .bg = 0, .tilemapLeft = 15, .tilemapTop = 1, @@ -309,7 +330,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .paletteNum = 15, .baseBlock = 0x30 }, - { + [WIN_SPICY] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 13, @@ -318,7 +339,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .paletteNum = 15, .baseBlock = 0x12C }, - { + [WIN_DRY] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, @@ -327,7 +348,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .paletteNum = 15, .baseBlock = 0x136 }, - { + [WIN_SWEET] = { .bg = 0, .tilemapLeft = 2, .tilemapTop = 17, @@ -336,7 +357,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .paletteNum = 15, .baseBlock = 0x140 }, - { + [WIN_BITTER] = { .bg = 0, .tilemapLeft = 8, .tilemapTop = 13, @@ -345,7 +366,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .paletteNum = 15, .baseBlock = 0x14A }, - { + [WIN_SOUR] = { .bg = 0, .tilemapLeft = 8, .tilemapTop = 15, @@ -354,7 +375,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .paletteNum = 15, .baseBlock = 0x154 }, - { + [WIN_FEEL] = { .bg = 0, .tilemapLeft = 11, .tilemapTop = 17, @@ -363,7 +384,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .paletteNum = 15, .baseBlock = 0x15E }, - { + [WIN_ACTIONS_TALL] = { .bg = 1, .tilemapLeft = 7, .tilemapTop = 5, @@ -372,7 +393,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .paletteNum = 15, .baseBlock = 0x162 }, - { + [WIN_ACTIONS] = { .bg = 1, .tilemapLeft = 7, .tilemapTop = 7, @@ -381,7 +402,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .paletteNum = 15, .baseBlock = 0x186 }, - { + [WIN_TOSS_MSG] = { .bg = 1, .tilemapLeft = 2, .tilemapTop = 15, @@ -411,7 +432,7 @@ static const struct ListMenuTemplate sPokeblockListMenuTemplate = .itemPrintFunc = NULL, .totalItems = 0, .maxShowed = 0, - .windowId = 1, + .windowId = WIN_LIST, .header_X = 0, .item_X = 1, .cursor_X = 0, @@ -426,33 +447,32 @@ static const struct ListMenuTemplate sPokeblockListMenuTemplate = .cursorKind = 1 }; -// code void OpenPokeblockCase(u8 caseId, void (*callback)(void)) { sPokeblockMenu = Alloc(sizeof(*sPokeblockMenu)); sPokeblockMenu->caseId = caseId; sPokeblockMenu->callbackOnUse = NULL; - sPokeblockMenu->unkTaskId = TASK_NONE; + sPokeblockMenu->arrowTaskId = TASK_NONE; sPokeblockMenu->isSwapping = FALSE; sSavedPokeblockData.callback = callback; switch (sPokeblockMenu->caseId) { case PBLOCK_CASE_BATTLE: - sPokeblockMenu->pokeblockOptionsIds = sActionsInBattle; - sPokeblockMenu->optionsNo = ARRAY_COUNT(sActionsInBattle); + sPokeblockMenu->pokeblockActionIds = sActionsInBattle; + sPokeblockMenu->numActions = ARRAY_COUNT(sActionsInBattle); break; case PBLOCK_CASE_FEEDER: - sPokeblockMenu->pokeblockOptionsIds = sActionsOnPokeblockFeeder; - sPokeblockMenu->optionsNo = ARRAY_COUNT(sActionsOnPokeblockFeeder); + sPokeblockMenu->pokeblockActionIds = sActionsOnPokeblockFeeder; + sPokeblockMenu->numActions = ARRAY_COUNT(sActionsOnPokeblockFeeder); break; case PBLOCK_CASE_GIVE: - sPokeblockMenu->pokeblockOptionsIds = sActionsWhenGivingToLady; - sPokeblockMenu->optionsNo = ARRAY_COUNT(sActionsWhenGivingToLady); + sPokeblockMenu->pokeblockActionIds = sActionsWhenGivingToLady; + sPokeblockMenu->numActions = ARRAY_COUNT(sActionsWhenGivingToLady); break; default: // PBLOCK_CASE_FIELD - sPokeblockMenu->pokeblockOptionsIds = sActionsOnField; - sPokeblockMenu->optionsNo = ARRAY_COUNT(sActionsOnField); + sPokeblockMenu->pokeblockActionIds = sActionsOnField; + sPokeblockMenu->numActions = ARRAY_COUNT(sActionsOnField); break; } @@ -498,6 +518,10 @@ static void CB2_InitPokeblockMenu(void) } } +#define tListTaskId data[0] +#define tWindowId data[1] +#define tToSwapId data[2] + static bool8 InitPokeblockMenu(void) { u8 taskId; @@ -519,7 +543,7 @@ static bool8 InitPokeblockMenu(void) break; case 3: ResetPaletteFade(); - gPaletteFade.bufferTransferDisabled = 1; + gPaletteFade.bufferTransferDisabled = TRUE; gMain.state++; break; case 4: @@ -543,8 +567,8 @@ static bool8 InitPokeblockMenu(void) break; case 8: SetMenuItemsCountAndMaxShowed(); - sub_81362E0(); - sub_8136344(); + LimitMenuScrollAndRow(); + SetInitialScroll(); gMain.state++; break; case 9: @@ -552,11 +576,11 @@ static bool8 InitPokeblockMenu(void) gMain.state++; break; case 10: - sub_8122344(sPokeblockMenu->field_E75, FIELD_E75_COUNT); + CreateSwapLineSprites(sPokeblockMenu->swapLineSpriteIds, ARRAY_COUNT(sPokeblockMenu->swapLineSpriteIds)); gMain.state++; break; case 11: - HandlePokeblockMenuCursor(sSavedPokeblockData.lastItemPos, 0x1005); + DrawPokeblockMenuHighlight(sSavedPokeblockData.selectedRow, TILE_HIGHLIGHT_BLUE); gMain.state++; break; case 12: @@ -564,29 +588,29 @@ static bool8 InitPokeblockMenu(void) gMain.state++; break; case 13: - HandlePokeblockListMenuItems(); + UpdatePokeblockList(); gMain.state++; break; case 14: - sub_81363BC(); + CreateScrollArrows(); gMain.state++; break; case 15: taskId = CreateTask(Task_HandlePokeblockMenuInput, 0); - gTasks[taskId].data[0] = ListMenuInit(&gMultiuseListMenuTemplate, sSavedPokeblockData.lastItemPage, sSavedPokeblockData.lastItemPos); + gTasks[taskId].tListTaskId = ListMenuInit(&gMultiuseListMenuTemplate, sSavedPokeblockData.scrollOffset, sSavedPokeblockData.selectedRow); gMain.state++; break; case 16: - PutPokeblockInfoText(); + DrawPokeblockMenuTitleText(); gMain.state++; break; case 17: - BlendPalettes(PALETTES_ALL, 0x10, 0); + BlendPalettes(PALETTES_ALL, 16, 0); gMain.state++; break; case 18: - BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); - gPaletteFade.bufferTransferDisabled = 0; + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); + gPaletteFade.bufferTransferDisabled = FALSE; gMain.state++; break; default: @@ -645,7 +669,7 @@ static bool8 LoadPokeblockMenuGfx(void) sPokeblockMenu->gfxState++; break; case 5: - LoadListMenuArrowsGfx(); + LoadListMenuSwapLineGfx(); sPokeblockMenu->gfxState = 0; return TRUE; } @@ -657,16 +681,14 @@ static void HandleInitWindows(void) { u8 i; - InitWindows(sWindowTemplatesForPokeblockMenu); + InitWindows(sWindowTemplates); DeactivateAllTextPrinters(); LoadUserWindowBorderGfx(0, 1, 0xE0); LoadMessageBoxGfx(0, 0xA, 0xD0); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); - for (i = 0; i < ARRAY_COUNT(sWindowTemplatesForPokeblockMenu) - 1; i++) - { + for (i = 0; i < ARRAY_COUNT(sWindowTemplates) - 1; i++) FillWindowPixelBuffer(i, PIXEL_FILL(0)); - } ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(1); @@ -674,29 +696,27 @@ static void HandleInitWindows(void) static void PrintOnPokeblockWindow(u8 windowId, const u8 *string, s32 x) { - AddTextPrinterParameterized4(windowId, 1, x, 1, 0, 0, sTextColorInPokeblockMenu, 0, string); + AddTextPrinterParameterized4(windowId, 1, x, 1, 0, 0, sTextColor, 0, string); } -static void PutPokeblockInfoText(void) +static void DrawPokeblockMenuTitleText(void) { u8 i; const u8 *itemName = ItemId_GetName(ITEM_POKEBLOCK_CASE); - PrintOnPokeblockWindow(0, itemName, GetStringCenterAlignXOffset(1, itemName, 0x48)); + PrintOnPokeblockWindow(WIN_TITLE, itemName, GetStringCenterAlignXOffset(1, itemName, 0x48)); - PrintOnPokeblockWindow(2, gText_Spicy, 0); - PrintOnPokeblockWindow(3, gText_Dry, 0); - PrintOnPokeblockWindow(4, gText_Sweet, 0); - PrintOnPokeblockWindow(5, gText_Bitter, 0); - PrintOnPokeblockWindow(6, gText_Sour, 0); + PrintOnPokeblockWindow(WIN_SPICY, gText_Spicy, 0); + PrintOnPokeblockWindow(WIN_DRY, gText_Dry, 0); + PrintOnPokeblockWindow(WIN_SWEET, gText_Sweet, 0); + PrintOnPokeblockWindow(WIN_BITTER, gText_Bitter, 0); + PrintOnPokeblockWindow(WIN_SOUR, gText_Sour, 0); - for (i = 0; i < 8; i++) - { + for (i = 0; i < WIN_ACTIONS_TALL; i++) PutWindowTilemap(i); - } } -static void HandlePokeblockListMenuItems(void) +static void UpdatePokeblockList(void) { u16 i; @@ -731,19 +751,19 @@ static void PutPokeblockListMenuString(u8 *dst, u16 pkblId) StringExpandPlaceholders(txtPtr, gText_LvVar1); } -static void MovePokeblockMenuCursor(s32 pkblId, bool8 arg1, struct ListMenu *arg2) +static void MovePokeblockMenuCursor(s32 pkblId, bool8 onInit, struct ListMenu *list) { - if (arg1 != TRUE) + if (onInit != TRUE) { PlaySE(SE_SELECT); - gSprites[sPokeblockMenu->pokeblockCaseSpriteId].callback = sub_8136470; + gSprites[sPokeblockMenu->pokeblockCaseSpriteId].callback = SpriteCB_ShakePokeblockCase; } if (!sPokeblockMenu->isSwapping) - sub_8135FCC(pkblId); + DrawPokeblockInfo(pkblId); } -static void sub_8135FCC(s32 pkblId) +static void DrawPokeblockInfo(s32 pkblId) { u8 i; struct Pokeblock *pokeblock; @@ -760,28 +780,32 @@ static void sub_8135FCC(s32 pkblId) { if (GetPokeblockData(pokeblock, PBLOCK_SPICY + i) > 0) { + // Pokéblock has this flavor, draw Pokéblock icon next to it rectTilemapSrc[0] = (i << 12) + 0x17; rectTilemapSrc[1] = (i << 12) + 0x18; } else { + // Pokéblock doesn't have this flavor, draw regular tiles rectTilemapSrc[0] = 0xF; rectTilemapSrc[1] = 0xF; } CopyToBgTilemapBufferRect(2, rectTilemapSrc, (i / 3 * 6) + 1, (i % 3 * 2) + 13, 1, 2); } + + // Print the Pokéblock's feel ConvertIntToDecimalStringN(gStringVar1, GetPokeblocksFeel(pokeblock), STR_CONV_MODE_RIGHT_ALIGN, 2); - PrintOnPokeblockWindow(7, gStringVar1, 4); + PrintOnPokeblockWindow(WIN_FEEL, gStringVar1, 4); } else { + // Selected cancel, erase info rectTilemapSrc[0] = 0xF; rectTilemapSrc[1] = 0xF; for (i = 0; i < FLAVOR_COUNT; i++) - { CopyToBgTilemapBufferRect(2, rectTilemapSrc, (i / 3 * 6) + 1, (i % 3 * 2) + 13, 1, 2); - } + CopyWindowToVram(7, 2); } @@ -789,9 +813,9 @@ static void sub_8135FCC(s32 pkblId) ScheduleBgCopyTilemapToVram(2); } -static void HandlePokeblockMenuCursor(u16 cursorPos, u16 arg1) +static void DrawPokeblockMenuHighlight(u16 cursorPos, u16 tileNum) { - FillBgTilemapBufferRect_Palette0(2, arg1, 0xF, (cursorPos * 2) + 1, 0xE, 2); + FillBgTilemapBufferRect_Palette0(2, tileNum, 0xF, (cursorPos * 2) + 1, 0xE, 2); ScheduleBgCopyTilemapToVram(2); } @@ -813,7 +837,7 @@ static void CompactPokeblockSlots(void) } } -static void SwapSortPokeblocksInternalData(u32 id1, u32 id2) +static void SwapPokeblockMenuItems(u32 id1, u32 id2) { s16 i, count; struct Pokeblock *pokeblocks = gSaveBlock1Ptr->pokeblocks; @@ -843,8 +867,8 @@ static void SwapSortPokeblocksInternalData(u32 id1, u32 id2) void ResetPokeblockScrollPositions(void) { - sSavedPokeblockData.lastItemPos = 0; - sSavedPokeblockData.lastItemPage = 0; + sSavedPokeblockData.selectedRow = 0; + sSavedPokeblockData.scrollOffset = 0; } static void SetMenuItemsCountAndMaxShowed(void) @@ -861,56 +885,56 @@ static void SetMenuItemsCountAndMaxShowed(void) sPokeblockMenu->itemsNo++; // STOW CASE menu item - if (sPokeblockMenu->itemsNo > 9) - sPokeblockMenu->maxShowed = 9; + if (sPokeblockMenu->itemsNo > MAX_MENU_ITEMS) + sPokeblockMenu->maxShowed = MAX_MENU_ITEMS; else sPokeblockMenu->maxShowed = sPokeblockMenu->itemsNo; } -static void sub_81362E0(void) +static void LimitMenuScrollAndRow(void) { - if (sSavedPokeblockData.lastItemPage != 0) + if (sSavedPokeblockData.scrollOffset != 0) { - if (sSavedPokeblockData.lastItemPage + sPokeblockMenu->maxShowed > sPokeblockMenu->itemsNo) - sSavedPokeblockData.lastItemPage = sPokeblockMenu->itemsNo - sPokeblockMenu->maxShowed; + if (sSavedPokeblockData.scrollOffset + sPokeblockMenu->maxShowed > sPokeblockMenu->itemsNo) + sSavedPokeblockData.scrollOffset = sPokeblockMenu->itemsNo - sPokeblockMenu->maxShowed; } - if (sSavedPokeblockData.lastItemPage + sSavedPokeblockData.lastItemPos >= sPokeblockMenu->itemsNo) + if (sSavedPokeblockData.scrollOffset + sSavedPokeblockData.selectedRow >= sPokeblockMenu->itemsNo) { if (sPokeblockMenu->itemsNo == 0) - sSavedPokeblockData.lastItemPos = 0; + sSavedPokeblockData.selectedRow = 0; else - sSavedPokeblockData.lastItemPos = sPokeblockMenu->itemsNo - 1; + sSavedPokeblockData.selectedRow = sPokeblockMenu->itemsNo - 1; } } -static void sub_8136344(void) +static void SetInitialScroll(void) { - if (sSavedPokeblockData.lastItemPos > 4) + if (sSavedPokeblockData.selectedRow > MENU_MIDPOINT) { u8 i; for (i = 0; - (i < sSavedPokeblockData.lastItemPos - 4) && (sSavedPokeblockData.lastItemPage + sPokeblockMenu->maxShowed != sPokeblockMenu->itemsNo); - sSavedPokeblockData.lastItemPos--, sSavedPokeblockData.lastItemPage++, i++); + (i < sSavedPokeblockData.selectedRow - MENU_MIDPOINT) && (sSavedPokeblockData.scrollOffset + sPokeblockMenu->maxShowed != sPokeblockMenu->itemsNo); + sSavedPokeblockData.selectedRow--, sSavedPokeblockData.scrollOffset++, i++); } } -static void sub_81363BC(void) +static void CreateScrollArrows(void) { - if (sPokeblockMenu->unkTaskId == TASK_NONE) + if (sPokeblockMenu->arrowTaskId == TASK_NONE) { - sPokeblockMenu->unkTaskId = AddScrollIndicatorArrowPairParameterized(SCROLL_ARROW_UP, 0xB0, 8, 0x98, sPokeblockMenu->itemsNo - sPokeblockMenu->maxShowed, - 0x456, 0x456, &sSavedPokeblockData.lastItemPage); + sPokeblockMenu->arrowTaskId = AddScrollIndicatorArrowPairParameterized(SCROLL_ARROW_UP, 0xB0, 8, 0x98, sPokeblockMenu->itemsNo - sPokeblockMenu->maxShowed, + TAG_SCROLL_ARROW, TAG_SCROLL_ARROW, &sSavedPokeblockData.scrollOffset); } } -static void sub_8136418(void) +static void DestroyScrollArrows(void) { - if (sPokeblockMenu->unkTaskId != TASK_NONE) + if (sPokeblockMenu->arrowTaskId != TASK_NONE) { - RemoveScrollIndicatorArrowPair(sPokeblockMenu->unkTaskId); - sPokeblockMenu->unkTaskId = TASK_NONE; + RemoveScrollIndicatorArrowPair(sPokeblockMenu->arrowTaskId); + sPokeblockMenu->arrowTaskId = TASK_NONE; } } @@ -919,26 +943,29 @@ u8 CreatePokeblockCaseSprite(s16 x, s16 y, u8 subpriority) return CreateSprite(&sSpriteTemplate_PokeblockCase, x, y, subpriority); } -static void sub_8136470(struct Sprite *sprite) -{ - if (sprite->data[0] > 1) - sprite->data[0] = 0; +#define sState data[0] +#define sTimer data[1] - switch (sprite->data[0]) +static void SpriteCB_ShakePokeblockCase(struct Sprite *sprite) +{ + if (sprite->sState > 1) + sprite->sState = 0; + + switch (sprite->sState) { case 0: sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL; sprite->affineAnims = sSpriteAffineAnimTable_85B26F0; InitSpriteAffineAnim(sprite); - sprite->data[0] = 1; - sprite->data[1] = 0; + sprite->sState = 1; + sprite->sTimer = 0; break; case 1: - if (++sprite->data[1] > 11) + if (++sprite->sTimer > 11) { sprite->oam.affineMode = ST_OAM_AFFINE_OFF; - sprite->data[0] = 0; - sprite->data[1] = 0; + sprite->sState = 0; + sprite->sTimer = 0; FreeOamMatrix(sprite->oam.matrixNum); sprite->callback = SpriteCallbackDummy; } @@ -948,7 +975,7 @@ static void sub_8136470(struct Sprite *sprite) static void FadePaletteAndSetTaskToClosePokeblockCase(u8 taskId) { - BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = Task_FreeDataAndExitPokeblockCase; } @@ -961,8 +988,8 @@ static void Task_FreeDataAndExitPokeblockCase(u8 taskId) if (sPokeblockMenu->caseId == PBLOCK_CASE_FEEDER || sPokeblockMenu->caseId == PBLOCK_CASE_GIVE) gFieldCallback = FieldCB_ContinueScriptHandleMusic; - DestroyListMenuTask(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos); - sub_8136418(); + DestroyListMenuTask(tListTaskId, &sSavedPokeblockData.scrollOffset, &sSavedPokeblockData.selectedRow); + DestroyScrollArrows(); ResetSpriteData(); FreeAllSpritePalettes(); @@ -985,29 +1012,31 @@ static void Task_HandlePokeblockMenuInput(u8 taskId) { if (JOY_NEW(SELECT_BUTTON)) { - ListMenuGetScrollAndRow(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos); - if (sSavedPokeblockData.lastItemPage + sSavedPokeblockData.lastItemPos != sPokeblockMenu->itemsNo - 1) + ListMenuGetScrollAndRow(tListTaskId, &sSavedPokeblockData.scrollOffset, &sSavedPokeblockData.selectedRow); + if (sSavedPokeblockData.scrollOffset + sSavedPokeblockData.selectedRow != sPokeblockMenu->itemsNo - 1) { + // Chose menu item to swap PlaySE(SE_SELECT); - HandlePokeblockMenuCursor(sSavedPokeblockData.lastItemPos, 0x2005); - data[2] = sSavedPokeblockData.lastItemPage + sSavedPokeblockData.lastItemPos; + DrawPokeblockMenuHighlight(sSavedPokeblockData.selectedRow, TILE_HIGHLIGHT_RED); + tToSwapId = sSavedPokeblockData.scrollOffset + sSavedPokeblockData.selectedRow; sPokeblockMenu->isSwapping = TRUE; gTasks[taskId].func = Task_HandlePokeblocksSwapInput; } } else { - u16 oldPosition = sSavedPokeblockData.lastItemPos; - s32 itemId = ListMenu_ProcessInput(data[0]); + u16 oldPosition = sSavedPokeblockData.selectedRow; + s32 input = ListMenu_ProcessInput(tListTaskId); + ListMenuGetScrollAndRow(tListTaskId, &sSavedPokeblockData.scrollOffset, &sSavedPokeblockData.selectedRow); - ListMenuGetScrollAndRow(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos); - if (oldPosition != sSavedPokeblockData.lastItemPos) + if (oldPosition != sSavedPokeblockData.selectedRow) { - HandlePokeblockMenuCursor(oldPosition, 5); - HandlePokeblockMenuCursor(sSavedPokeblockData.lastItemPos, 0x1005); + // Moved cursor + DrawPokeblockMenuHighlight(oldPosition, TILE_HIGHLIGHT_NONE); + DrawPokeblockMenuHighlight(sSavedPokeblockData.selectedRow, TILE_HIGHLIGHT_BLUE); } - switch (itemId) + switch (input) { case LIST_NOTHING_CHOSEN: break; @@ -1018,9 +1047,10 @@ static void Task_HandlePokeblockMenuInput(u8 taskId) FadePaletteAndSetTaskToClosePokeblockCase(taskId); break; default: + // Selected Pokéblock PlaySE(SE_SELECT); - gSpecialVar_ItemId = itemId; - PutPokeblockOptionsWindow(taskId); + gSpecialVar_ItemId = input; + ShowPokeblockActionsWindow(taskId); break; } } @@ -1036,100 +1066,102 @@ static void Task_HandlePokeblocksSwapInput(u8 taskId) if (JOY_NEW(SELECT_BUTTON)) { + // Swap items PlaySE(SE_SELECT); - ListMenuGetScrollAndRow(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos); - HandlePokeblocksSwap(taskId, FALSE); + ListMenuGetScrollAndRow(tListTaskId, &sSavedPokeblockData.scrollOffset, &sSavedPokeblockData.selectedRow); + UpdatePokeblockSwapMenu(taskId, FALSE); } else { - u16 i = sSavedPokeblockData.lastItemPage; - u16 var = sSavedPokeblockData.lastItemPos; - s32 itemId = ListMenu_ProcessInput(data[0]); + u16 i = sSavedPokeblockData.scrollOffset; + u16 row = sSavedPokeblockData.selectedRow; + s32 input = ListMenu_ProcessInput(tListTaskId); + ListMenuGetScrollAndRow(tListTaskId, &sSavedPokeblockData.scrollOffset, &sSavedPokeblockData.selectedRow); - ListMenuGetScrollAndRow(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos); - if (i != sSavedPokeblockData.lastItemPage || var != sSavedPokeblockData.lastItemPos) + if (i != sSavedPokeblockData.scrollOffset || row != sSavedPokeblockData.selectedRow) { - for (i = 0; i < 9; i++) + for (i = 0; i < MAX_MENU_ITEMS; i++) { - var = i + sSavedPokeblockData.lastItemPage; - if (var == data[2]) - HandlePokeblockMenuCursor(i, 0x2005); + row = i + sSavedPokeblockData.scrollOffset; + if (row == tToSwapId) + DrawPokeblockMenuHighlight(i, TILE_HIGHLIGHT_RED); else - HandlePokeblockMenuCursor(i, 5); + DrawPokeblockMenuHighlight(i, TILE_HIGHLIGHT_NONE); } } - sub_81223FC(sPokeblockMenu->field_E75, FIELD_E75_COUNT, 0); - sub_8122448(sPokeblockMenu->field_E75, FIELD_E75_COUNT, 0x80, (sSavedPokeblockData.lastItemPos * 16) + 8); + SetSwapLineSpritesInvisibility(sPokeblockMenu->swapLineSpriteIds, ARRAY_COUNT(sPokeblockMenu->swapLineSpriteIds), FALSE); + UpdateSwapLineSpritesPos(sPokeblockMenu->swapLineSpriteIds, ARRAY_COUNT(sPokeblockMenu->swapLineSpriteIds), 128, (sSavedPokeblockData.selectedRow * 16) + 8); - switch (itemId) + switch (input) { case LIST_NOTHING_CHOSEN: break; - case LIST_CANCEL: // same id as STOW CASE field + case LIST_CANCEL: PlaySE(SE_SELECT); - if (JOY_NEW(A_BUTTON)) - HandlePokeblocksSwap(taskId, FALSE); + if (JOY_NEW(A_BUTTON)) // Pointless check, B Button has been pressed here + UpdatePokeblockSwapMenu(taskId, FALSE); else - HandlePokeblocksSwap(taskId, TRUE); + UpdatePokeblockSwapMenu(taskId, TRUE); // Canceled swapping break; default: + // Swap items PlaySE(SE_SELECT); - HandlePokeblocksSwap(taskId, FALSE); + UpdatePokeblockSwapMenu(taskId, FALSE); break; } } } -static void HandlePokeblocksSwap(u8 taskId, bool8 noSwap) +static void UpdatePokeblockSwapMenu(u8 taskId, bool8 noSwap) { u8 i; s16 *data = gTasks[taskId].data; - u16 swappedFromId = sSavedPokeblockData.lastItemPage + sSavedPokeblockData.lastItemPos; + u16 swappedFromId = sSavedPokeblockData.scrollOffset + sSavedPokeblockData.selectedRow; sPokeblockMenu->isSwapping = FALSE; - DestroyListMenuTask(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos); + DestroyListMenuTask(tListTaskId, &sSavedPokeblockData.scrollOffset, &sSavedPokeblockData.selectedRow); - if (!noSwap && data[2] != swappedFromId && data[2] != swappedFromId - 1) + if (!noSwap && tToSwapId != swappedFromId && tToSwapId != swappedFromId - 1) { - SwapSortPokeblocksInternalData(data[2], swappedFromId); - HandlePokeblockListMenuItems(); + SwapPokeblockMenuItems(tToSwapId, swappedFromId); + UpdatePokeblockList(); } - if (data[2] < swappedFromId) - sSavedPokeblockData.lastItemPos--; + if (tToSwapId < swappedFromId) + sSavedPokeblockData.selectedRow--; - data[0] = ListMenuInit(&gMultiuseListMenuTemplate, sSavedPokeblockData.lastItemPage, sSavedPokeblockData.lastItemPos); + tListTaskId = ListMenuInit(&gMultiuseListMenuTemplate, sSavedPokeblockData.scrollOffset, sSavedPokeblockData.selectedRow); ScheduleBgCopyTilemapToVram(0); - sub_81223FC(sPokeblockMenu->field_E75, FIELD_E75_COUNT, 1); + SetSwapLineSpritesInvisibility(sPokeblockMenu->swapLineSpriteIds, ARRAY_COUNT(sPokeblockMenu->swapLineSpriteIds), TRUE); - for (i = 0; i < 9; i++) - HandlePokeblockMenuCursor(i, 5); + for (i = 0; i < MAX_MENU_ITEMS; i++) + DrawPokeblockMenuHighlight(i, TILE_HIGHLIGHT_NONE); - HandlePokeblockMenuCursor(sSavedPokeblockData.lastItemPos, 0x1005); + DrawPokeblockMenuHighlight(sSavedPokeblockData.selectedRow, TILE_HIGHLIGHT_BLUE); gTasks[taskId].func = Task_HandlePokeblockMenuInput; } -static void PutPokeblockOptionsWindow(u8 taskId) +static void ShowPokeblockActionsWindow(u8 taskId) { s16 *data = gTasks[taskId].data; - if (sPokeblockMenu->optionsNo == 3) - data[1] = 8; + if (sPokeblockMenu->numActions == 3) + tWindowId = WIN_ACTIONS_TALL; else - data[1] = 9; + tWindowId = WIN_ACTIONS; - sub_8136418(); - DrawStdFrameWithCustomTileAndPalette(data[1], 0, 1, 0xE); - sub_81995E4(data[1], sPokeblockMenu->optionsNo, sPokeblockMenuActions, sPokeblockMenu->pokeblockOptionsIds); - InitMenuInUpperLeftCornerPlaySoundWhenAPressed(data[1], sPokeblockMenu->optionsNo, 0); - PutWindowTilemap(data[1]); + DestroyScrollArrows(); + DrawStdFrameWithCustomTileAndPalette(tWindowId, 0, 1, 0xE); + sub_81995E4(tWindowId, sPokeblockMenu->numActions, sPokeblockMenuActions, sPokeblockMenu->pokeblockActionIds); + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(tWindowId, sPokeblockMenu->numActions, 0); + PutWindowTilemap(tWindowId); ScheduleBgCopyTilemapToVram(1); - gTasks[taskId].func = Task_HandlePokeblockOptionsInput; + gTasks[taskId].func = Task_HandlePokeblockActionsInput; } -static void Task_HandlePokeblockOptionsInput(u8 taskId) +static void Task_HandlePokeblockActionsInput(u8 taskId) { s8 itemId; @@ -1149,7 +1181,7 @@ static void Task_HandlePokeblockOptionsInput(u8 taskId) else { PlaySE(SE_SELECT); - sPokeblockMenuActions[sPokeblockMenu->pokeblockOptionsIds[itemId]].func.void_u8(taskId); + sPokeblockMenuActions[sPokeblockMenu->pokeblockActionIds[itemId]].func.void_u8(taskId); } } @@ -1173,10 +1205,10 @@ static void PokeblockAction_Toss(u8 taskId) { s16 *data = gTasks[taskId].data; - ClearStdWindowAndFrameToTransparent(data[1], FALSE); + ClearStdWindowAndFrameToTransparent(tWindowId, FALSE); StringCopy(gStringVar1, gPokeblockNames[gSaveBlock1Ptr->pokeblocks[gSpecialVar_ItemId].color]); StringExpandPlaceholders(gStringVar4, gText_ThrowAwayVar1); - DisplayMessageAndContinueTask(taskId, 10, 10, 13, 1, GetPlayerTextSpeedDelay(), gStringVar4, CreateTossPokeblockYesNoMenu); + DisplayMessageAndContinueTask(taskId, WIN_TOSS_MSG, 10, 13, 1, GetPlayerTextSpeedDelay(), gStringVar4, CreateTossPokeblockYesNoMenu); } static void CreateTossPokeblockYesNoMenu(u8 taskId) @@ -1184,44 +1216,44 @@ static void CreateTossPokeblockYesNoMenu(u8 taskId) CreateYesNoMenuWithCallbacks(taskId, &sTossPkblockWindowTemplate, 1, 0, 2, 1, 0xE, &sTossYesNoFuncTable); } -static void TossPokeblockChoice_Yes(u8 taskId) +static void TossedPokeblockMessage(u8 taskId) { StringExpandPlaceholders(gStringVar4, gText_Var1ThrownAway); - DisplayMessageAndContinueTask(taskId, 10, 10, 13, 1, GetPlayerTextSpeedDelay(), gStringVar4, HandleErasePokeblock); + DisplayMessageAndContinueTask(taskId, WIN_TOSS_MSG, 10, 13, 1, GetPlayerTextSpeedDelay(), gStringVar4, TossPokeblock); } -static void HandleErasePokeblock(u8 taskId) +static void TossPokeblock(u8 taskId) { if (JOY_NEW(A_BUTTON | B_BUTTON)) { s16 *data; - u16 *lastPage, *lastPos; + u16 *scrollOffset, *selectedRow; TryClearPokeblock(gSpecialVar_ItemId); PlaySE(SE_SELECT); - lastPage = &sSavedPokeblockData.lastItemPage; - lastPos = &sSavedPokeblockData.lastItemPos; + scrollOffset = &sSavedPokeblockData.scrollOffset; + selectedRow = &sSavedPokeblockData.selectedRow; data = gTasks[taskId].data; - DestroyListMenuTask(data[0], lastPage, lastPos); - HandlePokeblockMenuCursor(*lastPos, 5); + DestroyListMenuTask(tListTaskId, scrollOffset, selectedRow); + DrawPokeblockMenuHighlight(*selectedRow, TILE_HIGHLIGHT_NONE); SetMenuItemsCountAndMaxShowed(); - sub_81362E0(); - HandlePokeblockListMenuItems(); - data[0] = ListMenuInit(&gMultiuseListMenuTemplate, *lastPage, *lastPos); - HandlePokeblockMenuCursor(*lastPos, 0x1005); + LimitMenuScrollAndRow(); + UpdatePokeblockList(); + tListTaskId = ListMenuInit(&gMultiuseListMenuTemplate, *scrollOffset, *selectedRow); + DrawPokeblockMenuHighlight(*selectedRow, TILE_HIGHLIGHT_BLUE); ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(1); - TossPokeblockChoice_No(taskId); + CloseTossPokeblockWindow(taskId); } } -static void TossPokeblockChoice_No(u8 taskId) +static void CloseTossPokeblockWindow(u8 taskId) { - ClearDialogWindowAndFrameToTransparent(10, FALSE); + ClearDialogWindowAndFrameToTransparent(WIN_TOSS_MSG, FALSE); ScheduleBgCopyTilemapToVram(1); - sub_81363BC(); + CreateScrollArrows(); gTasks[taskId].func = Task_HandlePokeblockMenuInput; } @@ -1266,9 +1298,9 @@ static void PokeblockAction_Cancel(u8 taskId) { s16 *data = gTasks[taskId].data; - ClearStdWindowAndFrameToTransparent(data[1], FALSE); + ClearStdWindowAndFrameToTransparent(tWindowId, FALSE); ScheduleBgCopyTilemapToVram(1); - sub_81363BC(); + CreateScrollArrows(); gTasks[taskId].func = Task_HandlePokeblockMenuInput; } diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index e5b13e2f6..1da999fb8 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -498,13 +498,13 @@ static const union AffineAnimCmd *const sThrownPokeblockAffineAnimTable[] = static const struct CompressedSpriteSheet sPokeblock_SpriteSheet = { - gPokeblock_Gfx, 0x20, GFX_TAG_POKEBLOCK + gPokeblock_Gfx, 0x20, TAG_POKEBLOCK }; static const struct SpriteTemplate sThrownPokeblockSpriteTemplate = { - .tileTag = GFX_TAG_POKEBLOCK, - .paletteTag = GFX_TAG_POKEBLOCK, + .tileTag = TAG_POKEBLOCK, + .paletteTag = TAG_POKEBLOCK, .oam = &sThrownPokeblockOamData, .anims = sThrownPokeblockAnimTable, .images = NULL, @@ -711,7 +711,7 @@ static void SetPokeblockSpritePal(u8 pokeblockCaseId) { u8 colorId = GetPokeblockData(&gSaveBlock1Ptr->pokeblocks[pokeblockCaseId], PBLOCK_COLOR); sPokeblockSpritePal.data = sPokeblocksPals[colorId - 1]; - sPokeblockSpritePal.tag = GFX_TAG_POKEBLOCK; + sPokeblockSpritePal.tag = TAG_POKEBLOCK; } // defines for task data fields From e92d2005c40073b264cd4d6de08f19c9600d07c5 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Mon, 12 Apr 2021 17:33:20 -0500 Subject: [PATCH 31/63] Use designated initializers for gTypeNames --- src/battle_main.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/battle_main.c b/src/battle_main.c index 8a85c27f5..c30c92929 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -434,24 +434,24 @@ const u8 gTypeEffectiveness[336] = const u8 gTypeNames[NUMBER_OF_MON_TYPES][TYPE_NAME_LENGTH + 1] = { - _("NORMAL"), - _("FIGHT"), - _("FLYING"), - _("POISON"), - _("GROUND"), - _("ROCK"), - _("BUG"), - _("GHOST"), - _("STEEL"), - _("???"), - _("FIRE"), - _("WATER"), - _("GRASS"), - _("ELECTR"), - _("PSYCHC"), - _("ICE"), - _("DRAGON"), - _("DARK"), + [TYPE_NORMAL] = _("NORMAL"), + [TYPE_FIGHTING] = _("FIGHT"), + [TYPE_FLYING] = _("FLYING"), + [TYPE_POISON] = _("POISON"), + [TYPE_GROUND] = _("GROUND"), + [TYPE_ROCK] = _("ROCK"), + [TYPE_BUG] = _("BUG"), + [TYPE_GHOST] = _("GHOST"), + [TYPE_STEEL] = _("STEEL"), + [TYPE_MYSTERY] = _("???"), + [TYPE_FIRE] = _("FIRE"), + [TYPE_WATER] = _("WATER"), + [TYPE_GRASS] = _("GRASS"), + [TYPE_ELECTRIC] = _("ELECTR"), + [TYPE_PSYCHIC] = _("PSYCHC"), + [TYPE_ICE] = _("ICE"), + [TYPE_DRAGON] = _("DRAGON"), + [TYPE_DARK] = _("DARK"), }; // This is a factor in how much money you get for beating a trainer. From 042a2ecc417001be93bd363cbaff5415be65308c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 12 Apr 2021 12:33:06 -0400 Subject: [PATCH 32/63] Document pokeblock feed scene --- include/graphics.h | 2 +- include/pokeblock.h | 2 +- src/graphics.c | 2 +- src/pokeblock.c | 2 +- src/pokeblock_feed.c | 803 ++++++++++++++++++++++++------------------- src/use_pokeblock.c | 2 +- 6 files changed, 455 insertions(+), 358 deletions(-) diff --git a/include/graphics.h b/include/graphics.h index 7c36b9cf5..cea8bbab1 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4076,7 +4076,7 @@ extern const u8 gNamingScreenCursor_Gfx[]; extern const u8 gNamingScreenInputArrow_Gfx[]; extern const u8 gNamingScreenUnderscore_Gfx[]; -extern const u32 gUnknown_08D9BA44[]; +extern const u32 gPokeblockFeedBg_Tilemap[]; extern const u32 gConfetti_Gfx[]; extern const u32 gConfetti_Pal[]; diff --git a/include/pokeblock.h b/include/pokeblock.h index 4c5a40488..9e0161495 100644 --- a/include/pokeblock.h +++ b/include/pokeblock.h @@ -51,7 +51,7 @@ extern s16 gPokeblockGain; void ChooseMonToGivePokeblock(struct Pokeblock *pokeblock, void (*callback)(void)); // pokeblock feed -void CB2_PreparePokeblockFeedScene(void); +void PreparePokeblockFeedScene(void); // pokeblock extern const s8 gPokeblockFlavorCompatibilityTable[NUM_NATURES * FLAVOR_COUNT]; diff --git a/src/graphics.c b/src/graphics.c index 7a7a11b2b..09779eab7 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1201,7 +1201,7 @@ const u32 gPokeblockBlack_Pal[] = INCBIN_U32("graphics/pokeblock/black.gbapal.lz const u32 gPokeblockWhite_Pal[] = INCBIN_U32("graphics/pokeblock/white.gbapal.lz"); const u32 gPokeblockGold_Pal[] = INCBIN_U32("graphics/pokeblock/gold.gbapal.lz"); -const u32 gUnknown_08D9BA44[] = INCBIN_U32("graphics/interface/pokeblock_feeding_bg_map.bin.lz"); +const u32 gPokeblockFeedBg_Tilemap[] = INCBIN_U32("graphics/interface/pokeblock_feeding_bg_map.bin.lz"); #include "data/graphics/berries.h" #include "data/graphics/rayquaza_scene.h" diff --git a/src/pokeblock.c b/src/pokeblock.c index 7856e7054..daf50a612 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -37,7 +37,7 @@ #define MENU_MIDPOINT (MAX_MENU_ITEMS / 2) #define TILE_HIGHLIGHT_NONE 0x0005 // Tile number for the bg of an unselected menu item -#define TILE_HIGHLIGHT_BLUE 0x1005 // Tile number for the bg of a selected menu item +#define TILE_HIGHLIGHT_BLUE 0x1005 // Tile number for the bg of a selected menu item #define TILE_HIGHLIGHT_RED 0x2005 // Tile number for the bg of a menu item to swap #define TAG_POKEBLOCK_CASE 14800 diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 1da999fb8..793ef64dc 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -26,207 +26,283 @@ #include "util.h" #include "constants/rgb.h" -struct PokeblockFeedStruct +enum { + ANIMDATA_ROT_IDX, + ANIMDATA_ROT_SPEED, + ANIMDATA_SIN_AMPLITUDE, + ANIMDATA_COS_AMPLITUDE, + ANIMDATA_TIME, + ANIMDATA_ROT_ACCEL, + ANIMDATA_TARGET_X, + ANIMDATA_TARGET_Y, + ANIMDATA_APPR_TIME, + ANIMDATA_IS_LAST, + NUM_ANIMDATA +}; + +enum { + AFFINE_NONE, + AFFINE_TURN_UP, + AFFINE_TURN_UP_AND_DOWN, + AFFINE_TURN_DOWN, + AFFINE_TURN_DOWN_SLOW, + AFFINE_TURN_DOWN_SLIGHT, + AFFINE_TURN_UP_HIGH, + AFFINE_UNUSED_1, + AFFINE_UNUSED_2, + AFFINE_UNUSED_3, + NUM_MON_AFFINES, +}; + +#define MON_X 48 +#define MON_Y 80 + +// The animation the Pokémon does during the feeding scene depends on their nature. +// The below values are offsets into sMonPokeblockAnims of the animation data for that nature. +#define ANIM_HARDY 0 +#define ANIM_LONELY (ANIM_HARDY + 3) +#define ANIM_BRAVE (ANIM_LONELY + 1) +#define ANIM_ADAMANT (ANIM_BRAVE + 1) +#define ANIM_NAUGHTY (ANIM_ADAMANT + 5) +#define ANIM_BOLD (ANIM_NAUGHTY + 3) +#define ANIM_DOCILE (ANIM_BOLD + 2) +#define ANIM_RELAXED (ANIM_DOCILE + 1) +#define ANIM_IMPISH (ANIM_RELAXED + 2) +#define ANIM_LAX (ANIM_IMPISH + 1) +#define ANIM_TIMID (ANIM_LAX + 1) +#define ANIM_HASTY (ANIM_TIMID + 5) +#define ANIM_SERIOUS (ANIM_HASTY + 2) +#define ANIM_JOLLY (ANIM_SERIOUS + 1) +#define ANIM_NAIVE (ANIM_JOLLY + 1) +#define ANIM_MODEST (ANIM_NAIVE + 4) +#define ANIM_MILD (ANIM_MODEST + 3) +#define ANIM_QUIET (ANIM_MILD + 1) +#define ANIM_BASHFUL (ANIM_QUIET + 2) +#define ANIM_RASH (ANIM_BASHFUL + 3) +#define ANIM_CALM (ANIM_RASH + 3) +#define ANIM_GENTLE (ANIM_CALM + 1) +#define ANIM_SASSY (ANIM_GENTLE + 1) +#define ANIM_CAREFUL (ANIM_SASSY + 1) +#define ANIM_QUIRKY (ANIM_CAREFUL + 5) + +struct PokeblockFeed { struct Sprite *monSpritePtr; struct Sprite savedMonSprite; - u8 tilemapBuffer[0x808]; - s16 field_850[0x200]; - s16 field_C50[0x200]; - u8 field_1050; + u8 tilemapBuffer[BG_SCREEN_SIZE]; + u8 unused1[8]; + s16 monAnimX[0x200]; + s16 monAnimY[0x200]; + u8 animRunState; u8 animId; - u8 field_1052; + u8 unused2; bool8 noMonFlip; u16 species; - u16 field_1056; - u16 field_1058; + u16 monAnimLength; + u16 timer; u8 nature; - u8 monSpriteId_; - u8 field_105C; + u8 monSpriteId_; // Duplicated unnecessarily + u8 unused3; u8 monSpriteId; u8 pokeblockCaseSpriteId; u8 pokeblockSpriteId; - s16 field_1060[15]; + s16 animData[NUM_ANIMDATA]; + s16 monInitX; + s16 monInitY; + s16 maxAnimStageTime; + s16 monX; + s16 monY; s16 loadGfxState; - u8 unused; + u8 unused4; }; extern struct MusicPlayerInfo gMPlayInfo_BGM; extern const u16 gUnknown_0860F074[]; -// this file's functions static void HandleInitBackgrounds(void); static void HandleInitWindows(void); static void LaunchPokeblockFeedTask(void); static void SetPokeblockSpritePal(u8 pokeblockCaseId); -static void sub_817A5CC(void); +static void CalculateMonAnimLength(void); static void DoPokeblockCaseThrowEffect(u8 spriteId, bool8 arg1); -static void PrepareMonToMoveToPokeblock(u8 spriteId); -static void Task_HandleMonAtePokeblock(u8 taskId); -static void Task_PaletteFadeToReturn(u8 taskId); -static void sub_817A634(void); -static void sub_817A468(struct Sprite *sprite); -static void sub_817AB68(void); -static void sub_817AA54(void); -static bool8 sub_817A91C(void); +static void StartMonJumpForPokeblock(u8 spriteId); +static void Task_PrintAtePokeblockMessage(u8 taskId); +static void Task_FadeOutPokeblockFeed(u8 taskId); +static void UpdateMonAnim(void); +static void SpriteCB_MonJumpForPokeblock(struct Sprite *sprite); +static void CalculateMonAnimMovement(void); +static void CalculateMonAnimMovementEnd(void); +static bool8 InitMonAnimStage(void); static bool8 FreeMonSpriteOamMatrix(void); -static bool8 sub_817A9E4(void); +static bool8 DoMonAnimStep(void); static bool8 LoadMonAndSceneGfx(struct Pokemon *mon); static u8 CreatePokeblockSprite(void); static u8 CreatePokeblockCaseSpriteForFeeding(void); static u8 CreateMonSprite(struct Pokemon *mon); static void SpriteCB_ThrownPokeblock(struct Sprite* sprite); -// ram variables -EWRAM_DATA static struct PokeblockFeedStruct *sPokeblockFeed = NULL; +EWRAM_DATA static struct PokeblockFeed *sPokeblockFeed = NULL; EWRAM_DATA static struct CompressedSpritePalette sPokeblockSpritePal = {0}; -// const rom data static const u8 sNatureToMonPokeblockAnim[NUM_NATURES][2] = { - [NATURE_HARDY] = { 0, 0 }, - [NATURE_LONELY] = { 3, 0 }, - [NATURE_BRAVE] = { 4, 1 }, - [NATURE_ADAMANT] = { 5, 0 }, - [NATURE_NAUGHTY] = { 10, 0 }, - [NATURE_BOLD] = { 13, 0 }, - [NATURE_DOCILE] = { 15, 0 }, - [NATURE_RELAXED] = { 16, 2 }, - [NATURE_IMPISH] = { 18, 0 }, - [NATURE_LAX] = { 19, 0 }, - [NATURE_TIMID] = { 20, 0 }, - [NATURE_HASTY] = { 25, 0 }, - [NATURE_SERIOUS] = { 27, 3 }, - [NATURE_JOLLY] = { 28, 0 }, - [NATURE_NAIVE] = { 29, 0 }, - [NATURE_MODEST] = { 33, 4 }, - [NATURE_MILD] = { 36, 0 }, - [NATURE_QUIET] = { 37, 0 }, - [NATURE_BASHFUL] = { 39, 0 }, - [NATURE_RASH] = { 42, 0 }, - [NATURE_CALM] = { 45, 0 }, - [NATURE_GENTLE] = { 46, 5 }, - [NATURE_SASSY] = { 47, 6 }, - [NATURE_CAREFUL] = { 48, 0 }, - [NATURE_QUIRKY] = { 53, 0 }, + [NATURE_HARDY] = { ANIM_HARDY, AFFINE_NONE }, + [NATURE_LONELY] = { ANIM_LONELY, AFFINE_NONE }, + [NATURE_BRAVE] = { ANIM_BRAVE, AFFINE_TURN_UP }, + [NATURE_ADAMANT] = { ANIM_ADAMANT, AFFINE_NONE }, + [NATURE_NAUGHTY] = { ANIM_NAUGHTY, AFFINE_NONE }, + [NATURE_BOLD] = { ANIM_BOLD, AFFINE_NONE }, + [NATURE_DOCILE] = { ANIM_DOCILE, AFFINE_NONE }, + [NATURE_RELAXED] = { ANIM_RELAXED, AFFINE_TURN_UP_AND_DOWN }, + [NATURE_IMPISH] = { ANIM_IMPISH, AFFINE_NONE }, + [NATURE_LAX] = { ANIM_LAX, AFFINE_NONE }, + [NATURE_TIMID] = { ANIM_TIMID, AFFINE_NONE }, + [NATURE_HASTY] = { ANIM_HASTY, AFFINE_NONE }, + [NATURE_SERIOUS] = { ANIM_SERIOUS, AFFINE_TURN_DOWN }, + [NATURE_JOLLY] = { ANIM_JOLLY, AFFINE_NONE }, + [NATURE_NAIVE] = { ANIM_NAIVE, AFFINE_NONE }, + [NATURE_MODEST] = { ANIM_MODEST, AFFINE_TURN_DOWN_SLOW }, + [NATURE_MILD] = { ANIM_MILD, AFFINE_NONE }, + [NATURE_QUIET] = { ANIM_QUIET, AFFINE_NONE }, + [NATURE_BASHFUL] = { ANIM_BASHFUL, AFFINE_NONE }, + [NATURE_RASH] = { ANIM_RASH, AFFINE_NONE }, + [NATURE_CALM] = { ANIM_CALM, AFFINE_NONE }, + [NATURE_GENTLE] = { ANIM_GENTLE, AFFINE_TURN_DOWN_SLIGHT }, + [NATURE_SASSY] = { ANIM_SASSY, AFFINE_TURN_UP_HIGH }, + [NATURE_CAREFUL] = { ANIM_CAREFUL, AFFINE_NONE }, + [NATURE_QUIRKY] = { ANIM_QUIRKY, AFFINE_NONE }, }; -static const s16 sMonPokeblockAnims[][10] = +// Data for the animation the Pokémon does while readying to jump for the Pokéblock +// Each nature can have up to 8 anim 'stages' it progresses through, and each stage has its own array of data. +// The elements in each array correspond in order to the following: +// - ANIMDATA_ROT_IDX : Index into sin/cos table for circular movement +// - ANIMDATA_ROT_SPEED : Circular movement speed +// - ANIMDATA_SIN_AMPLITUDE: How far on the x to move +// - ANIMDATA_COS_AMPLITUDE: How far on the y to move +// - ANIMDATA_TIME : How long in frames this part of the animation takes +// - ANIMDATA_ROT_ACCEL : How much to increase circular movement speed +// - ANIMDATA_TARGET_X : Target x coord offset from start position +// - ANIMDATA_TARGET_Y : Target y coord offset from start position +// - ANIMDATA_APPR_TIME : The time over which the target position should be approached +// - ANIMDATA_IS_LAST : TRUE if it's the last anim stage for this nature, FALSE otherwise +// +static const s16 sMonPokeblockAnims[][NUM_ANIMDATA] = { - // HARDY - { 0, 4, 0, 8, 24, 0, 0, 0, 12, 0}, - { 0, 4, 0, 16, 24, 0, 0, 0, 12, 0}, - { 0, 4, 0, 32, 32, 0, 0, 0, 16, 1}, + [ANIM_HARDY] = + { 0, 4, 0, 8, 24, 0, 0, 0, 12, FALSE}, + { 0, 4, 0, 16, 24, 0, 0, 0, 12, FALSE}, + { 0, 4, 0, 32, 32, 0, 0, 0, 16, TRUE}, - // LONELY - { 0, 3, 6, 0, 48, 0, 0, 0, 24, 1}, + [ANIM_LONELY] = + { 0, 3, 6, 0, 48, 0, 0, 0, 24, TRUE}, - // BRAVE - { 64, 16, -24, 0, 32, 0, 0, 0, 0, 1}, + [ANIM_BRAVE] = + { 64, 16, -24, 0, 32, 0, 0, 0, 0, TRUE}, - // ADAMANT - { 0, 4, 8, 0, 16, 0, -8, 0, 0, 0}, - { 0, 0, 0, 0, 16, 0, 0, 0, 0, 0}, - { 0, 4, 8, 0, 16, 0, -8, 0, 0, 0}, - { 0, 0, 0, 0, 16, 0, 0, 0, 0, 0}, - { 0, 4, -16, 0, 4, 0, 16, 0, 0, 1}, + [ANIM_ADAMANT] = + { 0, 4, 8, 0, 16, 0, -8, 0, 0, FALSE}, + { 0, 0, 0, 0, 16, 0, 0, 0, 0, FALSE}, + { 0, 4, 8, 0, 16, 0, -8, 0, 0, FALSE}, + { 0, 0, 0, 0, 16, 0, 0, 0, 0, FALSE}, + { 0, 4, -16, 0, 4, 0, 16, 0, 0, TRUE}, - // NAUGHTY - { 0, 3, 6, 0, 12, 0, 0, 0, 6, 0}, - { 0, 3, -6, 0, 12, 0, 0, 0, 6, 0}, - { 0, 16, 16, 0, 45, 1, 0, 0, 0, 1}, + [ANIM_NAUGHTY] = + { 0, 3, 6, 0, 12, 0, 0, 0, 6, FALSE}, + { 0, 3, -6, 0, 12, 0, 0, 0, 6, FALSE}, + { 0, 16, 16, 0, 45, 1, 0, 0, 0, TRUE}, - // BOLD - { 0, 16, 0, 24, 32, 0, 0, 0, 16, 0}, - { 0, 16, 0, 23, 32, 0, 0, 0, 16, 1}, + [ANIM_BOLD] = + { 0, 16, 0, 24, 32, 0, 0, 0, 16, FALSE}, + { 0, 16, 0, 23, 32, 0, 0, 0, 16, TRUE}, - // DOCILE - { 0, 0, 0, 0, 80, 0, 0, 0, 0, 1}, + [ANIM_DOCILE] = + { 0, 0, 0, 0, 80, 0, 0, 0, 0, TRUE}, - // RELAXED - { 0, 2, 8, 0, 32, 0, 0, 0, 0, 0}, - { 0, 2, -8, 0, 32, 0, 0, 0, 0, 1}, + [ANIM_RELAXED] = + { 0, 2, 8, 0, 32, 0, 0, 0, 0, FALSE}, + { 0, 2, -8, 0, 32, 0, 0, 0, 0, TRUE}, - // IMPISH - { 0, 32, 2, 1, 48, 1, 0, 0, 24, 1}, + [ANIM_IMPISH] = + { 0, 32, 2, 1, 48, 1, 0, 0, 24, TRUE}, - // LAX - { 0, 2, 16, 16, 128, 0, 0, 0, 0, 1}, + [ANIM_LAX] = + { 0, 2, 16, 16, 128, 0, 0, 0, 0, TRUE}, - // TIMID - { 0, 2, -8, 0, 48, 0, -24, 0, 0, 0}, - { 0, 0, 0, 0, 8, 0, 0, 0, 0, 0}, - { 64, 32, 2, 0, 36, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 8, 0, 0, 0, 0, 0}, - { 0, 2, 8, 0, 48, 0, 24, 0, 0, 1}, + [ANIM_TIMID] = + { 0, 2, -8, 0, 48, 0, -24, 0, 0, FALSE}, + { 0, 0, 0, 0, 8, 0, 0, 0, 0, FALSE}, + { 64, 32, 2, 0, 36, 0, 0, 0, 0, FALSE}, + { 0, 0, 0, 0, 8, 0, 0, 0, 0, FALSE}, + { 0, 2, 8, 0, 48, 0, 24, 0, 0, TRUE}, - // HASTY - { 64, 24, 16, 0, 32, 0, 0, 0, 0, 0}, - { 0, 28, 2, 1, 32, 1, 0, 0, 16, 1}, + [ANIM_HASTY] = + { 64, 24, 16, 0, 32, 0, 0, 0, 0, FALSE}, + { 0, 28, 2, 1, 32, 1, 0, 0, 16, TRUE}, - // SERIOUS - { 0, 0, 0, 0, 32, 0, 0, 0, 0, 1}, + [ANIM_SERIOUS] = + { 0, 0, 0, 0, 32, 0, 0, 0, 0, TRUE}, - // JOLLY - { 64, 16, -16, 2, 48, 0, 0, 0, 32, 1}, + [ANIM_JOLLY] = + { 64, 16, -16, 2, 48, 0, 0, 0, 32, TRUE}, - // NAIVE - { 0, 12, -8, 4, 24, 0, 8, 0, 12, 0}, - { 0, 12, 8, 8, 24, 0, -16, 0, 12, 0}, - { 0, 12, -8, 16, 24, 0, 16, 0, 12, 0}, - { 0, 12, 8, 28, 24, 0, -8, 0, 12, 1}, + [ANIM_NAIVE] = + { 0, 12, -8, 4, 24, 0, 8, 0, 12, FALSE}, + { 0, 12, 8, 8, 24, 0, -16, 0, 12, FALSE}, + { 0, 12, -8, 16, 24, 0, 16, 0, 12, FALSE}, + { 0, 12, 8, 28, 24, 0, -8, 0, 12, TRUE}, - // MODEST - { 0, 0, 0, 0, 8, 0, 0, 0, 0, 0}, - { 64, 16, -4, 0, 32, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 8, 0, 0, 0, 0, 1}, + [ANIM_MODEST] = + { 0, 0, 0, 0, 8, 0, 0, 0, 0, FALSE}, + { 64, 16, -4, 0, 32, 0, 0, 0, 0, FALSE}, + { 0, 0, 0, 0, 8, 0, 0, 0, 0, TRUE}, - // MILD - { 128, 4, 0, 8, 64, 0, 0, 0, 0, 1}, + [ANIM_MILD] = + { 128, 4, 0, 8, 64, 0, 0, 0, 0, TRUE}, - // QUIET - { 0, 2, 16, 0, 48, 0, 0, 0, 0, 0}, - { 128, 2, 16, 0, 48, 0, 0, 0, 0, 1}, + [ANIM_QUIET] = + { 0, 2, 16, 0, 48, 0, 0, 0, 0, FALSE}, + { 128, 2, 16, 0, 48, 0, 0, 0, 0, TRUE}, - // BASHFUL - { 0, 2, -4, 0, 48, 0, -48, 0, 0, 0}, - { 0, 0, 0, 0, 80, 0, 0, 0, 0, 0}, - { 0, 2, 8, 0, 24, 0, 48, 0, 0, 1}, + [ANIM_BASHFUL] = + { 0, 2, -4, 0, 48, 0, -48, 0, 0, FALSE}, + { 0, 0, 0, 0, 80, 0, 0, 0, 0, FALSE}, + { 0, 2, 8, 0, 24, 0, 48, 0, 0, TRUE}, - // RASH - { 64, 4, 64, 58, 52, 0, -88, 0, 0, 0}, - { 0, 0, 0, 0, 80, 0, 0, 0, 0, 0}, - { 0, 24, 80, 0, 32, 0, 88, 0, 0, 1}, + [ANIM_RASH] = + { 64, 4, 64, 58, 52, 0, -88, 0, 0, FALSE}, + { 0, 0, 0, 0, 80, 0, 0, 0, 0, FALSE}, + { 0, 24, 80, 0, 32, 0, 88, 0, 0, TRUE}, - // CALM - { 0, 2, 16, 4, 64, 0, 0, 0, 0, 1}, + [ANIM_CALM] = + { 0, 2, 16, 4, 64, 0, 0, 0, 0, TRUE}, - // GENTLE - { 0, 0, 0, 0, 32, 0, 0, 0, 0, 1}, + [ANIM_GENTLE] = + { 0, 0, 0, 0, 32, 0, 0, 0, 0, TRUE}, - // SASSY - { 0, 0, 0, 0, 42, 0, 0, 0, 0, 1}, + [ANIM_SASSY] = + { 0, 0, 0, 0, 42, 0, 0, 0, 0, TRUE}, - // CAREFUL - { 0, 4, 0, 8, 24, 0, 0, 0, 12, 0}, - { 0, 0, 0, 0, 12, 0, 0, 0, 0, 0}, - { 0, 4, 0, 12, 24, 0, 0, 0, 12, 0}, - { 0, 0, 0, 0, 12, 0, 0, 0, 0, 0}, - { 0, 4, 0, 4, 24, 0, 0, 0, 12, 1}, + [ANIM_CAREFUL] = + { 0, 4, 0, 8, 24, 0, 0, 0, 12, FALSE}, + { 0, 0, 0, 0, 12, 0, 0, 0, 0, FALSE}, + { 0, 4, 0, 12, 24, 0, 0, 0, 12, FALSE}, + { 0, 0, 0, 0, 12, 0, 0, 0, 0, FALSE}, + { 0, 4, 0, 4, 24, 0, 0, 0, 12, TRUE}, - // QUIRKY - { 0, 4, 16, 12, 64, 0, 0, 0, 0, 0}, - { 0, -4, 16, 12, 64, 0, 0, 0, 0, 1}, + [ANIM_QUIRKY] = + { 0, 4, 16, 12, 64, 0, 0, 0, 0, FALSE}, + { 0, -4, 16, 12, 64, 0, 0, 0, 0, TRUE}, }; -static const union AffineAnimCmd sSpriteAffineAnim_8411E90[] = +static const union AffineAnimCmd sAffineAnim_Mon_None[] = { AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8411EA0[] = +static const union AffineAnimCmd sAffineAnim_Mon_TurnUp[] = { AFFINEANIMCMD_FRAME(0, 0, 12, 1), AFFINEANIMCMD_FRAME(0, 0, 0, 30), @@ -234,7 +310,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_8411EA0[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8411EC0[] = +static const union AffineAnimCmd sAffineAnim_Mon_TurnUp_Flipped[] = { AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0, 0, 12, 1), @@ -243,7 +319,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_8411EC0[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8411EE8[] = +static const union AffineAnimCmd sAffineAnim_Mon_TurnUpAndDown[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, 1, 16), AFFINEANIMCMD_FRAME(0x0, 0x0, -1, 32), @@ -251,7 +327,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_8411EE8[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8411F08[] = +static const union AffineAnimCmd sAffineAnim_Mon_TurnUpAndDown_Flipped[] = { AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0x0, 0x0, 1, 16), @@ -260,7 +336,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_8411F08[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8411F30[] = +static const union AffineAnimCmd sAffineAnim_Mon_TurnDown[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, -1, 8), AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 16), @@ -268,7 +344,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_8411F30[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8411F50[] = +static const union AffineAnimCmd sAffineAnim_Mon_TurnDown_Flipped[] = { AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0x0, 0x0, -1, 8), @@ -277,7 +353,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_8411F50[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8411F78[] = +static const union AffineAnimCmd sAffineAnim_Mon_TurnDownSlow[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, -1, 8), AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 32), @@ -285,7 +361,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_8411F78[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8411F98[] = +static const union AffineAnimCmd sAffineAnim_Mon_TurnDownSlow_Flipped[] = { AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0x0, 0x0, -1, 8), @@ -294,7 +370,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_8411F98[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8411FC0[] = +static const union AffineAnimCmd sAffineAnim_Mon_TurnDownSlight[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, -1, 4), AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 24), @@ -302,7 +378,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_8411FC0[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8411FE0[] = +static const union AffineAnimCmd sAffineAnim_Mon_TurnDownSlight_Flipped[] = { AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0x0, 0x0, -1, 4), @@ -311,7 +387,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_8411FE0[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8412008[] = +static const union AffineAnimCmd sAffineAnim_Mon_TurnUpHigh[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, 1, 24), AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 16), @@ -319,7 +395,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_8412008[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8412028[] = +static const union AffineAnimCmd sAffineAnim_Mon_TurnUpHigh_Flipped[] = { AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0x0, 0x0, 1, 24), @@ -328,29 +404,33 @@ static const union AffineAnimCmd sSpriteAffineAnim_8412028[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd *const sSpriteAffineAnimTable_85F04FC[] = +static const union AffineAnimCmd *const sAffineAnims_Mon[] = { - sSpriteAffineAnim_8411E90, - sSpriteAffineAnim_8411EA0, - sSpriteAffineAnim_8411EE8, - sSpriteAffineAnim_8411F30, - sSpriteAffineAnim_8411F78, - sSpriteAffineAnim_8411FC0, - sSpriteAffineAnim_8412008, - sSpriteAffineAnim_8411E90, - sSpriteAffineAnim_8411E90, - sSpriteAffineAnim_8411E90, - sSpriteAffineAnim_8411E90, - sSpriteAffineAnim_8411EC0, - sSpriteAffineAnim_8411F08, - sSpriteAffineAnim_8411F50, - sSpriteAffineAnim_8411F98, - sSpriteAffineAnim_8411FE0, - sSpriteAffineAnim_8412028, - sSpriteAffineAnim_8411E90, - sSpriteAffineAnim_8411E90, - sSpriteAffineAnim_8411E90, - sSpriteAffineAnim_8411E90, + // Animations for non-flipped mon sprites + [AFFINE_NONE] = sAffineAnim_Mon_None, + [AFFINE_TURN_UP] = sAffineAnim_Mon_TurnUp, + [AFFINE_TURN_UP_AND_DOWN] = sAffineAnim_Mon_TurnUpAndDown, + [AFFINE_TURN_DOWN] = sAffineAnim_Mon_TurnDown, + [AFFINE_TURN_DOWN_SLOW] = sAffineAnim_Mon_TurnDownSlow, + [AFFINE_TURN_DOWN_SLIGHT] = sAffineAnim_Mon_TurnDownSlight, + [AFFINE_TURN_UP_HIGH] = sAffineAnim_Mon_TurnUpHigh, + [AFFINE_UNUSED_1] = sAffineAnim_Mon_None, + [AFFINE_UNUSED_2] = sAffineAnim_Mon_None, + [AFFINE_UNUSED_3] = sAffineAnim_Mon_None, + + // Animations for flipped mon sprites + [AFFINE_NONE + NUM_MON_AFFINES] = sAffineAnim_Mon_None, + [AFFINE_TURN_UP + NUM_MON_AFFINES] = sAffineAnim_Mon_TurnUp_Flipped, + [AFFINE_TURN_UP_AND_DOWN + NUM_MON_AFFINES] = sAffineAnim_Mon_TurnUpAndDown_Flipped, + [AFFINE_TURN_DOWN + NUM_MON_AFFINES] = sAffineAnim_Mon_TurnDown_Flipped, + [AFFINE_TURN_DOWN_SLOW + NUM_MON_AFFINES] = sAffineAnim_Mon_TurnDownSlow_Flipped, + [AFFINE_TURN_DOWN_SLIGHT + NUM_MON_AFFINES] = sAffineAnim_Mon_TurnDownSlight_Flipped, + [AFFINE_TURN_UP_HIGH + NUM_MON_AFFINES] = sAffineAnim_Mon_TurnUpHigh_Flipped, + [AFFINE_UNUSED_1 + NUM_MON_AFFINES] = sAffineAnim_Mon_None, + [AFFINE_UNUSED_2 + NUM_MON_AFFINES] = sAffineAnim_Mon_None, + [AFFINE_UNUSED_3 + NUM_MON_AFFINES] = sAffineAnim_Mon_None, + + sAffineAnim_Mon_None, // ? Extra for some reason }; static const struct BgTemplate sBackgroundTemplates[] = @@ -377,7 +457,15 @@ static const struct BgTemplate sBackgroundTemplates[] = static const struct WindowTemplate sWindowTemplates[] = { - {0, 1, 0xF, 0x1C, 4, 0xF, 0xA}, + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 15, + .width = 28, + .height = 4, + .paletteNum = 15, + .baseBlock = 0xA + }, DUMMY_WIN_TEMPLATE }; @@ -400,7 +488,7 @@ static const u32* const sPokeblocksPals[] = [PBLOCK_CLR_GOLD - 1] = gPokeblockGold_Pal }; -static const union AffineAnimCmd sSpriteAffineAnim_84120DC[] = +static const union AffineAnimCmd sAffineAnim_Still[] = { AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_END @@ -408,10 +496,10 @@ static const union AffineAnimCmd sSpriteAffineAnim_84120DC[] = static const union AffineAnimCmd *const sSpriteAffineAnimTable_MonNoFlip[] = { - sSpriteAffineAnim_84120DC + sAffineAnim_Still }; -static const union AffineAnimCmd sSpriteAffineAnim_84120F0[] = +static const union AffineAnimCmd sAffineAnim_PokeblockCase_ThrowFromVertical[] = { AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0x0, 0x0, -8, 1), @@ -426,7 +514,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_84120F0[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_8412148[] = +static const union AffineAnimCmd sAffineAnim_PokeblockCase_ThrowFromHorizontal[] = { AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0x0, 0x0, 8, 1), @@ -441,22 +529,22 @@ static const union AffineAnimCmd sSpriteAffineAnim_8412148[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd *const sSpriteAffineAnimTable_85F0664[] = +static const union AffineAnimCmd *const sAffineAnims_PokeblockCase_Still[] = { - sSpriteAffineAnim_84120DC + sAffineAnim_Still }; -static const union AffineAnimCmd *const sSpriteAffineAnimTable_85F0668[] = +static const union AffineAnimCmd *const sAffineAnims_PokeblockCase_ThrowFromVertical[] = { - sSpriteAffineAnim_84120F0 + sAffineAnim_PokeblockCase_ThrowFromVertical }; -static const union AffineAnimCmd *const sSpriteAffineAnimTable_85F066C[] = +static const union AffineAnimCmd *const sAffineAnims_PokeblockCase_ThrowFromHorizontal[] = { - sSpriteAffineAnim_8412148 + sAffineAnim_PokeblockCase_ThrowFromHorizontal }; -static const struct OamData sThrownPokeblockOamData = +static const struct OamData sOamData_Pokeblock = { .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, @@ -473,46 +561,45 @@ static const struct OamData sThrownPokeblockOamData = .affineParam = 0, }; -static const union AnimCmd sThrownPokeblockSpriteAnim[] = +static const union AnimCmd sAnim_Pokeblock[] = { ANIMCMD_FRAME(0, 0), ANIMCMD_END }; -static const union AnimCmd *const sThrownPokeblockAnimTable[] = +static const union AnimCmd *const sAnims_Pokeblock[] = { - sThrownPokeblockSpriteAnim, + sAnim_Pokeblock, }; -static const union AffineAnimCmd sSpriteAffineAnim_84121C0[] = +static const union AffineAnimCmd sAffineAnim_Pokeblock[] = { AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(-8, -8, 0, 1), AFFINEANIMCMD_JUMP(1) }; -static const union AffineAnimCmd *const sThrownPokeblockAffineAnimTable[] = +static const union AffineAnimCmd *const sAffineAnims_Pokeblock[] = { - sSpriteAffineAnim_84121C0 + sAffineAnim_Pokeblock }; -static const struct CompressedSpriteSheet sPokeblock_SpriteSheet = +static const struct CompressedSpriteSheet sSpriteSheet_Pokeblock = { gPokeblock_Gfx, 0x20, TAG_POKEBLOCK }; -static const struct SpriteTemplate sThrownPokeblockSpriteTemplate = +static const struct SpriteTemplate sSpriteTemplate_Pokeblock = { .tileTag = TAG_POKEBLOCK, .paletteTag = TAG_POKEBLOCK, - .oam = &sThrownPokeblockOamData, - .anims = sThrownPokeblockAnimTable, + .oam = &sOamData_Pokeblock, + .anims = sAnims_Pokeblock, .images = NULL, - .affineAnims = sThrownPokeblockAffineAnimTable, + .affineAnims = sAffineAnims_Pokeblock, .callback = SpriteCB_ThrownPokeblock }; -// code static void CB2_PokeblockFeed(void) { RunTasks(); @@ -529,7 +616,7 @@ static void VBlankCB_PokeblockFeed(void) TransferPlttBuffer(); } -static bool8 TransitionToPokeblockFeedScene(void) +static bool8 LoadPokeblockFeedScene(void) { switch (gMain.state) { @@ -541,7 +628,7 @@ static bool8 TransitionToPokeblockFeedScene(void) break; case 1: ResetPaletteFade(); - gPaletteFade.bufferTransferDisabled = 1; + gPaletteFade.bufferTransferDisabled = TRUE; gMain.state++; break; case 2: @@ -566,9 +653,7 @@ static bool8 TransitionToPokeblockFeedScene(void) break; case 7: if (LoadMonAndSceneGfx(&gPlayerParty[gPokeblockMonId])) - { gMain.state++; - } break; case 8: sPokeblockFeed->pokeblockCaseSpriteId = CreatePokeblockCaseSpriteForFeeding(); @@ -587,12 +672,12 @@ static bool8 TransitionToPokeblockFeedScene(void) gMain.state++; break; case 12: - BlendPalettes(PALETTES_ALL, 0x10, 0); + BlendPalettes(PALETTES_ALL, 16, 0); gMain.state++; break; case 13: - BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); - gPaletteFade.bufferTransferDisabled = 0; + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); + gPaletteFade.bufferTransferDisabled = FALSE; gMain.state++; break; default: @@ -603,13 +688,13 @@ static bool8 TransitionToPokeblockFeedScene(void) return FALSE; } -void CB2_PreparePokeblockFeedScene(void) +void PreparePokeblockFeedScene(void) { while (1) { if (MenuHelpers_CallLinkSomething() == TRUE) break; - if (TransitionToPokeblockFeedScene() == TRUE) + if (LoadPokeblockFeedScene() == TRUE) break; if (MenuHelpers_LinkSomething() == TRUE) break; @@ -643,12 +728,14 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon) switch (sPokeblockFeed->loadGfxState) { case 0: + // Load mon gfx species = GetMonData(mon, MON_DATA_SPECIES2); personality = GetMonData(mon, MON_DATA_PERSONALITY); HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, personality); sPokeblockFeed->loadGfxState++; break; case 1: + // Load mon palette species = GetMonData(mon, MON_DATA_SPECIES2); personality = GetMonData(mon, MON_DATA_PERSONALITY); trainerId = GetMonData(mon, MON_DATA_OT_ID); @@ -667,7 +754,7 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon) sPokeblockFeed->loadGfxState++; break; case 4: - LoadCompressedSpriteSheet(&sPokeblock_SpriteSheet); + LoadCompressedSpriteSheet(&sSpriteSheet_Pokeblock); sPokeblockFeed->loadGfxState++; break; case 5: @@ -683,7 +770,7 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon) case 7: if (FreeTempTileDataBuffersIfPossible() != TRUE) { - LZDecompressWram(gUnknown_08D9BA44, sPokeblockFeed->tilemapBuffer); + LZDecompressWram(gPokeblockFeedBg_Tilemap, sPokeblockFeed->tilemapBuffer); sPokeblockFeed->loadGfxState++; } break; @@ -716,58 +803,63 @@ static void SetPokeblockSpritePal(u8 pokeblockCaseId) // defines for task data fields -#define tFrames data[0] -#define tData1 data[1] +#define tState data[0] +#define tHorizontalThrow data[1] + +#define STATE_START_THROW 255 // If the length of the Pokémon's animation exceeds 255 the throw may happen twice +#define STATE_SPAWN_PBLOCK (STATE_START_THROW + 14) +#define STATE_START_JUMP (STATE_SPAWN_PBLOCK + 12) +#define STATE_PRINT_MSG (STATE_START_JUMP + 16) static void Task_HandlePokeblockFeed(u8 taskId) { if (!gPaletteFade.active) { - switch (gTasks[taskId].tFrames) + switch (gTasks[taskId].tState) { case 0: - sPokeblockFeed->field_1050 = 0; - sPokeblockFeed->field_1058 = 0; - sub_817A5CC(); + sPokeblockFeed->animRunState = 0; + sPokeblockFeed->timer = 0; + CalculateMonAnimLength(); break; - case 255: - DoPokeblockCaseThrowEffect(sPokeblockFeed->pokeblockCaseSpriteId, gTasks[taskId].tData1); + case STATE_START_THROW: + DoPokeblockCaseThrowEffect(sPokeblockFeed->pokeblockCaseSpriteId, gTasks[taskId].tHorizontalThrow); break; - case 269: + case STATE_SPAWN_PBLOCK: sPokeblockFeed->pokeblockSpriteId = CreatePokeblockSprite(); break; - case 281: - PrepareMonToMoveToPokeblock(sPokeblockFeed->monSpriteId); + case STATE_START_JUMP: + StartMonJumpForPokeblock(sPokeblockFeed->monSpriteId); break; - case 297: - gTasks[taskId].func = Task_HandleMonAtePokeblock; + case STATE_PRINT_MSG: + gTasks[taskId].func = Task_PrintAtePokeblockMessage; return; } - if (sPokeblockFeed->field_1058 < sPokeblockFeed->field_1056) - sub_817A634(); - else if (sPokeblockFeed->field_1058 == sPokeblockFeed->field_1056) - gTasks[taskId].tFrames = 254; + if (sPokeblockFeed->timer < sPokeblockFeed->monAnimLength) + UpdateMonAnim(); + else if (sPokeblockFeed->timer == sPokeblockFeed->monAnimLength) + gTasks[taskId].tState = STATE_START_THROW - 1; - sPokeblockFeed->field_1058++; - gTasks[taskId].tFrames++; + sPokeblockFeed->timer++; + gTasks[taskId].tState++; } } static void LaunchPokeblockFeedTask(void) { u8 taskId = CreateTask(Task_HandlePokeblockFeed, 0); - gTasks[taskId].tFrames = 0; - gTasks[taskId].tData1 = 1; + gTasks[taskId].tState = 0; + gTasks[taskId].tHorizontalThrow = TRUE; } -static void Task_WaitForAtePokeblockText(u8 taskId) +static void Task_WaitForAtePokeblockMessage(u8 taskId) { if (RunTextPrintersRetIsActive(0) != TRUE) - gTasks[taskId].func = Task_PaletteFadeToReturn; + gTasks[taskId].func = Task_FadeOutPokeblockFeed; } -static void Task_HandleMonAtePokeblock(u8 taskId) +static void Task_PrintAtePokeblockMessage(u8 taskId) { struct Pokemon *mon = &gPlayerParty[gPokeblockMonId]; struct Pokeblock *pokeblock = &gSaveBlock1Ptr->pokeblocks[gSpecialVar_ItemId]; @@ -783,12 +875,12 @@ static void Task_HandleMonAtePokeblock(u8 taskId) else StringExpandPlaceholders(gStringVar4, gText_Var1DisdainfullyAteVar2); - gTextFlags.canABSpeedUpPrint = 1; + gTextFlags.canABSpeedUpPrint = TRUE; AddTextPrinterParameterized2(0, 1, gStringVar4, GetPlayerTextSpeedDelay(), NULL, 2, 1, 3); - gTasks[taskId].func = Task_WaitForAtePokeblockText; + gTasks[taskId].func = Task_WaitForAtePokeblockMessage; } -static void Task_ReturnAfterPaletteFade(u8 taskId) +static void Task_ExitPokeblockFeed(u8 taskId) { if (!gPaletteFade.active) { @@ -803,30 +895,29 @@ static void Task_ReturnAfterPaletteFade(u8 taskId) } } -static void Task_PaletteFadeToReturn(u8 taskId) +static void Task_FadeOutPokeblockFeed(u8 taskId) { - BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); - gTasks[taskId].func = Task_ReturnAfterPaletteFade; + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); + gTasks[taskId].func = Task_ExitPokeblockFeed; } -#undef tFrames -#undef tData1 +#undef tState +#undef tHorizontalThrow -// defines for mon sprite data fields - -#define tDelta data[0] -#define tDeltaMod data[1] -#define tSpecies data[2] +// Sprite data for Pokéblock and Pokémon +#define sSpeed data[0] +#define sAccel data[1] +#define sSpecies data[2] static u8 CreateMonSprite(struct Pokemon* mon) { u16 species = GetMonData(mon, MON_DATA_SPECIES2); - u8 spriteId = CreateSprite(&gMultiuseSpriteTemplate, 48, 80, 2); + u8 spriteId = CreateSprite(&gMultiuseSpriteTemplate, MON_X, MON_Y, 2); sPokeblockFeed->species = species; sPokeblockFeed->monSpriteId_ = spriteId; sPokeblockFeed->nature = GetNature(mon); - gSprites[spriteId].tSpecies = species; + gSprites[spriteId].sSpecies = species; gSprites[spriteId].callback = SpriteCallbackDummy; sPokeblockFeed->noMonFlip = TRUE; @@ -841,189 +932,191 @@ static u8 CreateMonSprite(struct Pokemon* mon) return spriteId; } -static void PrepareMonToMoveToPokeblock(u8 spriteId) +static void StartMonJumpForPokeblock(u8 spriteId) { - gSprites[spriteId].pos1.x = 48; - gSprites[spriteId].pos1.y = 80; - gSprites[spriteId].tDelta = -8; - gSprites[spriteId].tDeltaMod = 1; - gSprites[spriteId].callback = sub_817A468; + gSprites[spriteId].pos1.x = MON_X; + gSprites[spriteId].pos1.y = MON_Y; + gSprites[spriteId].sSpeed = -8; + gSprites[spriteId].sAccel = 1; + gSprites[spriteId].callback = SpriteCB_MonJumpForPokeblock; } -static void sub_817A468(struct Sprite* sprite) +static void SpriteCB_MonJumpForPokeblock(struct Sprite* sprite) { sprite->pos1.x += 4; - sprite->pos1.y += sprite->tDelta; - sprite->tDelta += sprite->tDeltaMod; + sprite->pos1.y += sprite->sSpeed; + sprite->sSpeed += sprite->sAccel; - if (sprite->tDelta == 0) - PlayCry1(sprite->tSpecies, 0); - if (sprite->tDelta == 9) + // Play cry at jump peak + if (sprite->sSpeed == 0) + PlayCry1(sprite->sSpecies, 0); + + if (sprite->sSpeed == 9) sprite->callback = SpriteCallbackDummy; } -#undef tDelta -#undef tDeltaMod -#undef tSpecies - static u8 CreatePokeblockCaseSpriteForFeeding(void) { u8 spriteId = CreatePokeblockCaseSprite(188, 100, 2); gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; - gSprites[spriteId].affineAnims = sSpriteAffineAnimTable_85F0664; + gSprites[spriteId].affineAnims = sAffineAnims_PokeblockCase_Still; gSprites[spriteId].callback = SpriteCallbackDummy; InitSpriteAffineAnim(&gSprites[spriteId]); return spriteId; } -static void DoPokeblockCaseThrowEffect(u8 spriteId, bool8 a1) +static void DoPokeblockCaseThrowEffect(u8 spriteId, bool8 horizontalThrow) { FreeOamMatrix(gSprites[spriteId].oam.matrixNum); gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE; - if (!a1) - gSprites[spriteId].affineAnims = sSpriteAffineAnimTable_85F0668; + if (!horizontalThrow) + gSprites[spriteId].affineAnims = sAffineAnims_PokeblockCase_ThrowFromVertical; // Never used, horizontalThrow always TRUE else - gSprites[spriteId].affineAnims = sSpriteAffineAnimTable_85F066C; + gSprites[spriteId].affineAnims = sAffineAnims_PokeblockCase_ThrowFromHorizontal; InitSpriteAffineAnim(&gSprites[spriteId]); } -// defines for the pokeblock sprite data fields -#define tDelta data[0] -#define tDeltaMod data[1] - static u8 CreatePokeblockSprite(void) { - u8 spriteId = CreateSprite(&sThrownPokeblockSpriteTemplate, 174, 84, 1); - gSprites[spriteId].tDelta = -12; - gSprites[spriteId].tDeltaMod = 1; + u8 spriteId = CreateSprite(&sSpriteTemplate_Pokeblock, 174, 84, 1); + gSprites[spriteId].sSpeed = -12; + gSprites[spriteId].sAccel = 1; return spriteId; } static void SpriteCB_ThrownPokeblock(struct Sprite* sprite) { sprite->pos1.x -= 4; - sprite->pos1.y += sprite->tDelta; - sprite->tDelta += sprite->tDeltaMod; - if (sprite->tDelta == 10) + sprite->pos1.y += sprite->sSpeed; + sprite->sSpeed += sprite->sAccel; + if (sprite->sSpeed == 10) DestroySprite(sprite); } -#undef tDelta -#undef tDeltaMod - -static void sub_817A5CC(void) +static void CalculateMonAnimLength(void) { u8 animId, i; - struct PokeblockFeedStruct *pokeblockFeed; + struct PokeblockFeed *pokeblockFeed; pokeblockFeed = sPokeblockFeed; - pokeblockFeed->field_1056 = 1; + pokeblockFeed->monAnimLength = 1; animId = sNatureToMonPokeblockAnim[pokeblockFeed->nature][0]; + + // Add up the time each stage of the animation will take for (i = 0; i < 8; i++, animId++) { - pokeblockFeed->field_1056 += sMonPokeblockAnims[animId][4]; - if (sMonPokeblockAnims[animId][9] == 1) + pokeblockFeed->monAnimLength += sMonPokeblockAnims[animId][ANIMDATA_TIME]; + if (sMonPokeblockAnims[animId][ANIMDATA_IS_LAST] == TRUE) break; } } -static void sub_817A634(void) +static void UpdateMonAnim(void) { - struct PokeblockFeedStruct *pokeblockFeed = sPokeblockFeed; + struct PokeblockFeed *pokeblockFeed = sPokeblockFeed; - switch (pokeblockFeed->field_1050) + switch (pokeblockFeed->animRunState) { case 0: pokeblockFeed->animId = sNatureToMonPokeblockAnim[pokeblockFeed->nature][0]; pokeblockFeed->monSpritePtr = &gSprites[pokeblockFeed->monSpriteId_]; pokeblockFeed->savedMonSprite = *pokeblockFeed->monSpritePtr; - pokeblockFeed->field_1050 = 10; + pokeblockFeed->animRunState = 10; break; case 1 ... 9: break; case 10: - sub_817A91C(); - if (sNatureToMonPokeblockAnim[pokeblockFeed->nature][1] != 0) + InitMonAnimStage(); + if (sNatureToMonPokeblockAnim[pokeblockFeed->nature][1] != AFFINE_NONE) { + // Initialize affine anim pokeblockFeed->monSpritePtr->oam.affineMode = ST_OAM_AFFINE_DOUBLE; pokeblockFeed->monSpritePtr->oam.matrixNum = 0; - pokeblockFeed->monSpritePtr->affineAnims = sSpriteAffineAnimTable_85F04FC; + pokeblockFeed->monSpritePtr->affineAnims = sAffineAnims_Mon; InitSpriteAffineAnim(pokeblockFeed->monSpritePtr); } - pokeblockFeed->field_1050 = 50; + pokeblockFeed->animRunState = 50; case 50: - if (sNatureToMonPokeblockAnim[pokeblockFeed->nature][1] != 0) + if (sNatureToMonPokeblockAnim[pokeblockFeed->nature][1] != AFFINE_NONE) { + // Start affine anim if (!pokeblockFeed->noMonFlip) // double negation, so mon's sprite is flipped - StartSpriteAffineAnim(pokeblockFeed->monSpritePtr, sNatureToMonPokeblockAnim[pokeblockFeed->nature][1] + 10); + StartSpriteAffineAnim(pokeblockFeed->monSpritePtr, sNatureToMonPokeblockAnim[pokeblockFeed->nature][1] + NUM_MON_AFFINES); else StartSpriteAffineAnim(pokeblockFeed->monSpritePtr, sNatureToMonPokeblockAnim[pokeblockFeed->nature][1]); } - pokeblockFeed->field_1050 = 60; + pokeblockFeed->animRunState = 60; break; case 60: - if (sub_817A9E4() == TRUE) + if (DoMonAnimStep() == TRUE) { - if (pokeblockFeed->field_1060[9] == 0) + if (!pokeblockFeed->animData[ANIMDATA_IS_LAST]) { + // Continue to next stage of animation pokeblockFeed->animId++; - sub_817A91C(); - pokeblockFeed->field_1050 = 60; + InitMonAnimStage(); + pokeblockFeed->animRunState = 60; } else { + // End animation FreeOamMatrix(pokeblockFeed->monSpritePtr->oam.matrixNum); - pokeblockFeed->field_1050 = 70; + pokeblockFeed->animRunState = 70; } } break; case 70: FreeMonSpriteOamMatrix(); pokeblockFeed->animId = 0; - pokeblockFeed->field_1050 = 0; + pokeblockFeed->animRunState = 0; break; case 71 ... 90: break; } } -static bool8 sub_817A91C(void) +static bool8 InitMonAnimStage(void) { - struct PokeblockFeedStruct *pokeblockFeed = sPokeblockFeed; + struct PokeblockFeed *pokeblockFeed = sPokeblockFeed; u8 i; - for (i = 0; i < 10; i++) - pokeblockFeed->field_1060[i] = sMonPokeblockAnims[pokeblockFeed->animId][i]; + for (i = 0; i < NUM_ANIMDATA; i++) + pokeblockFeed->animData[i] = sMonPokeblockAnims[pokeblockFeed->animId][i]; - if (pokeblockFeed->field_1060[4] == 0) + if (pokeblockFeed->animData[ANIMDATA_TIME] == 0) { return TRUE; } else { - pokeblockFeed->field_1060[10] = Sin(pokeblockFeed->field_1060[0], pokeblockFeed->field_1060[2]); - pokeblockFeed->field_1060[11] = Cos(pokeblockFeed->field_1060[0], pokeblockFeed->field_1060[3]); - pokeblockFeed->field_1060[12] = pokeblockFeed->field_1060[4]; - pokeblockFeed->field_1060[13] = pokeblockFeed->monSpritePtr->pos2.x; - pokeblockFeed->field_1060[14] = pokeblockFeed->monSpritePtr->pos2.y; - sub_817AB68(); - pokeblockFeed->field_1060[4] = pokeblockFeed->field_1060[12]; - sub_817AA54(); - pokeblockFeed->field_1060[4] = pokeblockFeed->field_1060[12]; + pokeblockFeed->monInitX = Sin(pokeblockFeed->animData[ANIMDATA_ROT_IDX], pokeblockFeed->animData[ANIMDATA_SIN_AMPLITUDE]); + pokeblockFeed->monInitY = Cos(pokeblockFeed->animData[ANIMDATA_ROT_IDX], pokeblockFeed->animData[ANIMDATA_COS_AMPLITUDE]); + pokeblockFeed->maxAnimStageTime = pokeblockFeed->animData[ANIMDATA_TIME]; + pokeblockFeed->monX = pokeblockFeed->monSpritePtr->pos2.x; + pokeblockFeed->monY = pokeblockFeed->monSpritePtr->pos2.y; + + // Calculate the positions to move to during the animation + // The time is counted down during this, so reset it afterwards + CalculateMonAnimMovement(); + pokeblockFeed->animData[ANIMDATA_TIME] = pokeblockFeed->maxAnimStageTime; + CalculateMonAnimMovementEnd(); + pokeblockFeed->animData[ANIMDATA_TIME] = pokeblockFeed->maxAnimStageTime; // Redundant return FALSE; } } -static bool8 sub_817A9E4(void) +static bool8 DoMonAnimStep(void) { - u16 var = sPokeblockFeed->field_1060[12] - sPokeblockFeed->field_1060[4]; + // Update mon's position + u16 time = sPokeblockFeed->maxAnimStageTime - sPokeblockFeed->animData[ANIMDATA_TIME]; + sPokeblockFeed->monSpritePtr->pos2.x = sPokeblockFeed->monAnimX[time]; + sPokeblockFeed->monSpritePtr->pos2.y = sPokeblockFeed->monAnimY[time]; - sPokeblockFeed->monSpritePtr->pos2.x = sPokeblockFeed->field_850[var]; - sPokeblockFeed->monSpritePtr->pos2.y = sPokeblockFeed->field_C50[var]; - - if (--sPokeblockFeed->field_1060[4] == 0) + // Count down time remaining in this stage + // Return TRUE if this stage is complete + if (--sPokeblockFeed->animData[ANIMDATA_TIME] == 0) return TRUE; else return FALSE; @@ -1035,66 +1128,70 @@ static bool8 FreeMonSpriteOamMatrix(void) return FALSE; } -static void sub_817AA54(void) +static void CalculateMonAnimMovementEnd(void) { - struct PokeblockFeedStruct *pokeblockFeed = sPokeblockFeed; + struct PokeblockFeed *pokeblockFeed = sPokeblockFeed; u16 i; - u16 r8 = pokeblockFeed->field_1060[8]; - u16 r7 = pokeblockFeed->field_1060[12] - r8; - s16 var3 = pokeblockFeed->field_1060[13] + pokeblockFeed->field_1060[6]; - s16 r9 = pokeblockFeed->field_1060[14] + pokeblockFeed->field_1060[7]; + u16 approachTime = pokeblockFeed->animData[ANIMDATA_APPR_TIME]; + u16 time = pokeblockFeed->maxAnimStageTime - approachTime; + s16 x = pokeblockFeed->monX + pokeblockFeed->animData[ANIMDATA_TARGET_X]; + s16 y = pokeblockFeed->monY + pokeblockFeed->animData[ANIMDATA_TARGET_Y]; - for (i = 0; i < r7 - 1; i++) + for (i = 0; i < time - 1; i++) { - s16 r1 = pokeblockFeed->field_850[r8 + i] - (var3); - s16 r4 = pokeblockFeed->field_C50[r8 + i] - r9; + s16 xOffset = pokeblockFeed->monAnimX[approachTime + i] - x; + s16 yOffset = pokeblockFeed->monAnimY[approachTime + i] - y; - pokeblockFeed->field_850[r8 + i] -= r1 * (i + 1) / r7; - pokeblockFeed->field_C50[r8 + i] -= r4 * (i + 1) / r7; + pokeblockFeed->monAnimX[approachTime + i] -= xOffset * (i + 1) / time; + pokeblockFeed->monAnimY[approachTime + i] -= yOffset * (i + 1) / time; } - pokeblockFeed->field_850[(r8 + r7) - 1] = var3; - pokeblockFeed->field_C50[(r8 + r7) - 1] = r9; + pokeblockFeed->monAnimX[approachTime + time - 1] = x; + pokeblockFeed->monAnimY[approachTime + time - 1] = y; } -static void sub_817AB68(void) +static void CalculateMonAnimMovement(void) { - struct PokeblockFeedStruct *pokeblockFeed = sPokeblockFeed; - bool8 var_24 = FALSE; - s16 r8 = pokeblockFeed->field_1060[13] - pokeblockFeed->field_1060[10]; - s16 r7 = pokeblockFeed->field_1060[14] - pokeblockFeed->field_1060[11]; + struct PokeblockFeed *pokeblockFeed = sPokeblockFeed; + bool8 negative = FALSE; + s16 x = pokeblockFeed->monX - pokeblockFeed->monInitX; + s16 y = pokeblockFeed->monY - pokeblockFeed->monInitY; while (1) { - u16 r5; - u16 r4; - u16 var; + u16 amplitude; + u16 time; + u16 acceleration; - var = abs(pokeblockFeed->field_1060[5]); - r5 = var + pokeblockFeed->field_1060[3]; - pokeblockFeed->field_1060[3] = r5; + acceleration = abs(pokeblockFeed->animData[ANIMDATA_ROT_ACCEL]); + amplitude = acceleration + pokeblockFeed->animData[ANIMDATA_COS_AMPLITUDE]; + pokeblockFeed->animData[ANIMDATA_COS_AMPLITUDE] = amplitude; - if (pokeblockFeed->field_1060[2] < 0) - var_24 = TRUE; + if (pokeblockFeed->animData[ANIMDATA_SIN_AMPLITUDE] < 0) + negative = TRUE; - r4 = pokeblockFeed->field_1060[12] - pokeblockFeed->field_1060[4]; + time = pokeblockFeed->maxAnimStageTime - pokeblockFeed->animData[ANIMDATA_TIME]; - if (pokeblockFeed->field_1060[4] == 0) + if (pokeblockFeed->animData[ANIMDATA_TIME] == 0) break; - if (!var_24) + if (!negative) { - pokeblockFeed->field_850[r4] = Sin(pokeblockFeed->field_1060[0], pokeblockFeed->field_1060[2] + r5 / 0x100) + r8; - pokeblockFeed->field_C50[r4] = Cos(pokeblockFeed->field_1060[0], pokeblockFeed->field_1060[3] + r5 / 0x100) + r7; + pokeblockFeed->monAnimX[time] = Sin(pokeblockFeed->animData[ANIMDATA_ROT_IDX], + pokeblockFeed->animData[ANIMDATA_SIN_AMPLITUDE] + amplitude / 0x100) + x; + pokeblockFeed->monAnimY[time] = Cos(pokeblockFeed->animData[ANIMDATA_ROT_IDX], + pokeblockFeed->animData[ANIMDATA_COS_AMPLITUDE] + amplitude / 0x100) + y; } else { - pokeblockFeed->field_850[r4] = Sin(pokeblockFeed->field_1060[0], pokeblockFeed->field_1060[2] - r5 / 0x100) + r8; - pokeblockFeed->field_C50[r4] = Cos(pokeblockFeed->field_1060[0], pokeblockFeed->field_1060[3] - r5 / 0x100) + r7; + pokeblockFeed->monAnimX[time] = Sin(pokeblockFeed->animData[ANIMDATA_ROT_IDX], + pokeblockFeed->animData[ANIMDATA_SIN_AMPLITUDE] - amplitude / 0x100) + x; + pokeblockFeed->monAnimY[time] = Cos(pokeblockFeed->animData[ANIMDATA_ROT_IDX], + pokeblockFeed->animData[ANIMDATA_COS_AMPLITUDE] - amplitude / 0x100) + y; } - pokeblockFeed->field_1060[0] += pokeblockFeed->field_1060[1]; - pokeblockFeed->field_1060[0] &= 0xFF; - pokeblockFeed->field_1060[4]--; + pokeblockFeed->animData[ANIMDATA_ROT_IDX] += pokeblockFeed->animData[ANIMDATA_ROT_SPEED]; + pokeblockFeed->animData[ANIMDATA_ROT_IDX] &= 0xFF; + pokeblockFeed->animData[ANIMDATA_TIME]--; } } diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index cfaec6f18..669b6ab25 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -708,7 +708,7 @@ static void FeedPokeblockToMon(void) FREE_AND_SET_NULL(sMenu); FreeAllWindowBuffers(); gMain.savedCallback = CB2_ReturnAndChooseMonToGivePokeblock; - CB2_PreparePokeblockFeedScene(); + PreparePokeblockFeedScene(); } break; } From 56057d3c32420b8c348b4054b6ef2ab65fb572a2 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 13 Apr 2021 02:45:16 -0400 Subject: [PATCH 33/63] Label more unused battle anims --- src/battle_anim_effects_1.c | 252 +++++++++++++++++++----------------- 1 file changed, 130 insertions(+), 122 deletions(-) diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 03dc75daf..9901aa5dd 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -16,7 +16,12 @@ #include "constants/rgb.h" #include "constants/songs.h" -EWRAM_DATA s16 gUnknown_0203A0F8[4] = {0}; +struct { + s16 startX; + s16 startY; + s16 targetX; + s16 targetY; +} static EWRAM_DATA sFrenzyPlantRootData = {0}; // Debug? Written to but never read. static void AnimMovePowderParticle(struct Sprite *); static void AnimMovePowderParticle_Step(struct Sprite *); @@ -65,14 +70,14 @@ static void AnimFlyingParticle(struct Sprite *); static void AnimFlyingParticle_Step(struct Sprite *); static void AnimNeedleArmSpike(struct Sprite *); static void AnimNeedleArmSpike_Step(struct Sprite *); -static void sub_81009F8(struct Sprite *); +static void AnimSlidingHit(struct Sprite *); static void AnimWhipHit(struct Sprite *); -static void sub_8100A94(struct Sprite *); +static void AnimFlickeringPunch(struct Sprite *); static void AnimCuttingSlice(struct Sprite *); static void AnimAirCutterSlice(struct Sprite *); static void AnimSlice_Step(struct Sprite *); -static void sub_8100E1C(struct Sprite *); -static void sub_8100E80(struct Sprite *); +static void AnimCirclingMusicNote(struct Sprite *); +static void AnimCirclingMusicNote_Step(struct Sprite *); static void AnimProtect(struct Sprite *); static void AnimProtect_Step(struct Sprite *); static void AnimMilkBottle(struct Sprite *); @@ -80,8 +85,8 @@ static void AnimMilkBottle_Step1(struct Sprite *); static void AnimMilkBottle_Step2(struct Sprite *, int, int); static void AnimGrantingStars(struct Sprite *); static void AnimSparkingStars(struct Sprite *); -static void sub_8101440(struct Sprite *); -static void sub_81014A0(struct Sprite *); +static void AnimBubbleBurst(struct Sprite *); +static void AnimBubbleBurst_Step(struct Sprite *); static void AnimSleepLetterZ(struct Sprite *); static void AnimSleepLetterZ_Step(struct Sprite *); static void AnimLockOnTarget(struct Sprite *); @@ -99,8 +104,8 @@ static void AnimBowMon_Step2(struct Sprite *); static void AnimBowMon_Step3(struct Sprite *); static void AnimBowMon_Step4(struct Sprite *); static void AnimBowMon_Step3_Callback(struct Sprite *); -static void sub_8101B90(struct Sprite *); -static void sub_8101BA0(struct Sprite *); +static void AnimTipMon(struct Sprite *); +static void AnimTipMon_Step(struct Sprite *); static void AnimSlashSlice(struct Sprite *); static void AnimFalseSwipeSlice(struct Sprite *); static void AnimFalseSwipeSlice_Step1(struct Sprite *); @@ -571,7 +576,7 @@ const struct SpriteTemplate gSwiftStarSpriteTemplate = .callback = AnimTranslateLinearSingleSineWave, }; -const union AnimCmd gConstrictBindingAnimCmds1[] = +static const union AnimCmd sAnim_ConstrictBinding[] = { ANIMCMD_FRAME(0, 4), ANIMCMD_FRAME(32, 4), @@ -580,7 +585,7 @@ const union AnimCmd gConstrictBindingAnimCmds1[] = ANIMCMD_END, }; -const union AnimCmd gConstrictBindingAnimCmds2[] = +static const union AnimCmd sAnim_ConstrictBinding_Flipped[] = { ANIMCMD_FRAME(0, 4, .hFlip = TRUE), ANIMCMD_FRAME(32, 4, .hFlip = TRUE), @@ -589,29 +594,29 @@ const union AnimCmd gConstrictBindingAnimCmds2[] = ANIMCMD_END, }; -const union AnimCmd *const gConstrictBindingAnimTable[] = +static const union AnimCmd *const sAnims_ConstrictBinding[] = { - gConstrictBindingAnimCmds1, - gConstrictBindingAnimCmds2, + sAnim_ConstrictBinding, + sAnim_ConstrictBinding_Flipped, }; -const union AffineAnimCmd gConstrictBindingAffineAnimCmds1[] = { +static const union AffineAnimCmd sAffineAnim_ConstrictBinding[] = { AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(-11, 0, 0, 6), AFFINEANIMCMD_FRAME(11, 0, 0, 6), AFFINEANIMCMD_END, }; -const union AffineAnimCmd gConstrictBindingAffineAnimCmds2[] = { +static const union AffineAnimCmd sAffineAnim_ConstrictBinding_Flipped[] = { AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(11, 0, 0, 6), AFFINEANIMCMD_FRAME(-11, 0, 0, 6), AFFINEANIMCMD_END, }; -const union AffineAnimCmd *const gConstrictBindingAffineAnimTable[] = { - gConstrictBindingAffineAnimCmds1, - gConstrictBindingAffineAnimCmds2, +static const union AffineAnimCmd *const sAffineAnims_ConstrictBinding[] = { + sAffineAnim_ConstrictBinding, + sAffineAnim_ConstrictBinding_Flipped, }; const struct SpriteTemplate gConstrictBindingSpriteTemplate = @@ -619,9 +624,9 @@ const struct SpriteTemplate gConstrictBindingSpriteTemplate = .tileTag = ANIM_TAG_TENDRILS, .paletteTag = ANIM_TAG_TENDRILS, .oam = &gOamData_AffineNormal_ObjNormal_64x32, - .anims = gConstrictBindingAnimTable, + .anims = sAnims_ConstrictBinding, .images = NULL, - .affineAnims = gConstrictBindingAffineAnimTable, + .affineAnims = sAffineAnims_ConstrictBinding, .callback = AnimConstrictBinding, }; @@ -1060,7 +1065,7 @@ const struct SpriteTemplate gNeedleArmSpikeSpriteTemplate = .callback = AnimNeedleArmSpike, }; -const union AnimCmd gWhipAnimCmds1[] = +static const union AnimCmd sAnim_Whip[] = { ANIMCMD_FRAME(64, 3), ANIMCMD_FRAME(80, 3), @@ -1069,7 +1074,7 @@ const union AnimCmd gWhipAnimCmds1[] = ANIMCMD_END, }; -const union AnimCmd gWhipAnimCmds2[] = +static const union AnimCmd sAnim_Whip_Flipped[] = { ANIMCMD_FRAME(64, 3, .hFlip = TRUE), ANIMCMD_FRAME(80, 3, .hFlip = TRUE), @@ -1078,10 +1083,10 @@ const union AnimCmd gWhipAnimCmds2[] = ANIMCMD_END, }; -const union AnimCmd *const gWhipAnimTable[] = +static const union AnimCmd *const sAnims_Whip[] = { - gWhipAnimCmds1, - gWhipAnimCmds2, + sAnim_Whip, + sAnim_Whip_Flipped, }; const struct SpriteTemplate gSlamHitSpriteTemplate = @@ -1089,7 +1094,7 @@ const struct SpriteTemplate gSlamHitSpriteTemplate = .tileTag = ANIM_TAG_SLAM_HIT, .paletteTag = ANIM_TAG_SLAM_HIT, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = gWhipAnimTable, + .anims = sAnims_Whip, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimWhipHit, @@ -1100,13 +1105,13 @@ const struct SpriteTemplate gVineWhipSpriteTemplate = .tileTag = ANIM_TAG_WHIP_HIT, .paletteTag = ANIM_TAG_WHIP_HIT, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = gWhipAnimTable, + .anims = sAnims_Whip, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimWhipHit, }; -const union AnimCmd gUnknown_08592900[] = +static const union AnimCmd sAnim_SlidingHit[] = { ANIMCMD_FRAME(0, 4), ANIMCMD_FRAME(16, 4), @@ -1116,96 +1121,96 @@ const union AnimCmd gUnknown_08592900[] = ANIMCMD_END, }; -const union AnimCmd *const gUnknown_08592918[] = +static const union AnimCmd *const sAnims_SlidingHit[] = { - gUnknown_08592900, + sAnim_SlidingHit, }; // Unused -const struct SpriteTemplate gUnknown_0859291C = +static const struct SpriteTemplate sSlidingHit1SpriteTemplate = { .tileTag = ANIM_TAG_HIT, .paletteTag = ANIM_TAG_HIT, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = gUnknown_08592918, + .anims = sAnims_SlidingHit, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81009F8, + .callback = AnimSlidingHit, }; // Unused -const struct SpriteTemplate gUnknown_08592934 = +static const struct SpriteTemplate sSlidingHit2SpriteTemplate = { .tileTag = ANIM_TAG_HIT_2, .paletteTag = ANIM_TAG_HIT_2, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = gUnknown_08592918, + .anims = sAnims_SlidingHit, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81009F8, + .callback = AnimSlidingHit, }; -const union AffineAnimCmd gUnknown_0859294C[] = { +static const union AffineAnimCmd sAffineAnim_FlickeringPunch_Normal[] = { AFFINEANIMCMD_FRAME(256, 256, 0, 0), AFFINEANIMCMD_END, }; -const union AffineAnimCmd gUnknown_0859295C[] = { +static const union AffineAnimCmd sAffineAnim_FlickeringPunch_TurnedTopLeft[] = { AFFINEANIMCMD_FRAME(256, 256, 32, 0), AFFINEANIMCMD_END, }; -const union AffineAnimCmd gUnknown_0859296C[] = { +static const union AffineAnimCmd sAffineAnim_FlickeringPunch_TurnedLeft[] = { AFFINEANIMCMD_FRAME(256, 256, 64, 0), AFFINEANIMCMD_END, }; -const union AffineAnimCmd gUnknown_0859297C[] = { +static const union AffineAnimCmd sAffineAnim_FlickeringPunch_TurnedBottomLeft[] = { AFFINEANIMCMD_FRAME(256, 256, 96, 0), AFFINEANIMCMD_END, }; -const union AffineAnimCmd gUnknown_0859298C[] = { +static const union AffineAnimCmd sAffineAnim_FlickeringPunch_UpsideDown[] = { AFFINEANIMCMD_FRAME(256, 256, -128, 0), AFFINEANIMCMD_END, }; -const union AffineAnimCmd gUnknown_0859299C[] = { +static const union AffineAnimCmd sAffineAnim_FlickeringPunch_TurnedBottomRight[] = { AFFINEANIMCMD_FRAME(256, 256, -96, 0), AFFINEANIMCMD_END, }; -const union AffineAnimCmd gUnknown_085929AC[] = { +static const union AffineAnimCmd sAffineAnim_FlickeringPunch_TurnedRight[] = { AFFINEANIMCMD_FRAME(256, 256, -64, 0), AFFINEANIMCMD_END, }; -const union AffineAnimCmd gUnknown_085929BC[] = { +static const union AffineAnimCmd sAffineAnim_FlickeringPunch_TurnedTopRight[] = { AFFINEANIMCMD_FRAME(256, 256, -32, 0), AFFINEANIMCMD_END, }; -const union AffineAnimCmd *const gUnknown_085929CC[] = { - gUnknown_0859294C, - gUnknown_0859295C, - gUnknown_0859296C, - gUnknown_0859297C, - gUnknown_0859298C, - gUnknown_0859299C, - gUnknown_085929AC, - gUnknown_085929BC, +static const union AffineAnimCmd *const sAffineAnims_FlickeringPunch[] = { + sAffineAnim_FlickeringPunch_Normal, + sAffineAnim_FlickeringPunch_TurnedTopLeft, + sAffineAnim_FlickeringPunch_TurnedLeft, + sAffineAnim_FlickeringPunch_TurnedBottomLeft, + sAffineAnim_FlickeringPunch_UpsideDown, + sAffineAnim_FlickeringPunch_TurnedBottomRight, + sAffineAnim_FlickeringPunch_TurnedRight, + sAffineAnim_FlickeringPunch_TurnedTopRight, }; // Unused -const struct SpriteTemplate gUnknown_085929EC = +static const struct SpriteTemplate sFlickeringPunchSpriteTemplate = { .tileTag = ANIM_TAG_HANDS_AND_FEET, .paletteTag = ANIM_TAG_HANDS_AND_FEET, .oam = &gOamData_AffineNormal_ObjNormal_32x32, .anims = gDummySpriteAnimTable, .images = NULL, - .affineAnims = gUnknown_085929CC, - .callback = sub_8100A94, + .affineAnims = sAffineAnims_FlickeringPunch, + .callback = AnimFlickeringPunch, }; const union AnimCmd gCuttingSliceAnimCmds[] = @@ -1244,90 +1249,90 @@ const struct SpriteTemplate gAirCutterSliceSpriteTemplate = .callback = AnimAirCutterSlice, }; -const union AnimCmd gUnknown_08592A4C[] = +static const union AnimCmd sAnim_CirclingMusicNote_Eighth[] = { ANIMCMD_FRAME(0, 1), ANIMCMD_END, }; -const union AnimCmd gUnknown_08592A54[] = +static const union AnimCmd sAnim_CirclingMusicNote_BeamedEighth[] = { ANIMCMD_FRAME(4, 1), ANIMCMD_END, }; -const union AnimCmd gUnknown_08592A5C[] = +static const union AnimCmd sAnim_CirclingMusicNote_SlantedBeamedEighth[] = { ANIMCMD_FRAME(8, 1), ANIMCMD_END, }; -const union AnimCmd gUnknown_08592A64[] = +static const union AnimCmd sAnim_CirclingMusicNote_Quarter[] = { ANIMCMD_FRAME(12, 1), ANIMCMD_END, }; -const union AnimCmd gUnknown_08592A6C[] = +static const union AnimCmd sAnim_CirclingMusicNote_QuarterRest[] = { ANIMCMD_FRAME(16, 1), ANIMCMD_END, }; -const union AnimCmd gUnknown_08592A74[] = +static const union AnimCmd sAnim_CirclingMusicNote_EighthRest[] = { ANIMCMD_FRAME(20, 1), ANIMCMD_END, }; -const union AnimCmd gUnknown_08592A7C[] = +static const union AnimCmd sAnim_CirclingMusicNote_Eighth_Flipped[] = { ANIMCMD_FRAME(0, 1, .vFlip = TRUE), ANIMCMD_END, }; -const union AnimCmd gUnknown_08592A84[] = +static const union AnimCmd sAnim_CirclingMusicNote_BeamedEighth_Flipped[] = { ANIMCMD_FRAME(4, 1, .vFlip = TRUE), ANIMCMD_END, }; -const union AnimCmd gUnknown_08592A8C[] = +static const union AnimCmd sAnim_CirclingMusicNote_SlantedBeamedEighth_Flipped[] = { ANIMCMD_FRAME(8, 1, .vFlip = TRUE), ANIMCMD_END, }; -const union AnimCmd gUnknown_08592A94[] = +static const union AnimCmd sAnim_CirclingMusicNote_Quarter_Flipped[] = { ANIMCMD_FRAME(12, 1, .vFlip = TRUE), ANIMCMD_END, }; -const union AnimCmd *const gUnknown_08592A9C[] = +static const union AnimCmd *const sAnims_CirclingMusicNote[] = { - gUnknown_08592A4C, - gUnknown_08592A54, - gUnknown_08592A5C, - gUnknown_08592A64, - gUnknown_08592A6C, - gUnknown_08592A74, - gUnknown_08592A7C, - gUnknown_08592A84, - gUnknown_08592A8C, - gUnknown_08592A94, + sAnim_CirclingMusicNote_Eighth, + sAnim_CirclingMusicNote_BeamedEighth, + sAnim_CirclingMusicNote_SlantedBeamedEighth, + sAnim_CirclingMusicNote_Quarter, + sAnim_CirclingMusicNote_QuarterRest, + sAnim_CirclingMusicNote_EighthRest, + sAnim_CirclingMusicNote_Eighth_Flipped, + sAnim_CirclingMusicNote_BeamedEighth_Flipped, + sAnim_CirclingMusicNote_SlantedBeamedEighth_Flipped, + sAnim_CirclingMusicNote_Quarter_Flipped, }; // Unused -const struct SpriteTemplate gUnknown_08592AC4 = +static const struct SpriteTemplate sCirclingMusicNoteSpriteTemplate = { .tileTag = ANIM_TAG_MUSIC_NOTES, .paletteTag = ANIM_TAG_MUSIC_NOTES, .oam = &gOamData_AffineOff_ObjNormal_16x16, - .anims = gUnknown_08592A9C, + .anims = sAnims_CirclingMusicNote, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8100E1C, + .callback = AnimCirclingMusicNote, }; const struct SpriteTemplate gProtectSpriteTemplate = @@ -1414,7 +1419,7 @@ const struct SpriteTemplate gSparklingStarsSpriteTemplate = .callback = AnimSparkingStars, }; -const union AnimCmd gUnknown_08592BAC[] = +static const union AnimCmd sAnim_BubbleBurst[] = { ANIMCMD_FRAME(0, 10), ANIMCMD_FRAME(4, 10), @@ -1427,7 +1432,7 @@ const union AnimCmd gUnknown_08592BAC[] = ANIMCMD_END, }; -const union AnimCmd gUnknown_08592BD0[] = +static const union AnimCmd sAnim_BubbleBurst_Flipped[] = { ANIMCMD_FRAME(0, 10, .hFlip = TRUE), ANIMCMD_FRAME(4, 10, .hFlip = TRUE), @@ -1440,22 +1445,22 @@ const union AnimCmd gUnknown_08592BD0[] = ANIMCMD_END, }; -const union AnimCmd *const gUnknown_08592BF4[] = +static const union AnimCmd *const sAnims_BubbleBurst[] = { - gUnknown_08592BAC, - gUnknown_08592BD0, + sAnim_BubbleBurst, + sAnim_BubbleBurst_Flipped, }; // Unused -const struct SpriteTemplate gUnknown_08592BFC = +static const struct SpriteTemplate sBubbleBurstSpriteTemplate = { .tileTag = ANIM_TAG_BUBBLE_BURST, .paletteTag = ANIM_TAG_BUBBLE_BURST, .oam = &gOamData_AffineOff_ObjNormal_16x16, - .anims = gUnknown_08592BF4, + .anims = sAnims_BubbleBurst, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8101440, + .callback = AnimBubbleBurst, }; const union AnimCmd gSleepLetterZAnimCmds[] = @@ -1556,7 +1561,8 @@ const struct SpriteTemplate gBowMonSpriteTemplate = }; // Unused -const struct SpriteTemplate gUnknown_08592CF0 = +// Same as BowMon above but without backing up +static const struct SpriteTemplate sTipMonSpriteTemplate = { .tileTag = 0, .paletteTag = 0, @@ -1564,7 +1570,7 @@ const struct SpriteTemplate gUnknown_08592CF0 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8101B90, + .callback = AnimTipMon, }; const union AnimCmd gSlashSliceAnimCmds1[] = @@ -2684,9 +2690,9 @@ static void AnimTranslateLinearSingleSineWave_Step(struct Sprite* sprite) destroy = TRUE; } - if (sprite->pos1.x + sprite->pos2.x > 256 + if (sprite->pos1.x + sprite->pos2.x > DISPLAY_WIDTH + 16 || sprite->pos1.x + sprite->pos2.x < -16 - || sprite->pos1.y + sprite->pos2.y > 160 + || sprite->pos1.y + sprite->pos2.y > DISPLAY_HEIGHT || sprite->pos1.y + sprite->pos2.y < -16) destroy = TRUE; @@ -2940,10 +2946,10 @@ static void AnimFrenzyPlantRoot(struct Sprite *sprite) StartSpriteAnim(sprite, gBattleAnimArgs[4]); sprite->data[2] = gBattleAnimArgs[5]; sprite->callback = AnimRootFlickerOut; - gUnknown_0203A0F8[0] = sprite->pos1.x; - gUnknown_0203A0F8[1] = sprite->pos1.y; - gUnknown_0203A0F8[2] = targetX; - gUnknown_0203A0F8[3] = targetY; + sFrenzyPlantRootData.startX = sprite->pos1.x; + sFrenzyPlantRootData.startY = sprite->pos1.y; + sFrenzyPlantRootData.targetX = targetX; + sFrenzyPlantRootData.targetY = targetY; } static void AnimRootFlickerOut(struct Sprite* sprite) @@ -2979,7 +2985,7 @@ static void AnimIngrainOrb(struct Sprite* sprite) DestroyAnimSprite(sprite); } -static void sub_80FF9B8(struct Sprite* sprite, s16 c) +static void InitItemBagData(struct Sprite* sprite, s16 c) { int a = (sprite->pos1.x << 8) | sprite->pos1.y; int b = (sprite->data[6] << 8) | sprite->data[7]; @@ -3005,7 +3011,7 @@ bool8 moveAlongLinearPath(struct Sprite* sprite) if (xEndPos == 0) xEndPos = -32; else if (xEndPos == 255) - xEndPos = 272; + xEndPos = DISPLAY_WIDTH + 32; yEndPos_2 = yEndPos - yStartPos; r0 = xEndPos - xStartPos; @@ -3059,14 +3065,14 @@ static void AnimPresent(struct Sprite* sprite) { sprite->data[6] = targetX; sprite->data[7] = targetY + 10; - sub_80FF9B8(sprite, 60); + InitItemBagData(sprite, 60); sprite->data[3] = 1; } else { sprite->data[6] = targetX; sprite->data[7] = targetY + 10; - sub_80FF9B8(sprite, 60); + InitItemBagData(sprite, 60); sprite->data[3] = 3; } @@ -3101,7 +3107,7 @@ static void AnimKnockOffItem(struct Sprite* sprite) { sprite->data[6] = 0; sprite->data[7] = targetY + 10; - sub_80FF9B8(sprite, 40); + InitItemBagData(sprite, 40); sprite->data[3] = 3; sprite->data[4] = 60; sprite->callback = AnimItemSteal_Step1; @@ -3113,7 +3119,7 @@ static void AnimKnockOffItem(struct Sprite* sprite) if (IsContest()) sprite->data[6] = 0; - sub_80FF9B8(sprite, 40); + InitItemBagData(sprite, 40); sprite->data[3] = 3; sprite->data[4] = 60; sprite->callback = AnimKnockOffOpponentsItem; @@ -3150,14 +3156,14 @@ static void AnimItemSteal(struct Sprite* sprite) { sprite->data[6] = attackerX; sprite->data[7] = attackerY + 10; - sub_80FF9B8(sprite, 60); + InitItemBagData(sprite, 60); sprite->data[3] = 1; } else { sprite->data[6] = attackerX; sprite->data[7] = attackerY + 10; - sub_80FF9B8(sprite, 60); + InitItemBagData(sprite, 60); sprite->data[3] = 3; } @@ -3737,7 +3743,7 @@ static void AnimWhipHit_WaitEnd(struct Sprite* sprite) DestroyAnimSprite(sprite); } -static void sub_81009F8(struct Sprite* sprite) +static void AnimSlidingHit(struct Sprite* sprite) { if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) { @@ -3764,7 +3770,7 @@ static void AnimWhipHit(struct Sprite* sprite) sprite->pos1.y += gBattleAnimArgs[1]; } -static void sub_8100A94(struct Sprite* sprite) +static void AnimFlickeringPunch(struct Sprite* sprite) { sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.y += gBattleAnimArgs[1]; @@ -3879,7 +3885,7 @@ static void AnimSlice_Step(struct Sprite* sprite) } } -void unref_sub_8100D38(struct Sprite* sprite) +static void UnusedFlickerAnim(struct Sprite* sprite) { if (sprite->data[2] > 1) { @@ -3912,7 +3918,7 @@ void unref_sub_8100D38(struct Sprite* sprite) } } -static void sub_8100E1C(struct Sprite* sprite) +static void AnimCirclingMusicNote(struct Sprite* sprite) { sprite->data[0] = gBattleAnimArgs[2]; if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) @@ -3924,11 +3930,11 @@ static void sub_8100E1C(struct Sprite* sprite) sprite->data[1] = -gBattleAnimArgs[3]; sprite->pos1.y += gBattleAnimArgs[1]; sprite->data[3] = gBattleAnimArgs[4]; - sprite->callback = sub_8100E80; + sprite->callback = AnimCirclingMusicNote_Step; sprite->callback(sprite); } -static void sub_8100E80(struct Sprite* sprite) +static void AnimCirclingMusicNote_Step(struct Sprite* sprite) { sprite->pos2.x = Cos(sprite->data[0], 100); sprite->pos2.y = Sin(sprite->data[0], 20); @@ -3938,7 +3944,7 @@ static void sub_8100E80(struct Sprite* sprite) sprite->subpriority = 14; sprite->data[0] = (sprite->data[0] + sprite->data[1]) & 0xFF; - sprite->data[5] += 0x82; + sprite->data[5] += 130; sprite->pos2.y += sprite->data[5] >> 8; sprite->data[2]++; if (sprite->data[2] == sprite->data[3]) @@ -4169,7 +4175,7 @@ static void AnimSparkingStars(struct Sprite* sprite) sprite->callback = TranslateSpriteLinearFixedPoint; } -static void sub_8101440(struct Sprite* sprite) +static void AnimBubbleBurst(struct Sprite* sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) @@ -4184,10 +4190,10 @@ static void sub_8101440(struct Sprite* sprite) StartSpriteAnim(sprite, 1); } - sprite->callback = sub_81014A0; + sprite->callback = AnimBubbleBurst_Step; } -static void sub_81014A0(struct Sprite* sprite) +static void AnimBubbleBurst_Step(struct Sprite* sprite) { if (++sprite->data[0] > 30) { @@ -4511,13 +4517,13 @@ static void AnimBowMon_Step4(struct Sprite* sprite) DestroyAnimSprite(sprite); } -static void sub_8101B90(struct Sprite *sprite) +static void AnimTipMon(struct Sprite *sprite) { sprite->data[0] = 0; - sprite->callback = sub_8101BA0; + sprite->callback = AnimTipMon_Step; } -static void sub_8101BA0(struct Sprite *sprite) +static void AnimTipMon_Step(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -4912,22 +4918,24 @@ void AnimTask_Conversion2AlphaBlend(u8 taskId) } } -void unref_sub_8102434(u8 taskId) +// Unused +static void AnimTask_HideBattlersHealthbox(u8 taskId) { u8 i; for (i = 0; i < gBattlersCount; i++) { - if (gBattleAnimArgs[0] == 1 && GetBattlerSide(i) == B_SIDE_PLAYER) + if (gBattleAnimArgs[0] == TRUE && GetBattlerSide(i) == B_SIDE_PLAYER) SetHealthboxSpriteInvisible(gHealthboxSpriteIds[i]); - if (gBattleAnimArgs[1] == 1 && GetBattlerSide(i) == B_SIDE_OPPONENT) + if (gBattleAnimArgs[1] == TRUE && GetBattlerSide(i) == B_SIDE_OPPONENT) SetHealthboxSpriteInvisible(gHealthboxSpriteIds[i]); } DestroyAnimVisualTask(taskId); } -void unref_sub_81024A8(u8 taskId) +// Unused +static void AnimTask_ShowBattlersHealthbox(u8 taskId) { u8 i; for (i = 0; i < gBattlersCount; i++) From 33ea2a10613df0d6ef25b146b175f8b3712896c3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 13 Apr 2021 02:50:50 -0400 Subject: [PATCH 34/63] Remove unnecessary scope for TEST_BUTTON --- include/global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/global.h b/include/global.h index 18e2bfea7..19605ca57 100644 --- a/include/global.h +++ b/include/global.h @@ -107,7 +107,7 @@ #define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) // Macros for checking the joypad -#define TEST_BUTTON(field, button) ({(field) & (button);}) +#define TEST_BUTTON(field, button) ((field) & (button)) #define JOY_NEW(button) TEST_BUTTON(gMain.newKeys, button) #define JOY_HELD(button) TEST_BUTTON(gMain.heldKeys, button) #define JOY_HELD_RAW(button) TEST_BUTTON(gMain.heldKeysRaw, button) From f9f33b643e0e15ba6bc150e508a7ba25ebc533f4 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 13 Apr 2021 03:17:39 -0400 Subject: [PATCH 35/63] Label unused move anims in anim_effects_2 --- src/battle_anim_effects_2.c | 108 ++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 8142624a2..3a04c8c46 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -16,13 +16,13 @@ #include "constants/rgb.h" #include "constants/songs.h" -static void sub_8103448(struct Sprite *); -static void sub_8103498(struct Sprite *); -static void sub_81034D8(struct Sprite *); -static void sub_810358C(struct Sprite *); -static void sub_8103620(struct Sprite *); -static void sub_8103658(struct Sprite *); -static void sub_8103680(struct Sprite *); +static void AnimCirclingFinger(struct Sprite *); +static void AnimBouncingMusicNote(struct Sprite *); +static void AnimBouncingMusicNote_Step(struct Sprite *); +static void AnimVibrateBattlerBack(struct Sprite *); +static void AnimMovingClamp(struct Sprite *); +static void AnimMovingClamp_Step(struct Sprite *); +static void AnimMovingClamp_End(struct Sprite *); static void AnimKinesisZapEnergy(struct Sprite *); static void AnimSwordsDanceBlade(struct Sprite *); static void AnimSwordsDanceBlade_Step(struct Sprite *); @@ -30,8 +30,8 @@ static void AnimSonicBoomProjectile(struct Sprite *); static void AnimAirWaveProjectile(struct Sprite *); static void AnimAirWaveProjectile_Step1(struct Sprite *sprite); static void AnimAirWaveProjectile_Step2(struct Sprite *sprite); -static void sub_8103FE8(struct Sprite *); -static void sub_8104018(struct Sprite *); +static void AnimVoidLines(struct Sprite *); +static void AnimVoidLines_Step(struct Sprite *); static void AnimCoinThrow(struct Sprite *); static void AnimFallingCoin(struct Sprite *); static void AnimFallingCoin_Step(struct Sprite *); @@ -109,7 +109,7 @@ static void AnimTask_ScaryFace_Step(u8); static void AnimTask_UproarDistortion_Step(u8); // Unused -const struct SpriteTemplate gUnknown_08593264 = +static const struct SpriteTemplate sCirclingFingerSpriteTemplate = { .tileTag = ANIM_TAG_FINGER, .paletteTag = ANIM_TAG_FINGER, @@ -117,23 +117,23 @@ const struct SpriteTemplate gUnknown_08593264 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8103448, + .callback = AnimCirclingFinger, }; -const union AnimCmd gUnknown_0859327C[] = +static const union AnimCmd sAnim_BouncingMusicNote[] = { ANIMCMD_FRAME(4, 1), ANIMCMD_END, }; -// Unused -const union AnimCmd *const gUnknown_08593284[] = +// Unused (association assumed) +static const union AnimCmd *const sAnims_BouncingMusicNote[] = { - gUnknown_0859327C, + sAnim_BouncingMusicNote, }; // Unused -const struct SpriteTemplate gUnknown_08593288 = +static const struct SpriteTemplate sBouncingMusicNoteSpriteTemplate = { .tileTag = ANIM_TAG_MUSIC_NOTES, .paletteTag = ANIM_TAG_MUSIC_NOTES, @@ -141,11 +141,11 @@ const struct SpriteTemplate gUnknown_08593288 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8103498, + .callback = AnimBouncingMusicNote, }; // Unused -const struct SpriteTemplate gUnknown_085932A0 = +static const struct SpriteTemplate sVibrateBattlerBackSpriteTemplate = { .tileTag = 0, .paletteTag = 0, @@ -153,11 +153,11 @@ const struct SpriteTemplate gUnknown_085932A0 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810358C, + .callback = AnimVibrateBattlerBack, }; // Unused -const struct SpriteTemplate gUnknown_085932B8 = +static const struct SpriteTemplate sMovingClampSpriteTemplate = { .tileTag = ANIM_TAG_CLAMP, .paletteTag = ANIM_TAG_CLAMP, @@ -165,10 +165,10 @@ const struct SpriteTemplate gUnknown_085932B8 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gAffineAnims_Bite, - .callback = sub_8103620, + .callback = AnimMovingClamp, }; -const union AnimCmd gUnknown_085932D0[] = +static const union AnimCmd sAnim_SmallExplosion[] = { ANIMCMD_FRAME(0, 9), ANIMCMD_FRAME(16, 3), @@ -177,32 +177,32 @@ const union AnimCmd gUnknown_085932D0[] = ANIMCMD_END, }; -const union AnimCmd *const gUnknown_085932E4[] = +static const union AnimCmd *const sAnims_SmallExplosion[] = { - gUnknown_085932D0, + sAnim_SmallExplosion, }; -const union AffineAnimCmd gUnknown_085932E8[] = +static const union AffineAnimCmd sAffineAnim_SmallExplosion[] = { AFFINEANIMCMD_FRAME(0x50, 0x50, 0, 0), AFFINEANIMCMD_FRAME(0x9, 0x9, 0, 18), AFFINEANIMCMD_END, }; -const union AffineAnimCmd *const gUnknown_08593300[] = +static const union AffineAnimCmd *const sAffineAnims_SmallExplosion[] = { - gUnknown_085932E8, + sAffineAnim_SmallExplosion, }; // Unused -const struct SpriteTemplate gUnknown_08593304 = +static const struct SpriteTemplate sSmallExplosionSpriteTemplate = { .tileTag = ANIM_TAG_EXPLOSION_6, .paletteTag = ANIM_TAG_EXPLOSION_6, .oam = &gOamData_AffineNormal_ObjNormal_32x32, - .anims = gUnknown_085932E4, + .anims = sAnims_SmallExplosion, .images = NULL, - .affineAnims = gUnknown_08593300, + .affineAnims = sAffineAnims_SmallExplosion, .callback = AnimSpriteOnMonPos, }; @@ -366,7 +366,7 @@ const struct SpriteTemplate gEggThrowSpriteTemplate = }; // Unused -const struct SpriteTemplate gUnknown_085934A0 = +static const struct SpriteTemplate sVoidLinesSpriteTemplate = { .tileTag = ANIM_TAG_VOID_LINES, .paletteTag = ANIM_TAG_VOID_LINES, @@ -374,7 +374,7 @@ const struct SpriteTemplate gUnknown_085934A0 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8103FE8, + .callback = AnimVoidLines, }; const union AnimCmd gCoinAnimCmds[] = @@ -1096,7 +1096,7 @@ const struct SpriteTemplate gDevilSpriteTemplate = .callback = AnimDevil, }; -const union AnimCmd gUnknown_08593B08[] = +static const union AnimCmd sAnim_FurySwipes[] = { ANIMCMD_FRAME(0, 4), ANIMCMD_FRAME(16, 4), @@ -1105,7 +1105,7 @@ const union AnimCmd gUnknown_08593B08[] = ANIMCMD_END, }; -const union AnimCmd gUnknown_08593B1C[] = +static const union AnimCmd sAnim_FurySwipes_Flipped[] = { ANIMCMD_FRAME(0, 4, .hFlip = TRUE), ANIMCMD_FRAME(16, 4, .hFlip = TRUE), @@ -1114,10 +1114,10 @@ const union AnimCmd gUnknown_08593B1C[] = ANIMCMD_END, }; -const union AnimCmd *const gFurySwipesAnimTable[] = +static const union AnimCmd *const sAnims_FurySwipes[] = { - gUnknown_08593B08, - gUnknown_08593B1C, + sAnim_FurySwipes, + sAnim_FurySwipes_Flipped, }; const struct SpriteTemplate gFurySwipesSpriteTemplate = @@ -1125,7 +1125,7 @@ const struct SpriteTemplate gFurySwipesSpriteTemplate = .tileTag = ANIM_TAG_SWIPE, .paletteTag = ANIM_TAG_SWIPE, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = gFurySwipesAnimTable, + .anims = sAnims_FurySwipes, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimFurySwipes, @@ -1262,7 +1262,7 @@ const struct SpriteTemplate gGuardRingSpriteTemplate = .callback = AnimGuardRing, }; -static void sub_8103448(struct Sprite *sprite) +static void AnimCirclingFinger(struct Sprite *sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); @@ -1276,7 +1276,7 @@ static void sub_8103448(struct Sprite *sprite) sprite->callback(sprite); } -static void sub_8103498(struct Sprite *sprite) +static void AnimBouncingMusicNote(struct Sprite *sprite) { u8 battler; if (gBattleAnimArgs[0] == 0) @@ -1287,10 +1287,10 @@ static void sub_8103498(struct Sprite *sprite) SetSpriteNextToMonHead(battler, sprite); sprite->data[0] = 0; sprite->data[1] = 0; - sprite->callback = sub_81034D8; + sprite->callback = AnimBouncingMusicNote_Step; } -static void sub_81034D8(struct Sprite *sprite) +static void AnimBouncingMusicNote_Step(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -1311,7 +1311,7 @@ static void sub_81034D8(struct Sprite *sprite) } } -static void sub_810353C(struct Sprite *sprite) +static void AnimVibrateBattlerBack_Step(struct Sprite *sprite) { s16 temp; gSprites[sprite->data[2]].pos2.x += sprite->data[1]; @@ -1326,7 +1326,7 @@ static void sub_810353C(struct Sprite *sprite) sprite->data[0]--; } -static void sub_810358C(struct Sprite *sprite) +static void AnimVibrateBattlerBack(struct Sprite *sprite) { u8 spriteId; sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); @@ -1341,30 +1341,30 @@ static void sub_810358C(struct Sprite *sprite) sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = gBattleAnimArgs[3]; sprite->data[2] = spriteId; - sprite->callback = sub_810353C; + sprite->callback = AnimVibrateBattlerBack_Step; sprite->invisible = TRUE; } -static void sub_8103620(struct Sprite *sprite) +static void AnimMovingClamp(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[4]; sprite->callback = WaitAnimForDuration; - StoreSpriteCallbackInData6(sprite, sub_8103658); + StoreSpriteCallbackInData6(sprite, AnimMovingClamp_Step); } -static void sub_8103658(struct Sprite *sprite) +static void AnimMovingClamp_Step(struct Sprite *sprite) { sprite->data[0] = sprite->data[1]; sprite->data[2] = sprite->pos1.x; sprite->data[4] = sprite->pos1.y + 15; sprite->callback = StartAnimLinearTranslation; - StoreSpriteCallbackInData6(sprite, sub_8103680); + StoreSpriteCallbackInData6(sprite, AnimMovingClamp_End); } -static void sub_8103680(struct Sprite *sprite) +static void AnimMovingClamp_End(struct Sprite *sprite) { if (sprite->data[5] == 0) DestroyAnimSprite(sprite); @@ -1738,14 +1738,14 @@ void AnimTask_AirCutterProjectile(u8 taskId) gTasks[taskId].func = AirCutterProjectileStep1; } -static void sub_8103FE8(struct Sprite *sprite) +static void AnimVoidLines(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, FALSE); - sprite->data[0] = 0x100 + (IndexOfSpritePaletteTag(gUnknown_085934A0.paletteTag) << 4); - sprite->callback = sub_8104018; + sprite->data[0] = 0x100 + (IndexOfSpritePaletteTag(sVoidLinesSpriteTemplate.paletteTag) << 4); + sprite->callback = AnimVoidLines_Step; } -static void sub_8104018(struct Sprite *sprite) +static void AnimVoidLines_Step(struct Sprite *sprite) { u16 id, val; int i; From 7645be27ebfb06d39b2b8d68dd8fc4ca24c6433c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 13 Apr 2021 03:28:03 -0400 Subject: [PATCH 36/63] Label unused move anims in anim_effects_3 --- .../unused.pal} | 0 src/battle_anim_effects_3.c | 26 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) rename graphics/{unknown/unknown_85CE55C.pal => battle_anims/unused.pal} (100%) diff --git a/graphics/unknown/unknown_85CE55C.pal b/graphics/battle_anims/unused.pal similarity index 100% rename from graphics/unknown/unknown_85CE55C.pal rename to graphics/battle_anims/unused.pal diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 0c56c6bca..67452fe90 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -91,7 +91,7 @@ static void AnimMeteorMashStar(struct Sprite *); static void AnimMeteorMashStar_Step(struct Sprite *sprite); static void AnimBlockX(struct Sprite *); static void AnimBlockX_Step(struct Sprite *); -static void sub_815FE80(struct Sprite *); +static void AnimUnusedItemBagSteal(struct Sprite *); static void AnimKnockOffStrike(struct Sprite *); static void AnimKnockOffStrike_Step(struct Sprite *sprite); static void AnimRecycle(struct Sprite *); @@ -432,7 +432,7 @@ const struct SpriteTemplate gRapidSpinSpriteTemplate = .callback = AnimRapidSpin, }; -const union AffineAnimCmd gUnknown_085CE2A0[] = +static const union AffineAnimCmd sAffineAnims_Torment[] = { AFFINEANIMCMD_FRAME(-12, 8, 0, 4), AFFINEANIMCMD_FRAME(20, -20, 0, 4), @@ -718,7 +718,7 @@ const struct SpriteTemplate gSweetScentPetalSpriteTemplate = .callback = AnimSweetScentPetal, }; -const u16 gUnknown_085CE55C[] = INCBIN_U16("graphics/unknown/unknown_85CE55C.gbapal"); +static const u16 sUnusedPalette[] = INCBIN_U16("graphics/battle_anims/unused.gbapal"); const union AnimCmd gPainSplitAnimCmds[] = { @@ -1071,7 +1071,7 @@ const struct SpriteTemplate gMeteorMashStarSpriteTemplate = .callback = AnimMeteorMashStar, }; -const struct SpriteTemplate gUnknown_085CE8F4 = +static const struct SpriteTemplate sUnusedStarBurstSpriteTemplate = { .tileTag = ANIM_TAG_GOLD_STARS, .paletteTag = ANIM_TAG_GOLD_STARS, @@ -1093,7 +1093,7 @@ const struct SpriteTemplate gBlockXSpriteTemplate = .callback = AnimBlockX, }; -const struct SpriteTemplate gUnknown_085CE924 = +static const struct SpriteTemplate sUnusedItemBagStealSpriteTemplate = { .tileTag = ANIM_TAG_ITEM_BAG, .paletteTag = ANIM_TAG_ITEM_BAG, @@ -1101,7 +1101,7 @@ const struct SpriteTemplate gUnknown_085CE924 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815FE80, + .callback = AnimUnusedItemBagSteal, }; const union AnimCmd gKnockOffStrikeAnimCmds[] = @@ -1944,7 +1944,7 @@ static void TormentAttacker_Step(u8 taskId) task->data[5] -= 6; } - PrepareAffineAnimInTaskData(task, task->data[15], gUnknown_085CE2A0); + PrepareAffineAnimInTaskData(task, task->data[15], sAffineAnims_Torment); task->data[1]++; task->data[0] = 1; break; @@ -3580,7 +3580,7 @@ static void AnimSmokeBallEscapeCloud(struct Sprite *sprite) sprite->callback = DestroyAnimSpriteAfterTimer; } -static void sub_815D8D8(u8 taskId) +static void AnimTask_SlideMonForFocusBand_Step2(u8 taskId) { u16 var0 = 0; u16 var1 = 0; @@ -3630,7 +3630,7 @@ static void sub_815D8D8(u8 taskId) } } -static void sub_815DA20(u8 taskId) +static void AnimTask_SlideMonForFocusBand_Step1(u8 taskId) { u16 var0 = 0; u16 var1 = 0; @@ -3679,7 +3679,7 @@ static void sub_815DA20(u8 taskId) { gTasks[taskId].data[0] = 30; gTasks[taskId].data[13] = 0; - gTasks[taskId].func = sub_815D8D8; + gTasks[taskId].func = AnimTask_SlideMonForFocusBand_Step2; } } @@ -3714,7 +3714,7 @@ void AnimTask_SlideMonForFocusBand(u8 taskId) gTasks[taskId].data[7] = 0; gTasks[taskId].data[4] = gBattleAnimArgs[4]; gTasks[taskId].data[5] = gBattleAnimArgs[5]; - gTasks[taskId].func = sub_815DA20; + gTasks[taskId].func = AnimTask_SlideMonForFocusBand_Step1; } // Squishes the mon vertically and emits sweat droplets a few times. @@ -4737,7 +4737,7 @@ void AnimTask_MonToSubstitute(u8 taskId) StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], 0); } - for (i = 0; i < 16; i++) + for (i = 0; i < NUM_TASK_DATA; i++) gTasks[taskId].data[i] = 0; gTasks[taskId].func = AnimTask_MonToSubstituteDoll; @@ -5143,7 +5143,7 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId) } } -static void sub_815FE80(struct Sprite *sprite) +static void AnimUnusedItemBagSteal(struct Sprite *sprite) { switch (sprite->data[7]) { From 98ab546d3a014b8563df859cf37fe619442d9951 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 13 Apr 2021 04:04:09 -0400 Subject: [PATCH 37/63] Label misc unused move anims --- src/battle_anim_flying.c | 6 ++-- src/battle_anim_ghost.c | 20 ++++++------- src/battle_anim_ice.c | 6 ++-- src/battle_anim_normal.c | 16 +++++----- src/battle_anim_status_effects.c | 50 ++++++++++++++++---------------- 5 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index bd6a494c8..5955d203e 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -290,7 +290,7 @@ const struct SpriteTemplate gDiveBallSpriteTemplate = .callback = AnimDiveBall, }; -static const union AffineAnimCmd sAnim_Unused_085964A8[] = +static const union AffineAnimCmd sAnim_Unused[] = { AFFINEANIMCMD_FRAME(0x100, 0x0, 0, 0), AFFINEANIMCMD_FRAME(0x0, 0x20, 0, 12), @@ -299,9 +299,9 @@ static const union AffineAnimCmd sAnim_Unused_085964A8[] = }; // Unused -static const union AffineAnimCmd *const sAnims_Unused_085964C8[] = +static const union AffineAnimCmd *const sAnims_Unused[] = { - sAnim_Unused_085964A8, + sAnim_Unused, }; const struct SpriteTemplate gDiveWaterSplashSpriteTemplate = diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index 2e4a2318d..4b253a7ec 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -39,8 +39,8 @@ static void AnimGhostStatusSprite(struct Sprite *); static void AnimGhostStatusSprite_Step(struct Sprite *); static void AnimTask_GrudgeFlames_Step(u8 taskId); static void AnimGrudgeFlame(struct Sprite *); -static void AnimUnused_8112F60(struct Sprite *); -static void AnimUnused_8112F60_Step(struct Sprite *); +static void AnimMonMoveCircular(struct Sprite *); +static void AnimMonMoveCircular_Step(struct Sprite *); static const union AffineAnimCmd sAffineAnim_ConfuseRayBallBounce[] = { @@ -124,16 +124,16 @@ const struct SpriteTemplate gLickSpriteTemplate = .callback = AnimLick, }; -static const union AffineAnimCmd sAnim_Unused_08596DA4[] = +static const union AffineAnimCmd sAffineAnim_Unused[] = { AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0), AFFINEANIMCMD_END, }; // Unused -static const union AffineAnimCmd *const gAnims_Unused_08596DB4[] = +static const union AffineAnimCmd *const sAffineAnims_Unused[] = { - sAnim_Unused_08596DA4, + sAffineAnim_Unused, }; const struct SpriteTemplate gDestinyBondWhiteShadowSpriteTemplate = @@ -206,7 +206,7 @@ const struct SpriteTemplate gGrudgeFlameSpriteTemplate = }; // Unused -const struct SpriteTemplate gUnusedSpriteTemplate_08596E48 = +static const struct SpriteTemplate sMonMoveCircularSpriteTemplate = { .tileTag = 0, .paletteTag = 0, @@ -214,7 +214,7 @@ const struct SpriteTemplate gUnusedSpriteTemplate_08596E48 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimUnused_8112F60, + .callback = AnimMonMoveCircular, }; static void AnimConfuseRayBallBounce(struct Sprite *sprite) @@ -1302,7 +1302,7 @@ static void AnimGrudgeFlame(struct Sprite *sprite) } } -static void AnimUnused_8112F60(struct Sprite *sprite) +static void AnimMonMoveCircular(struct Sprite *sprite) { sprite->invisible = TRUE; sprite->data[5] = gBattlerSpriteIds[gBattleAnimAttacker]; @@ -1310,12 +1310,12 @@ static void AnimUnused_8112F60(struct Sprite *sprite) sprite->data[1] = 10; sprite->data[2] = gBattleAnimArgs[0]; sprite->data[3] = gBattleAnimArgs[1]; - sprite->callback = AnimUnused_8112F60_Step; + sprite->callback = AnimMonMoveCircular_Step; gSprites[sprite->data[5]].pos1.y += 8; } -static void AnimUnused_8112F60_Step(struct Sprite *sprite) +static void AnimMonMoveCircular_Step(struct Sprite *sprite) { if (sprite->data[3]) { diff --git a/src/battle_anim_ice.c b/src/battle_anim_ice.c index 659cd0cb8..b97ccf9cd 100644 --- a/src/battle_anim_ice.c +++ b/src/battle_anim_ice.c @@ -49,16 +49,16 @@ static void AnimTask_LoadMistTiles_Step(u8); static void AnimTask_Hail2(u8); static bool8 GenerateHailParticle(u8 hailStructId, u8 affineAnimNum, u8 taskId, u8 c); -static const union AnimCmd sAnim_Unused_08595A48[] = +static const union AnimCmd sAnim_Unused[] = { ANIMCMD_FRAME(0, 5, .hFlip = TRUE), ANIMCMD_FRAME(1, 5, .hFlip = TRUE), ANIMCMD_JUMP(0), }; -static const union AnimCmd *const sAnims_Unused_08595A54[] = +static const union AnimCmd *const sAnims_Unused[] = { - sAnim_Unused_08595A48, + sAnim_Unused, }; // Unused diff --git a/src/battle_anim_normal.c b/src/battle_anim_normal.c index 60ec5b083..9be56880a 100644 --- a/src/battle_anim_normal.c +++ b/src/battle_anim_normal.c @@ -12,7 +12,7 @@ static void AnimSimplePaletteBlend_Step(struct Sprite *); static void AnimComplexPaletteBlend(struct Sprite *); static void AnimComplexPaletteBlend_Step1(struct Sprite *); static void AnimComplexPaletteBlend_Step2(struct Sprite *); -static void AnimUnused_81159B4(struct Sprite *); +static void AnimCirclingSparkle(struct Sprite *); static void AnimShakeMonOrBattleTerrain(struct Sprite *); static void AnimShakeMonOrBattleTerrain_Step(struct Sprite *); static void AnimShakeMonOrBattleTerrain_UpdateCoordOffsetEnabled(void); @@ -92,7 +92,7 @@ const struct SpriteTemplate gComplexPaletteBlendSpriteTemplate = .callback = AnimComplexPaletteBlend, }; -static const union AnimCmd sAnim_Unused_085972A4[] = +static const union AnimCmd sAnim_CirclingSparkle[] = { ANIMCMD_FRAME(0, 3), ANIMCMD_FRAME(16, 3), @@ -102,21 +102,21 @@ static const union AnimCmd sAnim_Unused_085972A4[] = ANIMCMD_JUMP(0), }; -static const union AnimCmd *const sAnims_Unused_085972BC[] = +static const union AnimCmd *const sAnims_CirclingSparkle[] = { - sAnim_Unused_085972A4, + sAnim_CirclingSparkle, }; // Unused -const struct SpriteTemplate gUnusedSpriteTemplate_085972C0 = +static const struct SpriteTemplate sCirclingSparkleSpriteTemplate = { .tileTag = ANIM_TAG_SPARKLE_4, .paletteTag = ANIM_TAG_SPARKLE_4, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_Unused_085972BC, + .anims = sAnims_CirclingSparkle, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimUnused_81159B4, + .callback = AnimCirclingSparkle, }; const struct SpriteTemplate gShakeMonOrTerrainSpriteTemplate = @@ -398,7 +398,7 @@ static void AnimComplexPaletteBlend_Step2(struct Sprite *sprite) } } -static void AnimUnused_81159B4(struct Sprite *sprite) +static void AnimCirclingSparkle(struct Sprite *sprite) { sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.y += gBattleAnimArgs[1]; diff --git a/src/battle_anim_status_effects.c b/src/battle_anim_status_effects.c index 9221116ba..e7ef05673 100644 --- a/src/battle_anim_status_effects.c +++ b/src/battle_anim_status_effects.c @@ -17,14 +17,14 @@ extern const u8 *const gBattleAnims_StatusConditions[]; extern const struct OamData gOamData_AffineOff_ObjNormal_8x8; extern const struct OamData gOamData_AffineOff_ObjBlend_64x64; -static void UnusedTask_80A9DB4(u8 taskId); +static void Task_UpdateFlashingCircleImpacts(u8 taskId); static void AnimTask_FrozenIceCube_Step1(u8 taskId); static void AnimTask_FrozenIceCube_Step2(u8 taskId); static void AnimTask_FrozenIceCube_Step3(u8 taskId); static void AnimTask_FrozenIceCube_Step4(u8 taskId); static void Task_DoStatusAnimation(u8 taskId); -static void AnimUnused_80A9E44(struct Sprite *sprite); -static void AnimUnused_80A9E44_Step(struct Sprite *sprite); +static void AnimFlashingCircleImpact(struct Sprite *sprite); +static void AnimFlashingCircleImpact_Step(struct Sprite *sprite); static const union AnimCmd sAnim_Unused_853EDE4[] = { @@ -259,7 +259,7 @@ static const struct SpriteTemplate gFrozenIceCubeSpriteTemplate = .callback = SpriteCallbackDummy, }; -static const struct SpriteTemplate gUnusedSpriteTemplate_0853EF60 = +static const struct SpriteTemplate sFlashingCircleImpactSpriteTemplate = { .tileTag = ANIM_TAG_CIRCLE_IMPACT, .paletteTag = ANIM_TAG_CIRCLE_IMPACT, @@ -267,31 +267,31 @@ static const struct SpriteTemplate gUnusedSpriteTemplate_0853EF60 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = AnimUnused_80A9E44, + .callback = AnimFlashingCircleImpact, }; // Unused -u8 Unused_80A9C70(u8 battlerId, bool8 b) +static u8 Task_FlashingCircleImpacts(u8 battlerId, bool8 red) { u8 battlerSpriteId = gBattlerSpriteIds[battlerId]; - u8 taskId = CreateTask(UnusedTask_80A9DB4, 10); - u8 spriteId2; + u8 taskId = CreateTask(Task_UpdateFlashingCircleImpacts, 10); + u8 spriteId; u8 i; LoadCompressedSpriteSheetUsingHeap(&gBattleAnimPicTable[GET_TRUE_SPRITE_INDEX(ANIM_TAG_CIRCLE_IMPACT)]); LoadCompressedSpritePaletteUsingHeap(&gBattleAnimPaletteTable[GET_TRUE_SPRITE_INDEX(ANIM_TAG_CIRCLE_IMPACT)]); gTasks[taskId].data[0] = battlerId; - if (b) + if (red) { gTasks[taskId].data[1] = RGB_RED; for (i = 0; i < 10; i++) { - spriteId2 = CreateSprite(&gUnusedSpriteTemplate_0853EF60, gSprites[battlerSpriteId].pos1.x, gSprites[battlerSpriteId].pos1.y + 32, 0); - gSprites[spriteId2].data[0] = i * 51; - gSprites[spriteId2].data[1] = -256; - gSprites[spriteId2].invisible = TRUE; + spriteId = CreateSprite(&sFlashingCircleImpactSpriteTemplate, gSprites[battlerSpriteId].pos1.x, gSprites[battlerSpriteId].pos1.y + 32, 0); + gSprites[spriteId].data[0] = i * 51; + gSprites[spriteId].data[1] = -256; + gSprites[spriteId].invisible = TRUE; if (i > 4) - gSprites[spriteId2].data[6] = 21; + gSprites[spriteId].data[6] = 21; } } else @@ -299,19 +299,19 @@ u8 Unused_80A9C70(u8 battlerId, bool8 b) gTasks[taskId].data[1] = RGB_BLUE; for (i = 0; i < 10; i++) { - spriteId2 = CreateSprite(&gUnusedSpriteTemplate_0853EF60, gSprites[battlerSpriteId].pos1.x, gSprites[battlerSpriteId].pos1.y - 32, 0); - gSprites[spriteId2].data[0] = i * 51; - gSprites[spriteId2].data[1] = 256; - gSprites[spriteId2].invisible = TRUE; + spriteId = CreateSprite(&sFlashingCircleImpactSpriteTemplate, gSprites[battlerSpriteId].pos1.x, gSprites[battlerSpriteId].pos1.y - 32, 0); + gSprites[spriteId].data[0] = i * 51; + gSprites[spriteId].data[1] = 256; + gSprites[spriteId].invisible = TRUE; if (i > 4) - gSprites[spriteId2].data[6] = 21; + gSprites[spriteId].data[6] = 21; } } - gSprites[spriteId2].data[7] = 1; + gSprites[spriteId].data[7] = 1; return taskId; } -static void UnusedTask_80A9DB4(u8 taskId) +static void Task_UpdateFlashingCircleImpacts(u8 taskId) { if (gTasks[taskId].data[2] == 2) { @@ -344,13 +344,13 @@ static void UnusedTask_80A9DB4(u8 taskId) } } -static void AnimUnused_80A9E44(struct Sprite *sprite) +static void AnimFlashingCircleImpact(struct Sprite *sprite) { if (sprite->data[6] == 0) { sprite->invisible = FALSE; - sprite->callback = AnimUnused_80A9E44_Step; - AnimUnused_80A9E44_Step(sprite); + sprite->callback = AnimFlashingCircleImpact_Step; + AnimFlashingCircleImpact_Step(sprite); } else { @@ -358,7 +358,7 @@ static void AnimUnused_80A9E44(struct Sprite *sprite) } } -static void AnimUnused_80A9E44_Step(struct Sprite *sprite) +static void AnimFlashingCircleImpact_Step(struct Sprite *sprite) { sprite->pos2.x = Cos(sprite->data[0], 32); sprite->pos2.y = Sin(sprite->data[0], 8); From be84499b56c26d11d75fc385b5b3596f4a2bd338 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 14 Apr 2021 12:24:09 -0400 Subject: [PATCH 38/63] Drop static function argument names --- src/pokeblock_feed.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 793ef64dc..47e510562 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -123,24 +123,24 @@ extern const u16 gUnknown_0860F074[]; static void HandleInitBackgrounds(void); static void HandleInitWindows(void); static void LaunchPokeblockFeedTask(void); -static void SetPokeblockSpritePal(u8 pokeblockCaseId); +static void SetPokeblockSpritePal(u8); static void CalculateMonAnimLength(void); -static void DoPokeblockCaseThrowEffect(u8 spriteId, bool8 arg1); -static void StartMonJumpForPokeblock(u8 spriteId); -static void Task_PrintAtePokeblockMessage(u8 taskId); -static void Task_FadeOutPokeblockFeed(u8 taskId); +static void DoPokeblockCaseThrowEffect(u8, bool8); +static void StartMonJumpForPokeblock(u8); +static void Task_PrintAtePokeblockMessage(u8); +static void Task_FadeOutPokeblockFeed(u8); static void UpdateMonAnim(void); -static void SpriteCB_MonJumpForPokeblock(struct Sprite *sprite); +static void SpriteCB_MonJumpForPokeblock(struct Sprite *); static void CalculateMonAnimMovement(void); static void CalculateMonAnimMovementEnd(void); static bool8 InitMonAnimStage(void); static bool8 FreeMonSpriteOamMatrix(void); static bool8 DoMonAnimStep(void); -static bool8 LoadMonAndSceneGfx(struct Pokemon *mon); +static bool8 LoadMonAndSceneGfx(struct Pokemon *); static u8 CreatePokeblockSprite(void); static u8 CreatePokeblockCaseSpriteForFeeding(void); -static u8 CreateMonSprite(struct Pokemon *mon); -static void SpriteCB_ThrownPokeblock(struct Sprite* sprite); +static u8 CreateMonSprite(struct Pokemon *); +static void SpriteCB_ThrownPokeblock(struct Sprite *); EWRAM_DATA static struct PokeblockFeed *sPokeblockFeed = NULL; EWRAM_DATA static struct CompressedSpritePalette sPokeblockSpritePal = {0}; From 62abcecc54ac810dc082e5e822be4796a5064ece Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 15 Apr 2021 02:04:01 -0400 Subject: [PATCH 39/63] More usage of DISPLAY constants --- src/battle_anim_effects_2.c | 11 +-- src/battle_anim_effects_3.c | 26 +++--- src/battle_anim_flying.c | 6 +- src/battle_anim_ghost.c | 12 +-- src/battle_anim_ground.c | 4 +- src/battle_anim_ice.c | 14 ++-- src/battle_anim_psychic.c | 2 +- src/battle_anim_rock.c | 4 +- src/battle_anim_throw.c | 2 +- src/battle_anim_water.c | 4 +- src/battle_controller_link_opponent.c | 4 +- src/battle_controller_link_partner.c | 2 +- src/battle_controller_opponent.c | 4 +- src/battle_controller_player.c | 6 +- src/battle_controller_player_partner.c | 2 +- src/battle_controller_recorded_opponent.c | 4 +- src/battle_controller_recorded_player.c | 2 +- src/battle_controller_safari.c | 2 +- src/battle_controller_wally.c | 4 +- src/battle_dome.c | 98 +++++++++++------------ src/battle_interface.c | 38 ++++----- src/battle_intro.c | 4 +- src/battle_main.c | 12 +-- src/battle_transition.c | 34 ++++---- src/cable_car.c | 2 +- src/confetti_util.c | 4 +- src/contest.c | 8 +- src/contest_util.c | 44 +++++----- src/evolution_graphics.c | 2 +- src/field_weather_effect.c | 4 +- src/hall_of_fame.c | 4 +- src/list_menu.c | 2 +- src/main_menu.c | 10 +-- src/mevent_801BAAC.c | 4 +- src/naming_screen.c | 2 +- src/option_menu.c | 2 +- src/pokedex.c | 22 ++--- src/pokedex_cry_screen.c | 2 +- src/pokemon_storage_system.c | 2 +- src/pokenav_menu_handler_2.c | 2 +- src/rayquaza_scene.c | 4 +- src/save_failed_screen.c | 2 +- src/starter_choose.c | 6 +- src/title_screen.c | 12 +-- src/trade.c | 12 +-- src/union_room_chat.c | 4 +- src/wallclock.c | 4 +- 47 files changed, 232 insertions(+), 229 deletions(-) diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 3a04c8c46..58e2bae9f 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -3069,11 +3069,11 @@ static void AnimMagentaHeart(struct Sprite *sprite) void AnimTask_FakeOut(u8 taskId) { - u16 win0h = IsContest() ? 0x98 : 0xF0; + u16 win0h = IsContest() ? 152 : DISPLAY_WIDTH; u16 win0v = 0; gBattle_WIN0H = win0h; - gBattle_WIN0V = 0xA0; + gBattle_WIN0V = DISPLAY_HEIGHT; SetGpuReg(REG_OFFSET_WIN0H, gBattle_WIN0H); SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); SetGpuReg(REG_OFFSET_WININ, 0x3F1F); @@ -3096,7 +3096,7 @@ static void AnimTask_FakeOut_Step1(u8 taskId) } else { - gBattle_WIN0H = gTasks[taskId].data[1] | (gTasks[taskId].data[0] << 8); + gBattle_WIN0H = WIN_RANGE(gTasks[taskId].data[0], gTasks[taskId].data[1]); } } @@ -3210,7 +3210,7 @@ void AnimParticleBurst(struct Sprite *sprite) static void AnimRedHeartRising(struct Sprite *sprite) { sprite->pos1.x = gBattleAnimArgs[0]; - sprite->pos1.y = 160; + sprite->pos1.y = DISPLAY_HEIGHT; sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = gBattleAnimArgs[1]; sprite->callback = WaitAnimForDuration; @@ -3464,7 +3464,8 @@ static void AnimOrbitScatter_Step(struct Sprite *sprite) { sprite->pos2.x += sprite->data[0]; sprite->pos2.y += sprite->data[1]; - if (sprite->pos1.x + sprite->pos2.x + 16 > 272u || sprite->pos1.y + sprite->pos2.y > 160 || sprite->pos1.y + sprite->pos2.y < -16) + if (sprite->pos1.x + sprite->pos2.x + 16 > ((u32)DISPLAY_WIDTH + 32) + || sprite->pos1.y + sprite->pos2.y > DISPLAY_HEIGHT || sprite->pos1.y + sprite->pos2.y < -16) DestroyAnimSprite(sprite); } diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 67452fe90..800431c6a 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -1509,7 +1509,7 @@ static void AnimLetterZ(struct Sprite *sprite) sprite->pos2.x = sprite->data[3] / 2; sprite->pos2.y = Sin(var0 & 0xFF, 5) + (sprite->data[4] / 2); - if ((u16)(sprite->pos1.x + sprite->pos2.x) > 240) + if ((u16)(sprite->pos1.x + sprite->pos2.x) > DISPLAY_WIDTH) DestroyAnimSprite(sprite); } @@ -1676,18 +1676,18 @@ void AnimTask_CreateSpotlight(u8 taskId) { if (IsContest()) { - SetGpuReg(REG_OFFSET_WININ, 0x1F3F); - gBattle_WIN1H = 0x98F0; - gBattle_WIN1V = 0x00A0; + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ); + gBattle_WIN1H = WIN_RANGE(152, DISPLAY_WIDTH); + gBattle_WIN1V = WIN_RANGE(0, DISPLAY_HEIGHT); SetGpuReg(REG_OFFSET_WIN1H, gBattle_WIN0H); SetGpuReg(REG_OFFSET_WIN1V, gBattle_WIN0V); } else { SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ); - gBattle_WIN1H = 0x00F0; - gBattle_WIN1V = 0x78A0; - SetGpuReg(REG_OFFSET_WIN1H, 0x00F0); + gBattle_WIN1H = WIN_RANGE(0, DISPLAY_WIDTH); + gBattle_WIN1V = WIN_RANGE(120, DISPLAY_HEIGHT); + SetGpuReg(REG_OFFSET_WIN1H, gBattle_WIN1H); SetGpuReg(REG_OFFSET_WIN1V, gBattle_WIN1V); SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN1_ON); } @@ -1785,13 +1785,13 @@ void AnimTask_RapinSpinMonElevation(u8 taskId) { var3 = gBattle_BG1_X; task->data[8] = var3; - var4 = var3 + 240; + var4 = var3 + DISPLAY_WIDTH; } else { var3 = gBattle_BG2_X; task->data[8] = var3; - var4 = var3 + 240; + var4 = var3 + DISPLAY_WIDTH; } task->data[9] = var4; @@ -2807,7 +2807,7 @@ static void AnimSweetScentPetal(struct Sprite *sprite) } else { - sprite->pos1.x = 240; + sprite->pos1.x = DISPLAY_WIDTH; sprite->pos1.y = gBattleAnimArgs[0] - 30; } @@ -2824,7 +2824,7 @@ static void AnimSweetScentPetal_Step(struct Sprite *sprite) sprite->pos1.x += 5; sprite->pos1.y -= 1; - if (sprite->pos1.x > 240) + if (sprite->pos1.x > DISPLAY_WIDTH) DestroyAnimSprite(sprite); sprite->pos2.y = Sin(sprite->data[0] & 0xFF, 16); @@ -5049,7 +5049,7 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId) subpriority = gSprites[GetAnimBattlerSpriteId(ANIM_TARGET)].subpriority + 1; isBackPic = FALSE; - x = 272; + x = DISPLAY_WIDTH + 32; } else { @@ -5116,7 +5116,7 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId) if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) gSprites[spriteId].pos2.x = -gSprites[spriteId].pos1.x - 32; else - gSprites[spriteId].pos2.x = 272 - gSprites[spriteId].pos1.x; + gSprites[spriteId].pos2.x = DISPLAY_WIDTH + 32 - gSprites[spriteId].pos1.x; gTasks[taskId].data[0]++; break; diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index 5955d203e..9e3e6c33e 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -496,7 +496,7 @@ static void AnimFlyBallAttack(struct Sprite *sprite) { if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) { - sprite->pos1.x = 272; + sprite->pos1.x = DISPLAY_WIDTH + 32; sprite->pos1.y = -32; StartSpriteAffineAnim(sprite, 1); } @@ -528,8 +528,8 @@ static void AnimFlyBallAttack_Step(struct Sprite *sprite) } if (sprite->pos1.x + sprite->pos2.x < -32 - || sprite->pos1.x + sprite->pos2.x > 272 - || sprite->pos1.y + sprite->pos2.y > 160) + || sprite->pos1.x + sprite->pos2.x > DISPLAY_WIDTH + 32 + || sprite->pos1.y + sprite->pos2.y > DISPLAY_HEIGHT) { gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = FALSE; DestroyAnimSprite(sprite); diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index 4b253a7ec..b52932b46 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -957,12 +957,12 @@ void AnimTask_CurseStretchingBlackBg(u8 taskId) else startX = 200; - gBattle_WIN0H = (startX << 8) | startX; + gBattle_WIN0H = WIN_RANGE(startX, startX); startY = 40; - gBattle_WIN0V = (startY << 8) | startY; + gBattle_WIN0V = WIN_RANGE(startY, startY); leftDistance = startX; - rightDistance = 240 - startX; + rightDistance = DISPLAY_WIDTH - startX; topDistance = startY; bottomDistance = 72; gTasks[taskId].data[1] = leftDistance; @@ -1001,7 +1001,7 @@ static void AnimTask_CurseStretchingBlackBg_Step1(u8 taskId) else { left = 0; - right = 240; + right = DISPLAY_WIDTH; top = 0; bottom = 112; selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); @@ -1009,8 +1009,8 @@ static void AnimTask_CurseStretchingBlackBg_Step1(u8 taskId) gTasks[taskId].func = AnimTask_CurseStretchingBlackBg_Step2; } - gBattle_WIN0H = (left << 8) | right; - gBattle_WIN0V = (top << 8) | bottom; + gBattle_WIN0H = WIN_RANGE(left, right); + gBattle_WIN0V = WIN_RANGE(top, bottom); } static void AnimTask_CurseStretchingBlackBg_Step2(u8 taskId) diff --git a/src/battle_anim_ground.c b/src/battle_anim_ground.c index 6dc9c5815..aa089394e 100644 --- a/src/battle_anim_ground.c +++ b/src/battle_anim_ground.c @@ -353,7 +353,7 @@ static void AnimTask_DigBounceMovement(u8 taskId) else gBattle_BG2_Y = task->data[13] - task->data[5]; - gSprites[task->data[10]].pos2.x = 272 - gSprites[task->data[10]].pos1.x; + gSprites[task->data[10]].pos2.x = DISPLAY_WIDTH + 32 - gSprites[task->data[10]].pos1.x; task->data[0]++; } break; @@ -405,7 +405,7 @@ static void AnimTask_DigSetVisibleUnderground(u8 taskId) task->data[10] = GetAnimBattlerSpriteId(ANIM_ATTACKER); gSprites[task->data[10]].invisible = FALSE; gSprites[task->data[10]].pos2.x = 0; - gSprites[task->data[10]].pos2.y = 160 - gSprites[task->data[10]].pos1.y; + gSprites[task->data[10]].pos2.y = DISPLAY_HEIGHT - gSprites[task->data[10]].pos1.y; task->data[0]++; break; case 1: diff --git a/src/battle_anim_ice.c b/src/battle_anim_ice.c index b97ccf9cd..23b0f6c3b 100644 --- a/src/battle_anim_ice.c +++ b/src/battle_anim_ice.c @@ -696,8 +696,8 @@ static void AnimSwirlingSnowball(struct Sprite *sprite) sprite->data[0] = 1; AnimFastTranslateLinear(sprite); - if ((u32)(sprite->pos1.x + sprite->pos2.x + 16) > 272 - || sprite->pos1.y + sprite->pos2.y > 160 + if ((u32)(sprite->pos1.x + sprite->pos2.x + 16) > DISPLAY_WIDTH + 32 + || sprite->pos1.y + sprite->pos2.y > DISPLAY_HEIGHT || sprite->pos1.y + sprite->pos2.y < -16) break; } @@ -762,7 +762,7 @@ static void AnimSwirlingSnowball_End(struct Sprite *sprite) sprite->data[0] = 1; AnimFastTranslateLinear(sprite); - if ((u32)(sprite->pos1.x + sprite->pos2.x + 16) > 272 + if ((u32)(sprite->pos1.x + sprite->pos2.x + 16) > DISPLAY_WIDTH + 32 || sprite->pos1.y + sprite->pos2.y > 256 || sprite->pos1.y + sprite->pos2.y < -16) DestroyAnimSprite(sprite); @@ -816,8 +816,8 @@ static void AnimMoveParticleBeyondTarget(struct Sprite *sprite) { sprite->data[0] = 1; AnimFastTranslateLinear(sprite); - if ((u32)(sprite->pos1.x + sprite->pos2.x + 16) > 272 - || sprite->pos1.y + sprite->pos2.y > 160 + if ((u32)(sprite->pos1.x + sprite->pos2.x + 16) > DISPLAY_WIDTH + 32 + || sprite->pos1.y + sprite->pos2.y > DISPLAY_HEIGHT || sprite->pos1.y + sprite->pos2.y < -16) break; } @@ -846,8 +846,8 @@ static void AnimWiggleParticleTowardsTarget(struct Sprite *sprite) sprite->data[7] = (sprite->data[7] + sprite->data[6]) & 0xFF; if (sprite->data[0] == 1) { - if ((u32)(sprite->pos1.x + sprite->pos2.x + 16) > 272 - || sprite->pos1.y + sprite->pos2.y > 160 + if ((u32)(sprite->pos1.x + sprite->pos2.x + 16) > DISPLAY_WIDTH + 32 + || sprite->pos1.y + sprite->pos2.y > DISPLAY_HEIGHT || sprite->pos1.y + sprite->pos2.y < -16) DestroyAnimSprite(sprite); } diff --git a/src/battle_anim_psychic.c b/src/battle_anim_psychic.c index 2e7844f76..718fce396 100644 --- a/src/battle_anim_psychic.c +++ b/src/battle_anim_psychic.c @@ -737,7 +737,7 @@ static void AnimTask_Teleport_Step(u8 taskId) else { gSprites[task->data[0]].invisible = TRUE; - gSprites[task->data[0]].pos1.x = 272; + gSprites[task->data[0]].pos1.x = DISPLAY_WIDTH + 32; ResetSpriteRotScale(task->data[0]); DestroyAnimVisualTask(taskId); } diff --git a/src/battle_anim_rock.c b/src/battle_anim_rock.c index c2db62063..3e9eafb90 100644 --- a/src/battle_anim_rock.c +++ b/src/battle_anim_rock.c @@ -496,7 +496,7 @@ static void AnimFlyingSandCrescent(struct Sprite *sprite) { if (gBattleAnimArgs[3] != 0 && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) { - sprite->pos1.x = 304; + sprite->pos1.x = DISPLAY_WIDTH + 64; gBattleAnimArgs[1] = -gBattleAnimArgs[1]; sprite->data[5] = 1; sprite->oam.matrixNum = ST_OAM_HFLIP; @@ -523,7 +523,7 @@ static void AnimFlyingSandCrescent(struct Sprite *sprite) if (sprite->data[5] == 0) { - if (sprite->pos1.x + sprite->pos2.x > 272) + if (sprite->pos1.x + sprite->pos2.x > DISPLAY_WIDTH + 32) { sprite->callback = DestroyAnimSprite; } diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c index d36f6c3f9..f6a48cf69 100755 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -1537,7 +1537,7 @@ static void SpriteCB_Ball_Block_Step(struct Sprite *sprite) sprite->sDy = (sprite->sDy + 0x800) & 0xFF; sprite->sDx = (sprite->sDx + 0x680) & 0xFF; - if (sprite->pos1.y + sprite->pos2.y > 160 + if (sprite->pos1.y + sprite->pos2.y > DISPLAY_HEIGHT || sprite->pos1.x + sprite->pos2.x < -8) { sprite->sFrame = 0; diff --git a/src/battle_anim_water.c b/src/battle_anim_water.c index 43849645e..d9cfeab9a 100644 --- a/src/battle_anim_water.c +++ b/src/battle_anim_water.c @@ -487,8 +487,8 @@ void AnimTask_CreateRaindrops(u8 taskId) gTasks[taskId].data[0]++; if (gTasks[taskId].data[0] % gTasks[taskId].data[2] == 1) { - x = Random2() % 240; - y = Random2() % 80; + x = Random2() % DISPLAY_WIDTH; + y = Random2() % (DISPLAY_HEIGHT / 2); CreateSprite(&gRainDropSpriteTemplate, x, y, 4); } if (gTasks[taskId].data[0] == gTasks[taskId].data[3]) diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 179ae18e8..0f612f964 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -1134,7 +1134,7 @@ static void LinkOpponentHandleLoadMonSprite(void) GetBattlerSpriteDefault_Y(gActiveBattler), GetBattlerSpriteSubpriority(gActiveBattler)); - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); @@ -1302,7 +1302,7 @@ static void LinkOpponentHandleDrawTrainerPic(void) (8 - gTrainerFrontPicCoords[trainerPicId].size) * 4 + 40, GetBattlerSpriteSubpriority(gActiveBattler)); - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = 2; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineParam = trainerPicId; diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 2bb1cd914..9184f5ac9 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -1021,7 +1021,7 @@ static void LinkPartnerHandleLoadMonSprite(void) GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteDefault_Y(gActiveBattler), GetBattlerSpriteSubpriority(gActiveBattler)); - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 2c181c14f..9fce5050e 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1143,7 +1143,7 @@ static void OpponentHandleLoadMonSprite(void) GetBattlerSpriteDefault_Y(gActiveBattler), GetBattlerSpriteSubpriority(gActiveBattler)); - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = species; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; @@ -1310,7 +1310,7 @@ static void OpponentHandleDrawTrainerPic(void) (8 - gTrainerFrontPicCoords[trainerPicId].size) * 4 + 40, GetBattlerSpriteSubpriority(gActiveBattler)); - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = 2; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineParam = trainerPicId; diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index e7801d0e4..34fcb82f6 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -630,7 +630,7 @@ static u32 HandleMoveInputUnused(void) { PlaySE(SE_SELECT); gBattle_BG0_X = 0; - gBattle_BG0_Y = 0x140; + gBattle_BG0_Y = DISPLAY_HEIGHT * 2; var = 0xFF; } if (JOY_NEW(DPAD_LEFT) && gMoveSelectionCursor[gActiveBattler] & 1) @@ -2568,7 +2568,7 @@ static void HandleChooseActionAfterDma3(void) if (!IsDma3ManagerBusyWithBgCopy()) { gBattle_BG0_X = 0; - gBattle_BG0_Y = 160; + gBattle_BG0_Y = DISPLAY_HEIGHT; gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseAction; } } @@ -2610,7 +2610,7 @@ static void HandleChooseMoveAfterDma3(void) if (!IsDma3ManagerBusyWithBgCopy()) { gBattle_BG0_X = 0; - gBattle_BG0_Y = 320; + gBattle_BG0_Y = DISPLAY_HEIGHT * 2; gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseMove; } } diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index cc433a9b2..401ad311b 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1205,7 +1205,7 @@ static void PlayerPartnerHandleLoadMonSprite(void) GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteDefault_Y(gActiveBattler), GetBattlerSpriteSubpriority(gActiveBattler)); - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 663d71ec7..245e4bd30 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -1117,7 +1117,7 @@ static void RecordedOpponentHandleLoadMonSprite(void) GetBattlerSpriteDefault_Y(gActiveBattler), GetBattlerSpriteSubpriority(gActiveBattler)); - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); @@ -1249,7 +1249,7 @@ static void RecordedOpponentHandleDrawTrainerPic(void) (8 - gTrainerFrontPicCoords[trainerPicId].size) * 4 + 40, GetBattlerSpriteSubpriority(gActiveBattler)); - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = 2; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineParam = trainerPicId; diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index aa4154a3f..73c23afc5 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -1098,7 +1098,7 @@ static void RecordedPlayerHandleLoadMonSprite(void) GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteDefault_Y(gActiveBattler), GetBattlerSpriteSubpriority(gActiveBattler)); - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index 0fdf32fb6..5d8b46ebd 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -442,7 +442,7 @@ static void HandleChooseActionAfterDma3(void) if (!IsDma3ManagerBusyWithBgCopy()) { gBattle_BG0_X = 0; - gBattle_BG0_Y = 160; + gBattle_BG0_Y = DISPLAY_HEIGHT; gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseAction; } } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index 0d1515213..b35ffa692 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1195,7 +1195,7 @@ static void HandleChooseActionAfterDma3(void) if (!IsDma3ManagerBusyWithBgCopy()) { gBattle_BG0_X = 0; - gBattle_BG0_Y = 160; + gBattle_BG0_Y = DISPLAY_HEIGHT; gBattlerControllerFuncs[gActiveBattler] = WallyHandleActions; } } @@ -1233,7 +1233,7 @@ static void WallyHandleChooseMove(void) if (!IsDma3ManagerBusyWithBgCopy()) { gBattle_BG0_X = 0; - gBattle_BG0_Y = 0x140; + gBattle_BG0_Y = DISPLAY_HEIGHT * 2; gBattleStruct->wallyMovesState++; } break; diff --git a/src/battle_dome.c b/src/battle_dome.c index 4e6e6a652..a5cf168ef 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -2998,7 +2998,7 @@ static void Task_ShowTourneyInfoCard(u8 taskId) if (mode == INFOCARD_MATCH) gBattle_BG2_X = 0, gBattle_BG2_Y = 0; else - gBattle_BG2_X = 0, gBattle_BG2_Y = 160; + gBattle_BG2_X = 0, gBattle_BG2_Y = DISPLAY_HEIGHT; gTasks[taskId].tState++; break; @@ -3143,7 +3143,7 @@ static void SpriteCb_TrainerIconCardScrollLeft(struct Sprite *sprite) } else { - if (sprite->pos1.x >= 272) + if (sprite->pos1.x >= DISPLAY_WIDTH + 32) { sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE; FreeAndDestroyTrainerPicSprite(sprite->data[3]); @@ -3156,7 +3156,7 @@ static void SpriteCb_TrainerIconCardScrollRight(struct Sprite *sprite) sprite->pos1.x -= 4; if (sprite->data[0] != 0) { - if (sprite->pos1.x <= 272) + if (sprite->pos1.x <= DISPLAY_WIDTH + 32) sprite->invisible = FALSE; if (++sprite->data[1] == 64) sprite->callback = SpriteCallbackDummy; @@ -3237,7 +3237,7 @@ static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite) } else { - if (sprite->pos1.x >= 256) + if (sprite->pos1.x >= DISPLAY_WIDTH + 16) { sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE; FreeAndDestroyMonIconSprite(sprite); @@ -3252,7 +3252,7 @@ static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite) sprite->pos1.x -= 4; if (sprite->data[0] != 0) { - if (sprite->pos1.x <= 256) + if (sprite->pos1.x <= DISPLAY_WIDTH + 16) sprite->invisible = FALSE; if (++sprite->data[1] == 64) sprite->callback = SpriteCb_MonIcon; @@ -3439,12 +3439,12 @@ static void Task_HandleInfoCardInput(u8 taskId) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; gBattle_BG1_X = 0; - gBattle_BG1_Y = 160; + gBattle_BG1_Y = DISPLAY_HEIGHT; } else { gBattle_BG0_X = 0; - gBattle_BG0_Y = 160; + gBattle_BG0_Y = DISPLAY_HEIGHT; gBattle_BG1_X = 0; gBattle_BG1_Y = 0; } @@ -3454,13 +3454,13 @@ static void Task_HandleInfoCardInput(u8 taskId) if (sInfoCard->pos == 0) { gBattle_BG2_X = 0; - gBattle_BG2_Y = 320; + gBattle_BG2_Y = DISPLAY_HEIGHT * 2; trainerTourneyId = sTourneyTreeTrainerIds[gTasks[taskId2].data[1]]; DisplayTrainerInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_UP, trainerTourneyId); } else { - gBattle_BG2_X = 256; + gBattle_BG2_X = DISPLAY_WIDTH + 16; gBattle_BG2_Y = 0; trainerTourneyId = sTourneyTreeTrainerIds[gTasks[taskId2].data[1]]; DisplayTrainerInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_UP, trainerTourneyId); @@ -3474,7 +3474,7 @@ static void Task_HandleInfoCardInput(u8 taskId) matchNo = gTasks[taskId2].data[1] - 16; BufferDomeWinString(matchNo, sInfoCard->tournamentIds); gBattle_BG2_X = 0; - gBattle_BG2_Y = 320; + gBattle_BG2_Y = DISPLAY_HEIGHT * 2; trainerTourneyId = sInfoCard->tournamentIds[0]; DisplayTrainerInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_UP, trainerTourneyId); } @@ -3483,14 +3483,14 @@ static void Task_HandleInfoCardInput(u8 taskId) matchNo = gTasks[taskId2].data[1] - 16; BufferDomeWinString(matchNo, sInfoCard->tournamentIds); gBattle_BG2_X = 0; - gBattle_BG2_Y = 320; + gBattle_BG2_Y = DISPLAY_HEIGHT * 2; trainerTourneyId = sInfoCard->tournamentIds[1]; DisplayTrainerInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_UP, trainerTourneyId); } else { - gBattle_BG2_X = 256; - gBattle_BG2_Y = 160; + gBattle_BG2_X = DISPLAY_WIDTH + 16; + gBattle_BG2_Y = DISPLAY_HEIGHT; matchNo = gTasks[taskId2].data[1] - 16; DisplayMatchInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_UP, matchNo); } @@ -3555,12 +3555,12 @@ static void Task_HandleInfoCardInput(u8 taskId) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; gBattle_BG1_X = 0; - gBattle_BG1_Y = -160; + gBattle_BG1_Y = -DISPLAY_HEIGHT; } else { gBattle_BG0_X = 0; - gBattle_BG0_Y = -160; + gBattle_BG0_Y = -DISPLAY_HEIGHT; gBattle_BG1_X = 0; gBattle_BG1_Y = 0; } @@ -3570,7 +3570,7 @@ static void Task_HandleInfoCardInput(u8 taskId) if (sInfoCard->pos == 0) { gBattle_BG2_X = 0; - gBattle_BG2_Y = 160; + gBattle_BG2_Y = DISPLAY_HEIGHT; trainerTourneyId = sTourneyTreeTrainerIds[gTasks[taskId2].data[1]]; DisplayTrainerInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_DOWN, trainerTourneyId); } @@ -3590,7 +3590,7 @@ static void Task_HandleInfoCardInput(u8 taskId) matchNo = gTasks[taskId2].data[1] - 16; BufferDomeWinString(matchNo, sInfoCard->tournamentIds); gBattle_BG2_X = 0; - gBattle_BG2_Y = 160; + gBattle_BG2_Y = DISPLAY_HEIGHT; trainerTourneyId = sInfoCard->tournamentIds[0]; DisplayTrainerInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_DOWN, trainerTourneyId); } @@ -3599,13 +3599,13 @@ static void Task_HandleInfoCardInput(u8 taskId) matchNo = gTasks[taskId2].data[1] - 16; BufferDomeWinString(matchNo, sInfoCard->tournamentIds); gBattle_BG2_X = 0; - gBattle_BG2_Y = 160; + gBattle_BG2_Y = DISPLAY_HEIGHT; trainerTourneyId = sInfoCard->tournamentIds[1]; DisplayTrainerInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_DOWN, trainerTourneyId); } else { - gBattle_BG2_X = 256; + gBattle_BG2_X = DISPLAY_WIDTH + 16; gBattle_BG2_Y = 0; matchNo = gTasks[taskId2].data[1] - 16; DisplayMatchInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_DOWN, matchNo); @@ -3669,12 +3669,12 @@ static void Task_HandleInfoCardInput(u8 taskId) { gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - gBattle_BG1_X = 256; + gBattle_BG1_X = DISPLAY_WIDTH + 16; gBattle_BG1_Y = 0; } else { - gBattle_BG0_X = 256; + gBattle_BG0_X = DISPLAY_WIDTH + 16; gBattle_BG0_Y = 0; gBattle_BG1_X = 0; gBattle_BG1_Y = 0; @@ -3682,14 +3682,14 @@ static void Task_HandleInfoCardInput(u8 taskId) if (sInfoCard->pos == 0) { - gBattle_BG2_X = 256; - gBattle_BG2_Y = 160; + gBattle_BG2_X = DISPLAY_WIDTH + 16; + gBattle_BG2_Y = DISPLAY_HEIGHT; trainerTourneyId = sTourneyTreeTrainerIds[gTasks[taskId2].data[1]]; DisplayTrainerInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_LEFT, trainerTourneyId); } else { - gBattle_BG2_X = 256; + gBattle_BG2_X = DISPLAY_WIDTH + 16; gBattle_BG2_Y = 0; matchNo = sIdToMatchNumber[gTasks[taskId2].data[1]][sInfoCard->pos - 1]; DisplayMatchInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_LEFT, matchNo); @@ -3752,12 +3752,12 @@ static void Task_HandleInfoCardInput(u8 taskId) { gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - gBattle_BG1_X = 256; + gBattle_BG1_X = DISPLAY_WIDTH + 16; gBattle_BG1_Y = 0; } else { - gBattle_BG0_X = 256; + gBattle_BG0_X = DISPLAY_WIDTH + 16; gBattle_BG0_Y = 0; gBattle_BG1_X = 0; gBattle_BG1_Y = 0; @@ -3765,15 +3765,15 @@ static void Task_HandleInfoCardInput(u8 taskId) if (sInfoCard->pos == 0) { - gBattle_BG2_X = 256; - gBattle_BG2_Y = 160; + gBattle_BG2_X = DISPLAY_WIDTH + 16; + gBattle_BG2_Y = DISPLAY_HEIGHT; trainerTourneyId = sInfoCard->tournamentIds[0]; DisplayTrainerInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_LEFT, trainerTourneyId); } else { gBattle_BG2_X = 0; - gBattle_BG2_Y = 160; + gBattle_BG2_Y = DISPLAY_HEIGHT; matchNo = gTasks[taskId2].data[1] - 16; DisplayMatchInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_LEFT, matchNo); } @@ -3835,12 +3835,12 @@ static void Task_HandleInfoCardInput(u8 taskId) { gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - gBattle_BG1_X = -256; + gBattle_BG1_X = -(DISPLAY_WIDTH + 16); gBattle_BG1_Y = 0; } else { - gBattle_BG0_X = -256; + gBattle_BG0_X = -(DISPLAY_WIDTH + 16); gBattle_BG0_Y = 0; gBattle_BG1_X = 0; gBattle_BG1_Y = 0; @@ -3849,7 +3849,7 @@ static void Task_HandleInfoCardInput(u8 taskId) if (sInfoCard->pos == 1) { gBattle_BG2_X = 0; - gBattle_BG2_Y = 160; + gBattle_BG2_Y = DISPLAY_HEIGHT; } else { @@ -3916,12 +3916,12 @@ static void Task_HandleInfoCardInput(u8 taskId) { gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - gBattle_BG1_X = -256; + gBattle_BG1_X = -(DISPLAY_WIDTH + 16); gBattle_BG1_Y = 0; } else { - gBattle_BG0_X = -256; + gBattle_BG0_X = -(DISPLAY_WIDTH + 16); gBattle_BG0_Y = 0; gBattle_BG1_X = 0; gBattle_BG1_Y = 0; @@ -3929,15 +3929,15 @@ static void Task_HandleInfoCardInput(u8 taskId) if (sInfoCard->pos == 2) { - gBattle_BG2_X = 256; - gBattle_BG2_Y = 160; + gBattle_BG2_X = DISPLAY_WIDTH + 16; + gBattle_BG2_Y = DISPLAY_HEIGHT; trainerTourneyId = sInfoCard->tournamentIds[1]; DisplayTrainerInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_RIGHT, trainerTourneyId); } else { gBattle_BG2_X = 0; - gBattle_BG2_Y = 160; + gBattle_BG2_Y = DISPLAY_HEIGHT; matchNo = gTasks[taskId2].data[1] - 16; DisplayMatchInfoOnCard(gTasks[taskId].tUsingAlternateSlot | MOVE_CARD_RIGHT, matchNo); } @@ -4248,13 +4248,13 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) if (flags & CARD_ALTERNATE_SLOT) arrId = 2 * (FRONTIER_PARTY_SIZE + 1), windowId = 9, palSlot = 2; if (flags & MOVE_CARD_RIGHT) - x = 256; + x = DISPLAY_WIDTH + 16; if (flags & MOVE_CARD_DOWN) - y = 160; + y = DISPLAY_HEIGHT; if (flags & MOVE_CARD_LEFT) - x = -256; + x = -(DISPLAY_WIDTH + 16); if (flags & MOVE_CARD_UP) - y = -160; + y = -DISPLAY_HEIGHT; // Create trainer pic sprite if (trainerId == TRAINER_PLAYER) @@ -4709,13 +4709,13 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo) if (flags & CARD_ALTERNATE_SLOT) arrId = 2 * (FRONTIER_PARTY_SIZE + 1), windowId = 9, palSlot = 2; if (flags & MOVE_CARD_RIGHT) - x = 256; + x = DISPLAY_WIDTH + 16; if (flags & MOVE_CARD_DOWN) - y = 160; + y = DISPLAY_HEIGHT; if (flags & MOVE_CARD_LEFT) - x = -256; + x = -(DISPLAY_WIDTH + 16); if (flags & MOVE_CARD_UP) - y = -160; + y = -DISPLAY_HEIGHT; // Copy trainers information to handy arrays. winStringId = BufferDomeWinString(matchNo, sInfoCard->tournamentIds); @@ -5285,10 +5285,10 @@ static void Task_ShowTourneyTree(u8 taskId) 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_WIN0H, WIN_RANGE(88, 96)); + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(0, DISPLAY_HEIGHT - 1)); + SetGpuReg(REG_OFFSET_WIN1H, WIN_RANGE(144, 152)); + SetGpuReg(REG_OFFSET_WIN1V, WIN_RANGE(0, DISPLAY_HEIGHT - 1)); SetGpuReg(REG_OFFSET_WININ, 0); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); ResetPaletteFade(); diff --git a/src/battle_interface.c b/src/battle_interface.c index cccc0b971..5518fd21b 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -330,7 +330,7 @@ static const struct SpriteTemplate sHealthbarSpriteTemplates[MAX_BATTLERS_COUNT] static const struct Subsprite sUnknown_0832C220[] = { { - .x = 240, + .x = DISPLAY_WIDTH, .y = 0, .shape = SPRITE_SHAPE(64x32), .size = SPRITE_SIZE(64x32), @@ -346,7 +346,7 @@ static const struct Subsprite sUnknown_0832C220[] = .priority = 1 }, { - .x = 240, + .x = DISPLAY_WIDTH, .y = 32, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -374,7 +374,7 @@ static const struct Subsprite sUnknown_0832C220[] = static const struct Subsprite sUnknown_0832C234[] = { { - .x = 240, + .x = DISPLAY_WIDTH, .y = 0, .shape = SPRITE_SHAPE(64x32), .size = SPRITE_SIZE(64x32), @@ -390,7 +390,7 @@ static const struct Subsprite sUnknown_0832C234[] = .priority = 1 }, { - .x = 240, + .x = DISPLAY_WIDTH, .y = 32, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -418,7 +418,7 @@ static const struct Subsprite sUnknown_0832C234[] = static const struct Subsprite sUnknown_0832C248[] = { { - .x = 240, + .x = DISPLAY_WIDTH, .y = 0, .shape = SPRITE_SHAPE(64x32), .size = SPRITE_SIZE(64x32), @@ -438,7 +438,7 @@ static const struct Subsprite sUnknown_0832C248[] = static const struct Subsprite sUnknown_0832C250[] = { { - .x = 240, + .x = DISPLAY_WIDTH, .y = 0, .shape = SPRITE_SHAPE(64x32), .size = SPRITE_SIZE(64x32), @@ -458,7 +458,7 @@ static const struct Subsprite sUnknown_0832C250[] = static const struct Subsprite sUnknown_0832C258[] = { { - .x = 240, + .x = DISPLAY_WIDTH, .y = 0, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -478,7 +478,7 @@ static const struct Subsprite sUnknown_0832C258[] = static const struct Subsprite sUnknown_0832C260[] = { { - .x = 240, + .x = DISPLAY_WIDTH, .y = 0, .shape = SPRITE_SHAPE(32x8), .size = SPRITE_SIZE(32x8), @@ -494,7 +494,7 @@ static const struct Subsprite sUnknown_0832C260[] = .priority = 1 }, { - .x = 224, + .x = DISPLAY_WIDTH - 16, .y = 0, .shape = SPRITE_SHAPE(8x8), .size = SPRITE_SIZE(8x8), @@ -869,8 +869,8 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId) { if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) { - healthboxLeftSpriteId = CreateSprite(&sHealthboxPlayerSpriteTemplates[0], 240, 160, 1); - healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxPlayerSpriteTemplates[0], 240, 160, 1); + healthboxLeftSpriteId = CreateSprite(&sHealthboxPlayerSpriteTemplates[0], DISPLAY_WIDTH, DISPLAY_HEIGHT, 1); + healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxPlayerSpriteTemplates[0], DISPLAY_WIDTH, DISPLAY_HEIGHT, 1); gSprites[healthboxLeftSpriteId].oam.shape = ST_OAM_SQUARE; @@ -879,8 +879,8 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId) } else { - healthboxLeftSpriteId = CreateSprite(&sHealthboxOpponentSpriteTemplates[0], 240, 160, 1); - healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxOpponentSpriteTemplates[0], 240, 160, 1); + healthboxLeftSpriteId = CreateSprite(&sHealthboxOpponentSpriteTemplates[0], DISPLAY_WIDTH, DISPLAY_HEIGHT, 1); + healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxOpponentSpriteTemplates[0], DISPLAY_WIDTH, DISPLAY_HEIGHT, 1); gSprites[healthboxRightSpriteId].oam.tileNum += 32; @@ -895,8 +895,8 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId) { if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) { - healthboxLeftSpriteId = CreateSprite(&sHealthboxPlayerSpriteTemplates[GetBattlerPosition(battlerId) / 2], 240, 160, 1); - healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxPlayerSpriteTemplates[GetBattlerPosition(battlerId) / 2], 240, 160, 1); + healthboxLeftSpriteId = CreateSprite(&sHealthboxPlayerSpriteTemplates[GetBattlerPosition(battlerId) / 2], DISPLAY_WIDTH, DISPLAY_HEIGHT, 1); + healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxPlayerSpriteTemplates[GetBattlerPosition(battlerId) / 2], DISPLAY_WIDTH, DISPLAY_HEIGHT, 1); gSprites[healthboxLeftSpriteId].oam.affineParam = healthboxRightSpriteId; @@ -908,8 +908,8 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId) } else { - healthboxLeftSpriteId = CreateSprite(&sHealthboxOpponentSpriteTemplates[GetBattlerPosition(battlerId) / 2], 240, 160, 1); - healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxOpponentSpriteTemplates[GetBattlerPosition(battlerId) / 2], 240, 160, 1); + healthboxLeftSpriteId = CreateSprite(&sHealthboxOpponentSpriteTemplates[GetBattlerPosition(battlerId) / 2], DISPLAY_WIDTH, DISPLAY_HEIGHT, 1); + healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxOpponentSpriteTemplates[GetBattlerPosition(battlerId) / 2], DISPLAY_WIDTH, DISPLAY_HEIGHT, 1); gSprites[healthboxLeftSpriteId].oam.affineParam = healthboxRightSpriteId; @@ -946,8 +946,8 @@ u8 CreateSafariPlayerHealthboxSprites(void) { u8 healthboxLeftSpriteId, healthboxRightSpriteId; - healthboxLeftSpriteId = CreateSprite(&sHealthboxSafariSpriteTemplate, 240, 160, 1); - healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxSafariSpriteTemplate, 240, 160, 1); + healthboxLeftSpriteId = CreateSprite(&sHealthboxSafariSpriteTemplate, DISPLAY_WIDTH, DISPLAY_HEIGHT, 1); + healthboxRightSpriteId = CreateSpriteAtEnd(&sHealthboxSafariSpriteTemplate, DISPLAY_WIDTH, DISPLAY_HEIGHT, 1); gSprites[healthboxLeftSpriteId].oam.shape = ST_OAM_SQUARE; gSprites[healthboxRightSpriteId].oam.shape = ST_OAM_SQUARE; diff --git a/src/battle_intro.c b/src/battle_intro.c index c76e5bc31..0ea65dab1 100644 --- a/src/battle_intro.c +++ b/src/battle_intro.c @@ -532,8 +532,8 @@ static void BattleIntroSlidePartner(u8 taskId) SetGpuReg(REG_OFFSET_WININ, WININ_WIN1_BG1 | WININ_WIN1_BG2 | WININ_WIN1_BG3 | WININ_WIN1_OBJ | WININ_WIN1_CLR); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR); gBattle_BG0_Y = -48; - gBattle_BG1_X = 240; - gBattle_BG2_X = -240; + gBattle_BG1_X = DISPLAY_WIDTH; + gBattle_BG2_X = -DISPLAY_WIDTH; } break; case 2: diff --git a/src/battle_main.c b/src/battle_main.c index c30c92929..323053bdf 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -611,22 +611,22 @@ static void CB2_InitBattleInternal(void) CpuFill32(0, (void*)(VRAM), VRAM_SIZE); SetGpuReg(REG_OFFSET_MOSAIC, 0); - SetGpuReg(REG_OFFSET_WIN0H, 240); - SetGpuReg(REG_OFFSET_WIN0V, 0x5051); + SetGpuReg(REG_OFFSET_WIN0H, DISPLAY_WIDTH); + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(DISPLAY_HEIGHT / 2, DISPLAY_HEIGHT / 2 + 1)); SetGpuReg(REG_OFFSET_WININ, 0); SetGpuReg(REG_OFFSET_WINOUT, 0); - gBattle_WIN0H = 240; + gBattle_WIN0H = DISPLAY_WIDTH; if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gPartnerTrainerId != TRAINER_STEVEN_PARTNER) { - gBattle_WIN0V = 159; - gBattle_WIN1H = 240; + gBattle_WIN0V = DISPLAY_HEIGHT - 1; + gBattle_WIN1H = DISPLAY_WIDTH; gBattle_WIN1V = 32; } else { - gBattle_WIN0V = 0x5051; + gBattle_WIN0V = WIN_RANGE(DISPLAY_HEIGHT / 2, DISPLAY_HEIGHT / 2 + 1); ScanlineEffect_Clear(); i = 0; diff --git a/src/battle_transition.c b/src/battle_transition.c index d47b99c86..ed518eaf8 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -1252,8 +1252,8 @@ static void sub_814669C(struct Task *task) task->tData5 = 0x4000; sTransitionStructPtr->WININ = 63; sTransitionStructPtr->WINOUT = 0; - sTransitionStructPtr->WIN0H = 240; - sTransitionStructPtr->WIN0V = 160; + sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; + sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; sTransitionStructPtr->BLDCNT = 0x3F41; sTransitionStructPtr->BLDALPHA = (task->tData1 << 8) | (task->tData2); @@ -1692,7 +1692,7 @@ static void sub_814713C(struct Sprite *sprite) } else { - if (sprite->pos1.x >= 0 && sprite->pos1.x <= 240) + if (sprite->pos1.x >= 0 && sprite->pos1.x <= DISPLAY_WIDTH) { s16 posX = sprite->pos1.x >> 3; s16 posY = sprite->pos1.y >> 3; @@ -1733,7 +1733,7 @@ static bool8 Phase2_Clockwise_BlackFade_Func1(struct Task *task) sTransitionStructPtr->WININ = 0; sTransitionStructPtr->WINOUT = 63; sTransitionStructPtr->WIN0H = -3855; - sTransitionStructPtr->WIN0V = 160; + sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; for (i = 0; i < 160; i++) { @@ -2001,8 +2001,8 @@ static bool8 Phase2_Wave_Func1(struct Task *task) sTransitionStructPtr->WININ = 63; sTransitionStructPtr->WINOUT = 0; - sTransitionStructPtr->WIN0H = 240; - sTransitionStructPtr->WIN0V = 160; + sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; + sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; for (i = 0; i < 160; i++) { @@ -2113,7 +2113,7 @@ static bool8 Phase2_Mugshot_Func1(struct Task *task) task->tData3 = 239; sTransitionStructPtr->WININ = 63; sTransitionStructPtr->WINOUT = 62; - sTransitionStructPtr->WIN0V = 160; + sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; for (i = 0; i < 160; i++) { @@ -2253,7 +2253,7 @@ static bool8 Phase2_Mugshot_Func6(struct Task *task) DmaStop(0); memset(gScanlineEffectRegBuffers[0], 0, 0x140); memset(gScanlineEffectRegBuffers[1], 0, 0x140); - SetGpuReg(REG_OFFSET_WIN0H, 0xF0); + SetGpuReg(REG_OFFSET_WIN0H, DISPLAY_WIDTH); SetGpuReg(REG_OFFSET_BLDY, 0); task->tState++; task->tData3 = 0; @@ -2384,7 +2384,7 @@ static void Mugshots_CreateOpponentPlayerSprites(struct Task *task) sMugshotsOpponentCoords[mugshotId][0] - 32, sMugshotsOpponentCoords[mugshotId][1] + 42, 0, gDecompressionBuffer); - task->tPlayerSpriteId = CreateTrainerSprite(PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender), 272, 106, 0, gDecompressionBuffer); + task->tPlayerSpriteId = CreateTrainerSprite(PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender), DISPLAY_WIDTH + 32, 106, 0, gDecompressionBuffer); opponentSprite = &gSprites[task->tOpponentSpriteId]; playerSprite = &gSprites[task->tPlayerSpriteId]; @@ -2507,7 +2507,7 @@ static bool8 Phase2_Slice_Func1(struct Task *task) task->tData3 = 1; sTransitionStructPtr->WININ = 63; sTransitionStructPtr->WINOUT = 0; - sTransitionStructPtr->WIN0V = 160; + sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; sTransitionStructPtr->VBlank_DMA = FALSE; for (i = 0; i < 160; i++) @@ -2608,7 +2608,7 @@ static bool8 Phase2_ShredSplit_Func1(struct Task *task) sTransitionStructPtr->WININ = 63; sTransitionStructPtr->WINOUT = 0; - sTransitionStructPtr->WIN0V = 160; + sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; for (i = 0; i < 0xA0; i++) { @@ -2780,8 +2780,8 @@ static bool8 Phase2_Blackhole_Func1(struct Task *task) sTransitionStructPtr->WININ = 0; sTransitionStructPtr->WINOUT = 63; - sTransitionStructPtr->WIN0H = 240; - sTransitionStructPtr->WIN0V = 160; + sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; + sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; for (i = 0; i < 0xA0; i++) { @@ -3208,8 +3208,8 @@ static bool8 Phase2_Rayquaza_Func9(struct Task *task) sTransitionStructPtr->WININ = 0; sTransitionStructPtr->WINOUT = 63; - sTransitionStructPtr->WIN0H = 240; - sTransitionStructPtr->WIN0V = 160; + sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; + sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; for (i = 0; i < 160; i++) { @@ -3259,7 +3259,7 @@ static bool8 Phase2_WhiteFade_Func1(struct Task *task) sTransitionStructPtr->BLDY = 0; sTransitionStructPtr->WININ = 0x1E; sTransitionStructPtr->WINOUT = 0x3F; - sTransitionStructPtr->WIN0V = 0xA0; + sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; for (i = 0; i < 160; i++) { @@ -3470,7 +3470,7 @@ static bool8 Phase2_Shards_Func1(struct Task *task) sTransitionStructPtr->WININ = 0x3F; sTransitionStructPtr->WINOUT = 0; - sTransitionStructPtr->WIN0V = 0xA0; + sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; for (i = 0; i < 160; i++) { diff --git a/src/cable_car.c b/src/cable_car.c index 56118161b..733d10436 100644 --- a/src/cable_car.c +++ b/src/cable_car.c @@ -684,7 +684,7 @@ static void SpriteCB_HikerGoingUp(struct Sprite *sprite) break; } - if (sprite->pos1.y > 160) + if (sprite->pos1.y > DISPLAY_HEIGHT) DestroySprite(sprite); } } diff --git a/src/confetti_util.c b/src/confetti_util.c index 3bda3ab53..bcf19f705 100644 --- a/src/confetti_util.c +++ b/src/confetti_util.c @@ -210,8 +210,8 @@ u8 ConfettiUtil_Remove(u8 id) return 0xFF; memset(&sWork->array[id], 0, sizeof(struct ConfettiUtil)); - sWork->array[id].oam.y = 160; - sWork->array[id].oam.x = 240; + sWork->array[id].oam.y = DISPLAY_HEIGHT; + sWork->array[id].oam.x = DISPLAY_WIDTH; sWork->array[id].dummied = TRUE; memcpy(&gMain.oamBuffer[id + 64], &gDummyOamData, sizeof(struct OamData)); return id; diff --git a/src/contest.c b/src/contest.c index f5326663f..246fc1e50 100644 --- a/src/contest.c +++ b/src/contest.c @@ -1393,7 +1393,7 @@ static void Task_RaiseCurtainAtStart(u8 taskId) break; case 1: *(s16*)&gBattle_BG1_Y += 7; - if ((s16)gBattle_BG1_Y <= 160) + if ((s16)gBattle_BG1_Y <= DISPLAY_HEIGHT) break; gTasks[taskId].data[0]++; break; @@ -1513,8 +1513,8 @@ static void Task_ShowMoveSelectScreen(u8 taskId) u8 i; u8 moveName[32]; - gBattle_BG0_Y = 160; - gBattle_BG2_Y = 160; + gBattle_BG0_Y = DISPLAY_HEIGHT; + gBattle_BG2_Y = DISPLAY_HEIGHT; for (i = 0; i < MAX_MON_MOVES; i++) { @@ -2681,7 +2681,7 @@ static void Task_WaitForOutOfTimeMsg(u8 taskId) { SetBgForCurtainDrop(); gBattle_BG1_X = 0; - gBattle_BG1_Y = 160; + gBattle_BG1_Y = DISPLAY_HEIGHT; PlaySE12WithPanning(SE_CONTEST_CURTAIN_FALL, 0); gTasks[taskId].data[0] = 0; gTasks[taskId].func = Task_DropCurtainAtAppealsEnd; diff --git a/src/contest_util.c b/src/contest_util.c index e5fd51db1..98854c4c6 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -521,8 +521,8 @@ static void CB2_StartShowContestResults(void) gPaletteFade.bufferTransferDisabled = FALSE; sContestResults->data->showResultsTaskId = CreateTask(Task_ShowContestResults, 5); SetMainCallback2(CB2_ShowContestResults); - gBattle_WIN1H = 0x00F0; - gBattle_WIN1V = 0x80A0; + gBattle_WIN1H = WIN_RANGE(0, DISPLAY_WIDTH); + gBattle_WIN1V = WIN_RANGE(128, DISPLAY_HEIGHT); CreateTask(Task_SlideContestResultsBg, 20); CalculateContestantsResultData(); if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_WIRELESS) @@ -679,7 +679,7 @@ static void Task_AnnouncePreliminaryResults(u8 taskId) { CreateTask(Task_FlashStarsAndHearts, 20); x = DrawResultsTextWindow(gText_AnnouncingResults, sContestResults->data->slidingTextBoxSpriteId); - StartTextBoxSlideIn(x, 144, 120, 1088); + StartTextBoxSlideIn(x, DISPLAY_HEIGHT - 16, 120, 1088); gTasks[taskId].tState++; } else if (gTasks[taskId].tState == 1) @@ -702,7 +702,7 @@ static void Task_AnnouncePreliminaryResults(u8 taskId) else if (gTasks[taskId].tState == 3) { x = DrawResultsTextWindow(gText_PreliminaryResults, sContestResults->data->slidingTextBoxSpriteId); - StartTextBoxSlideIn(x, 144, -1, 1088); + StartTextBoxSlideIn(x, DISPLAY_HEIGHT - 16, -1, 1088); gTasks[taskId].tState++; } else if (gTasks[taskId].tState == 4) @@ -752,7 +752,7 @@ static void Task_AnnounceRound2Results(u8 taskId) { gTasks[taskId].tTimer = 0; x = DrawResultsTextWindow(gText_Round2Results, sContestResults->data->slidingTextBoxSpriteId); - StartTextBoxSlideIn(x, 144, -1, 1088); + StartTextBoxSlideIn(x, DISPLAY_HEIGHT - 16, -1, 1088); } } else if (sContestResults->data->slidingTextBoxState == SLIDING_TEXT_ARRIVED) @@ -841,7 +841,7 @@ static void Task_AnnounceWinner(u8 taskId) StringCopy(gStringVar2, gContestMons[i].nickname); StringExpandPlaceholders(winnerTextBuffer, gText_ContestantsMonWon); x = DrawResultsTextWindow(winnerTextBuffer, sContestResults->data->slidingTextBoxSpriteId); - StartTextBoxSlideIn(x, 144, -1, 1088); + StartTextBoxSlideIn(x, DISPLAY_HEIGHT - 16, -1, 1088); gTasks[taskId].tState++; } break; @@ -864,8 +864,8 @@ static void Task_ShowWinnerMonBanner(u8 taskId) switch (gTasks[taskId].tState) { case 0: - gBattle_WIN0H = 0x00F0; - gBattle_WIN0V = 0x5050; + gBattle_WIN0H = WIN_RANGE(0, DISPLAY_WIDTH); + gBattle_WIN0V = WIN_RANGE(DISPLAY_HEIGHT / 2, DISPLAY_HEIGHT / 2); GET_CONTEST_WINNER_ID(i); species = gContestMons[i].species; @@ -892,7 +892,7 @@ static void Task_ShowWinnerMonBanner(u8 taskId) LoadCompressedSpritePalette(pokePal); SetMultiuseSpriteTemplateToPokemon(species, B_POSITION_OPPONENT_LEFT); gMultiuseSpriteTemplate.paletteTag = pokePal->tag; - spriteId = CreateSprite(&gMultiuseSpriteTemplate, 272, 80, 10); + spriteId = CreateSprite(&gMultiuseSpriteTemplate, DISPLAY_WIDTH + 32, 80, 10); gSprites[spriteId].data[1] = species; gSprites[spriteId].oam.priority = 0; gSprites[spriteId].callback = SpriteCB_WinnerMonSlideIn; @@ -912,7 +912,7 @@ static void Task_ShowWinnerMonBanner(u8 taskId) gTasks[taskId].tCounter = 32; counter = gTasks[taskId].tCounter; - gBattle_WIN0V = ((80 - counter) << 8) | (80 + counter); + gBattle_WIN0V = WIN_RANGE(DISPLAY_HEIGHT / 2 - counter, DISPLAY_HEIGHT / 2 + counter); if (counter == 32) gTasks[taskId].tState++; } @@ -934,11 +934,11 @@ static void Task_ShowWinnerMonBanner(u8 taskId) { u8 top = (gBattle_WIN0V >> 8); top += 2; - if (top > 80) - top = 80; + if (top > DISPLAY_HEIGHT / 2) + top = DISPLAY_HEIGHT / 2; - gBattle_WIN0V = (top << 8) | (160 - top); - if (top == 80) + gBattle_WIN0V = WIN_RANGE(top, DISPLAY_HEIGHT - top); + if (top == DISPLAY_HEIGHT / 2) gTasks[taskId].tState++; } break; @@ -1205,7 +1205,7 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId) } RemoveWindow(windowId); - return (240 - (strWidth + 2) * 8) / 2; + return (DISPLAY_WIDTH - (strWidth + 2) * 8) / 2; } static void LoadContestResultSprites(void) @@ -1221,7 +1221,7 @@ static void LoadContestResultSprites(void) LoadSpritePalette(&sUnknown_0858D850); for (i = 0; i < (int)ARRAY_COUNT(sUnknown_0858D810); i++) { - spriteIds[i] = CreateSprite(&template, 272, 144, 10); + spriteIds[i] = CreateSprite(&template, DISPLAY_WIDTH + 32, DISPLAY_HEIGHT - 16, 10); template.tileTag++; } @@ -1248,7 +1248,7 @@ static void LoadContestResultSprites(void) static void StartTextBoxSlideIn(s16 x, u16 y, u16 slideOutTimer, u16 slideIncrement) { struct Sprite *sprite = &gSprites[sContestResults->data->slidingTextBoxSpriteId]; - sprite->pos1.x = 272; + sprite->pos1.x = DISPLAY_WIDTH + 32; sprite->pos1.y = y; sprite->pos2.x = 0; sprite->pos2.y = 0; @@ -1275,8 +1275,8 @@ static void StartTextBoxSlideOut(u16 slideIncrement) static void EndTextBoxSlideOut(struct Sprite *sprite) { - sprite->pos1.x = 272; - sprite->pos1.y = 144; + sprite->pos1.x = DISPLAY_WIDTH + 32; + sprite->pos1.y = DISPLAY_HEIGHT - 16; sprite->pos2.y = 0; sprite->pos2.x = 0; sprite->callback = SpriteCallbackDummy; @@ -1353,8 +1353,8 @@ static void ShowLinkResultsTextBox(const u8 *text) gSprites[sprite->data[i]].invisible = FALSE; } - gBattle_WIN0H = 0x00F0; - gBattle_WIN0V = ((sprite->pos1.y - 16) << 8) | (sprite->pos1.y + 16); + gBattle_WIN0H = WIN_RANGE(0, DISPLAY_WIDTH); + gBattle_WIN0V = WIN_RANGE(sprite->pos1.y - 16, sprite->pos1.y + 16); SetGpuReg(REG_OFFSET_WININ, WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR | WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR); } @@ -1600,7 +1600,7 @@ static void Task_CreateConfetti(u8 taskId) gTasks[taskId].data[0] = 0; if (sContestResults->data->confettiCount < 40) { - u8 spriteId = CreateSprite(&sSpriteTemplate_Confetti, (Random() % 240) - 20, 44, 5); + u8 spriteId = CreateSprite(&sSpriteTemplate_Confetti, (Random() % DISPLAY_WIDTH) - 20, 44, 5); gSprites[spriteId].data[0] = Random() % 512; gSprites[spriteId].data[1] = (Random() % 24) + 16; gSprites[spriteId].data[2] = (Random() % 256) + 48; diff --git a/src/evolution_graphics.c b/src/evolution_graphics.c index a66a7a28d..2a3aaa9e8 100644 --- a/src/evolution_graphics.c +++ b/src/evolution_graphics.c @@ -55,7 +55,7 @@ static const struct SpritePalette sEvoSparkleSpritePals[] = static const struct OamData sOamData_EvoSparkle = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 63043885d..90f867410 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -1537,8 +1537,8 @@ void Ash_InitAll(void) void Ash_Main(void) { gWeatherPtr->ashBaseSpritesX = gSpriteCoordOffsetX & 0x1FF; - while (gWeatherPtr->ashBaseSpritesX >= 240) - gWeatherPtr->ashBaseSpritesX -= 240; + while (gWeatherPtr->ashBaseSpritesX >= DISPLAY_WIDTH) + gWeatherPtr->ashBaseSpritesX -= DISPLAY_WIDTH; switch (gWeatherPtr->initStep) { diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 037acd09c..3eb8d3f0a 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -1398,7 +1398,7 @@ static bool8 CreateHofConfettiSprite(void) u8 spriteID; struct Sprite* sprite; - s16 posX = Random() % 240; + s16 posX = Random() % DISPLAY_WIDTH; s16 posY = -(Random() % 8); spriteID = CreateSprite(&sSpriteTemplate_HofConfetti, posX, posY, 0); @@ -1505,7 +1505,7 @@ static void Task_DoDomeConfetti(u8 taskId) id = ConfettiUtil_AddNew(&sOamData_Confetti, TAG_CONFETTI, TAG_CONFETTI, - Random() % 240, + Random() % DISPLAY_WIDTH, -(Random() % 8), Random() % ARRAY_COUNT(sAnims_Confetti), id); diff --git a/src/list_menu.c b/src/list_menu.c index 79ea1fde0..9ac9b87ab 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -679,7 +679,7 @@ static u8 ListMenuAddCursorObject(struct ListMenu *list, u32 cursorKind) struct CursorStruct cursor; cursor.left = 0; - cursor.top = 160; + cursor.top = DISPLAY_HEIGHT; cursor.rowWidth = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8 + 2; cursor.rowHeight = GetFontAttribute(list->template.fontId, FONTATTR_MAX_LETTER_HEIGHT) + 2; cursor.tileTag = 0x4000; diff --git a/src/main_menu.c b/src/main_menu.c index d2ec55d3e..38859b860 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -896,8 +896,8 @@ static bool8 HandleMainMenuInput(u8 taskId) { PlaySE(SE_SELECT); BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA); - SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(0, 240)); - SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(0, 160)); + SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(0, DISPLAY_WIDTH)); + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(0, DISPLAY_HEIGHT)); gTasks[taskId].func = Task_HandleMainMenuBPressed; } else if ((JOY_NEW(DPAD_UP)) && tCurrItem > 0) @@ -1547,7 +1547,7 @@ static void Task_NewGameBirchSpeech_SlideOutOldGenderSprite(u8 taskId) spriteId = gTasks[taskId].tMaySpriteId; else spriteId = gTasks[taskId].tBrendanSpriteId; - gSprites[spriteId].pos1.x = 240; + gSprites[spriteId].pos1.x = DISPLAY_WIDTH; gSprites[spriteId].pos1.y = 60; gSprites[spriteId].invisible = FALSE; gTasks[taskId].tPlayerSpriteId = spriteId; @@ -2129,8 +2129,8 @@ static void CreateMainMenuErrorWindow(const u8* str) PutWindowTilemap(7); CopyWindowToVram(7, 2); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[7], MAIN_MENU_BORDER_TILE); - SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(9, 231)); - SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(113, 159)); + SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(9, DISPLAY_WIDTH - 9)); + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(113, DISPLAY_HEIGHT - 1)); } static void MainMenu_FormatSavegameText(void) diff --git a/src/mevent_801BAAC.c b/src/mevent_801BAAC.c index 2afb9ea70..a64f65e03 100644 --- a/src/mevent_801BAAC.c +++ b/src/mevent_801BAAC.c @@ -584,8 +584,8 @@ s32 FadeToWonderNewsMenu(void) ChangeBgY(1, 0, 0); ChangeBgY(2, 0, 0); ChangeBgY(3, 0, 0); - SetGpuReg(REG_OFFSET_WIN0H, 0xF0); - SetGpuReg(REG_OFFSET_WIN0V, 0x1A98); + SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(0, DISPLAY_WIDTH)); + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(26, 152)); SetGpuReg(REG_OFFSET_WININ, 0x1F); SetGpuReg(REG_OFFSET_WINOUT, 0x1B); SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); diff --git a/src/naming_screen.c b/src/naming_screen.c index b594fe106..3c8478e04 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -475,7 +475,7 @@ static void NamingScreen_Init(void) sNamingScreen->bgToHide = 1; sNamingScreen->template = sNamingScreenTemplates[sNamingScreen->templateNum]; sNamingScreen->currentPage = sNamingScreen->template->initialPage; - sNamingScreen->inputCharBaseXPos = (240 - sNamingScreen->template->maxChars * 8) / 2 + 6; + sNamingScreen->inputCharBaseXPos = (DISPLAY_WIDTH - sNamingScreen->template->maxChars * 8) / 2 + 6; if (sNamingScreen->templateNum == NAMING_SCREEN_WALDA) sNamingScreen->inputCharBaseXPos += 11; sNamingScreen->keyRepeatStartDelayCopy = gKeyRepeatStartDelay; diff --git a/src/option_menu.c b/src/option_menu.c index 936aff923..ec66e827a 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -381,7 +381,7 @@ static void Task_OptionMenuFadeOut(u8 taskId) static void HighlightOptionMenuItem(u8 index) { - SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(16, 224)); + SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(16, DISPLAY_WIDTH - 16)); SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(index * 16 + 40, index * 16 + 56)); } diff --git a/src/pokedex.c b/src/pokedex.c index 2d371f937..9386a8b33 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -305,7 +305,7 @@ static void ClearSearchParameterBoxText(void); static const struct OamData sOamData_ScrollBar = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, @@ -322,7 +322,7 @@ static const struct OamData sOamData_ScrollBar = static const struct OamData sOamData_ScrollArrow = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, @@ -339,7 +339,7 @@ static const struct OamData sOamData_ScrollArrow = static const struct OamData sOamData_InterfaceText = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, @@ -356,7 +356,7 @@ static const struct OamData sOamData_InterfaceText = static const struct OamData sOamData_RotatingPokeBall = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_WINDOW, .mosaic = 0, @@ -373,7 +373,7 @@ static const struct OamData sOamData_RotatingPokeBall = static const struct OamData sOamData_SeenOwnText = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, @@ -390,7 +390,7 @@ static const struct OamData sOamData_SeenOwnText = static const struct OamData sOamData_Dex8x16 = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, @@ -2768,7 +2768,7 @@ static void CreateInterfaceSprites(u8 page) // Scroll arrows spriteId = CreateSprite(&sScrollArrowSpriteTemplate, 184, 4, 0); gSprites[spriteId].sIsDownArrow = FALSE; - spriteId = CreateSprite(&sScrollArrowSpriteTemplate, 184, 156, 0); + spriteId = CreateSprite(&sScrollArrowSpriteTemplate, 184, DISPLAY_HEIGHT - 4, 0); gSprites[spriteId].sIsDownArrow = TRUE; gSprites[spriteId].vFlip = TRUE; @@ -2779,20 +2779,20 @@ static void CreateInterfaceSprites(u8 page) spriteId = CreateSprite(&sInterfaceTextSpriteTemplate, 48, 120, 0); StartSpriteAnim(&gSprites[spriteId], 3); // Select button - spriteId = CreateSprite(&sInterfaceTextSpriteTemplate, 16, 144, 0); + spriteId = CreateSprite(&sInterfaceTextSpriteTemplate, 16, DISPLAY_HEIGHT - 16, 0); StartSpriteAnim(&gSprites[spriteId], 2); gSprites[spriteId].data[2] = 0x80; // Search text - spriteId = CreateSprite(&sInterfaceTextSpriteTemplate, 48, 144, 0); + spriteId = CreateSprite(&sInterfaceTextSpriteTemplate, 48, DISPLAY_HEIGHT - 16, 0); StartSpriteAnim(&gSprites[spriteId], 1); - spriteId = CreateSprite(&sRotatingPokeBallSpriteTemplate, 0, 80, 2); + spriteId = CreateSprite(&sRotatingPokeBallSpriteTemplate, 0, DISPLAY_HEIGHT / 2, 2); gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteId].oam.matrixNum = 30; gSprites[spriteId].data[0] = 30; gSprites[spriteId].data[1] = 0; - spriteId = CreateSprite(&sRotatingPokeBallSpriteTemplate, 0, 80, 2); + spriteId = CreateSprite(&sRotatingPokeBallSpriteTemplate, 0, DISPLAY_HEIGHT / 2, 2); gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteId].oam.matrixNum = 31; gSprites[spriteId].data[0] = 31; diff --git a/src/pokedex_cry_screen.c b/src/pokedex_cry_screen.c index 0a6f639ae..447ce7515 100644 --- a/src/pokedex_cry_screen.c +++ b/src/pokedex_cry_screen.c @@ -188,7 +188,7 @@ static const union AnimCmd *const sSpriteAnimTable_CryMeterNeedle[] = static const struct OamData sOamData_CryMeterNeedle = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, .bpp = ST_OAM_4BPP, diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 0a35aa323..d3ec36c9e 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -4836,7 +4836,7 @@ static void CreatePartyMonsSprites(bool8 arg0) { for (i = 0; i < count; i++) { - sPSSData->partySprites[i]->pos1.y -= 160; + sPSSData->partySprites[i]->pos1.y -= DISPLAY_HEIGHT; sPSSData->partySprites[i]->invisible = TRUE; } } diff --git a/src/pokenav_menu_handler_2.c b/src/pokenav_menu_handler_2.c index eea8131a9..2ba83b23c 100644 --- a/src/pokenav_menu_handler_2.c +++ b/src/pokenav_menu_handler_2.c @@ -1223,7 +1223,7 @@ static void SetupPokenavMenuScanlineEffects(void) SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); SetGpuRegBits(REG_OFFSET_WININ, 0x3F); SetGpuRegBits(REG_OFFSET_WINOUT, 0x1F); - SetGpuRegBits(REG_OFFSET_WIN0V, 0xA0); + SetGpuRegBits(REG_OFFSET_WIN0V, DISPLAY_HEIGHT); ScanlineEffect_Stop(); SetMenuOptionGlow(); ScanlineEffect_SetParams(sPokenavMainMenuScanlineEffectParams); diff --git a/src/rayquaza_scene.c b/src/rayquaza_scene.c index 101916f13..24e76e1c9 100644 --- a/src/rayquaza_scene.c +++ b/src/rayquaza_scene.c @@ -1860,7 +1860,7 @@ static void SpriteCB_DuoFight_Groudon(struct Sprite *sprite) static void DuoFight_SlideGroudonDown(struct Sprite *sprite) { s16 *data = sprite->data; - if (sprite->pos1.y <= 160) + if (sprite->pos1.y <= DISPLAY_HEIGHT) { sprite->pos1.y += 8; gSprites[sprite->sGroudonBodySpriteId].pos1.y += 8; @@ -1965,7 +1965,7 @@ static void SpriteCB_DuoFight_Kyogre(struct Sprite *sprite) static void DuoFight_SlideKyogreDown(struct Sprite *sprite) { s16 *data = sprite->data; - if (sprite->pos1.y <= 160) + if (sprite->pos1.y <= DISPLAY_HEIGHT) { sprite->pos1.y += 8; gSprites[sprite->data[0] >> 8].pos1.y += 8; diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 529bb75e7..8f727310c 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -47,7 +47,7 @@ static EWRAM_DATA u8 sUnused2[4] = {0}; static const struct OamData sClockOamData = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, diff --git a/src/starter_choose.c b/src/starter_choose.c index 4b582f839..92cb2d48c 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -157,7 +157,7 @@ static const u8 sTextColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_ static const struct OamData sOam_Hand = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, @@ -174,7 +174,7 @@ static const struct OamData sOam_Hand = static const struct OamData sOam_Pokeball = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, @@ -191,7 +191,7 @@ static const struct OamData sOam_Pokeball = static const struct OamData sOam_StarterCircle = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, diff --git a/src/title_screen.c b/src/title_screen.c index f2c609fec..9752cc611 100644 --- a/src/title_screen.c +++ b/src/title_screen.c @@ -105,7 +105,7 @@ const u16 gTitleScreenAlphaBlend[64] = static const struct OamData sVersionBannerLeftOamData = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, @@ -122,7 +122,7 @@ static const struct OamData sVersionBannerLeftOamData = static const struct OamData sVersionBannerRightOamData = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, @@ -193,7 +193,7 @@ static const struct CompressedSpriteSheet sSpriteSheet_EmeraldVersion[] = static const struct OamData sOamData_CopyrightBanner = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, @@ -305,7 +305,7 @@ static const struct SpritePalette sSpritePalette_PressStart[] = static const struct OamData sPokemonLogoShineOamData = { - .y = 160, + .y = DISPLAY_HEIGHT, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, .mosaic = 0, @@ -430,7 +430,7 @@ static void CreateCopyrightBanner(s16 x, s16 y) static void SpriteCB_PokemonLogoShine(struct Sprite *sprite) { - if (sprite->pos1.x < 272) + if (sprite->pos1.x < DISPLAY_WIDTH + 32) { if (sprite->data[0]) // Flash background { @@ -473,7 +473,7 @@ static void SpriteCB_PokemonLogoShine(struct Sprite *sprite) static void SpriteCB_PokemonLogoShine2(struct Sprite *sprite) { - if (sprite->pos1.x < 272) + if (sprite->pos1.x < DISPLAY_WIDTH + 32) sprite->pos1.x += 8; else DestroySprite(sprite); diff --git a/src/trade.c b/src/trade.c index f423b20af..cb3db3c18 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1318,8 +1318,8 @@ static void TradeMenuMoveCursor(u8 *cursorPosition, u8 direction) if (newPosition == (PARTY_SIZE * 2)) // CANCEL { StartSpriteAnim(&gSprites[sTradeMenuData->cursorSpriteIdx], 1); - gSprites[sTradeMenuData->cursorSpriteIdx].pos1.x = 224; - gSprites[sTradeMenuData->cursorSpriteIdx].pos1.y = 160; + gSprites[sTradeMenuData->cursorSpriteIdx].pos1.x = DISPLAY_WIDTH - 16; + gSprites[sTradeMenuData->cursorSpriteIdx].pos1.y = DISPLAY_HEIGHT; } else { @@ -3496,7 +3496,8 @@ static bool8 AnimateTradeSequenceCable(void) case 38: gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].pos2.y -= 3; gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PARTNER]].pos2.y += 3; - if (gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].pos2.y < -160 && gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].pos2.y >= -163) + if (gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].pos2.y < -DISPLAY_HEIGHT + && gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].pos2.y >= -DISPLAY_HEIGHT - 3) { PlaySE(SE_WARP_IN); } @@ -3994,7 +3995,8 @@ static bool8 AnimateTradeSequenceWireless(void) case 38: gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].pos2.y -= 3; gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PARTNER]].pos2.y += 3; - if (gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].pos2.y < -160 && gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].pos2.y >= -163) + if (gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].pos2.y < -DISPLAY_HEIGHT + && gSprites[sTradeData->pokePicSpriteIdxs[TRADE_PLAYER]].pos2.y >= -DISPLAY_HEIGHT - 3) { PlaySE(SE_WARP_IN); } @@ -4833,7 +4835,7 @@ static void c3_0805465C(u8 taskId) { sTradeData->wirelessWinLeft = sTradeData->wirelessWinRight = 120; sTradeData->wirelessWinTop = 0; - sTradeData->wirelessWinBottom = 160; + sTradeData->wirelessWinBottom = DISPLAY_HEIGHT; SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_OBJ); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG0 | diff --git a/src/union_room_chat.c b/src/union_room_chat.c index 3733abe1e..fb875bbb4 100755 --- a/src/union_room_chat.c +++ b/src/union_room_chat.c @@ -3011,8 +3011,8 @@ static void ResetGpuBgState(void) SetGpuReg(REG_OFFSET_BLDCNT, 0); ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_WIN1_ON | DISPCNT_OBJWIN_ON); SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); - SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(64, 240)); - SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(0, 144)); + SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(64, DISPLAY_WIDTH)); + SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(0, DISPLAY_HEIGHT - 16)); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG0 | WININ_WIN0_BG2 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); diff --git a/src/wallclock.c b/src/wallclock.c index 4d1c1fd8f..70888ac5f 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -147,7 +147,7 @@ static const struct SpritePalette sSpritePalettes_Clock[] = static const struct OamData sOam_ClockHand = { - .y = 160, + .y = DISPLAY_HEIGHT, .shape = SPRITE_SHAPE(64x64), .size = SPRITE_SIZE(64x64), .priority = 1, @@ -199,7 +199,7 @@ static const struct SpriteTemplate sSpriteTemplate_HourHand = static const struct OamData sOam_PeriodIndicator = { - .y = 160, + .y = DISPLAY_HEIGHT, .shape = SPRITE_SHAPE(16x16), .size = SPRITE_SIZE(16x16), .priority = 3, From 8368b753dfb2ca77d90ec0cc32e62410961d6ed6 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 15 Apr 2021 02:43:09 -0400 Subject: [PATCH 40/63] More usage of WININ/OUT constants --- src/battle_anim_effects_2.c | 4 ++-- src/battle_bg.c | 4 ++-- src/field_weather_effect.c | 2 +- src/mevent_801BAAC.c | 4 ++-- src/option_menu.c | 4 ++-- src/pokedex.c | 4 ++-- src/pokenav_menu_handler_2.c | 4 ++-- src/title_screen.c | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 58e2bae9f..92bca01f2 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -3076,8 +3076,8 @@ void AnimTask_FakeOut(u8 taskId) gBattle_WIN0V = DISPLAY_HEIGHT; SetGpuReg(REG_OFFSET_WIN0H, gBattle_WIN0H); SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); - SetGpuReg(REG_OFFSET_WININ, 0x3F1F); - SetGpuReg(REG_OFFSET_WINOUT, 0x3F3F); + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN1_ALL); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_ALL | WINOUT_WINOBJ_ALL); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_DARKEN); SetGpuReg(REG_OFFSET_BLDY, 0x10); gTasks[taskId].data[0] = win0v; diff --git a/src/battle_bg.c b/src/battle_bg.c index 571080aea..ae5d27779 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -1134,8 +1134,8 @@ void DrawBattleEntryBackground(void) CopyToBgTilemapBuffer(2, gUnknown_08D779D8, 0, 0); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); - SetGpuReg(REG_OFFSET_WININ, 0x36); - SetGpuReg(REG_OFFSET_WINOUT, 0x36); + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_OBJ | WININ_WIN0_CLR); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); gBattle_BG1_Y = 0xFF5C; gBattle_BG2_Y = 0xFF5C; LoadCompressedSpriteSheetUsingHeap(&sVsLettersSpriteSheet); diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 90f867410..0d1e6958c 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -306,7 +306,7 @@ static void UpdateDroughtBlend(u8 taskId) task->tBlendY = 0; task->tBlendDelay = 0; task->tWinRange = REG_WININ; - SetGpuReg(REG_OFFSET_WININ, WIN_RANGE(63, 63)); + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_ALL | WININ_WIN1_ALL); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_TGT1_BG2 | BLDCNT_TGT1_BG3 | BLDCNT_TGT1_OBJ | BLDCNT_EFFECT_LIGHTEN); SetGpuReg(REG_OFFSET_BLDY, 0); task->tState++; diff --git a/src/mevent_801BAAC.c b/src/mevent_801BAAC.c index a64f65e03..a3e6ee0b6 100644 --- a/src/mevent_801BAAC.c +++ b/src/mevent_801BAAC.c @@ -586,8 +586,8 @@ s32 FadeToWonderNewsMenu(void) ChangeBgY(3, 0, 0); SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(0, DISPLAY_WIDTH)); SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(26, 152)); - SetGpuReg(REG_OFFSET_WININ, 0x1F); - SetGpuReg(REG_OFFSET_WINOUT, 0x1B); + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ); SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); break; case 2: diff --git a/src/option_menu.c b/src/option_menu.c index ec66e827a..a210c9502 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -185,8 +185,8 @@ void CB2_InitOptionMenu(void) DeactivateAllTextPrinters(); SetGpuReg(REG_OFFSET_WIN0H, 0); SetGpuReg(REG_OFFSET_WIN0V, 0); - SetGpuReg(REG_OFFSET_WININ, 1); - SetGpuReg(REG_OFFSET_WINOUT, 35); + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG0); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 | WINOUT_WIN01_CLR); SetGpuReg(REG_OFFSET_BLDCNT, 193); SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDY, 4); diff --git a/src/pokedex.c b/src/pokedex.c index 9386a8b33..c7c892d53 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2109,8 +2109,8 @@ static bool8 LoadPokedexListPage(u8 page) gMain.state++; break; case 5: - SetGpuReg(REG_OFFSET_WININ, 0x3F3F); - SetGpuReg(REG_OFFSET_WINOUT, 0x1D3F); + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_ALL | WININ_WIN1_ALL); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_ALL | WINOUT_WINOBJ_BG0 | WINOUT_WINOBJ_BG2 | WINOUT_WINOBJ_BG3 | WINOUT_WINOBJ_OBJ); SetGpuReg(REG_OFFSET_WIN0H, 0); SetGpuReg(REG_OFFSET_WIN0V, 0); SetGpuReg(REG_OFFSET_WIN1H, 0); diff --git a/src/pokenav_menu_handler_2.c b/src/pokenav_menu_handler_2.c index 2ba83b23c..8cd2a6b2f 100644 --- a/src/pokenav_menu_handler_2.c +++ b/src/pokenav_menu_handler_2.c @@ -1221,8 +1221,8 @@ static void SetupPokenavMenuScanlineEffects(void) SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_OBJ | BLDCNT_EFFECT_LIGHTEN); SetGpuReg(REG_OFFSET_BLDY, 0); SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON); - SetGpuRegBits(REG_OFFSET_WININ, 0x3F); - SetGpuRegBits(REG_OFFSET_WINOUT, 0x1F); + SetGpuRegBits(REG_OFFSET_WININ, WININ_WIN0_ALL); + SetGpuRegBits(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ); SetGpuRegBits(REG_OFFSET_WIN0V, DISPLAY_HEIGHT); ScanlineEffect_Stop(); SetMenuOptionGlow(); diff --git a/src/title_screen.c b/src/title_screen.c index 9752cc611..21d10495c 100644 --- a/src/title_screen.c +++ b/src/title_screen.c @@ -596,8 +596,8 @@ void CB2_InitTitleScreen(void) SetGpuReg(REG_OFFSET_WIN0V, 0); SetGpuReg(REG_OFFSET_WIN1H, 0); SetGpuReg(REG_OFFSET_WIN1V, 0); - SetGpuReg(REG_OFFSET_WININ, 0x1F1F); - SetGpuReg(REG_OFFSET_WINOUT, 0x3F1F); + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WINOBJ_ALL); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_LIGHTEN); SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDY, 0xC); From f94540c2b875cff0085149b95728d2f0a0c610eb Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 15 Apr 2021 03:00:01 -0400 Subject: [PATCH 41/63] Misc reg constant cleanup --- src/battle_anim_effects_2.c | 2 +- src/battle_anim_ghost.c | 2 +- src/battle_main.c | 2 +- src/battle_transition.c | 48 ++++++++++++++++++------------------- src/berry_blender.c | 4 ++-- src/diploma.c | 34 +++++++++++++------------- src/evolution_scene.c | 2 +- src/option_menu.c | 2 +- src/title_screen.c | 2 +- 9 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 92bca01f2..5dd584386 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -3079,7 +3079,7 @@ void AnimTask_FakeOut(u8 taskId) SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN1_ALL); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_ALL | WINOUT_WINOBJ_ALL); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_DARKEN); - SetGpuReg(REG_OFFSET_BLDY, 0x10); + SetGpuReg(REG_OFFSET_BLDY, 16); gTasks[taskId].data[0] = win0v; gTasks[taskId].data[1] = win0h; gTasks[taskId].func = AnimTask_FakeOut_Step1; diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index b52932b46..e7cd4b253 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -950,7 +950,7 @@ void AnimTask_CurseStretchingBlackBg(u8 taskId) SetGpuReg(REG_OFFSET_WINOUT, ((WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ) | (WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR))); SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_DARKEN)); - SetGpuReg(REG_OFFSET_BLDY, 0x10); + SetGpuReg(REG_OFFSET_BLDY, 16); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER || IsContest()) startX = 40; diff --git a/src/battle_main.c b/src/battle_main.c index 323053bdf..741461b0b 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -2047,7 +2047,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir void sub_8038A04(void) // unused { if (REG_VCOUNT < 0xA0 && REG_VCOUNT >= 0x6F) - SetGpuReg(REG_OFFSET_BG0CNT, 0x9800); + SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_SCREENBASE(24) | BGCNT_TXT256x512); } void VBlankCB_Battle(void) diff --git a/src/battle_transition.c b/src/battle_transition.c index ed518eaf8..1b484f7c5 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -1250,12 +1250,12 @@ static void sub_814669C(struct Task *task) task->tData2 = 0; task->tData4 = 0; task->tData5 = 0x4000; - sTransitionStructPtr->WININ = 63; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; sTransitionStructPtr->WINOUT = 0; sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; - sTransitionStructPtr->BLDCNT = 0x3F41; - sTransitionStructPtr->BLDALPHA = (task->tData1 << 8) | (task->tData2); + sTransitionStructPtr->BLDCNT = BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL; + sTransitionStructPtr->BLDALPHA = BLDALPHA_BLEND(task->tData2, task->tData1); for (i = 0; i < 160; i++) { @@ -1480,7 +1480,7 @@ static bool8 Phase2_BigPokeball_Func3(struct Task *task) task->tData2++; task->tData3 = 2; } - sTransitionStructPtr->BLDALPHA = (task->tData1 << 8) | task->tData2; + sTransitionStructPtr->BLDALPHA = BLDALPHA_BLEND(task->tData2, task->tData1); if (task->tData2 > 15) task->tState++; task->tData4 += 8; @@ -1500,7 +1500,7 @@ static bool8 Phase2_BigPokeball_Func4(struct Task *task) task->tData1--; task->tData3 = 2; } - sTransitionStructPtr->BLDALPHA = (task->tData1 << 8) | task->tData2; + sTransitionStructPtr->BLDALPHA = BLDALPHA_BLEND(task->tData2, task->tData1); if (task->tData1 == 0) task->tState++; task->tData4 += 8; @@ -1731,7 +1731,7 @@ static bool8 Phase2_Clockwise_BlackFade_Func1(struct Task *task) ScanlineEffect_Clear(); sTransitionStructPtr->WININ = 0; - sTransitionStructPtr->WINOUT = 63; + sTransitionStructPtr->WINOUT = WINOUT_WIN01_ALL; sTransitionStructPtr->WIN0H = -3855; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; @@ -1999,7 +1999,7 @@ static bool8 Phase2_Wave_Func1(struct Task *task) InitTransitionStructVars(); ScanlineEffect_Clear(); - sTransitionStructPtr->WININ = 63; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; sTransitionStructPtr->WINOUT = 0; sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; @@ -2111,8 +2111,8 @@ static bool8 Phase2_Mugshot_Func1(struct Task *task) task->tData1 = 0; task->tData2 = 1; task->tData3 = 239; - sTransitionStructPtr->WININ = 63; - sTransitionStructPtr->WINOUT = 62; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; + sTransitionStructPtr->WINOUT = WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; for (i = 0; i < 160; i++) @@ -2258,7 +2258,7 @@ static bool8 Phase2_Mugshot_Func6(struct Task *task) task->tState++; task->tData3 = 0; task->tData4 = 0; - sTransitionStructPtr->BLDCNT = 0xBF; + sTransitionStructPtr->BLDCNT = BLDCNT_TGT1_ALL | BLDCNT_EFFECT_LIGHTEN; SetVBlankCallback(VBlankCB1_Phase2_Mugshots); } return FALSE; @@ -2505,7 +2505,7 @@ static bool8 Phase2_Slice_Func1(struct Task *task) task->tData2 = 256; task->tData3 = 1; - sTransitionStructPtr->WININ = 63; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; sTransitionStructPtr->WINOUT = 0; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; sTransitionStructPtr->VBlank_DMA = FALSE; @@ -2606,7 +2606,7 @@ static bool8 Phase2_ShredSplit_Func1(struct Task *task) InitTransitionStructVars(); ScanlineEffect_Clear(); - sTransitionStructPtr->WININ = 63; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; sTransitionStructPtr->WINOUT = 0; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; @@ -2779,7 +2779,7 @@ static bool8 Phase2_Blackhole_Func1(struct Task *task) ScanlineEffect_Clear(); sTransitionStructPtr->WININ = 0; - sTransitionStructPtr->WINOUT = 63; + sTransitionStructPtr->WINOUT = WINOUT_WIN01_ALL; sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; @@ -3116,7 +3116,7 @@ static bool8 Phase2_Rayquaza_Func3(struct Task *task) InitTransitionStructVars(); ScanlineEffect_Clear(); - SetGpuReg(REG_OFFSET_BG0CNT, 0x9A08); + SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(26) | BGCNT_TXT256x512); GetBg0TilesDst(&tilemap, &tileset); CpuFill16(0, tilemap, 0x800); CpuCopy16(sRayquaza_Tileset, tileset, 0x2000); @@ -3207,7 +3207,7 @@ static bool8 Phase2_Rayquaza_Func9(struct Task *task) u16 i; sTransitionStructPtr->WININ = 0; - sTransitionStructPtr->WINOUT = 63; + sTransitionStructPtr->WINOUT = WINOUT_WIN01_ALL; sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; @@ -3255,10 +3255,10 @@ static bool8 Phase2_WhiteFade_Func1(struct Task *task) InitTransitionStructVars(); ScanlineEffect_Clear(); - sTransitionStructPtr->BLDCNT = 0xBF; + sTransitionStructPtr->BLDCNT = BLDCNT_TGT1_ALL | BLDCNT_EFFECT_LIGHTEN; sTransitionStructPtr->BLDY = 0; - sTransitionStructPtr->WININ = 0x1E; - sTransitionStructPtr->WINOUT = 0x3F; + sTransitionStructPtr->WININ = WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_BG3 | WININ_WIN0_OBJ; + sTransitionStructPtr->WINOUT = WINOUT_WIN01_ALL; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; for (i = 0; i < 160; i++) @@ -3314,10 +3314,10 @@ static bool8 Phase2_WhiteFade_Func4(struct Task *task) SetVBlankCallback(0); SetHBlankCallback(0); - sTransitionStructPtr->WIN0H = 0xF0; + sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; sTransitionStructPtr->BLDY = 0; sTransitionStructPtr->BLDCNT = 0xFF; - sTransitionStructPtr->WININ = 0x3F; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; SetVBlankCallback(VBlankCB1_Phase2_WhiteFade); @@ -3468,7 +3468,7 @@ static bool8 Phase2_Shards_Func1(struct Task *task) InitTransitionStructVars(); ScanlineEffect_Clear(); - sTransitionStructPtr->WININ = 0x3F; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; sTransitionStructPtr->WINOUT = 0; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; @@ -3895,8 +3895,8 @@ static bool8 Phase2_FrontierLogoWave_Func1(struct Task *task) task->tData5 = 0; task->tData6 = 16; task->tData7 = 2560; - sTransitionStructPtr->BLDCNT = 0x3F41; - sTransitionStructPtr->BLDALPHA = (task->tData6 << 8) | (task->tData5); + sTransitionStructPtr->BLDCNT = BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL; + sTransitionStructPtr->BLDALPHA = BLDALPHA_BLEND(task->tData5, task->tData6); REG_BLDCNT = sTransitionStructPtr->BLDCNT; REG_BLDALPHA = sTransitionStructPtr->BLDALPHA; GetBg0TilesDst(&tilemap, &tileset); @@ -3965,7 +3965,7 @@ static bool8 Phase2_FrontierLogoWave_Func4(struct Task *task) else if (task->tData6 > 0) task->tData6--; - sTransitionStructPtr->BLDALPHA = (task->tData6 << 8) | (task->tData5); + sTransitionStructPtr->BLDALPHA = BLDALPHA_BLEND(task->tData5, task->tData6); } for (i = 0; i < 160; i++, var6 += var8) diff --git a/src/berry_blender.c b/src/berry_blender.c index 39e1dca08..d47aa707d 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1426,7 +1426,7 @@ static void CB2_StartBlenderLink(void) sBerryBlender->centerScale += 4; if (sBerryBlender->centerScale > 255) { - SetGpuRegBits(REG_OFFSET_BG2CNT, 2); + SetGpuRegBits(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2)); sBerryBlender->mainState++; sBerryBlender->centerScale = 256; sBerryBlender->arrowPos = sArrowStartPos[sArrowStartPosIds[sBerryBlender->numPlayers - 2]]; @@ -1726,7 +1726,7 @@ static void CB2_StartBlenderLocal(void) sBerryBlender->mainState++; sBerryBlender->centerScale = 256; sBerryBlender->arrowPos = sArrowStartPos[sArrowStartPosIds[sBerryBlender->numPlayers - 2]]; - SetGpuRegBits(REG_OFFSET_BG2CNT, 2); + SetGpuRegBits(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2)); sBerryBlender->framesToWait = 0; PlaySE(SE_TRUCK_DOOR); PrintPlayerNames(); diff --git a/src/diploma.c b/src/diploma.c index 8652430e7..dca0912e3 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -51,18 +51,18 @@ void CB2_ShowDiploma(void) { SetVBlankCallback(NULL); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG3CNT, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG2CNT, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG1CNT, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG0CNT, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG3HOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG3VOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG2HOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG2VOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG1HOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG1VOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG0HOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG0VOFS, DISPCNT_MODE_0); + SetGpuReg(REG_OFFSET_BG3CNT, 0); + SetGpuReg(REG_OFFSET_BG2CNT, 0); + SetGpuReg(REG_OFFSET_BG1CNT, 0); + SetGpuReg(REG_OFFSET_BG0CNT, 0); + SetGpuReg(REG_OFFSET_BG3HOFS, 0); + SetGpuReg(REG_OFFSET_BG3VOFS, 0); + SetGpuReg(REG_OFFSET_BG2HOFS, 0); + SetGpuReg(REG_OFFSET_BG2VOFS, 0); + SetGpuReg(REG_OFFSET_BG1HOFS, 0); + SetGpuReg(REG_OFFSET_BG1VOFS, 0); + SetGpuReg(REG_OFFSET_BG0HOFS, 0); + SetGpuReg(REG_OFFSET_BG0VOFS, 0); // why doesn't this one use the dma manager either? DmaFill16(3, 0, VRAM, VRAM_SIZE); DmaFill32(3, 0, OAM, OAM_SIZE); @@ -129,12 +129,12 @@ static void DisplayDiplomaText(void) { if (HasAllMons()) { - SetGpuReg(REG_OFFSET_BG1HOFS, DISPCNT_BG0_ON); + SetGpuReg(REG_OFFSET_BG1HOFS, DISPLAY_WIDTH + 16); StringCopy(gStringVar1, gText_DexNational); } else { - SetGpuReg(REG_OFFSET_BG1HOFS, DISPCNT_MODE_0); + SetGpuReg(REG_OFFSET_BG1HOFS, 0); StringCopy(gStringVar1, gText_DexHoenn); } StringExpandPlaceholders(gStringVar4, gText_PokedexDiploma); @@ -173,9 +173,9 @@ static void InitDiplomaBg(void) SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); ShowBg(0); ShowBg(1); - SetGpuReg(REG_OFFSET_BLDCNT, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BLDALPHA, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BLDY, DISPCNT_MODE_0); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); } static const struct WindowTemplate sDiplomaWinTemplates[2] = diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 59316835f..39e917161 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -1125,7 +1125,7 @@ static void Task_TradeEvolutionScene(u8 taskId) var = gSprites[sEvoStructPtr->preEvoSpriteId].oam.paletteNum + 16; sEvoGraphicsTaskId = EvolutionSparkles_SpiralUpward(var); gTasks[taskId].tState++; - SetGpuReg(REG_OFFSET_BG3CNT, 0x603); + SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) | BGCNT_SCREENBASE(6)); } break; case T_EVOSTATE_SPARKLE_ARC: diff --git a/src/option_menu.c b/src/option_menu.c index a210c9502..0174b69db 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -187,7 +187,7 @@ void CB2_InitOptionMenu(void) SetGpuReg(REG_OFFSET_WIN0V, 0); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG0); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 | WINOUT_WIN01_CLR); - SetGpuReg(REG_OFFSET_BLDCNT, 193); + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_DARKEN); SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDY, 4); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); diff --git a/src/title_screen.c b/src/title_screen.c index 21d10495c..cf356cefa 100644 --- a/src/title_screen.c +++ b/src/title_screen.c @@ -600,7 +600,7 @@ void CB2_InitTitleScreen(void) SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WINOBJ_ALL); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_LIGHTEN); SetGpuReg(REG_OFFSET_BLDALPHA, 0); - SetGpuReg(REG_OFFSET_BLDY, 0xC); + SetGpuReg(REG_OFFSET_BLDY, 12); SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(3) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(26) | BGCNT_16COLOR | BGCNT_TXT256x256); SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(2) | BGCNT_CHARBASE(3) | BGCNT_SCREENBASE(27) | BGCNT_16COLOR | BGCNT_TXT256x256); SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(1) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(9) | BGCNT_256COLOR | BGCNT_AFF256x256); From 30fecca109e77cd3f7b85600ee6ba984878b2d03 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 15 Apr 2021 13:31:18 -0400 Subject: [PATCH 42/63] Doc storage - menu texts --- src/pokemon_storage_system.c | 812 ++++++++++++++++++----------------- 1 file changed, 426 insertions(+), 386 deletions(-) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 0a35aa323..99f16e43b 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -42,6 +42,186 @@ #include "constants/rgb.h" #include "constants/songs.h" +enum { + BOX_OPTION_WITHDRAW, + BOX_OPTION_DEPOSIT, + BOX_OPTION_MOVE_MONS, + BOX_OPTION_MOVE_ITEMS, + BOX_OPTION_EXIT, +}; + +// IDs for messages to print with PrintMessage +enum { + MSG_EXIT_BOX, + MSG_WHAT_YOU_DO, + MSG_PICK_A_THEME, + MSG_PICK_A_WALLPAPER, + MSG_IS_SELECTED, + MSG_JUMP_TO_WHICH_BOX, + MSG_DEPOSIT_IN_WHICH_BOX, + MSG_WAS_DEPOSITED, + MSG_BOX_IS_FULL, + MSG_RELEASE_POKE, + MSG_WAS_RELEASED, + MSG_BYE_BYE, + MSG_MARK_POKE, + MSG_LAST_POKE, + MSG_PARTY_FULL, + MSG_HOLDING_POKE, + MSG_WHICH_ONE_WILL_TAKE, + MSG_CANT_RELEASE_EGG, + MSG_CONTINUE_BOX, + MSG_CAME_BACK, + MSG_WORRIED, + MSG_SURPRISE, + MSG_PLEASE_REMOVE_MAIL, + MSG_IS_SELECTED2, + MSG_GIVE_TO_MON, + MSG_PLACED_IN_BAG, + MSG_BAG_FULL, + MSG_PUT_IN_BAG, + MSG_ITEM_IS_HELD, + MSG_CHANGED_TO_ITEM, + MSG_CANT_STORE_MAIL, +}; + +enum { + MSG_FORMAT_NORMAL, + MSG_FORMAT_MON_NAME_1, + MSG_FORMAT_MON_NAME_2, // Unused + MSG_FORMAT_MON_NAME_3, // Unused + MSG_FORMAT_MON_NAME_4, + MSG_FORMAT_MON_NAME_5, // Unused + MSG_FORMAT_MON_NAME_6, + MSG_FORMAT_ITEM_NAME, +}; + +// IDs for menu selection items. See SetMenuText, HandleMenuInput, etc +enum { + MENU_CANCEL, + MENU_STORE, + MENU_WITHDRAW, + MENU_MOVE, + MENU_SHIFT, + MENU_PLACE, + MENU_SUMMARY, + MENU_RELEASE, + MENU_MARK, + MENU_JUMP, + MENU_WALLPAPER, + MENU_NAME, + MENU_TAKE, + MENU_GIVE, + MENU_GIVE_2, + MENU_SWITCH, + MENU_BAG, + MENU_INFO, + MENU_SCENERY_1, + MENU_SCENERY_2, + MENU_SCENERY_3, + MENU_ETCETERA, + MENU_FRIENDS, + MENU_FOREST, + MENU_CITY, + MENU_DESERT, + MENU_SAVANNA, + MENU_CRAG, + MENU_VOLCANO, + MENU_SNOW, + MENU_CAVE, + MENU_BEACH, + MENU_SEAFLOOR, + MENU_RIVER, + MENU_SKY, + MENU_POLKADOT, + MENU_POKECENTER, + MENU_MACHINE, + MENU_SIMPLE, +}; +#define MENU_WALLPAPERS_START MENU_FOREST + +enum { + SCREEN_CHANGE_EXIT_BOX, + SCREEN_CHANGE_SUMMARY_SCREEN, + SCREEN_CHANGE_NAME_BOX, + SCREEN_CHANGE_ITEM_FROM_BAG, +}; + +enum { + MODE_PARTY, + MODE_BOX, + MODE_MOVE, +}; + +enum { + WALLPAPER_FOREST, + WALLPAPER_CITY, + WALLPAPER_DESERT, + WALLPAPER_SAVANNA, + WALLPAPER_CRAG, + WALLPAPER_VOLCANO, + WALLPAPER_SNOW, + WALLPAPER_CAVE, + WALLPAPER_BEACH, + WALLPAPER_SEAFLOOR, + WALLPAPER_RIVER, + WALLPAPER_SKY, + WALLPAPER_POLKADOT, + WALLPAPER_POKECENTER, + WALLPAPER_MACHINE, + WALLPAPER_PLAIN, + WALLPAPER_FRIENDS, // The one received as a gift from Walda's parents. + WALLPAPER_COUNT +}; + +enum { + FRIENDS_ZIGZAGOON, + FRIENDS_SCREEN, + FRIENDS_HORIZONTAL, + FRIENDS_DIAGONAL, + FRIENDS_BLOCK, + FRIENDS_RIBBON, + FRIENDS_POKECENTER2, + FRIENDS_FRAME, + FRIENDS_BLANK, + FRIENDS_CIRCLES, + FRIENDS_AZUMARILL, + FRIENDS_PIKACHU, + FRIENDS_LEGENDARY, + FRIENDS_DUSCLOPS, + FRIENDS_LUDICOLO, + FRIENDS_WHISCASH, + FRIENDS_WALLPAPERS_COUNT +}; + +enum { + CURSOR_AREA_IN_BOX, + CURSOR_AREA_IN_PARTY, + CURSOR_AREA_BOX, + CURSOR_AREA_BUTTONS, // Party Pokemon and Close Box +}; + +#define TAG_PAL_WAVEFORM 0xDACA +#define TAG_PAL_DAC8 0xDAC8 +#define TAG_PAL_DAC6 0xDAC6 +#define TAG_PAL_DACE 0xDACE +#define TAG_PAL_DAC7 0xDAC7 +#define TAG_PAL_DAC9 0xDAC9 +#define TAG_PAL_DAC0 0xDAC0 +#define TAG_PAL_DACB 0xDACB + +#define TAG_TILE_WAVEFORM 0x5 +#define TAG_TILE_10 0x10 +#define TAG_TILE_2 0x2 +#define TAG_TILE_D 0xD +#define TAG_TILE_A 0xA +#define TAG_TILE_3 0x3 +#define TAG_TILE_4 0x4 +#define TAG_TILE_12 0x12 +#define TAG_TILE_7 0x7 +#define TAG_TILE_0 0x0 +#define TAG_TILE_1 0x1 + struct WallpaperTable { const u32 *tiles; @@ -55,7 +235,7 @@ struct PokemonStorageSystemFunc s8 unk4; }; -struct StorageAction +struct StorageMessage { const u8 *text; u8 format; @@ -194,7 +374,7 @@ struct PokemonStorageSystemData u8 menuItemsCount; u8 menuWidth; u8 field_CAE; // Written to, but never read. - u16 field_CB0; + u16 menuWindowId; struct Sprite *field_CB4; struct Sprite *field_CB8; s32 field_CBC; @@ -299,149 +479,6 @@ struct UnkStruct_2039D84 u8 field_2D; }; -enum -{ - BOX_OPTION_WITHDRAW, - BOX_OPTION_DEPOSIT, - BOX_OPTION_MOVE_MONS, - BOX_OPTION_MOVE_ITEMS, - BOX_OPTION_EXIT, -}; - -enum -{ - PC_TEXT_EXIT_BOX, - PC_TEXT_WHAT_YOU_DO, - PC_TEXT_PICK_A_THEME, - PC_TEXT_PICK_A_WALLPAPER, - PC_TEXT_IS_SELECTED, - PC_TEXT_JUMP_TO_WHICH_BOX, - PC_TEXT_DEPOSIT_IN_WHICH_BOX, - PC_TEXT_WAS_DEPOSITED, - PC_TEXT_BOX_IS_FULL, - PC_TEXT_RELEASE_POKE, - PC_TEXT_WAS_RELEASED, - PC_TEXT_BYE_BYE, - PC_TEXT_MARK_POKE, - PC_TEXT_LAST_POKE, - PC_TEXT_PARTY_FULL, - PC_TEXT_HOLDING_POKE, - PC_TEXT_WHICH_ONE_WILL_TAKE, - PC_TEXT_CANT_RELEASE_EGG, - PC_TEXT_CONTINUE_BOX, - PC_TEXT_CAME_BACK, - PC_TEXT_WORRIED, - PC_TEXT_SURPRISE, - PC_TEXT_PLEASE_REMOVE_MAIL, - PC_TEXT_IS_SELECTED2, - PC_TEXT_GIVE_TO_MON, - PC_TEXT_PLACED_IN_BAG, - PC_TEXT_BAG_FULL, - PC_TEXT_PUT_IN_BAG, - PC_TEXT_ITEM_IS_HELD, - PC_TEXT_CHANGED_TO_ITEM, - PC_TEXT_CANT_STORE_MAIL, -}; - -enum -{ - PC_TEXT_FMT_NORMAL, - PC_TEXT_FMT_MON_NAME_1, - PC_TEXT_FMT_MON_NAME_2, - PC_TEXT_FMT_MON_NAME_3, - PC_TEXT_FMT_MON_NAME_4, - PC_TEXT_FMT_MON_NAME_5, - PC_TEXT_FMT_MON_NAME_6, - PC_TEXT_FMT_ITEM_NAME, -}; - -enum -{ - SCREEN_CHANGE_EXIT_BOX, - SCREEN_CHANGE_SUMMARY_SCREEN, - SCREEN_CHANGE_NAME_BOX, - SCREEN_CHANGE_ITEM_FROM_BAG, -}; - -enum -{ - MODE_PARTY, - MODE_BOX, - MODE_MOVE, -}; - -enum -{ - WALLPAPER_FOREST, - WALLPAPER_CITY, - WALLPAPER_DESERT, - WALLPAPER_SAVANNA, - WALLPAPER_CRAG, - WALLPAPER_VOLCANO, - WALLPAPER_SNOW, - WALLPAPER_CAVE, - WALLPAPER_BEACH, - WALLPAPER_SEAFLOOR, - WALLPAPER_RIVER, - WALLPAPER_SKY, - WALLPAPER_POLKADOT, - WALLPAPER_POKECENTER, - WALLPAPER_MACHINE, - WALLPAPER_PLAIN, - WALLPAPER_FRIENDS, // The one received as a gift from Walda's parents. - WALLPAPER_COUNT -}; - -enum -{ - FRIENDS_ZIGZAGOON, - FRIENDS_SCREEN, - FRIENDS_HORIZONTAL, - FRIENDS_DIAGONAL, - FRIENDS_BLOCK, - FRIENDS_RIBBON, - FRIENDS_POKECENTER2, - FRIENDS_FRAME, - FRIENDS_BLANK, - FRIENDS_CIRCLES, - FRIENDS_AZUMARILL, - FRIENDS_PIKACHU, - FRIENDS_LEGENDARY, - FRIENDS_DUSCLOPS, - FRIENDS_LUDICOLO, - FRIENDS_WHISCASH, - FRIENDS_WALLPAPERS_COUNT -}; - -enum -{ - CURSOR_AREA_IN_BOX, - CURSOR_AREA_IN_PARTY, - CURSOR_AREA_BOX, - CURSOR_AREA_BUTTONS, // Party Pokemon and Close Box -}; - -#define TAG_PAL_WAVEFORM 0xDACA -#define TAG_PAL_DAC8 0xDAC8 -#define TAG_PAL_DAC6 0xDAC6 -#define TAG_PAL_DACE 0xDACE -#define TAG_PAL_DAC7 0xDAC7 -#define TAG_PAL_DAC9 0xDAC9 -#define TAG_PAL_DAC0 0xDAC0 -#define TAG_PAL_DACB 0xDACB - -#define TAG_TILE_WAVEFORM 0x5 -#define TAG_TILE_10 0x10 -#define TAG_TILE_2 0x2 -#define TAG_TILE_D 0xD -#define TAG_TILE_A 0xA -#define TAG_TILE_3 0x3 -#define TAG_TILE_4 0x4 -#define TAG_TILE_12 0x12 -#define TAG_TILE_7 0x7 -#define TAG_TILE_0 0x0 -#define TAG_TILE_1 0x1 - // IWRAM bss static u32 gUnknown_03000F78[98]; @@ -518,7 +555,7 @@ static void sub_80CC064(void); static void sub_80CE324(void); static void ClearBottomWindow(void); static void sub_80CA704(void); -static void sub_80D013C(void); +static void RemoveMenu(void); static void sub_80CE00C(void); static void sub_80D1194(void); static void PrintCursorMonInfo(void); @@ -627,8 +664,8 @@ static void sub_80D01D0(u8 arg0); static void sub_80CD1A8(bool8 arg0); static void sub_80CA984(bool8 arg0); static void CreatePartyMonsSprites(bool8 arg0); -static void PrintStorageActionText(u8 id); -static s16 sub_80D00AC(void); +static void PrintMessage(u8 id); +static s16 HandleMenuInput(void); static s8 RunCanReleaseMon(void); static u8 GetBoxCursorPosition(void); static void Item_FromMonToMoving(u8 cursorArea, u8 cursorPos); @@ -675,7 +712,7 @@ static bool32 AtLeastThreeUsableMons(void); static u8 InBoxInput_Normal(void); static u8 InBoxInput_MovingMultiple(void); static u8 InBoxInput_GrabbingMultiple(void); -static s8 sub_80CFF98(u8 arg0); +static s8 GetMenuItemTextId(u8); static u8 sub_80CFA5C(void); static u8 sub_80D0BA4(void); static bool8 sub_80CFA84(void); @@ -914,39 +951,39 @@ static const struct SpriteTemplate sSpriteTemplate_CursorMon = .callback = SpriteCallbackDummy, }; -static const struct StorageAction gPCStorageActionTexts[] = +static const struct StorageMessage sMessages[] = { - [PC_TEXT_EXIT_BOX] = {gText_ExitFromBox, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_WHAT_YOU_DO] = {gText_WhatDoYouWantToDo, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_PICK_A_THEME] = {gText_PleasePickATheme, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_PICK_A_WALLPAPER] = {gText_PickTheWallpaper, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_IS_SELECTED] = {gText_PkmnIsSelected, PC_TEXT_FMT_MON_NAME_1}, - [PC_TEXT_JUMP_TO_WHICH_BOX] = {gText_JumpToWhichBox, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_DEPOSIT_IN_WHICH_BOX] = {gText_DepositInWhichBox, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_WAS_DEPOSITED] = {gText_PkmnWasDeposited, PC_TEXT_FMT_MON_NAME_1}, - [PC_TEXT_BOX_IS_FULL] = {gText_BoxIsFull2, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_RELEASE_POKE] = {gText_ReleaseThisPokemon, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_WAS_RELEASED] = {gText_PkmnWasReleased, PC_TEXT_FMT_MON_NAME_4}, - [PC_TEXT_BYE_BYE] = {gText_ByeByePkmn, PC_TEXT_FMT_MON_NAME_6}, - [PC_TEXT_MARK_POKE] = {gText_MarkYourPkmn, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_LAST_POKE] = {gText_ThatsYourLastPkmn, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_PARTY_FULL] = {gText_YourPartysFull, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_HOLDING_POKE] = {gText_YoureHoldingAPkmn, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_WHICH_ONE_WILL_TAKE] = {gText_WhichOneWillYouTake, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_CANT_RELEASE_EGG] = {gText_YouCantReleaseAnEgg, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_CONTINUE_BOX] = {gText_ContinueBoxOperations, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_CAME_BACK] = {gText_PkmnCameBack, PC_TEXT_FMT_MON_NAME_1}, - [PC_TEXT_WORRIED] = {gText_WasItWorriedAboutYou, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_SURPRISE] = {gText_FourEllipsesExclamation, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_PLEASE_REMOVE_MAIL] = {gText_PleaseRemoveTheMail, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_IS_SELECTED2] = {gText_PkmnIsSelected, PC_TEXT_FMT_ITEM_NAME}, - [PC_TEXT_GIVE_TO_MON] = {gText_GiveToAPkmn, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_PLACED_IN_BAG] = {gText_PlacedItemInBag, PC_TEXT_FMT_ITEM_NAME}, - [PC_TEXT_BAG_FULL] = {gText_BagIsFull2, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_PUT_IN_BAG] = {gText_PutItemInBag, PC_TEXT_FMT_NORMAL}, - [PC_TEXT_ITEM_IS_HELD] = {gText_ItemIsNowHeld, PC_TEXT_FMT_ITEM_NAME}, - [PC_TEXT_CHANGED_TO_ITEM] = {gText_ChangedToNewItem, PC_TEXT_FMT_ITEM_NAME}, - [PC_TEXT_CANT_STORE_MAIL] = {gText_MailCantBeStored, PC_TEXT_FMT_NORMAL}, + [MSG_EXIT_BOX] = {gText_ExitFromBox, MSG_FORMAT_NORMAL}, + [MSG_WHAT_YOU_DO] = {gText_WhatDoYouWantToDo, MSG_FORMAT_NORMAL}, + [MSG_PICK_A_THEME] = {gText_PleasePickATheme, MSG_FORMAT_NORMAL}, + [MSG_PICK_A_WALLPAPER] = {gText_PickTheWallpaper, MSG_FORMAT_NORMAL}, + [MSG_IS_SELECTED] = {gText_PkmnIsSelected, MSG_FORMAT_MON_NAME_1}, + [MSG_JUMP_TO_WHICH_BOX] = {gText_JumpToWhichBox, MSG_FORMAT_NORMAL}, + [MSG_DEPOSIT_IN_WHICH_BOX] = {gText_DepositInWhichBox, MSG_FORMAT_NORMAL}, + [MSG_WAS_DEPOSITED] = {gText_PkmnWasDeposited, MSG_FORMAT_MON_NAME_1}, + [MSG_BOX_IS_FULL] = {gText_BoxIsFull2, MSG_FORMAT_NORMAL}, + [MSG_RELEASE_POKE] = {gText_ReleaseThisPokemon, MSG_FORMAT_NORMAL}, + [MSG_WAS_RELEASED] = {gText_PkmnWasReleased, MSG_FORMAT_MON_NAME_4}, + [MSG_BYE_BYE] = {gText_ByeByePkmn, MSG_FORMAT_MON_NAME_6}, + [MSG_MARK_POKE] = {gText_MarkYourPkmn, MSG_FORMAT_NORMAL}, + [MSG_LAST_POKE] = {gText_ThatsYourLastPkmn, MSG_FORMAT_NORMAL}, + [MSG_PARTY_FULL] = {gText_YourPartysFull, MSG_FORMAT_NORMAL}, + [MSG_HOLDING_POKE] = {gText_YoureHoldingAPkmn, MSG_FORMAT_NORMAL}, + [MSG_WHICH_ONE_WILL_TAKE] = {gText_WhichOneWillYouTake, MSG_FORMAT_NORMAL}, + [MSG_CANT_RELEASE_EGG] = {gText_YouCantReleaseAnEgg, MSG_FORMAT_NORMAL}, + [MSG_CONTINUE_BOX] = {gText_ContinueBoxOperations, MSG_FORMAT_NORMAL}, + [MSG_CAME_BACK] = {gText_PkmnCameBack, MSG_FORMAT_MON_NAME_1}, + [MSG_WORRIED] = {gText_WasItWorriedAboutYou, MSG_FORMAT_NORMAL}, + [MSG_SURPRISE] = {gText_FourEllipsesExclamation, MSG_FORMAT_NORMAL}, + [MSG_PLEASE_REMOVE_MAIL] = {gText_PleaseRemoveTheMail, MSG_FORMAT_NORMAL}, + [MSG_IS_SELECTED2] = {gText_PkmnIsSelected, MSG_FORMAT_ITEM_NAME}, + [MSG_GIVE_TO_MON] = {gText_GiveToAPkmn, MSG_FORMAT_NORMAL}, + [MSG_PLACED_IN_BAG] = {gText_PlacedItemInBag, MSG_FORMAT_ITEM_NAME}, + [MSG_BAG_FULL] = {gText_BagIsFull2, MSG_FORMAT_NORMAL}, + [MSG_PUT_IN_BAG] = {gText_PutItemInBag, MSG_FORMAT_NORMAL}, + [MSG_ITEM_IS_HELD] = {gText_ItemIsNowHeld, MSG_FORMAT_ITEM_NAME}, + [MSG_CHANGED_TO_ITEM] = {gText_ChangedToNewItem, MSG_FORMAT_ITEM_NAME}, + [MSG_CANT_STORE_MAIL] = {gText_MailCantBeStored, MSG_FORMAT_NORMAL}, }; static const struct WindowTemplate sYesNoWindowTemplate = @@ -2382,7 +2419,7 @@ static void Cb_ReshowPSS(u8 taskId) { if (sWhichToReshow == 2 && gSpecialVar_ItemId != 0) { - PrintStorageActionText(PC_TEXT_ITEM_IS_HELD); + PrintMessage(MSG_ITEM_IS_HELD); sPSSData->state++; } else @@ -2419,7 +2456,7 @@ static void Cb_MainPSS(u8 taskId) case 5: if (sPSSData->boxOption != BOX_OPTION_MOVE_MONS && sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) { - PrintStorageActionText(PC_TEXT_WHICH_ONE_WILL_TAKE); + PrintMessage(MSG_WHICH_ONE_WILL_TAKE); sPSSData->state = 3; } else @@ -2622,12 +2659,12 @@ static void Cb_MainPSS(u8 taskId) break; case 4: PlaySE(SE_FAILURE); - PrintStorageActionText(PC_TEXT_LAST_POKE); + PrintMessage(MSG_LAST_POKE); sPSSData->state = 6; break; case 5: PlaySE(SE_FAILURE); - PrintStorageActionText(PC_TEXT_PLEASE_REMOVE_MAIL); + PrintMessage(MSG_PLEASE_REMOVE_MAIL); sPSSData->state = 6; break; case 6: @@ -2718,11 +2755,11 @@ static void Cb_OnSelectedMon(u8 taskId) { PlaySE(SE_SELECT); if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) - PrintStorageActionText(PC_TEXT_IS_SELECTED); + PrintMessage(MSG_IS_SELECTED); else if (IsActiveItemMoving() || sPSSData->cursorMonItem != 0) - PrintStorageActionText(PC_TEXT_IS_SELECTED2); + PrintMessage(MSG_IS_SELECTED2); else - PrintStorageActionText(PC_TEXT_GIVE_TO_MON); + PrintMessage(MSG_GIVE_TO_MON); AddMenu(); sPSSData->state = 1; @@ -2733,14 +2770,14 @@ static void Cb_OnSelectedMon(u8 taskId) sPSSData->state = 2; break; case 2: - switch (sub_80D00AC()) + switch (HandleMenuInput()) { - case -1: - case 0: + case MENU_B_PRESSED: + case MENU_CANCEL: ClearBottomWindow(); SetPSSCallback(Cb_MainPSS); break; - case 3: + case MENU_MOVE: if (CanMovePartyMon()) { sPSSData->state = 3; @@ -2752,12 +2789,12 @@ static void Cb_OnSelectedMon(u8 taskId) SetPSSCallback(Cb_MoveMon); } break; - case 5: + case MENU_PLACE: PlaySE(SE_SELECT); ClearBottomWindow(); SetPSSCallback(Cb_PlaceMon); break; - case 4: + case MENU_SHIFT: if (!CanShiftMon()) { sPSSData->state = 3; @@ -2769,12 +2806,12 @@ static void Cb_OnSelectedMon(u8 taskId) SetPSSCallback(Cb_ShiftMon); } break; - case 2: + case MENU_WITHDRAW: PlaySE(SE_SELECT); ClearBottomWindow(); SetPSSCallback(Cb_WithdrawMon); break; - case 1: + case MENU_STORE: if (CanMovePartyMon()) { sPSSData->state = 3; @@ -2790,7 +2827,7 @@ static void Cb_OnSelectedMon(u8 taskId) SetPSSCallback(Cb_DepositMenu); } break; - case 7: + case MENU_RELEASE: if (CanMovePartyMon()) { sPSSData->state = 3; @@ -2809,51 +2846,51 @@ static void Cb_OnSelectedMon(u8 taskId) SetPSSCallback(Cb_ReleaseMon); } break; - case 6: + case MENU_SUMMARY: PlaySE(SE_SELECT); SetPSSCallback(Cb_ShowMonSummary); break; - case 8: + case MENU_MARK: PlaySE(SE_SELECT); SetPSSCallback(Cb_ShowMarkMenu); break; - case 12: + case MENU_TAKE: PlaySE(SE_SELECT); SetPSSCallback(Cb_TakeItemForMoving); break; - case 13: + case MENU_GIVE: PlaySE(SE_SELECT); SetPSSCallback(Cb_GiveMovingItemToMon); break; - case 16: + case MENU_BAG: SetPSSCallback(Cb_ItemToBag); break; - case 15: + case MENU_SWITCH: PlaySE(SE_SELECT); SetPSSCallback(Cb_SwitchSelectedItem); break; - case 14: + case MENU_GIVE_2: PlaySE(SE_SELECT); SetPSSCallback(Cb_GiveItemFromBag); break; - case 17: + case MENU_INFO: SetPSSCallback(Cb_ShowItemInfo); break; } break; case 3: PlaySE(SE_FAILURE); - PrintStorageActionText(PC_TEXT_LAST_POKE); + PrintMessage(MSG_LAST_POKE); sPSSData->state = 6; break; case 5: PlaySE(SE_FAILURE); - PrintStorageActionText(PC_TEXT_CANT_RELEASE_EGG); + PrintMessage(MSG_CANT_RELEASE_EGG); sPSSData->state = 6; break; case 4: PlaySE(SE_FAILURE); - PrintStorageActionText(PC_TEXT_PLEASE_REMOVE_MAIL); + PrintMessage(MSG_PLEASE_REMOVE_MAIL); sPSSData->state = 6; break; case 6: @@ -2931,7 +2968,7 @@ static void Cb_WithdrawMon(u8 taskId) case 0: if (CalculatePlayerPartyCount() == PARTY_SIZE) { - PrintStorageActionText(PC_TEXT_PARTY_FULL); + PrintMessage(MSG_PARTY_FULL); sPSSData->state = 1; } else @@ -2983,7 +3020,7 @@ static void Cb_DepositMenu(u8 taskId) switch (sPSSData->state) { case 0: - PrintStorageActionText(PC_TEXT_DEPOSIT_IN_WHICH_BOX); + PrintMessage(MSG_DEPOSIT_IN_WHICH_BOX); sub_80C77E8(&sPSSData->field_1E5C, TAG_TILE_A, TAG_PAL_DAC7, 3, FALSE); sub_80C78D4(gUnknown_02039D0E); sPSSData->state++; @@ -3013,7 +3050,7 @@ static void Cb_DepositMenu(u8 taskId) } else { - PrintStorageActionText(PC_TEXT_BOX_IS_FULL); + PrintMessage(MSG_BOX_IS_FULL); sPSSData->state = 4; } } @@ -3035,7 +3072,7 @@ static void Cb_DepositMenu(u8 taskId) case 4: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { - PrintStorageActionText(PC_TEXT_DEPOSIT_IN_WHICH_BOX); + PrintMessage(MSG_DEPOSIT_IN_WHICH_BOX); sPSSData->state = 1; } break; @@ -3047,7 +3084,7 @@ static void Cb_ReleaseMon(u8 taskId) switch (sPSSData->state) { case 0: - PrintStorageActionText(PC_TEXT_RELEASE_POKE); + PrintMessage(MSG_RELEASE_POKE); ShowYesNoWindow(1); sPSSData->state++; // fallthrough @@ -3090,13 +3127,13 @@ static void Cb_ReleaseMon(u8 taskId) case 3: ReleaseMon(); RefreshCursorMonData(); - PrintStorageActionText(PC_TEXT_WAS_RELEASED); + PrintMessage(MSG_WAS_RELEASED); sPSSData->state++; break; case 4: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { - PrintStorageActionText(PC_TEXT_BYE_BYE); + PrintMessage(MSG_BYE_BYE); sPSSData->state++; } break; @@ -3129,13 +3166,13 @@ static void Cb_ReleaseMon(u8 taskId) SetPSSCallback(Cb_MainPSS); break; case 8: - PrintStorageActionText(PC_TEXT_WAS_RELEASED); + PrintMessage(MSG_WAS_RELEASED); sPSSData->state++; break; case 9: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { - PrintStorageActionText(PC_TEXT_SURPRISE); + PrintMessage(MSG_SURPRISE); sPSSData->state++; } break; @@ -3151,14 +3188,14 @@ static void Cb_ReleaseMon(u8 taskId) if (!sub_80CC0A0()) { sub_80CE324(); - PrintStorageActionText(PC_TEXT_CAME_BACK); + PrintMessage(MSG_CAME_BACK); sPSSData->state++; } break; case 12: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { - PrintStorageActionText(PC_TEXT_WORRIED); + PrintMessage(MSG_WORRIED); sPSSData->state++; } break; @@ -3177,7 +3214,7 @@ static void Cb_ShowMarkMenu(u8 taskId) switch (sPSSData->state) { case 0: - PrintStorageActionText(PC_TEXT_MARK_POKE); + PrintMessage(MSG_MARK_POKE); sPSSData->markMenu.markings = sPSSData->cursorMonMarkings; OpenMonMarkingsMenu(sPSSData->cursorMonMarkings, 0xb0, 0x10); sPSSData->state++; @@ -3251,7 +3288,7 @@ static void Cb_GiveMovingItemToMon(u8 taskId) sub_80CFE54(0); sub_80CE00C(); PrintCursorMonInfo(); - PrintStorageActionText(PC_TEXT_ITEM_IS_HELD); + PrintMessage(MSG_ITEM_IS_HELD); sPSSData->state++; } break; @@ -3277,7 +3314,7 @@ static void Cb_ItemToBag(u8 taskId) if (!AddBagItem(sPSSData->cursorMonItem, 1)) { PlaySE(SE_FAILURE); - PrintStorageActionText(PC_TEXT_BAG_FULL); + PrintMessage(MSG_BAG_FULL); sPSSData->state = 3; } else @@ -3290,7 +3327,7 @@ static void Cb_ItemToBag(u8 taskId) case 1: if (!sub_80D1218()) { - PrintStorageActionText(PC_TEXT_PLACED_IN_BAG); + PrintMessage(MSG_PLACED_IN_BAG); sPSSData->state = 2; } break; @@ -3343,7 +3380,7 @@ static void Cb_SwitchSelectedItem(u8 taskId) sub_80CFE54(3); sub_80CE00C(); PrintCursorMonInfo(); - PrintStorageActionText(PC_TEXT_CHANGED_TO_ITEM); + PrintMessage(MSG_CHANGED_TO_ITEM); sPSSData->state++; } break; @@ -3410,7 +3447,7 @@ static void Cb_CloseBoxWhileHoldingItem(u8 taskId) { case 0: PlaySE(SE_SELECT); - PrintStorageActionText(PC_TEXT_PUT_IN_BAG); + PrintMessage(MSG_PUT_IN_BAG); ShowYesNoWindow(0); sPSSData->state = 1; break; @@ -3430,7 +3467,7 @@ static void Cb_CloseBoxWhileHoldingItem(u8 taskId) } else { - PrintStorageActionText(PC_TEXT_BAG_FULL); + PrintMessage(MSG_BAG_FULL); sPSSData->state = 2; } break; @@ -3485,7 +3522,7 @@ static void Cb_PrintCantStoreMail(u8 taskId) switch (sPSSData->state) { case 0: - PrintStorageActionText(PC_TEXT_CANT_STORE_MAIL); + PrintMessage(MSG_CANT_STORE_MAIL); sPSSData->state++; break; case 1: @@ -3511,7 +3548,7 @@ static void Cb_HandleBoxOptions(u8 taskId) switch (sPSSData->state) { case 0: - PrintStorageActionText(PC_TEXT_WHAT_YOU_DO); + PrintMessage(MSG_WHAT_YOU_DO); AddMenu(); sPSSData->state++; break; @@ -3520,24 +3557,24 @@ static void Cb_HandleBoxOptions(u8 taskId) return; sPSSData->state++; case 2: - switch (sub_80D00AC()) + switch (HandleMenuInput()) { - case -1: - case 0: + case MENU_B_PRESSED: + case MENU_CANCEL: sub_80CD1A8(TRUE); ClearBottomWindow(); SetPSSCallback(Cb_MainPSS); break; - case 11: + case MENU_NAME: PlaySE(SE_SELECT); SetPSSCallback(Cb_NameBox); break; - case 10: + case MENU_WALLPAPER: PlaySE(SE_SELECT); ClearBottomWindow(); SetPSSCallback(Cb_HandleWallpapers); break; - case 9: + case MENU_JUMP: PlaySE(SE_SELECT); ClearBottomWindow(); SetPSSCallback(Cb_JumpBox); @@ -3553,7 +3590,7 @@ static void Cb_HandleWallpapers(u8 taskId) { case 0: AddWallpaperSetsMenu(); - PrintStorageActionText(PC_TEXT_PICK_A_THEME); + PrintMessage(MSG_PICK_A_THEME); sPSSData->state++; break; case 1: @@ -3561,25 +3598,28 @@ static void Cb_HandleWallpapers(u8 taskId) sPSSData->state++; break; case 2: - sPSSData->wallpaperSetId = sub_80D00AC(); + sPSSData->wallpaperSetId = HandleMenuInput(); switch (sPSSData->wallpaperSetId) { - case -1: + case MENU_B_PRESSED: sub_80CD1A8(TRUE); ClearBottomWindow(); SetPSSCallback(Cb_MainPSS); break; - case 18 ... 21: + case MENU_SCENERY_1: + case MENU_SCENERY_2: + case MENU_SCENERY_3: + case MENU_ETCETERA: PlaySE(SE_SELECT); - sub_80D013C(); + RemoveMenu(); sPSSData->wallpaperSetId -= 18; sPSSData->state++; break; - // New wallpaper from Walda. - case 22: + case MENU_FRIENDS: + // New wallpaper from Walda. PlaySE(SE_SELECT); sPSSData->wallpaperId = 16; - sub_80D013C(); + RemoveMenu(); ClearBottomWindow(); sPSSData->state = 6; break; @@ -3589,24 +3629,24 @@ static void Cb_HandleWallpapers(u8 taskId) if (!IsDma3ManagerBusyWithBgCopy()) { AddWallpapersMenu(sPSSData->wallpaperSetId); - PrintStorageActionText(PC_TEXT_PICK_A_WALLPAPER); + PrintMessage(MSG_PICK_A_WALLPAPER); sPSSData->state++; } break; case 4: - sPSSData->wallpaperId = sub_80D00AC(); + sPSSData->wallpaperId = HandleMenuInput(); switch (sPSSData->wallpaperId) { - case -2: + case MENU_NOTHING_CHOSEN: break; - case -1: + case MENU_B_PRESSED: ClearBottomWindow(); sPSSData->state = 0; break; default: PlaySE(SE_SELECT); ClearBottomWindow(); - sPSSData->wallpaperId -= 23; + sPSSData->wallpaperId -= MENU_WALLPAPERS_START; SetWallpaperForCurrentBox(sPSSData->wallpaperId); sPSSData->state++; break; @@ -3634,7 +3674,7 @@ static void Cb_JumpBox(u8 taskId) switch (sPSSData->state) { case 0: - PrintStorageActionText(PC_TEXT_JUMP_TO_WHICH_BOX); + PrintMessage(MSG_JUMP_TO_WHICH_BOX); sub_80C77E8(&sPSSData->field_1E5C, TAG_TILE_A, TAG_PAL_DAC7, 3, FALSE); sub_80C78D4(StorageGetCurrentBox()); sPSSData->state++; @@ -3742,7 +3782,7 @@ static void Cb_OnCloseBoxPressed(u8 taskId) if (IsMonBeingMoved()) { PlaySE(SE_FAILURE); - PrintStorageActionText(PC_TEXT_HOLDING_POKE); + PrintMessage(MSG_HOLDING_POKE); sPSSData->state = 1; } else if (IsActiveItemMoving()) @@ -3752,7 +3792,7 @@ static void Cb_OnCloseBoxPressed(u8 taskId) else { PlaySE(SE_SELECT); - PrintStorageActionText(PC_TEXT_EXIT_BOX); + PrintMessage(MSG_EXIT_BOX); ShowYesNoWindow(0); sPSSData->state = 2; } @@ -3803,7 +3843,7 @@ static void Cb_OnBPressed(u8 taskId) if (IsMonBeingMoved()) { PlaySE(SE_FAILURE); - PrintStorageActionText(PC_TEXT_HOLDING_POKE); + PrintMessage(MSG_HOLDING_POKE); sPSSData->state = 1; } else if (IsActiveItemMoving()) @@ -3813,7 +3853,7 @@ static void Cb_OnBPressed(u8 taskId) else { PlaySE(SE_SELECT); - PrintStorageActionText(PC_TEXT_CONTINUE_BOX); + PrintMessage(MSG_CONTINUE_BOX); ShowYesNoWindow(0); sPSSData->state = 2; } @@ -4382,26 +4422,26 @@ static void sub_80CAC1C(void) CopyBgTilemapBufferToVram(0); } -static void PrintStorageActionText(u8 id) +static void PrintMessage(u8 id) { u8 *txtPtr; DynamicPlaceholderTextUtil_Reset(); - switch (gPCStorageActionTexts[id].format) + switch (sMessages[id].format) { - case PC_TEXT_FMT_NORMAL: + case MSG_FORMAT_NORMAL: break; - case PC_TEXT_FMT_MON_NAME_1: - case PC_TEXT_FMT_MON_NAME_2: - case PC_TEXT_FMT_MON_NAME_3: + case MSG_FORMAT_MON_NAME_1: + case MSG_FORMAT_MON_NAME_2: + case MSG_FORMAT_MON_NAME_3: DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->cursorMonNick); break; - case PC_TEXT_FMT_MON_NAME_4: - case PC_TEXT_FMT_MON_NAME_5: - case PC_TEXT_FMT_MON_NAME_6: + case MSG_FORMAT_MON_NAME_4: + case MSG_FORMAT_MON_NAME_5: + case MSG_FORMAT_MON_NAME_6: DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->field_21E0); break; - case PC_TEXT_FMT_ITEM_NAME: + case MSG_FORMAT_ITEM_NAME: if (IsActiveItemMoving()) txtPtr = StringCopy(sPSSData->itemName, GetMovingItemName()); else @@ -4415,7 +4455,7 @@ static void PrintStorageActionText(u8 id) break; } - DynamicPlaceholderTextUtil_ExpandPlaceholders(sPSSData->field_2190, gPCStorageActionTexts[id].text); + DynamicPlaceholderTextUtil_ExpandPlaceholders(sPSSData->field_2190, sMessages[id].text); FillWindowPixelBuffer(1, PIXEL_FILL(1)); AddTextPrinterParameterized(1, 1, sPSSData->field_2190, 0, 1, TEXT_SPEED_FF, NULL); DrawTextBorderOuter(1, 2, 14); @@ -4439,12 +4479,12 @@ static void ClearBottomWindow(void) static void AddWallpaperSetsMenu(void) { InitMenu(); - SetMenuText(18); - SetMenuText(19); - SetMenuText(20); - SetMenuText(21); + SetMenuText(MENU_SCENERY_1); + SetMenuText(MENU_SCENERY_2); + SetMenuText(MENU_SCENERY_3); + SetMenuText(MENU_ETCETERA); if (IsWaldaWallpaperUnlocked()) - SetMenuText(22); + SetMenuText(MENU_FRIENDS); AddMenu(); } @@ -4454,28 +4494,28 @@ static void AddWallpapersMenu(u8 wallpaperSet) switch (wallpaperSet) { case 0: - SetMenuText(23); - SetMenuText(24); - SetMenuText(25); - SetMenuText(26); + SetMenuText(MENU_FOREST); + SetMenuText(MENU_CITY); + SetMenuText(MENU_DESERT); + SetMenuText(MENU_SAVANNA); break; case 1: - SetMenuText(27); - SetMenuText(28); - SetMenuText(29); - SetMenuText(30); + SetMenuText(MENU_CRAG); + SetMenuText(MENU_VOLCANO); + SetMenuText(MENU_SNOW); + SetMenuText(MENU_CAVE); break; case 2: - SetMenuText(31); - SetMenuText(32); - SetMenuText(33); - SetMenuText(34); + SetMenuText(MENU_BEACH); + SetMenuText(MENU_SEAFLOOR); + SetMenuText(MENU_RIVER); + SetMenuText(MENU_SKY); break; case 3: - SetMenuText(35); - SetMenuText(36); - SetMenuText(37); - SetMenuText(38); + SetMenuText(MENU_POLKADOT); + SetMenuText(MENU_POKECENTER); + SetMenuText(MENU_MACHINE); + SetMenuText(MENU_SIMPLE); break; } AddMenu(); @@ -7010,23 +7050,23 @@ static u8 InBoxInput_Normal(void) if (sPSSData->boxOption != BOX_OPTION_MOVE_MONS || sIsMonBeingMoved == TRUE) { - switch (sub_80CFF98(0)) + switch (GetMenuItemTextId(0)) { - case 1: + case MENU_STORE: return 11; - case 2: + case MENU_WITHDRAW: return 12; - case 3: + case MENU_MOVE: return 13; - case 4: + case MENU_SHIFT: return 14; - case 5: + case MENU_PLACE: return 15; - case 12: + case MENU_TAKE: return 16; - case 13: + case MENU_GIVE: return 17; - case 15: + case MENU_SWITCH: return 18; } } @@ -7290,23 +7330,23 @@ static u8 HandleInput_InParty(void) if (!sCanOnlyMove) return 8; - switch (sub_80CFF98(0)) + switch (GetMenuItemTextId(0)) { - case 1: + case MENU_STORE: return 11; - case 2: + case MENU_WITHDRAW: return 12; - case 3: + case MENU_MOVE: return 13; - case 4: + case MENU_SHIFT: return 14; - case 5: + case MENU_PLACE: return 15; - case 12: + case MENU_TAKE: return 16; - case 13: + case MENU_GIVE: return 17; - case 15: + case MENU_SWITCH: return 18; } } @@ -7515,10 +7555,10 @@ static u8 HandleInput(void) static void AddBoxMenu(void) { InitMenu(); - SetMenuText(9); - SetMenuText(10); - SetMenuText(11); - SetMenuText(0); + SetMenuText(MENU_JUMP); + SetMenuText(MENU_WALLPAPER); + SetMenuText(MENU_NAME); + SetMenuText(MENU_CANCEL); } static u8 sub_80CFA5C(void) @@ -7538,13 +7578,13 @@ static bool8 sub_80CFA84(void) { case BOX_OPTION_DEPOSIT: if (var0) - SetMenuText(1); + SetMenuText(MENU_STORE); else return FALSE; break; case BOX_OPTION_WITHDRAW: if (var0) - SetMenuText(2); + SetMenuText(MENU_WITHDRAW); else return FALSE; break; @@ -7552,14 +7592,14 @@ static bool8 sub_80CFA84(void) if (sIsMonBeingMoved) { if (var0) - SetMenuText(4); + SetMenuText(MENU_SHIFT); else - SetMenuText(5); + SetMenuText(MENU_PLACE); } else { if (var0) - SetMenuText(3); + SetMenuText(MENU_MOVE); else return FALSE; } @@ -7569,18 +7609,18 @@ static bool8 sub_80CFA84(void) return FALSE; } - SetMenuText(6); + SetMenuText(MENU_SUMMARY); if (sPSSData->boxOption == BOX_OPTION_MOVE_MONS) { if (!sBoxCursorArea) - SetMenuText(2); + SetMenuText(MENU_WITHDRAW); else - SetMenuText(1); + SetMenuText(MENU_STORE); } - SetMenuText(8); - SetMenuText(7); - SetMenuText(0); + SetMenuText(MENU_MARK); + SetMenuText(MENU_RELEASE); + SetMenuText(MENU_CANCEL); return TRUE; } @@ -7596,16 +7636,16 @@ static bool8 sub_80CFB44(void) if (sPSSData->cursorMonSpecies == SPECIES_NONE) return FALSE; - SetMenuText(14); + SetMenuText(MENU_GIVE_2); } else { if (!ItemIsMail(sPSSData->cursorMonItem)) { - SetMenuText(12); - SetMenuText(16); + SetMenuText(MENU_TAKE); + SetMenuText(MENU_BAG); } - SetMenuText(17); + SetMenuText(MENU_INFO); } } else @@ -7615,18 +7655,18 @@ static bool8 sub_80CFB44(void) if (sPSSData->cursorMonSpecies == SPECIES_NONE) return FALSE; - SetMenuText(13); + SetMenuText(MENU_GIVE); } else { if (ItemIsMail(sPSSData->cursorMonItem) == TRUE) return FALSE; - SetMenuText(15); + SetMenuText(MENU_SWITCH); } } - SetMenuText(0); + SetMenuText(MENU_CANCEL); return TRUE; } @@ -7825,57 +7865,57 @@ static void InitMenu(void) sPSSData->menuWindow.baseBlock = 92; } -static const u8 *const gUnknown_0857BA80[] = +static const u8 *const sMenuTexts[] = { - gPCText_Cancel, - gPCText_Store, - gPCText_Withdraw, - gPCText_Move, - gPCText_Shift, - gPCText_Place, - gPCText_Summary, - gPCText_Release, - gPCText_Mark, - gPCText_Jump, - gPCText_Wallpaper, - gPCText_Name, - gPCText_Take, - gPCText_Give, - gPCText_Give, - gPCText_Switch, - gPCText_Bag, - gPCText_Info, - gPCText_Scenery1, - gPCText_Scenery2, - gPCText_Scenery3, - gPCText_Etcetera, - gPCText_Friends, - gPCText_Forest, - gPCText_City, - gPCText_Desert, - gPCText_Savanna, - gPCText_Crag, - gPCText_Volcano, - gPCText_Snow, - gPCText_Cave, - gPCText_Beach, - gPCText_Seafloor, - gPCText_River, - gPCText_Sky, - gPCText_PolkaDot, - gPCText_Pokecenter, - gPCText_Machine, - gPCText_Simple, + [MENU_CANCEL] = gPCText_Cancel, + [MENU_STORE] = gPCText_Store, + [MENU_WITHDRAW] = gPCText_Withdraw, + [MENU_MOVE] = gPCText_Move, + [MENU_SHIFT] = gPCText_Shift, + [MENU_PLACE] = gPCText_Place, + [MENU_SUMMARY] = gPCText_Summary, + [MENU_RELEASE] = gPCText_Release, + [MENU_MARK] = gPCText_Mark, + [MENU_JUMP] = gPCText_Jump, + [MENU_WALLPAPER] = gPCText_Wallpaper, + [MENU_NAME] = gPCText_Name, + [MENU_TAKE] = gPCText_Take, + [MENU_GIVE] = gPCText_Give, + [MENU_GIVE_2] = gPCText_Give, + [MENU_SWITCH] = gPCText_Switch, + [MENU_BAG] = gPCText_Bag, + [MENU_INFO] = gPCText_Info, + [MENU_SCENERY_1] = gPCText_Scenery1, + [MENU_SCENERY_2] = gPCText_Scenery2, + [MENU_SCENERY_3] = gPCText_Scenery3, + [MENU_ETCETERA] = gPCText_Etcetera, + [MENU_FRIENDS] = gPCText_Friends, + [MENU_FOREST] = gPCText_Forest, + [MENU_CITY] = gPCText_City, + [MENU_DESERT] = gPCText_Desert, + [MENU_SAVANNA] = gPCText_Savanna, + [MENU_CRAG] = gPCText_Crag, + [MENU_VOLCANO] = gPCText_Volcano, + [MENU_SNOW] = gPCText_Snow, + [MENU_CAVE] = gPCText_Cave, + [MENU_BEACH] = gPCText_Beach, + [MENU_SEAFLOOR] = gPCText_Seafloor, + [MENU_RIVER] = gPCText_River, + [MENU_SKY] = gPCText_Sky, + [MENU_POLKADOT] = gPCText_PolkaDot, + [MENU_POKECENTER] = gPCText_Pokecenter, + [MENU_MACHINE] = gPCText_Machine, + [MENU_SIMPLE] = gPCText_Simple, }; static void SetMenuText(u8 textId) { - if (sPSSData->menuItemsCount < 7) + if (sPSSData->menuItemsCount < ARRAY_COUNT(sPSSData->menuItems)) { u8 len; struct StorageMenu *menu = &sPSSData->menuItems[sPSSData->menuItemsCount]; - menu->text = gUnknown_0857BA80[textId]; + menu->text = sMenuTexts[textId]; menu->textId = textId; len = StringLength(menu->text); if (len > sPSSData->menuWidth) @@ -7885,12 +7925,12 @@ static void SetMenuText(u8 textId) } } -static s8 sub_80CFF98(u8 arg0) +static s8 GetMenuItemTextId(u8 menuIdx) { - if (arg0 >= sPSSData->menuItemsCount) + if (menuIdx >= sPSSData->menuItemsCount) return -1; else - return sPSSData->menuItems[arg0].textId; + return sPSSData->menuItems[menuIdx].textId; } static void AddMenu(void) @@ -7899,11 +7939,11 @@ static void AddMenu(void) sPSSData->menuWindow.height = 2 * sPSSData->menuItemsCount; sPSSData->menuWindow.tilemapLeft = 29 - sPSSData->menuWindow.width; sPSSData->menuWindow.tilemapTop = 15 - sPSSData->menuWindow.height; - sPSSData->field_CB0 = AddWindow(&sPSSData->menuWindow); - ClearWindowTilemap(sPSSData->field_CB0); - DrawStdFrameWithCustomTileAndPalette(sPSSData->field_CB0, FALSE, 11, 14); - PrintMenuTable(sPSSData->field_CB0, sPSSData->menuItemsCount, (void*)sPSSData->menuItems); - InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sPSSData->field_CB0, sPSSData->menuItemsCount, 0); + sPSSData->menuWindowId = AddWindow(&sPSSData->menuWindow); + ClearWindowTilemap(sPSSData->menuWindowId); + DrawStdFrameWithCustomTileAndPalette(sPSSData->menuWindowId, FALSE, 11, 14); + PrintMenuTable(sPSSData->menuWindowId, sPSSData->menuItemsCount, (void*)sPSSData->menuItems); + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sPSSData->menuWindowId, sPSSData->menuItemsCount, 0); ScheduleBgCopyTilemapToVram(0); sPSSData->field_CAE = 0; } @@ -7913,21 +7953,21 @@ static bool8 sub_80D00A8(void) return FALSE; } -static s16 sub_80D00AC(void) +static s16 HandleMenuInput(void) { - s32 textId = -2; + s32 input = MENU_NOTHING_CHOSEN; do { if (JOY_NEW(A_BUTTON)) { - textId = Menu_GetCursorPos(); + input = Menu_GetCursorPos(); break; } else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); - textId = -1; + input = MENU_B_PRESSED; } if (JOY_NEW(DPAD_UP)) @@ -7942,19 +7982,19 @@ static s16 sub_80D00AC(void) } } while (0); - if (textId != -2) - sub_80D013C(); + if (input != MENU_NOTHING_CHOSEN) + RemoveMenu(); - if (textId >= 0) - textId = sPSSData->menuItems[textId].textId; + if (input >= 0) + input = sPSSData->menuItems[input].textId; - return textId; + return input; } -static void sub_80D013C(void) +static void RemoveMenu(void) { - ClearStdWindowAndFrameToTransparent(sPSSData->field_CB0, TRUE); - RemoveWindow(sPSSData->field_CB0); + ClearStdWindowAndFrameToTransparent(sPSSData->menuWindowId, TRUE); + RemoveWindow(sPSSData->menuWindowId); } // The functions below handle moving and grabbing multiple mons at once. From a1ed59450e133a9dd84c59869418d449e48fc1ce Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 15 Apr 2021 14:06:25 -0400 Subject: [PATCH 43/63] Doc storage - wallpaper and titles --- include/pokemon_storage_system.h | 2 - src/data/wallpapers.h | 393 +++++++++++ src/pokemon_storage_system.c | 1129 +++++++++++------------------- 3 files changed, 789 insertions(+), 735 deletions(-) create mode 100644 src/data/wallpapers.h diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 7b6a38678..4e5ccfcda 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -51,8 +51,6 @@ void ZeroBoxMonAt(u8 boxId, u8 boxPosition); void BoxMonAtToMon(u8 boxId, u8 boxPosition, struct Pokemon *dst); struct BoxPokemon *GetBoxedMonPtr(u8 boxId, u8 boxPosition); u8 *GetBoxNamePtr(u8 boxId); -u8 GetBoxWallpaper(u8 boxId); -void SetBoxWallpaper(u8 boxId, u8 wallpaperId); s16 sub_80D214C(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3); bool8 CheckFreePokemonStorageSpace(void); bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); diff --git a/src/data/wallpapers.h b/src/data/wallpapers.h new file mode 100644 index 000000000..d075753b7 --- /dev/null +++ b/src/data/wallpapers.h @@ -0,0 +1,393 @@ +enum { + WALLPAPER_FOREST, + WALLPAPER_CITY, + WALLPAPER_DESERT, + WALLPAPER_SAVANNA, + WALLPAPER_CRAG, + WALLPAPER_VOLCANO, + WALLPAPER_SNOW, + WALLPAPER_CAVE, + WALLPAPER_BEACH, + WALLPAPER_SEAFLOOR, + WALLPAPER_RIVER, + WALLPAPER_SKY, + WALLPAPER_POLKADOT, + WALLPAPER_POKECENTER, + WALLPAPER_MACHINE, + WALLPAPER_PLAIN, + WALLPAPER_FRIENDS, // The one received as a gift from Walda's parents. + WALLPAPER_COUNT +}; +#define MAX_DEFAULT_WALLPAPER WALLPAPER_SAVANNA + +static const u16 sWallpaperPalettes_Forest[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/forest_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/forest_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Forest[] = INCBIN_U32("graphics/pokemon_storage/forest.4bpp.lz"); +static const u32 sWallpaperTilemap_Forest[] = INCBIN_U32("graphics/pokemon_storage/forest.bin.lz"); + +static const u16 sWallpaperPalettes_City[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/city_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/city_bg.gbapal"), +}; +static const u32 sWallpaperTiles_City[] = INCBIN_U32("graphics/pokemon_storage/city.4bpp.lz"); +static const u32 sWallpaperTilemap_City[] = INCBIN_U32("graphics/pokemon_storage/city.bin.lz"); + +static const u16 sWallpaperPalettes_Desert[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/desert_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/desert_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Desert[] = INCBIN_U32("graphics/pokemon_storage/desert.4bpp.lz"); +static const u32 sWallpaperTilemap_Desert[] = INCBIN_U32("graphics/pokemon_storage/desert.bin.lz"); + +static const u16 sWallpaperPalettes_Savanna[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/savanna_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/savanna_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Savanna[] = INCBIN_U32("graphics/pokemon_storage/savanna.4bpp.lz"); +static const u32 sWallpaperTilemap_Savanna[] = INCBIN_U32("graphics/pokemon_storage/savanna.bin.lz"); + +static const u16 sWallpaperPalettes_Crag[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/crag_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/crag_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Crag[] = INCBIN_U32("graphics/pokemon_storage/crag.4bpp.lz"); +static const u32 sWallpaperTilemap_Crag[] = INCBIN_U32("graphics/pokemon_storage/crag.bin.lz"); + +static const u16 sWallpaperPalettes_Volcano[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/volcano_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/volcano_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Volcano[] = INCBIN_U32("graphics/pokemon_storage/volcano.4bpp.lz"); +static const u32 sWallpaperTilemap_Volcano[] = INCBIN_U32("graphics/pokemon_storage/volcano.bin.lz"); + +static const u16 sWallpaperPalettes_Snow[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/snow_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/snow_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Snow[] = INCBIN_U32("graphics/pokemon_storage/snow.4bpp.lz"); +static const u32 sWallpaperTilemap_Snow[] = INCBIN_U32("graphics/pokemon_storage/snow.bin.lz"); + +static const u16 sWallpaperPalettes_Cave[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/cave_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/cave_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Cave[] = INCBIN_U32("graphics/pokemon_storage/cave.4bpp.lz"); +static const u32 sWallpaperTilemap_Cave[] = INCBIN_U32("graphics/pokemon_storage/cave.bin.lz"); + +static const u16 sWallpaperPalettes_Beach[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/beach_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/beach_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Beach[] = INCBIN_U32("graphics/pokemon_storage/beach.4bpp.lz"); +static const u32 sWallpaperTilemap_Beach[] = INCBIN_U32("graphics/pokemon_storage/beach.bin.lz"); + +static const u16 sWallpaperPalettes_Seafloor[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/seafloor_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/seafloor_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Seafloor[] = INCBIN_U32("graphics/pokemon_storage/seafloor.4bpp.lz"); +static const u32 sWallpaperTilemap_Seafloor[] = INCBIN_U32("graphics/pokemon_storage/seafloor.bin.lz"); + +static const u16 sWallpaperPalettes_River[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/river_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/river_bg.gbapal"), +}; +static const u32 sWallpaperTiles_River[] = INCBIN_U32("graphics/pokemon_storage/river.4bpp.lz"); +static const u32 sWallpaperTilemap_River[] = INCBIN_U32("graphics/pokemon_storage/river.bin.lz"); +static const u16 sWallpaperPalettes_Sky[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/sky_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/sky_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Sky[] = INCBIN_U32("graphics/pokemon_storage/sky.4bpp.lz"); +static const u32 sWallpaperTilemap_Sky[] = INCBIN_U32("graphics/pokemon_storage/sky.bin.lz"); + +static const u16 sWallpaperPalettes_PolkaDot[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/polkadot_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/polkadot_bg.gbapal"), +}; +static const u32 sWallpaperTiles_PolkaDot[] = INCBIN_U32("graphics/pokemon_storage/polkadot.4bpp.lz"); +static const u32 sWallpaperTilemap_PolkaDot[] = INCBIN_U32("graphics/pokemon_storage/polkadot.bin.lz"); + +static const u16 sWallpaperPalettes_Pokecenter[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/pokecenter_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/pokecenter_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Pokecenter[] = INCBIN_U32("graphics/pokemon_storage/pokecenter.4bpp.lz"); +static const u32 sWallpaperTilemap_Pokecenter[] = INCBIN_U32("graphics/pokemon_storage/pokecenter.bin.lz"); + +static const u16 sWallpaperPalettes_Machine[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/machine_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/machine_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Machine[] = INCBIN_U32("graphics/pokemon_storage/machine.4bpp.lz"); +static const u32 sWallpaperTilemap_Machine[] = INCBIN_U32("graphics/pokemon_storage/machine.bin.lz"); + +static const u16 sWallpaperPalettes_Plain[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/plain_frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/plain_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.4bpp.lz"); +static const u32 sWallpaperTilemap_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.bin.lz"); + +// 12x18 tilemap +static const u32 gUnknown_085773C4[] = INCBIN_U32("graphics/unused/tilemap_5773C4.bin"); + +// Shadow color, text color +static const u16 sBoxTitleColors[WALLPAPER_COUNT][2] = +{ + [WALLPAPER_FOREST] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_CITY] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_DESERT] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_SAVANNA] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_CRAG] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_VOLCANO] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_SNOW] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_CAVE] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_BEACH] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_SEAFLOOR] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_RIVER] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_SKY] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_POLKADOT] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_POKECENTER] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_MACHINE] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_PLAIN] = {RGB(7, 7, 7), RGB_WHITE}, + [WALLPAPER_FRIENDS] = {RGB(7, 7, 7), RGB_WHITE} +}; + +#define WALLPAPER_ENTRY(name) {sWallpaperTiles_##name, sWallpaperTilemap_##name, sWallpaperPalettes_##name[0]} +// A few wallpapers are not defined in this file +#define WALLPAPER_ENTRY_G(name) {gWallpaperTiles_##name, gWallpaperTilemap_##name, gWallpaperPalettes_##name[0]} + +static const struct Wallpaper sWallpapers[WALLPAPER_COUNT - 1] = +{ + [WALLPAPER_FOREST] = WALLPAPER_ENTRY(Forest), + [WALLPAPER_CITY] = WALLPAPER_ENTRY(City), + [WALLPAPER_DESERT] = WALLPAPER_ENTRY(Desert), + [WALLPAPER_SAVANNA] = WALLPAPER_ENTRY(Savanna), + [WALLPAPER_CRAG] = WALLPAPER_ENTRY(Crag), + [WALLPAPER_VOLCANO] = WALLPAPER_ENTRY(Volcano), + [WALLPAPER_SNOW] = WALLPAPER_ENTRY(Snow), + [WALLPAPER_CAVE] = WALLPAPER_ENTRY(Cave), + [WALLPAPER_BEACH] = WALLPAPER_ENTRY(Beach), + [WALLPAPER_SEAFLOOR] = WALLPAPER_ENTRY(Seafloor), + [WALLPAPER_RIVER] = WALLPAPER_ENTRY(River), + [WALLPAPER_SKY] = WALLPAPER_ENTRY(Sky), + [WALLPAPER_POLKADOT] = WALLPAPER_ENTRY(PolkaDot), + [WALLPAPER_POKECENTER] = WALLPAPER_ENTRY(Pokecenter), + [WALLPAPER_MACHINE] = WALLPAPER_ENTRY(Machine), + [WALLPAPER_PLAIN] = WALLPAPER_ENTRY(Plain), +}; + +static const u8 sArrow_Gfx[] = INCBIN_U8("graphics/pokemon_storage/arrow.4bpp"); + +static const u16 sWallpaperPalettes_Zigzagoon[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), + INCBIN_U16("graphics/pokemon_storage/zigzagoon_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Zigzagoon[] = INCBIN_U32("graphics/pokemon_storage/zigzagoon.4bpp.lz"); +static const u32 sWallpaperTilemap_Zigzagoon[] = INCBIN_U32("graphics/pokemon_storage/zigzagoon.bin.lz"); + +static const u16 sWallpaperPalettes_Screen[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), + INCBIN_U16("graphics/pokemon_storage/screen_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Screen[] = INCBIN_U32("graphics/pokemon_storage/screen.4bpp.lz"); +static const u32 sWallpaperTilemap_Screen[] = INCBIN_U32("graphics/pokemon_storage/screen.bin.lz"); + +static const u16 sWallpaperPalettes_Diagonal[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), + INCBIN_U16("graphics/pokemon_storage/diagonal_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Diagonal[] = INCBIN_U32("graphics/pokemon_storage/diagonal.4bpp.lz"); +static const u32 sWallpaperTilemap_Diagonal[] = INCBIN_U32("graphics/pokemon_storage/diagonal.bin.lz"); + +static const u16 sWallpaperPalettes_Block[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/block_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/block_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Block[] = INCBIN_U32("graphics/pokemon_storage/block.4bpp.lz"); +static const u32 sWallpaperTilemap_Block[] = INCBIN_U32("graphics/pokemon_storage/block.bin.lz"); + +static const u16 sWallpaperPalettes_Pokecenter2[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/pokecenter2_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/pokecenter2_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Pokecenter2[] = INCBIN_U32("graphics/pokemon_storage/pokecenter2.4bpp.lz"); +static const u32 sWallpaperTilemap_Pokecenter2[] = INCBIN_U32("graphics/pokemon_storage/pokecenter2.bin.lz"); + +static const u16 sWallpaperPalettes_Frame[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/frame_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/frame_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Frame[] = INCBIN_U32("graphics/pokemon_storage/frame.4bpp.lz"); +static const u32 sWallpaperTilemap_Frame[] = INCBIN_U32("graphics/pokemon_storage/frame.bin.lz"); + +static const u16 sWallpaperPalettes_Blank[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), + INCBIN_U16("graphics/pokemon_storage/zigzagoon_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Blank[] = INCBIN_U32("graphics/pokemon_storage/blank.4bpp.lz"); +static const u32 sWallpaperTilemap_Blank[] = INCBIN_U32("graphics/pokemon_storage/blank.bin.lz"); + +static const u16 sWallpaperPalettes_Circles[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/circles_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Circles[] = INCBIN_U32("graphics/pokemon_storage/circles.4bpp.lz"); +static const u32 sWallpaperTilemap_Circles[] = INCBIN_U32("graphics/pokemon_storage/circles.bin.lz"); + +static const u16 sWallpaperPalettes_Azumarill[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/azumarill_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Azumarill[] = INCBIN_U32("graphics/pokemon_storage/azumarill.4bpp.lz"); +static const u32 sWallpaperTilemap_Azumarill[] = INCBIN_U32("graphics/pokemon_storage/azumarill.bin.lz"); + +static const u16 sWallpaperPalettes_Pikachu[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/pikachu_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Pikachu[] = INCBIN_U32("graphics/pokemon_storage/pikachu.4bpp.lz"); +static const u32 sWallpaperTilemap_Pikachu[] = INCBIN_U32("graphics/pokemon_storage/pikachu.bin.lz"); + +static const u16 sWallpaperPalettes_Legendary[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/legendary_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Legendary[] = INCBIN_U32("graphics/pokemon_storage/legendary.4bpp.lz"); +static const u32 sWallpaperTilemap_Legendary[] = INCBIN_U32("graphics/pokemon_storage/legendary.bin.lz"); + +static const u16 sWallpaperPalettes_Dusclops[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/dusclops_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Dusclops[] = INCBIN_U32("graphics/pokemon_storage/dusclops.4bpp.lz"); +static const u32 sWallpaperTilemap_Dusclops[] = INCBIN_U32("graphics/pokemon_storage/dusclops.bin.lz"); + +static const u16 sWallpaperPalettes_Ludicolo[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/ludicolo_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Ludicolo[] = INCBIN_U32("graphics/pokemon_storage/ludicolo.4bpp.lz"); +static const u32 sWallpaperTilemap_Ludicolo[] = INCBIN_U32("graphics/pokemon_storage/ludicolo.bin.lz"); + +static const u16 sWallpaperPalettes_Whiscash[][16] = +{ + INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/whiscash_bg.gbapal"), +}; +static const u32 sWallpaperTiles_Whiscash[] = INCBIN_U32("graphics/pokemon_storage/whiscash.4bpp.lz"); +static const u32 sWallpaperTilemap_Whiscash[] = INCBIN_U32("graphics/pokemon_storage/whiscash.bin.lz"); + +static const u32 sWallpaperIcon_Aqua[] = INCBIN_U32("graphics/pokemon_storage/aqua_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Heart[] = INCBIN_U32("graphics/pokemon_storage/heart_icon.4bpp.lz"); +static const u32 sWallpaperIcon_FiveStar[] = INCBIN_U32("graphics/pokemon_storage/five_star_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Brick[] = INCBIN_U32("graphics/pokemon_storage/brick_icon.4bpp.lz"); +static const u32 sWallpaperIcon_FourStar[] = INCBIN_U32("graphics/pokemon_storage/four_star_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Asterisk[] = INCBIN_U32("graphics/pokemon_storage/asterisk_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Dot[] = INCBIN_U32("graphics/pokemon_storage/dot_icon.4bpp.lz"); +static const u32 sWallpaperIcon_LineCircle[] = INCBIN_U32("graphics/pokemon_storage/line_circle_icon.4bpp.lz"); +static const u32 sWallpaperIcon_PokeBall[] = INCBIN_U32("graphics/pokemon_storage/pokeball_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Maze[] = INCBIN_U32("graphics/pokemon_storage/maze_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Footprint[] = INCBIN_U32("graphics/pokemon_storage/footprint_icon.4bpp.lz"); +static const u32 sWallpaperIcon_BigAsterisk[] = INCBIN_U32("graphics/pokemon_storage/big_asterisk_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Circle[] = INCBIN_U32("graphics/pokemon_storage/circle_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Koffing[] = INCBIN_U32("graphics/pokemon_storage/koffing_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Ribbon[] = INCBIN_U32("graphics/pokemon_storage/ribbon_icon.4bpp.lz"); +static const u32 sWallpaperIcon_FourCircles[] = INCBIN_U32("graphics/pokemon_storage/four_circles_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Lotad[] = INCBIN_U32("graphics/pokemon_storage/lotad_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Crystal[] = INCBIN_U32("graphics/pokemon_storage/crystal_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Pichu[] = INCBIN_U32("graphics/pokemon_storage/pichu_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Diglett[] = INCBIN_U32("graphics/pokemon_storage/diglett_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Luvdisc[] = INCBIN_U32("graphics/pokemon_storage/luvdisc_icon.4bpp.lz"); +static const u32 sWallpaperIcon_StarInCircle[] = INCBIN_U32("graphics/pokemon_storage/star_in_circle_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Spinda[] = INCBIN_U32("graphics/pokemon_storage/spinda_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Latis[] = INCBIN_U32("graphics/pokemon_storage/latis_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Minun[] = INCBIN_U32("graphics/pokemon_storage/minun_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Togepi[] = INCBIN_U32("graphics/pokemon_storage/togepi_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Magma[] = INCBIN_U32("graphics/pokemon_storage/magma_icon.4bpp.lz"); + +static const struct Wallpaper sWaldaWallpapers[] = +{ + WALLPAPER_ENTRY(Zigzagoon), + WALLPAPER_ENTRY(Screen), + WALLPAPER_ENTRY_G(Horizontal), + WALLPAPER_ENTRY(Diagonal), + WALLPAPER_ENTRY(Block), + WALLPAPER_ENTRY_G(Ribbon), + WALLPAPER_ENTRY(Pokecenter2), + WALLPAPER_ENTRY(Frame), + WALLPAPER_ENTRY(Blank), + WALLPAPER_ENTRY(Circles), + WALLPAPER_ENTRY(Azumarill), + WALLPAPER_ENTRY(Pikachu), + WALLPAPER_ENTRY(Legendary), + WALLPAPER_ENTRY(Dusclops), + WALLPAPER_ENTRY(Ludicolo), + WALLPAPER_ENTRY(Whiscash), +}; + +static const u32 *const sWaldaWallpaperIcons[] = +{ + sWallpaperIcon_Aqua, + sWallpaperIcon_Heart, + sWallpaperIcon_FiveStar, + sWallpaperIcon_Brick, + sWallpaperIcon_FourStar, + sWallpaperIcon_Asterisk, + sWallpaperIcon_Dot, + gWallpaperIcon_Cross, + sWallpaperIcon_LineCircle, + sWallpaperIcon_PokeBall, + sWallpaperIcon_Maze, + sWallpaperIcon_Footprint, + sWallpaperIcon_BigAsterisk, + sWallpaperIcon_Circle, + sWallpaperIcon_Koffing, + sWallpaperIcon_Ribbon, + gWallpaperIcon_Bolt, + sWallpaperIcon_FourCircles, + sWallpaperIcon_Lotad, + sWallpaperIcon_Crystal, + sWallpaperIcon_Pichu, + sWallpaperIcon_Diglett, + sWallpaperIcon_Luvdisc, + sWallpaperIcon_StarInCircle, + sWallpaperIcon_Spinda, + sWallpaperIcon_Latis, + gWallpaperIcon_Plusle, + sWallpaperIcon_Minun, + sWallpaperIcon_Togepi, + sWallpaperIcon_Magma, +}; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 99f16e43b..6bcc10afc 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -138,6 +138,7 @@ enum { MENU_MACHINE, MENU_SIMPLE, }; +#define MENU_WALLPAPER_SETS_START MENU_SCENERY_1 #define MENU_WALLPAPERS_START MENU_FOREST enum { @@ -153,27 +154,6 @@ enum { MODE_MOVE, }; -enum { - WALLPAPER_FOREST, - WALLPAPER_CITY, - WALLPAPER_DESERT, - WALLPAPER_SAVANNA, - WALLPAPER_CRAG, - WALLPAPER_VOLCANO, - WALLPAPER_SNOW, - WALLPAPER_CAVE, - WALLPAPER_BEACH, - WALLPAPER_SEAFLOOR, - WALLPAPER_RIVER, - WALLPAPER_SKY, - WALLPAPER_POLKADOT, - WALLPAPER_POKECENTER, - WALLPAPER_MACHINE, - WALLPAPER_PLAIN, - WALLPAPER_FRIENDS, // The one received as a gift from Walda's parents. - WALLPAPER_COUNT -}; - enum { FRIENDS_ZIGZAGOON, FRIENDS_SCREEN, @@ -206,26 +186,28 @@ enum { #define TAG_PAL_DAC6 0xDAC6 #define TAG_PAL_DACE 0xDACE #define TAG_PAL_DAC7 0xDAC7 -#define TAG_PAL_DAC9 0xDAC9 +#define PALTAG_BOX_TITLE 0xDAC9 #define TAG_PAL_DAC0 0xDAC0 #define TAG_PAL_DACB 0xDACB -#define TAG_TILE_WAVEFORM 0x5 -#define TAG_TILE_10 0x10 -#define TAG_TILE_2 0x2 -#define TAG_TILE_D 0xD -#define TAG_TILE_A 0xA -#define TAG_TILE_3 0x3 -#define TAG_TILE_4 0x4 -#define TAG_TILE_12 0x12 -#define TAG_TILE_7 0x7 -#define TAG_TILE_0 0x0 -#define TAG_TILE_1 0x1 +#define TAG_TILE_0 0 +#define TAG_TILE_1 1 +#define TAG_TILE_2 2 +#define GFXTAG_BOX_TITLE 3 +#define GFXTAG_BOX_TITLE_ALT 4 +#define TAG_TILE_WAVEFORM 5 +#define GFXTAG_ARROW 6 +#define TAG_TILE_7 7 +#define TAG_TILE_A 10 +#define TAG_TILE_D 13 +#define TAG_TILE_10 16 +#define TAG_TILE_12 18 -struct WallpaperTable + +struct Wallpaper { const u32 *tiles; - const u32 *tileMap; + const u32 *tilemap; const u16 *palettes; }; @@ -275,7 +257,7 @@ struct UnkPSSStruct_2002370 struct Sprite *unk_0000; struct Sprite *unk_0004[4]; u32 unk_0014[3]; - struct Sprite *unk_0020[2]; + struct Sprite *arrowSprites[2]; u8 filler_0028[0x214]; u32 unk_023c; u16 unk_0240; @@ -317,37 +299,37 @@ struct PokemonStorageSystemData u16 bg2_X; s16 wallpaperScrollSpeed; u16 field_2D0; - u8 field_2D2; + u8 wallpaperOffset; u8 field_2D3; // Written to, but never read. - u8 field_2D4; // Written to, but never read. + u8 scrollToBoxIdUnused; // Written to, but never read. u16 field_2D6; // Written to, but never read. - s16 field_2D8; // Written to, but never read. + s16 scrollDirectionUnused; // Written to, but never read. u16 field_2DA; // Written to, but never read. u16 field_2DC; // Written to, but never read. u16 field_2DE; // Written to, but never read. u16 field_2E0; // Written to, but never read. u8 filler[22]; - u8 field_2F8[1024]; - u8 field_6F8; - u8 field_6F9; // Written to, but never read. - u8 field_6FA; - s8 field_6FB; - u16 field_6FC[16]; - u16 field_71C; - u16 field_71E; - struct Sprite *field_720[2]; - struct Sprite *field_728[2]; - struct Sprite *field_730[2]; - u32 field_738; + u8 boxTitleTiles[1024]; + u8 boxTitleCycleId; + u8 wallpaperLoadState; // Written to, but never read. + u8 wallpaperLoadBoxId; + s8 wallpaperLoadDir; + u16 boxTitlePal[16]; + u16 boxTitlePalOffset; + u16 boxTitleAltPalOffset; + struct Sprite *curBoxTitleSprites[2]; + struct Sprite *nextBoxTitleSprites[2]; + struct Sprite *arrowSprites[2]; + u32 boxTitlePalBits; u8 field_73C[80]; // Unused u16 field_78C; // Written to, but never read. s16 wallpaperSetId; s16 wallpaperId; - u16 field_792[360]; + u16 wallpaperTilemap[360]; u8 wallpaperChangeState; - u8 field_A63; - u8 boxScrollDestination; - s8 field_A65; + u8 scrollState; + u8 scrollToBoxId; + s8 scrollDirection; u8 *wallpaperTiles; struct Sprite *movingMonSprite; struct Sprite *partySprites[PARTY_SIZE]; @@ -433,7 +415,7 @@ struct PokemonStorageSystemData struct BoxPokemon *box; } field_218C; u8 field_2190[40]; - u8 field_21B8[40]; + u8 boxTitleText[40]; u8 field_21E0[POKEMON_NAME_LENGTH + 1]; u8 itemName[20]; u8 inBoxMovingMode; @@ -449,7 +431,7 @@ struct PokemonStorageSystemData u8 field_22C4[0x800]; u8 field_2AC4[0x1800]; // Unused u8 field_42C4[0x800]; - u8 field_4AC4[0x1000]; + u8 wallpaperBgTilemapBuffer[0x1000]; u8 field_5AC4[0x800]; }; @@ -501,19 +483,19 @@ EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0; EWRAM_DATA static bool8 sCanOnlyMove = 0; // This file's functions. -static void CreatePCMenu(u8 whichMenu, s16 *windowIdPtr); -static void Cb2_EnterPSS(u8 boxOption); +static void CreatePCMenu(u8, s16 *); +static void Cb2_EnterPSS(u8); static u8 GetCurrentBoxOption(void); static u8 HandleInput(void); static u8 sub_80CDC2C(void); static u8 sub_80CB9BC(void); -static void LoadWallpaperGfx(u8 boxId, s8 direction); -static void sub_80CCCFC(u8 boxId, s8 direction); -static void sub_80CD0B8(s8 direction); -static void SetCurrentBox(u8 boxId); -static void sub_80CC32C(u8 boxId); -static void sub_80C7958(u8 curBox); -static void sub_80CCAE0(void *arg0); +static void LoadWallpaperGfx(u8, s8); +static void CreateIncomingBoxTitle(u8, s8); +static void StartBoxScrollArrowsSlide(s8); +static void SetCurrentBox(u8); +static void CreateInitBoxTask(u8); +static void sub_80C7958(u8); +static void TrimOldWallpaper(void *); static void sub_80C7B14(void); static void sub_80C7BB4(void); static void ScrollBackground(void); @@ -561,14 +543,14 @@ static void sub_80D1194(void); static void PrintCursorMonInfo(void); static void sub_80CA65C(void); static void AddWallpaperSetsMenu(void); -static void sub_80CD02C(void); +static void CreateBoxScrollArrows(void); static void InitMenu(void); -static void sub_80CD158(void); +static void StopBoxScrollArrowsSlide(void); static void sub_80CFC14(void); static void sub_80CEB40(void); -static void sub_80CCEE0(void); +static void CycleBoxTitleSprites(void); static void sub_80D1818(void); -static void sub_80D19B4(u32 arg0); +static void sub_80D19B4(u32); static void sub_80CAA74(void); static void PrintItemDescription(void); static void sub_80CE760(void); @@ -578,7 +560,7 @@ static void sub_80CFECC(void); static void sub_80CA9EC(void); static void FreePSSData(void); static void AddBoxMenu(void); -static void sub_80CCF9C(void); +static void CycleBoxTitleColor(void); static void MoveMon(void); static void PlaceMon(void); static void sub_80CAB20(void); @@ -588,16 +570,16 @@ static void sub_80CB950(void); static void sub_80CA9C0(void); static void SetUpDoShowPartyMenu(void); static void BoxSetMosaic(void); -static void sub_80C7CF4(struct Sprite *sprite); -static void sub_80CC100(struct Sprite *sprite); -static void sub_80CB278(struct Sprite *sprite); -static void sub_80CD210(struct Sprite *sprite); +static void SpriteCB_JumpBoxArrow(struct Sprite *); +static void sub_80CC100(struct Sprite *); +static void sub_80CB278(struct Sprite *); +static void SpriteCB_Arrow(struct Sprite *); static bool32 WaitForWallpaperGfxLoad(void); static bool8 InitPSSWindows(void); static bool8 sub_80CC0A0(void); static bool8 sub_80CE2A8(void); static bool8 sub_80D0164(void); -static bool8 sub_80CC35C(void); +static bool8 IsInitBoxActive(void); static bool8 sub_80D01E4(void); static bool8 sub_80CDED4(void); static bool8 sub_80CDF08(void); @@ -614,14 +596,14 @@ static bool8 sub_80D0BC0(void); static bool8 sub_80CA2B8(void); static bool8 DoWallpaperGfxChange(void); static bool8 DoMonPlaceChange(void); -static bool8 sub_80D00A8(void); +static bool8 IsMenuLoading(void); static bool8 CanMovePartyMon(void); static bool8 CanShiftMon(void); static bool8 IsCursorOnCloseBox(void); static bool8 IsCursorOnBox(void); static bool8 IsCursorInBox(void); static bool8 IsMonBeingMoved(void); -static bool8 TryStorePartyMonInBox(u8 boxId); +static bool8 TryStorePartyMonInBox(u8); static void Cb_InitPSS(u8 taskId); static void Cb_PlaceMon(u8 taskId); static void Cb_ChangeScreen(u8 taskId); @@ -653,34 +635,34 @@ static void Cb_HandleWallpapers(u8 taskId); static void Cb_NameBox(u8 taskId); static void Cb_PrintCantStoreMail(u8 taskId); static void Cb_HandleMovingMonFromParty(u8 taskId); -static void SetUpScrollToBox(u8 boxId); -static void sub_80CFE54(u8 animNum); -static void SetMovingMonPriority(u8 priority); -static void InitMonPlaceChange(u8 arg0); -static void SetMonMarkings(u8 markings); -static void ShowYesNoWindow(s8 cursorPos); -static void sub_80CDBF8(u8 cursorBoxPosition); -static void sub_80D01D0(u8 arg0); -static void sub_80CD1A8(bool8 arg0); -static void sub_80CA984(bool8 arg0); -static void CreatePartyMonsSprites(bool8 arg0); +static void SetUpScrollToBox(u8); +static void sub_80CFE54(u8); +static void SetMovingMonPriority(u8); +static void InitMonPlaceChange(u8); +static void SetMonMarkings(u8); +static void ShowYesNoWindow(s8); +static void sub_80CDBF8(u8); +static void sub_80D01D0(u8); +static void AnimateBoxScrollArrows(bool8); +static void sub_80CA984(bool8); +static void CreatePartyMonsSprites(bool8); static void PrintMessage(u8 id); static s16 HandleMenuInput(void); static s8 RunCanReleaseMon(void); static u8 GetBoxCursorPosition(void); -static void Item_FromMonToMoving(u8 cursorArea, u8 cursorPos); -static void Item_GiveMovingToMon(u8 cursorArea, u8 cursorPos); -static void Item_TakeMons(u8 cursorArea, u8 cursorPos); -static void Item_SwitchMonsWithMoving(u8 cursorArea, u8 cursorPos); -static struct Sprite *sub_80CD2E8(u16 x, u16 y, u8 animId, u8 priority, u8 subpriority); -static void SetWallpaperForCurrentBox(u8 wallpaperId); -static void AddWallpapersMenu(u8 wallpaperSet); +static void Item_FromMonToMoving(u8, u8); +static void Item_GiveMovingToMon(u8, u8); +static void Item_TakeMons(u8, u8); +static void Item_SwitchMonsWithMoving(u8, u8); +static struct Sprite *CreateJumpBoxArrows(u16, u16, u8, u8, u8); +static void SetWallpaperForCurrentBox(u8); +static void AddWallpapersMenu(u8); static u16 GetMovingItem(void); static void LoadCursorMonGfx(u16 species, u32 pid); static void sub_80CA2D0(struct Sprite *sprite); -static void sub_80CCF64(struct Sprite *sprite); +static void SpriteCB_OutgoingBoxTitle(struct Sprite *); static void sub_80CBA3C(struct Sprite *sprite); -static void sub_80CCF30(struct Sprite *sprite); +static void SpriteCB_IncomingBoxTitle(struct Sprite *); static void sub_80CBAF0(s16 yDelta); static void sub_80CAAA8(u8 arg0, bool8 isPartyMon); static const u8 *GetMovingItemName(void); @@ -690,13 +672,13 @@ static void sub_80D0E50(u8 cursorArea, u8 cursorPos); static void sub_80D0F38(u16 item); static struct Sprite *CreateMonIconSprite(u16 species, u32 personality, s16 x, s16 y, u8 oamPriority, u8 subpriority); static void DestroyBoxMonIcon(struct Sprite *sprite); -static void SetBoxSpeciesAndPersonalities(u8 boxId); -static void sub_80CB9D0(struct Sprite *sprite, u16 partyId); -static void sub_80CC370(u8 taskId); -static void sub_80CCB50(u8 boxId); +static void SetBoxSpeciesAndPersonalities(u8); +static void sub_80CB9D0(struct Sprite *, u16); +static void Task_InitBox(u8 taskId); +static void InitBoxTitle(u8 boxId); static s8 DetermineBoxScrollDirection(u8 boxId); -static void sub_80CCA3C(const void *tilemap, s8 direction, u8 arg2); -static s16 sub_80CD00C(const u8 *string); +static void DrawWallpaper(const void *, s8, u8); +static s16 GetBoxTitleBaseX(const u8 *); static bool8 MonPlaceChange_Shift(void); static bool8 MonPlaceChange_Move(void); static bool8 MonPlaceChange_Place(void); @@ -750,6 +732,8 @@ static void sub_80D2A90(struct UnkStruct_2000020 *arg0, struct UnkStruct_2000028 static void sub_80D2AA4(void); static void sub_80D2B88(struct UnkStruct_2000028 *unkStruct); static void sub_80D2C1C(struct UnkStruct_2000028 *unkStruct); +static u8 GetBoxWallpaper(u8); +static void SetBoxWallpaper(u8, u8); // static const rom data static const struct PSS_MenuStringPtrs gUnknown_085716C0[] = @@ -1126,450 +1110,83 @@ static const union AffineAnimCmd *const gSpriteAffineAnimTable_857291C[] = gSpriteAffineAnim_8572904 }; -static const u16 gWallpaperPalettes_Forest[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/forest_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/forest_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Forest[] = INCBIN_U32("graphics/pokemon_storage/forest.4bpp.lz"); -static const u32 gWallpaperTilemap_Forest[] = INCBIN_U32("graphics/pokemon_storage/forest.bin.lz"); - -static const u16 gWallpaperPalettes_City[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/city_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/city_bg.gbapal"), -}; -static const u32 gWallpaperTiles_City[] = INCBIN_U32("graphics/pokemon_storage/city.4bpp.lz"); -static const u32 gWallpaperTilemap_City[] = INCBIN_U32("graphics/pokemon_storage/city.bin.lz"); - -static const u16 gWallpaperPalettes_Desert[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/desert_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/desert_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Desert[] = INCBIN_U32("graphics/pokemon_storage/desert.4bpp.lz"); -static const u32 gWallpaperTilemap_Desert[] = INCBIN_U32("graphics/pokemon_storage/desert.bin.lz"); - -static const u16 gWallpaperPalettes_Savanna[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/savanna_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/savanna_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Savanna[] = INCBIN_U32("graphics/pokemon_storage/savanna.4bpp.lz"); -static const u32 gWallpaperTilemap_Savanna[] = INCBIN_U32("graphics/pokemon_storage/savanna.bin.lz"); - -static const u16 gWallpaperPalettes_Crag[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/crag_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/crag_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Crag[] = INCBIN_U32("graphics/pokemon_storage/crag.4bpp.lz"); -static const u32 gWallpaperTilemap_Crag[] = INCBIN_U32("graphics/pokemon_storage/crag.bin.lz"); - -static const u16 gWallpaperPalettes_Volcano[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/volcano_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/volcano_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Volcano[] = INCBIN_U32("graphics/pokemon_storage/volcano.4bpp.lz"); -static const u32 gWallpaperTilemap_Volcano[] = INCBIN_U32("graphics/pokemon_storage/volcano.bin.lz"); - -static const u16 gWallpaperPalettes_Snow[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/snow_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/snow_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Snow[] = INCBIN_U32("graphics/pokemon_storage/snow.4bpp.lz"); -static const u32 gWallpaperTilemap_Snow[] = INCBIN_U32("graphics/pokemon_storage/snow.bin.lz"); - -static const u16 gWallpaperPalettes_Cave[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/cave_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/cave_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Cave[] = INCBIN_U32("graphics/pokemon_storage/cave.4bpp.lz"); -static const u32 gWallpaperTilemap_Cave[] = INCBIN_U32("graphics/pokemon_storage/cave.bin.lz"); - -static const u16 gWallpaperPalettes_Beach[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/beach_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/beach_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Beach[] = INCBIN_U32("graphics/pokemon_storage/beach.4bpp.lz"); -static const u32 gWallpaperTilemap_Beach[] = INCBIN_U32("graphics/pokemon_storage/beach.bin.lz"); - -static const u16 gWallpaperPalettes_Seafloor[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/seafloor_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/seafloor_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Seafloor[] = INCBIN_U32("graphics/pokemon_storage/seafloor.4bpp.lz"); -static const u32 gWallpaperTilemap_Seafloor[] = INCBIN_U32("graphics/pokemon_storage/seafloor.bin.lz"); - -static const u16 gWallpaperPalettes_River[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/river_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/river_bg.gbapal"), -}; -static const u32 gWallpaperTiles_River[] = INCBIN_U32("graphics/pokemon_storage/river.4bpp.lz"); -static const u32 gWallpaperTilemap_River[] = INCBIN_U32("graphics/pokemon_storage/river.bin.lz"); -static const u16 gWallpaperPalettes_Sky[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/sky_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/sky_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Sky[] = INCBIN_U32("graphics/pokemon_storage/sky.4bpp.lz"); -static const u32 gWallpaperTilemap_Sky[] = INCBIN_U32("graphics/pokemon_storage/sky.bin.lz"); - -static const u16 gWallpaperPalettes_PolkaDot[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/polkadot_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/polkadot_bg.gbapal"), -}; -static const u32 gWallpaperTiles_PolkaDot[] = INCBIN_U32("graphics/pokemon_storage/polkadot.4bpp.lz"); -static const u32 gWallpaperTilemap_PolkaDot[] = INCBIN_U32("graphics/pokemon_storage/polkadot.bin.lz"); - -static const u16 gWallpaperPalettes_Pokecenter[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/pokecenter_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/pokecenter_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Pokecenter[] = INCBIN_U32("graphics/pokemon_storage/pokecenter.4bpp.lz"); -static const u32 gWallpaperTilemap_Pokecenter[] = INCBIN_U32("graphics/pokemon_storage/pokecenter.bin.lz"); - -static const u16 gWallpaperPalettes_Machine[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/machine_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/machine_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Machine[] = INCBIN_U32("graphics/pokemon_storage/machine.4bpp.lz"); -static const u32 gWallpaperTilemap_Machine[] = INCBIN_U32("graphics/pokemon_storage/machine.bin.lz"); - -static const u16 gWallpaperPalettes_Plain[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/plain_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/plain_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.4bpp.lz"); -static const u32 gWallpaperTilemap_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.bin.lz"); - -// 12x18 tilemap -static const u32 gUnknown_085773C4[] = INCBIN_U32("graphics/unused/tilemap_5773C4.bin"); - -static const u16 gUnknown_08577574[][2] = -{ - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF}, - {0x1CE7, 0x7FFF} -}; - -#define WALLPAPER_ENTRY(name) {gWallpaperTiles_##name, gWallpaperTilemap_##name, gWallpaperPalettes_##name[0]} - -static const struct WallpaperTable gWallpaperTable[] = -{ - [WALLPAPER_FOREST] = WALLPAPER_ENTRY(Forest), - [WALLPAPER_CITY] = WALLPAPER_ENTRY(City), - [WALLPAPER_DESERT] = WALLPAPER_ENTRY(Desert), - [WALLPAPER_SAVANNA] = WALLPAPER_ENTRY(Savanna), - [WALLPAPER_CRAG] = WALLPAPER_ENTRY(Crag), - [WALLPAPER_VOLCANO] = WALLPAPER_ENTRY(Volcano), - [WALLPAPER_SNOW] = WALLPAPER_ENTRY(Snow), - [WALLPAPER_CAVE] = WALLPAPER_ENTRY(Cave), - [WALLPAPER_BEACH] = WALLPAPER_ENTRY(Beach), - [WALLPAPER_SEAFLOOR] = WALLPAPER_ENTRY(Seafloor), - [WALLPAPER_RIVER] = WALLPAPER_ENTRY(River), - [WALLPAPER_SKY] = WALLPAPER_ENTRY(Sky), - [WALLPAPER_POLKADOT] = WALLPAPER_ENTRY(PolkaDot), - [WALLPAPER_POKECENTER] = WALLPAPER_ENTRY(Pokecenter), - [WALLPAPER_MACHINE] = WALLPAPER_ENTRY(Machine), - [WALLPAPER_PLAIN] = WALLPAPER_ENTRY(Plain), -}; - -static const u8 gPCGfx_Arrow[] = INCBIN_U8("graphics/pokemon_storage/arrow.4bpp"); - -static const u16 gWallpaperPalettes_Zigzagoon[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), - INCBIN_U16("graphics/pokemon_storage/zigzagoon_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Zigzagoon[] = INCBIN_U32("graphics/pokemon_storage/zigzagoon.4bpp.lz"); -static const u32 gWallpaperTilemap_Zigzagoon[] = INCBIN_U32("graphics/pokemon_storage/zigzagoon.bin.lz"); - -static const u16 gWallpaperPalettes_Screen[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), - INCBIN_U16("graphics/pokemon_storage/screen_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Screen[] = INCBIN_U32("graphics/pokemon_storage/screen.4bpp.lz"); -static const u32 gWallpaperTilemap_Screen[] = INCBIN_U32("graphics/pokemon_storage/screen.bin.lz"); - -static const u16 gWallpaperPalettes_Diagonal[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), - INCBIN_U16("graphics/pokemon_storage/diagonal_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Diagonal[] = INCBIN_U32("graphics/pokemon_storage/diagonal.4bpp.lz"); -static const u32 gWallpaperTilemap_Diagonal[] = INCBIN_U32("graphics/pokemon_storage/diagonal.bin.lz"); - -static const u16 gWallpaperPalettes_Block[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/block_bg.gbapal"), - INCBIN_U16("graphics/pokemon_storage/block_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Block[] = INCBIN_U32("graphics/pokemon_storage/block.4bpp.lz"); -static const u32 gWallpaperTilemap_Block[] = INCBIN_U32("graphics/pokemon_storage/block.bin.lz"); - -static const u16 gWallpaperPalettes_Pokecenter2[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/pokecenter2_bg.gbapal"), - INCBIN_U16("graphics/pokemon_storage/pokecenter2_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Pokecenter2[] = INCBIN_U32("graphics/pokemon_storage/pokecenter2.4bpp.lz"); -static const u32 gWallpaperTilemap_Pokecenter2[] = INCBIN_U32("graphics/pokemon_storage/pokecenter2.bin.lz"); - -static const u16 gWallpaperPalettes_Frame[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/frame_bg.gbapal"), - INCBIN_U16("graphics/pokemon_storage/frame_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Frame[] = INCBIN_U32("graphics/pokemon_storage/frame.4bpp.lz"); -static const u32 gWallpaperTilemap_Frame[] = INCBIN_U32("graphics/pokemon_storage/frame.bin.lz"); - -static const u16 gWallpaperPalettes_Blank[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), - INCBIN_U16("graphics/pokemon_storage/zigzagoon_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Blank[] = INCBIN_U32("graphics/pokemon_storage/blank.4bpp.lz"); -static const u32 gWallpaperTilemap_Blank[] = INCBIN_U32("graphics/pokemon_storage/blank.bin.lz"); - -static const u16 gWallpaperPalettes_Circles[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/circles_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Circles[] = INCBIN_U32("graphics/pokemon_storage/circles.4bpp.lz"); -static const u32 gWallpaperTilemap_Circles[] = INCBIN_U32("graphics/pokemon_storage/circles.bin.lz"); - -static const u16 gWallpaperPalettes_Azumarill[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/azumarill_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Azumarill[] = INCBIN_U32("graphics/pokemon_storage/azumarill.4bpp.lz"); -static const u32 gWallpaperTilemap_Azumarill[] = INCBIN_U32("graphics/pokemon_storage/azumarill.bin.lz"); - -static const u16 gWallpaperPalettes_Pikachu[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/pikachu_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Pikachu[] = INCBIN_U32("graphics/pokemon_storage/pikachu.4bpp.lz"); -static const u32 gWallpaperTilemap_Pikachu[] = INCBIN_U32("graphics/pokemon_storage/pikachu.bin.lz"); - -static const u16 gWallpaperPalettes_Legendary[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/legendary_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Legendary[] = INCBIN_U32("graphics/pokemon_storage/legendary.4bpp.lz"); -static const u32 gWallpaperTilemap_Legendary[] = INCBIN_U32("graphics/pokemon_storage/legendary.bin.lz"); - -static const u16 gWallpaperPalettes_Dusclops[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/dusclops_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Dusclops[] = INCBIN_U32("graphics/pokemon_storage/dusclops.4bpp.lz"); -static const u32 gWallpaperTilemap_Dusclops[] = INCBIN_U32("graphics/pokemon_storage/dusclops.bin.lz"); - -static const u16 gWallpaperPalettes_Ludicolo[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/ludicolo_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Ludicolo[] = INCBIN_U32("graphics/pokemon_storage/ludicolo.4bpp.lz"); -static const u32 gWallpaperTilemap_Ludicolo[] = INCBIN_U32("graphics/pokemon_storage/ludicolo.bin.lz"); - -static const u16 gWallpaperPalettes_Whiscash[][16] = -{ - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/whiscash_bg.gbapal"), -}; -static const u32 gWallpaperTiles_Whiscash[] = INCBIN_U32("graphics/pokemon_storage/whiscash.4bpp.lz"); -static const u32 gWallpaperTilemap_Whiscash[] = INCBIN_U32("graphics/pokemon_storage/whiscash.bin.lz"); - -static const u32 gWallpaperIcon_Aqua[] = INCBIN_U32("graphics/pokemon_storage/aqua_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Heart[] = INCBIN_U32("graphics/pokemon_storage/heart_icon.4bpp.lz"); -static const u32 gWallpaperIcon_FiveStar[] = INCBIN_U32("graphics/pokemon_storage/five_star_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Brick[] = INCBIN_U32("graphics/pokemon_storage/brick_icon.4bpp.lz"); -static const u32 gWallpaperIcon_FourStar[] = INCBIN_U32("graphics/pokemon_storage/four_star_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Asterisk[] = INCBIN_U32("graphics/pokemon_storage/asterisk_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Dot[] = INCBIN_U32("graphics/pokemon_storage/dot_icon.4bpp.lz"); -static const u32 gWallpaperIcon_LineCircle[] = INCBIN_U32("graphics/pokemon_storage/line_circle_icon.4bpp.lz"); -static const u32 gWallpaperIcon_PokeBall[] = INCBIN_U32("graphics/pokemon_storage/pokeball_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Maze[] = INCBIN_U32("graphics/pokemon_storage/maze_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Footprint[] = INCBIN_U32("graphics/pokemon_storage/footprint_icon.4bpp.lz"); -static const u32 gWallpaperIcon_BigAsterisk[] = INCBIN_U32("graphics/pokemon_storage/big_asterisk_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Circle[] = INCBIN_U32("graphics/pokemon_storage/circle_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Koffing[] = INCBIN_U32("graphics/pokemon_storage/koffing_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Ribbon[] = INCBIN_U32("graphics/pokemon_storage/ribbon_icon.4bpp.lz"); -static const u32 gWallpaperIcon_FourCircles[] = INCBIN_U32("graphics/pokemon_storage/four_circles_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Lotad[] = INCBIN_U32("graphics/pokemon_storage/lotad_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Crystal[] = INCBIN_U32("graphics/pokemon_storage/crystal_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Pichu[] = INCBIN_U32("graphics/pokemon_storage/pichu_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Diglett[] = INCBIN_U32("graphics/pokemon_storage/diglett_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Luvdisc[] = INCBIN_U32("graphics/pokemon_storage/luvdisc_icon.4bpp.lz"); -static const u32 gWallpaperIcon_StarInCircle[] = INCBIN_U32("graphics/pokemon_storage/star_in_circle_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Spinda[] = INCBIN_U32("graphics/pokemon_storage/spinda_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Latis[] = INCBIN_U32("graphics/pokemon_storage/latis_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Minun[] = INCBIN_U32("graphics/pokemon_storage/minun_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Togepi[] = INCBIN_U32("graphics/pokemon_storage/togepi_icon.4bpp.lz"); -static const u32 gWallpaperIcon_Magma[] = INCBIN_U32("graphics/pokemon_storage/magma_icon.4bpp.lz"); - -static const struct WallpaperTable gFriendsWallpaperTable[] = -{ - WALLPAPER_ENTRY(Zigzagoon), - WALLPAPER_ENTRY(Screen), - WALLPAPER_ENTRY(Horizontal), - WALLPAPER_ENTRY(Diagonal), - WALLPAPER_ENTRY(Block), - WALLPAPER_ENTRY(Ribbon), - WALLPAPER_ENTRY(Pokecenter2), - WALLPAPER_ENTRY(Frame), - WALLPAPER_ENTRY(Blank), - WALLPAPER_ENTRY(Circles), - WALLPAPER_ENTRY(Azumarill), - WALLPAPER_ENTRY(Pikachu), - WALLPAPER_ENTRY(Legendary), - WALLPAPER_ENTRY(Dusclops), - WALLPAPER_ENTRY(Ludicolo), - WALLPAPER_ENTRY(Whiscash), -}; - -static const u32 *const gFriendsIcons[] = -{ - gWallpaperIcon_Aqua, - gWallpaperIcon_Heart, - gWallpaperIcon_FiveStar, - gWallpaperIcon_Brick, - gWallpaperIcon_FourStar, - gWallpaperIcon_Asterisk, - gWallpaperIcon_Dot, - gWallpaperIcon_Cross, - gWallpaperIcon_LineCircle, - gWallpaperIcon_PokeBall, - gWallpaperIcon_Maze, - gWallpaperIcon_Footprint, - gWallpaperIcon_BigAsterisk, - gWallpaperIcon_Circle, - gWallpaperIcon_Koffing, - gWallpaperIcon_Ribbon, - gWallpaperIcon_Bolt, - gWallpaperIcon_FourCircles, - gWallpaperIcon_Lotad, - gWallpaperIcon_Crystal, - gWallpaperIcon_Pichu, - gWallpaperIcon_Diglett, - gWallpaperIcon_Luvdisc, - gWallpaperIcon_StarInCircle, - gWallpaperIcon_Spinda, - gWallpaperIcon_Latis, - gWallpaperIcon_Plusle, - gWallpaperIcon_Minun, - gWallpaperIcon_Togepi, - gWallpaperIcon_Magma, -}; +#include "data/wallpapers.h" // Unknown Unused data. static const u16 gUnknown_0857B07C = 0x23BA; -static const struct SpriteSheet gUnknown_0857B080 = {gPCGfx_Arrow, 0x80, 6}; +static const struct SpriteSheet sSpriteSheet_Arrow = {sArrow_Gfx, 0x80, GFXTAG_ARROW}; -static const struct OamData gOamData_83BB298 = +static const struct OamData sOamData_BoxTitle = { .shape = SPRITE_SHAPE(32x16), .size = SPRITE_SIZE(32x16), .priority = 2 }; -static const union AnimCmd gSpriteAnim_83BB2A0[] = +static const union AnimCmd sAnim_BoxTitle_Left[] = { ANIMCMD_FRAME(0, 5), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_83BB2A8[] = +static const union AnimCmd sAnim_BoxTitle_Right[] = { ANIMCMD_FRAME(8, 5), ANIMCMD_END }; -static const union AnimCmd *const gSpriteAnimTable_83BB2B0[] = +static const union AnimCmd *const sAnims_BoxTitle[] = { - gSpriteAnim_83BB2A0, - gSpriteAnim_83BB2A8 + sAnim_BoxTitle_Left, + sAnim_BoxTitle_Right }; -static const struct SpriteTemplate gSpriteTemplate_857B0A8 = +static const struct SpriteTemplate sSpriteTemplate_BoxTitle = { - TAG_TILE_3, - TAG_PAL_DAC9, - &gOamData_83BB298, - gSpriteAnimTable_83BB2B0, - NULL, - gDummySpriteAffineAnimTable, - SpriteCallbackDummy + .tileTag = GFXTAG_BOX_TITLE, + .paletteTag = PALTAG_BOX_TITLE, + .oam = &sOamData_BoxTitle, + .anims = sAnims_BoxTitle, + .images NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy }; -static const struct OamData gOamData_83BB2D0 = +static const struct OamData sOamData_Arrow = { .shape = SPRITE_SHAPE(8x16), .size = SPRITE_SIZE(8x16), .priority = 2 }; -static const union AnimCmd gSpriteAnim_83BB2D8[] = +static const union AnimCmd sAnim_Arrow_Left[] = { ANIMCMD_FRAME(0, 5), ANIMCMD_END }; -static const union AnimCmd gSpriteAnim_83BB2E0[] = +static const union AnimCmd sAnim_Arrow_Right[] = { ANIMCMD_FRAME(2, 5), ANIMCMD_END }; -static const union AnimCmd *const gSpriteAnimTable_83BB2E8[] = +static const union AnimCmd *const sAnims_Arrow[] = { - gSpriteAnim_83BB2D8, - gSpriteAnim_83BB2E0 + sAnim_Arrow_Left, + sAnim_Arrow_Right }; -static const struct SpriteTemplate gUnknown_0857B0E0 = +static const struct SpriteTemplate sSpriteTemplate_Arrow = { - 6, - TAG_PAL_WAVEFORM, - &gOamData_83BB2D0, - gSpriteAnimTable_83BB2E8, - NULL, - gDummySpriteAffineAnimTable, - sub_80CD210 + .tileTag = GFXTAG_ARROW, + .paletteTag = TAG_PAL_WAVEFORM, + .oam = &sOamData_Arrow, + .anims = sAnims_Arrow, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_Arrow }; static const u16 gHandCursorPalette[] = INCBIN_U16("graphics/pokemon_storage/hand_cursor.gbapal"); @@ -1961,10 +1578,10 @@ void ResetPokemonStorageSystem(void) u8 *dest = StringCopy(GetBoxNamePtr(boxId), gText_Box); ConvertIntToDecimalStringN(dest, boxId + 1, STR_CONV_MODE_LEFT_ALIGN, 2); } + for (boxId = 0; boxId < TOTAL_BOXES_COUNT; boxId++) - { - SetBoxWallpaper(boxId, boxId % 4); - } + SetBoxWallpaper(boxId, boxId % (MAX_DEFAULT_WALLPAPER + 1)); + ResetWaldaWallpaper(); } @@ -2079,11 +1696,11 @@ static void sub_80C7958(u8 curBox) } for (i = 0; i < 2; i++) { - gUnknown_02039D04->unk_0020[i] = sub_80CD2E8(72 * i + 0x7c, 0x58, i, 0, gUnknown_02039D04->unk_0246); - if (gUnknown_02039D04->unk_0020[i]) + gUnknown_02039D04->arrowSprites[i] = CreateJumpBoxArrows(72 * i + 124, 88, i, 0, gUnknown_02039D04->unk_0246); + if (gUnknown_02039D04->arrowSprites[i]) { - gUnknown_02039D04->unk_0020[i]->data[0] = (i == 0 ? -1 : 1); - gUnknown_02039D04->unk_0020[i]->callback = sub_80C7CF4; + gUnknown_02039D04->arrowSprites[i]->data[0] = (i == 0 ? -1 : 1); + gUnknown_02039D04->arrowSprites[i]->callback = SpriteCB_JumpBoxArrow; } } sub_80C7BE4(); @@ -2107,8 +1724,8 @@ static void sub_80C7B14(void) } for (i = 0; i < 2; i++) { - if (gUnknown_02039D04->unk_0020[i]) - DestroySprite(gUnknown_02039D04->unk_0020[i]); + if (gUnknown_02039D04->arrowSprites[i]) + DestroySprite(gUnknown_02039D04->arrowSprites[i]); } } @@ -2156,7 +1773,7 @@ static void sub_80C7BE4(void) RemoveWindow(windowId); } -static void sub_80C7CF4(struct Sprite *sprite) +static void SpriteCB_JumpBoxArrow(struct Sprite *sprite) { if (++sprite->data[1] > 3) { @@ -2350,10 +1967,10 @@ static void Cb_InitPSS(u8 taskId) sub_80CA704(); break; case 8: - sub_80CC32C(StorageGetCurrentBox()); + CreateInitBoxTask(StorageGetCurrentBox()); break; case 9: - if (sub_80CC35C()) + if (IsInitBoxActive()) return; if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) @@ -2765,8 +2382,8 @@ static void Cb_OnSelectedMon(u8 taskId) sPSSData->state = 1; } break; - case 1: // debug? - if (!sub_80D00A8()) + case 1: + if (!IsMenuLoading()) sPSSData->state = 2; break; case 2: @@ -3553,7 +3170,7 @@ static void Cb_HandleBoxOptions(u8 taskId) sPSSData->state++; break; case 1: - if (sub_80D00A8()) + if (IsMenuLoading()) return; sPSSData->state++; case 2: @@ -3561,7 +3178,7 @@ static void Cb_HandleBoxOptions(u8 taskId) { case MENU_B_PRESSED: case MENU_CANCEL: - sub_80CD1A8(TRUE); + AnimateBoxScrollArrows(TRUE); ClearBottomWindow(); SetPSSCallback(Cb_MainPSS); break; @@ -3594,7 +3211,7 @@ static void Cb_HandleWallpapers(u8 taskId) sPSSData->state++; break; case 1: - if (!sub_80D00A8()) + if (!IsMenuLoading()) sPSSData->state++; break; case 2: @@ -3602,7 +3219,7 @@ static void Cb_HandleWallpapers(u8 taskId) switch (sPSSData->wallpaperSetId) { case MENU_B_PRESSED: - sub_80CD1A8(TRUE); + AnimateBoxScrollArrows(TRUE); ClearBottomWindow(); SetPSSCallback(Cb_MainPSS); break; @@ -3612,13 +3229,13 @@ static void Cb_HandleWallpapers(u8 taskId) case MENU_ETCETERA: PlaySE(SE_SELECT); RemoveMenu(); - sPSSData->wallpaperSetId -= 18; + sPSSData->wallpaperSetId -= MENU_WALLPAPER_SETS_START; sPSSData->state++; break; case MENU_FRIENDS: // New wallpaper from Walda. PlaySE(SE_SELECT); - sPSSData->wallpaperId = 16; + sPSSData->wallpaperId = WALLPAPER_FRIENDS; RemoveMenu(); ClearBottomWindow(); sPSSData->state = 6; @@ -3655,7 +3272,7 @@ static void Cb_HandleWallpapers(u8 taskId) case 5: if (!DoWallpaperGfxChange()) { - sub_80CD1A8(TRUE); + AnimateBoxScrollArrows(TRUE); SetPSSCallback(Cb_MainPSS); } break; @@ -3691,7 +3308,7 @@ static void Cb_JumpBox(u8 taskId) sub_80C7890(); if (sPSSData->newCurrBoxId == 201 || sPSSData->newCurrBoxId == StorageGetCurrentBox()) { - sub_80CD1A8(TRUE); + AnimateBoxScrollArrows(TRUE); SetPSSCallback(Cb_MainPSS); } else @@ -4493,25 +4110,25 @@ static void AddWallpapersMenu(u8 wallpaperSet) InitMenu(); switch (wallpaperSet) { - case 0: + case MENU_SCENERY_1 - MENU_WALLPAPER_SETS_START: SetMenuText(MENU_FOREST); SetMenuText(MENU_CITY); SetMenuText(MENU_DESERT); SetMenuText(MENU_SAVANNA); break; - case 1: + case MENU_SCENERY_2 - MENU_WALLPAPER_SETS_START: SetMenuText(MENU_CRAG); SetMenuText(MENU_VOLCANO); SetMenuText(MENU_SNOW); SetMenuText(MENU_CAVE); break; - case 2: + case MENU_SCENERY_3 - MENU_WALLPAPER_SETS_START: SetMenuText(MENU_BEACH); SetMenuText(MENU_SEAFLOOR); SetMenuText(MENU_RIVER); SetMenuText(MENU_SKY); break; - case 3: + case MENU_ETCETERA - MENU_WALLPAPER_SETS_START: SetMenuText(MENU_POLKADOT); SetMenuText(MENU_POKECENTER); SetMenuText(MENU_MACHINE); @@ -4576,7 +4193,7 @@ static void CreateMovingMonIcon(void) sPSSData->movingMonSprite->callback = sub_80CC100; } -static void sub_80CB028(u8 boxId) +static void InitBoxMonSprites(u8 boxId) { u8 boxPosition; u16 i, j, count; @@ -4585,6 +4202,8 @@ static void sub_80CB028(u8 boxId) count = 0; boxPosition = 0; + + // For each box slot, create a Pokémon icon if a species is present for (i = 0; i < IN_BOX_COLUMNS; i++) { for (j = 0; j < IN_BOX_ROWS; j++) @@ -4604,11 +4223,12 @@ static void sub_80CB028(u8 boxId) } } + // If in item mode, set all Pokémon icons with no item to be transparent if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) { for (boxPosition = 0; boxPosition < IN_BOX_COUNT; boxPosition++) { - if (GetBoxMonDataAt(boxId, boxPosition, MON_DATA_HELD_ITEM) == 0) + if (GetBoxMonDataAt(boxId, boxPosition, MON_DATA_HELD_ITEM) == ITEM_NONE) sPSSData->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; } } @@ -5260,59 +4880,67 @@ static void DestroyBoxMonIcon(struct Sprite *sprite) DestroySprite(sprite); } -static void sub_80CC32C(u8 boxId) -{ - u8 taskId = CreateTask(sub_80CC370, 2); +#define tState data[0] +#define tDmaIdx data[1] +#define tBoxId data[2] - gTasks[taskId].data[2] = boxId; +static void CreateInitBoxTask(u8 boxId) +{ + u8 taskId = CreateTask(Task_InitBox, 2); + + gTasks[taskId].tBoxId = boxId; } -static bool8 sub_80CC35C(void) +static bool8 IsInitBoxActive(void) { - return FuncIsActiveTask(sub_80CC370); + return FuncIsActiveTask(Task_InitBox); } -static void sub_80CC370(u8 taskId) +static void Task_InitBox(u8 taskId) { struct Task *task = &gTasks[taskId]; - switch (task->data[0]) + switch (task->tState) { case 0: - sPSSData->field_2D2 = 0; + sPSSData->wallpaperOffset = 0; sPSSData->bg2_X = 0; - task->data[1] = RequestDma3Fill(0, sPSSData->field_4AC4, 0x1000, 1); + task->tDmaIdx = RequestDma3Fill(0, sPSSData->wallpaperBgTilemapBuffer, sizeof(sPSSData->wallpaperBgTilemapBuffer), 1); break; case 1: - if (CheckForSpaceForDma3Request(task->data[1]) == -1) + if (CheckForSpaceForDma3Request(task->tDmaIdx) == -1) return; - SetBgTilemapBuffer(2, sPSSData->field_4AC4); + SetBgTilemapBuffer(2, sPSSData->wallpaperBgTilemapBuffer); ShowBg(2); break; case 2: - LoadWallpaperGfx(task->data[2], 0); + LoadWallpaperGfx(task->tBoxId, 0); break; case 3: if (!WaitForWallpaperGfxLoad()) return; - sub_80CCB50(task->data[2]); - sub_80CD02C(); - sub_80CB028(task->data[2]); + InitBoxTitle(task->tBoxId); + CreateBoxScrollArrows(); + InitBoxMonSprites(task->tBoxId); SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(27) | BGCNT_TXT512x256); break; case 4: DestroyTask(taskId); break; default: - task->data[0] = 0; + task->tState = 0; return; } - task->data[0]++; + task->tState++; } +#undef tState +#undef tDmaIdx +#undef tBoxId + static void SetUpScrollToBox(u8 boxId) { s8 direction = DetermineBoxScrollDirection(boxId); @@ -5320,34 +4948,35 @@ static void SetUpScrollToBox(u8 boxId) sPSSData->wallpaperScrollSpeed = (direction > 0) ? 6 : -6; sPSSData->field_2D3 = (direction > 0) ? 1 : 2; sPSSData->field_2D0 = 32; - sPSSData->field_2D4 = boxId; + sPSSData->scrollToBoxIdUnused = boxId; sPSSData->field_2D6 = (direction <= 0) ? 5 : 0; - sPSSData->field_2D8 = direction; + sPSSData->scrollDirectionUnused = direction; + sPSSData->field_2DA = (direction > 0) ? 264 : 56; sPSSData->field_2DC = (direction <= 0) ? 5 : 0; sPSSData->field_2DE = 0; sPSSData->field_2E0 = 2; - sPSSData->boxScrollDestination = boxId; - sPSSData->field_A65 = direction; - sPSSData->field_A63 = 0; + sPSSData->scrollToBoxId = boxId; + sPSSData->scrollDirection = direction; + sPSSData->scrollState = 0; } static bool8 ScrollToBox(void) { bool8 var; - switch (sPSSData->field_A63) + switch (sPSSData->scrollState) { case 0: - LoadWallpaperGfx(sPSSData->boxScrollDestination, sPSSData->field_A65); - sPSSData->field_A63++; + LoadWallpaperGfx(sPSSData->scrollToBoxId, sPSSData->scrollDirection); + sPSSData->scrollState++; case 1: if (!WaitForWallpaperGfxLoad()) return TRUE; - sub_80CB4CC(sPSSData->boxScrollDestination, sPSSData->field_A65); - sub_80CCCFC(sPSSData->boxScrollDestination, sPSSData->field_A65); - sub_80CD0B8(sPSSData->field_A65); + sub_80CB4CC(sPSSData->scrollToBoxId, sPSSData->scrollDirection); + CreateIncomingBoxTitle(sPSSData->scrollToBoxId, sPSSData->scrollDirection); + StartBoxScrollArrowsSlide(sPSSData->scrollDirection); break; case 2: var = sub_80CB584(); @@ -5356,13 +4985,13 @@ static bool8 ScrollToBox(void) sPSSData->bg2_X += sPSSData->wallpaperScrollSpeed; if (--sPSSData->field_2D0 != 0) return TRUE; - sub_80CCEE0(); - sub_80CD158(); + CycleBoxTitleSprites(); + StopBoxScrollArrowsSlide(); } return var; } - sPSSData->field_A63++; + sPSSData->scrollState++; return TRUE; } @@ -5393,7 +5022,7 @@ static bool8 DoWallpaperGfxChange(void) switch (sPSSData->wallpaperChangeState) { case 0: - BeginNormalPaletteFade(sPSSData->field_738, 1, 0, 16, RGB_WHITEALPHA); + BeginNormalPaletteFade(sPSSData->boxTitlePalBits, 1, 0, 16, RGB_WHITEALPHA); sPSSData->wallpaperChangeState++; break; case 1: @@ -5407,8 +5036,8 @@ static bool8 DoWallpaperGfxChange(void) case 2: if (WaitForWallpaperGfxLoad() == TRUE) { - sub_80CCF9C(); - BeginNormalPaletteFade(sPSSData->field_738, 1, 16, 0, RGB_WHITEALPHA); + CycleBoxTitleColor(); + BeginNormalPaletteFade(sPSSData->boxTitlePalBits, 1, 16, 0, RGB_WHITEALPHA); sPSSData->wallpaperChangeState++; } break; @@ -5426,54 +5055,54 @@ static bool8 DoWallpaperGfxChange(void) static void LoadWallpaperGfx(u8 boxId, s8 direction) { u8 wallpaperId; - const struct WallpaperTable *wallpaperGfx; + const struct Wallpaper *wallpaper; void *iconGfx; - u32 size1, size2; + u32 tilesSize, iconSize; - sPSSData->field_6F9 = 0; - sPSSData->field_6FA = boxId; - sPSSData->field_6FB = direction; - if (sPSSData->field_6FB != 0) + sPSSData->wallpaperLoadState = 0; + sPSSData->wallpaperLoadBoxId = boxId; + sPSSData->wallpaperLoadDir = direction; + if (sPSSData->wallpaperLoadDir != 0) { - sPSSData->field_2D2 = (sPSSData->field_2D2 == 0); - sub_80CCAE0(sPSSData->field_4AC4); + sPSSData->wallpaperOffset = (sPSSData->wallpaperOffset == 0); + TrimOldWallpaper(sPSSData->wallpaperBgTilemapBuffer); } - wallpaperId = GetBoxWallpaper(sPSSData->field_6FA); + wallpaperId = GetBoxWallpaper(sPSSData->wallpaperLoadBoxId); if (wallpaperId != WALLPAPER_FRIENDS) { - wallpaperGfx = &gWallpaperTable[wallpaperId]; - LZ77UnCompWram(wallpaperGfx->tileMap, sPSSData->field_792); - sub_80CCA3C(sPSSData->field_792, sPSSData->field_6FB, sPSSData->field_2D2); + wallpaper = &sWallpapers[wallpaperId]; + LZ77UnCompWram(wallpaper->tilemap, sPSSData->wallpaperTilemap); + DrawWallpaper(sPSSData->wallpaperTilemap, sPSSData->wallpaperLoadDir, sPSSData->wallpaperOffset); - if (sPSSData->field_6FB != 0) - LoadPalette(wallpaperGfx->palettes, (sPSSData->field_2D2 * 32) + 0x40, 0x40); + if (sPSSData->wallpaperLoadDir != 0) + LoadPalette(wallpaper->palettes, (sPSSData->wallpaperOffset * 32) + 0x40, 0x40); else - CpuCopy16(wallpaperGfx->palettes, &gPlttBufferUnfaded[(sPSSData->field_2D2 * 32) + 0x40], 0x40); + CpuCopy16(wallpaper->palettes, &gPlttBufferUnfaded[(sPSSData->wallpaperOffset * 32) + 0x40], 0x40); - sPSSData->wallpaperTiles = malloc_and_decompress(wallpaperGfx->tiles, &size1); - LoadBgTiles(2, sPSSData->wallpaperTiles, size1, sPSSData->field_2D2 << 8); + sPSSData->wallpaperTiles = malloc_and_decompress(wallpaper->tiles, &tilesSize); + LoadBgTiles(2, sPSSData->wallpaperTiles, tilesSize, sPSSData->wallpaperOffset << 8); } else { - wallpaperGfx = &gFriendsWallpaperTable[GetWaldaWallpaperPatternId()]; - LZ77UnCompWram(wallpaperGfx->tileMap, sPSSData->field_792); - sub_80CCA3C(sPSSData->field_792, sPSSData->field_6FB, sPSSData->field_2D2); + wallpaper = &sWaldaWallpapers[GetWaldaWallpaperPatternId()]; + LZ77UnCompWram(wallpaper->tilemap, sPSSData->wallpaperTilemap); + DrawWallpaper(sPSSData->wallpaperTilemap, sPSSData->wallpaperLoadDir, sPSSData->wallpaperOffset); - CpuCopy16(wallpaperGfx->palettes, sPSSData->field_792, 0x40); - CpuCopy16(GetWaldaWallpaperColorsPtr(), &sPSSData->field_792[1], 4); - CpuCopy16(GetWaldaWallpaperColorsPtr(), &sPSSData->field_792[17], 4); + CpuCopy16(wallpaper->palettes, sPSSData->wallpaperTilemap, 0x40); + CpuCopy16(GetWaldaWallpaperColorsPtr(), &sPSSData->wallpaperTilemap[1], 4); + CpuCopy16(GetWaldaWallpaperColorsPtr(), &sPSSData->wallpaperTilemap[17], 4); - if (sPSSData->field_6FB != 0) - LoadPalette(sPSSData->field_792, (sPSSData->field_2D2 * 32) + 0x40, 0x40); + if (sPSSData->wallpaperLoadDir != 0) + LoadPalette(sPSSData->wallpaperTilemap, (sPSSData->wallpaperOffset * 32) + 0x40, 0x40); else - CpuCopy16(sPSSData->field_792, &gPlttBufferUnfaded[(sPSSData->field_2D2 * 32) + 0x40], 0x40); + CpuCopy16(sPSSData->wallpaperTilemap, &gPlttBufferUnfaded[(sPSSData->wallpaperOffset * 32) + 0x40], 0x40); - sPSSData->wallpaperTiles = malloc_and_decompress(wallpaperGfx->tiles, &size1); - iconGfx = malloc_and_decompress(gFriendsIcons[GetWaldaWallpaperIconId()], &size2); - CpuCopy32(iconGfx, sPSSData->wallpaperTiles + 0x800, size2); + sPSSData->wallpaperTiles = malloc_and_decompress(wallpaper->tiles, &tilesSize); + iconGfx = malloc_and_decompress(sWaldaWallpaperIcons[GetWaldaWallpaperIconId()], &iconSize); + CpuCopy32(iconGfx, sPSSData->wallpaperTiles + 0x800, iconSize); Free(iconGfx); - LoadBgTiles(2, sPSSData->wallpaperTiles, size1, sPSSData->field_2D2 << 8); + LoadBgTiles(2, sPSSData->wallpaperTiles, tilesSize, sPSSData->wallpaperOffset << 8); } CopyBgTilemapBufferToVram(2); @@ -5492,12 +5121,12 @@ static bool32 WaitForWallpaperGfxLoad(void) return TRUE; } -static void sub_80CCA3C(const void *tilemap, s8 direction, u8 arg2) +static void DrawWallpaper(const void *tilemap, s8 direction, u8 offset) { - s16 var = (arg2 * 2) + 3; + s16 var = (offset * 2) + 3; s16 x = ((sPSSData->bg2_X / 8 + 10) + (direction * 24)) & 0x3F; - CopyRectToBgTilemapBufferRect(2, tilemap, 0, 0, 0x14, 0x12, x, 2, 0x14, 0x12, 0x11, arg2 << 8, var); + CopyRectToBgTilemapBufferRect(2, tilemap, 0, 0, 0x14, 0x12, x, 2, 0x14, 0x12, 0x11, offset << 8, var); if (direction == 0) return; @@ -5509,10 +5138,10 @@ static void sub_80CCA3C(const void *tilemap, s8 direction, u8 arg2) FillBgTilemapBufferRect(2, 0, x, 2, 4, 0x12, 0x11); } -static void sub_80CCAE0(void *arg0) +static void TrimOldWallpaper(void *tilemap) { u16 i; - u16 *dest = arg0; + u16 *dest = tilemap; s16 r3 = ((sPSSData->bg2_X / 8) + 30) & 0x3F; if (r3 <= 31) @@ -5531,238 +5160,266 @@ static void sub_80CCAE0(void *arg0) } } -static void sub_80CCB50(u8 boxId) +static void InitBoxTitle(u8 boxId) { u8 tagIndex; - s16 r6; + s16 x; u16 i; - struct SpriteSheet spriteSheet = {sPSSData->field_2F8, 0x200, TAG_TILE_3}; + struct SpriteSheet spriteSheet = {sPSSData->boxTitleTiles, 0x200, GFXTAG_BOX_TITLE}; struct SpritePalette palettes[] = { - {sPSSData->field_6FC, TAG_PAL_DAC9}, + {sPSSData->boxTitlePal, PALTAG_BOX_TITLE}, {} }; u16 wallpaperId = GetBoxWallpaper(boxId); - sPSSData->field_6FC[14] = gUnknown_08577574[wallpaperId][0]; - sPSSData->field_6FC[15] = gUnknown_08577574[wallpaperId][1]; + sPSSData->boxTitlePal[14] = sBoxTitleColors[wallpaperId][0]; // Shadow color + sPSSData->boxTitlePal[15] = sBoxTitleColors[wallpaperId][1]; // Text Color LoadSpritePalettes(palettes); - sPSSData->field_738 = 0x3f0; + sPSSData->boxTitlePalBits = 0x3f0; - tagIndex = IndexOfSpritePaletteTag(TAG_PAL_DAC9); - sPSSData->field_71C = 0x10e + 16 * tagIndex; - sPSSData->field_738 |= 0x10000 << tagIndex; + tagIndex = IndexOfSpritePaletteTag(PALTAG_BOX_TITLE); + sPSSData->boxTitlePalOffset = 0x10e + 16 * tagIndex; + sPSSData->boxTitlePalBits |= 0x10000 << tagIndex; - tagIndex = IndexOfSpritePaletteTag(TAG_PAL_DAC9); - sPSSData->field_71E = 0x10e + 16 * tagIndex; - sPSSData->field_738 |= 0x10000 << tagIndex; + // The below seems intended to have separately tracked + // the incoming wallpaper title's palette, but as they now + // share a palette tag, all colors (and fields in some cases) + // this is redundant along with the use of boxTitleAltPalOffset + tagIndex = IndexOfSpritePaletteTag(PALTAG_BOX_TITLE); + sPSSData->boxTitleAltPalOffset = 0x10e + 16 * tagIndex; + sPSSData->boxTitlePalBits |= 0x10000 << tagIndex; - StringCopyPadded(sPSSData->field_21B8, GetBoxNamePtr(boxId), 0, 8); - DrawTextWindowAndBufferTiles(sPSSData->field_21B8, sPSSData->field_2F8, 0, 0, 2); + StringCopyPadded(sPSSData->boxTitleText, GetBoxNamePtr(boxId), 0, 8); + DrawTextWindowAndBufferTiles(sPSSData->boxTitleText, sPSSData->boxTitleTiles, 0, 0, 2); LoadSpriteSheet(&spriteSheet); - r6 = sub_80CD00C(GetBoxNamePtr(boxId)); + x = GetBoxTitleBaseX(GetBoxNamePtr(boxId)); + // Title is split across two sprites for (i = 0; i < 2; i++) { - u8 spriteId = CreateSprite(&gSpriteTemplate_857B0A8, r6 + i * 32, 28, 24); - sPSSData->field_720[i] = &gSprites[spriteId]; - StartSpriteAnim(sPSSData->field_720[i], i); + u8 spriteId = CreateSprite(&sSpriteTemplate_BoxTitle, x + i * 32, 28, 24); + sPSSData->curBoxTitleSprites[i] = &gSprites[spriteId]; + StartSpriteAnim(sPSSData->curBoxTitleSprites[i], i); } - sPSSData->field_6F8 = 0; + sPSSData->boxTitleCycleId = 0; } -static void sub_80CCCFC(u8 boxId, s8 direction) +// Sprite data for moving title text +#define sSpeed data[0] +// Flipped between incoming/outgoing for some reason +#define sIncomingX data[1] +#define sIncomingDelay data[2] +#define sOutgoingDelay data[1] +#define sOutgoingX data[2] + +static void CreateIncomingBoxTitle(u8 boxId, s8 direction) { - u16 r8; - s16 x, x2; + u16 palOffset; + s16 x, adjustedX; u16 i; - struct SpriteSheet spriteSheet = {sPSSData->field_2F8, 0x200, TAG_TILE_3}; - struct SpriteTemplate template = gSpriteTemplate_857B0A8; + struct SpriteSheet spriteSheet = {sPSSData->boxTitleTiles, 0x200, GFXTAG_BOX_TITLE}; + struct SpriteTemplate template = sSpriteTemplate_BoxTitle; - sPSSData->field_6F8 = (sPSSData->field_6F8 == 0); - if (sPSSData->field_6F8 == 0) + sPSSData->boxTitleCycleId = (sPSSData->boxTitleCycleId == 0); + if (sPSSData->boxTitleCycleId == 0) { - spriteSheet.tag = TAG_TILE_3; - r8 = sPSSData->field_71C; + spriteSheet.tag = GFXTAG_BOX_TITLE; + palOffset = sPSSData->boxTitlePalOffset; } else { - spriteSheet.tag = TAG_TILE_4; - r8 = sPSSData->field_71C; - template.tileTag = TAG_TILE_4; - template.paletteTag = TAG_PAL_DAC9; + spriteSheet.tag = GFXTAG_BOX_TITLE_ALT; + palOffset = sPSSData->boxTitlePalOffset; + template.tileTag = GFXTAG_BOX_TITLE_ALT; + template.paletteTag = PALTAG_BOX_TITLE; } - StringCopyPadded(sPSSData->field_21B8, GetBoxNamePtr(boxId), 0, 8); - DrawTextWindowAndBufferTiles(sPSSData->field_21B8, sPSSData->field_2F8, 0, 0, 2); + StringCopyPadded(sPSSData->boxTitleText, GetBoxNamePtr(boxId), 0, 8); + DrawTextWindowAndBufferTiles(sPSSData->boxTitleText, sPSSData->boxTitleTiles, 0, 0, 2); LoadSpriteSheet(&spriteSheet); - LoadPalette(gUnknown_08577574[GetBoxWallpaper(boxId)], r8, 4); - x = sub_80CD00C(GetBoxNamePtr(boxId)); - x2 = x; - x2 += direction * 192; + LoadPalette(sBoxTitleColors[GetBoxWallpaper(boxId)], palOffset, 4); + x = GetBoxTitleBaseX(GetBoxNamePtr(boxId)); + adjustedX = x; + adjustedX += direction * 192; + // Title is split across two sprites for (i = 0; i < 2; i++) { - u8 spriteId = CreateSprite(&template, i * 32 + x2, 28, 24); + u8 spriteId = CreateSprite(&template, i * 32 + adjustedX, 28, 24); - sPSSData->field_728[i] = &gSprites[spriteId]; - sPSSData->field_728[i]->data[0] = (-direction) * 6; - sPSSData->field_728[i]->data[1] = i * 32 + x; - sPSSData->field_728[i]->data[2] = 0; - sPSSData->field_728[i]->callback = sub_80CCF30; - StartSpriteAnim(sPSSData->field_728[i], i); + sPSSData->nextBoxTitleSprites[i] = &gSprites[spriteId]; + sPSSData->nextBoxTitleSprites[i]->sSpeed = (-direction) * 6; + sPSSData->nextBoxTitleSprites[i]->sIncomingX = i * 32 + x; + sPSSData->nextBoxTitleSprites[i]->sIncomingDelay = 0; + sPSSData->nextBoxTitleSprites[i]->callback = SpriteCB_IncomingBoxTitle; + StartSpriteAnim(sPSSData->nextBoxTitleSprites[i], i); - sPSSData->field_720[i]->data[0] = (-direction) * 6; - sPSSData->field_720[i]->data[1] = 1; - sPSSData->field_720[i]->callback = sub_80CCF64; + sPSSData->curBoxTitleSprites[i]->sSpeed = (-direction) * 6; + sPSSData->curBoxTitleSprites[i]->sOutgoingDelay = 1; + sPSSData->curBoxTitleSprites[i]->callback = SpriteCB_OutgoingBoxTitle; } } -static void sub_80CCEE0(void) +static void CycleBoxTitleSprites(void) { - if (sPSSData->field_6F8 == 0) - FreeSpriteTilesByTag(TAG_TILE_4); + if (sPSSData->boxTitleCycleId == 0) + FreeSpriteTilesByTag(GFXTAG_BOX_TITLE_ALT); else - FreeSpriteTilesByTag(TAG_TILE_3); + FreeSpriteTilesByTag(GFXTAG_BOX_TITLE); - sPSSData->field_720[0] = sPSSData->field_728[0]; - sPSSData->field_720[1] = sPSSData->field_728[1]; + sPSSData->curBoxTitleSprites[0] = sPSSData->nextBoxTitleSprites[0]; + sPSSData->curBoxTitleSprites[1] = sPSSData->nextBoxTitleSprites[1]; } -static void sub_80CCF30(struct Sprite *sprite) +static void SpriteCB_IncomingBoxTitle(struct Sprite *sprite) { - if (sprite->data[2] != 0) - sprite->data[2]--; - else if ((sprite->pos1.x += sprite->data[0]) == sprite->data[1]) + if (sprite->sIncomingDelay != 0) + sprite->sIncomingDelay--; + else if ((sprite->pos1.x += sprite->sSpeed) == sprite->sIncomingX) sprite->callback = SpriteCallbackDummy; } -static void sub_80CCF64(struct Sprite *sprite) +static void SpriteCB_OutgoingBoxTitle(struct Sprite *sprite) { - if (sprite->data[1] != 0) + if (sprite->sOutgoingDelay != 0) { - sprite->data[1]--; + sprite->sOutgoingDelay--; } else { - sprite->pos1.x += sprite->data[0]; - sprite->data[2] = sprite->pos1.x + sprite->pos2.x; - if (sprite->data[2] < 0x40 || sprite->data[2] > 0x100) + sprite->pos1.x += sprite->sSpeed; + sprite->sOutgoingX = sprite->pos1.x + sprite->pos2.x; + if (sprite->sOutgoingX < 64 || sprite->sOutgoingX > DISPLAY_WIDTH + 16) DestroySprite(sprite); } } -static void sub_80CCF9C(void) +#undef sSpeed +#undef sIncomingX +#undef sIncomingDelay +#undef sOutgoingDelay +#undef sOutgoingX + +static void CycleBoxTitleColor(void) { u8 boxId = StorageGetCurrentBox(); u8 wallpaperId = GetBoxWallpaper(boxId); - if (sPSSData->field_6F8 == 0) - CpuCopy16(gUnknown_08577574[wallpaperId], gPlttBufferUnfaded + sPSSData->field_71C, 4); + if (sPSSData->boxTitleCycleId == 0) + CpuCopy16(sBoxTitleColors[wallpaperId], gPlttBufferUnfaded + sPSSData->boxTitlePalOffset, 4); else - CpuCopy16(gUnknown_08577574[wallpaperId], gPlttBufferUnfaded + sPSSData->field_71E, 4); + CpuCopy16(sBoxTitleColors[wallpaperId], gPlttBufferUnfaded + sPSSData->boxTitleAltPalOffset, 4); } -static s16 sub_80CD00C(const u8 *string) +static s16 GetBoxTitleBaseX(const u8 *string) { - return 0xB0 - GetStringWidth(1, string, 0) / 2; + return DISPLAY_WIDTH - 64 - GetStringWidth(1, string, 0) / 2; } -static void sub_80CD02C(void) +// Sprite data for box scroll arrows +#define sState data[0] +#define sTimer data[1] +#define sSpeed data[3] + +static void CreateBoxScrollArrows(void) { u16 i; - LoadSpriteSheet(&gUnknown_0857B080); + LoadSpriteSheet(&sSpriteSheet_Arrow); for (i = 0; i < 2; i++) { - u8 spriteId = CreateSprite(&gUnknown_0857B0E0, 0x5c + i * 0x88, 28, 22); + u8 spriteId = CreateSprite(&sSpriteTemplate_Arrow, 92 + i * 136, 28, 22); if (spriteId != MAX_SPRITES) { struct Sprite *sprite = &gSprites[spriteId]; StartSpriteAnim(sprite, i); - sprite->data[3] = (i == 0) ? -1 : 1; - sPSSData->field_730[i] = sprite; + sprite->sSpeed = (i == 0) ? -1 : 1; + sPSSData->arrowSprites[i] = sprite; } } if (IsCursorOnBox()) - sub_80CD1A8(TRUE); + AnimateBoxScrollArrows(TRUE); } -static void sub_80CD0B8(s8 direction) +// Slide box scroll arrows horizontally for box change +static void StartBoxScrollArrowsSlide(s8 direction) { u16 i; for (i = 0; i < 2; i++) { - sPSSData->field_730[i]->pos2.x = 0; - sPSSData->field_730[i]->data[0] = 2; + sPSSData->arrowSprites[i]->pos2.x = 0; + sPSSData->arrowSprites[i]->sState = 2; } if (direction < 0) { - sPSSData->field_730[0]->data[1] = 29; - sPSSData->field_730[1]->data[1] = 5; - sPSSData->field_730[0]->data[2] = 0x48; - sPSSData->field_730[1]->data[2] = 0x48; + sPSSData->arrowSprites[0]->sTimer = 29; + sPSSData->arrowSprites[1]->sTimer = 5; + sPSSData->arrowSprites[0]->data[2] = 72; + sPSSData->arrowSprites[1]->data[2] = 72; } else { - sPSSData->field_730[0]->data[1] = 5; - sPSSData->field_730[1]->data[1] = 29; - sPSSData->field_730[0]->data[2] = 0xF8; - sPSSData->field_730[1]->data[2] = 0xF8; + sPSSData->arrowSprites[0]->sTimer = 5; + sPSSData->arrowSprites[1]->sTimer = 29; + sPSSData->arrowSprites[0]->data[2] = DISPLAY_WIDTH + 8; + sPSSData->arrowSprites[1]->data[2] = DISPLAY_WIDTH + 8; } - sPSSData->field_730[0]->data[7] = 0; - sPSSData->field_730[1]->data[7] = 1; + sPSSData->arrowSprites[0]->data[7] = 0; + sPSSData->arrowSprites[1]->data[7] = 1; } -static void sub_80CD158(void) +// New box's scroll arrows have entered, stop sliding and set their position +static void StopBoxScrollArrowsSlide(void) { u16 i; for (i = 0; i < 2; i++) { - sPSSData->field_730[i]->pos1.x = 0x88 * i + 0x5c; - sPSSData->field_730[i]->pos2.x = 0; - sPSSData->field_730[i]->invisible = FALSE; + sPSSData->arrowSprites[i]->pos1.x = 136 * i + 92; + sPSSData->arrowSprites[i]->pos2.x = 0; + sPSSData->arrowSprites[i]->invisible = FALSE; } - sub_80CD1A8(TRUE); + AnimateBoxScrollArrows(TRUE); } -static void sub_80CD1A8(bool8 a0) +// Bounce scroll arrows while title is selected +static void AnimateBoxScrollArrows(bool8 animate) { u16 i; - if (a0) + if (animate) { + // Start arrows moving for (i = 0; i < 2; i++) { - sPSSData->field_730[i]->data[0] = 1; - sPSSData->field_730[i]->data[1] = 0; - sPSSData->field_730[i]->data[2] = 0; - sPSSData->field_730[i]->data[4] = 0; + sPSSData->arrowSprites[i]->sState = 1; + sPSSData->arrowSprites[i]->sTimer = 0; + sPSSData->arrowSprites[i]->data[2] = 0; + sPSSData->arrowSprites[i]->data[4] = 0; } } else { + // Stop arrows moving for (i = 0; i < 2; i++) - { - sPSSData->field_730[i]->data[0] = 0; - } + sPSSData->arrowSprites[i]->sState = 0; } } -static void sub_80CD210(struct Sprite *sprite) +static void SpriteCB_Arrow(struct Sprite *sprite) { - switch (sprite->data[0]) + switch (sprite->sState) { case 0: sprite->pos2.x = 0; break; case 1: - if (++sprite->data[1] > 3) + if (++sprite->sTimer > 3) { - sprite->data[1] = 0; - sprite->pos2.x += sprite->data[3]; + sprite->sTimer = 0; + sprite->pos2.x += sprite->sSpeed; if (++sprite->data[2] > 5) { sprite->data[2] = 0; @@ -5771,17 +5428,17 @@ static void sub_80CD210(struct Sprite *sprite) } break; case 2: - sprite->data[0] = 3; + sprite->sState = 3; break; case 3: sprite->pos1.x -= sPSSData->wallpaperScrollSpeed; - if (sprite->pos1.x < 73 || sprite->pos1.x > 247) + if (sprite->pos1.x <= 72 || sprite->pos1.x >= DISPLAY_WIDTH + 8) sprite->invisible = TRUE; - if (--sprite->data[1] == 0) + if (--sprite->sTimer == 0) { sprite->pos1.x = sprite->data[2]; sprite->invisible = FALSE; - sprite->data[0] = 4; + sprite->sState = 4; } break; case 4: @@ -5790,9 +5447,12 @@ static void sub_80CD210(struct Sprite *sprite) } } -static struct Sprite *sub_80CD2E8(u16 x, u16 y, u8 animId, u8 priority, u8 subpriority) +#undef sState +#undef sSpeed + +static struct Sprite *CreateJumpBoxArrows(u16 x, u16 y, u8 animId, u8 priority, u8 subpriority) { - u8 spriteId = CreateSprite(&gUnknown_0857B0E0, x, y, subpriority); + u8 spriteId = CreateSprite(&sSpriteTemplate_Arrow, x, y, subpriority); if (spriteId == MAX_SPRITES) return NULL; @@ -5905,25 +5565,25 @@ static bool8 sub_80CD554(void) sPSSData->field_CC0 += sPSSData->field_CC8; sPSSData->field_CB4->pos1.x = sPSSData->field_CBC >> 8; sPSSData->field_CB4->pos1.y = sPSSData->field_CC0 >> 8; - if (sPSSData->field_CB4->pos1.x > 0x100) + if (sPSSData->field_CB4->pos1.x > DISPLAY_WIDTH + 16) { - tmp = sPSSData->field_CB4->pos1.x - 0x100; - sPSSData->field_CB4->pos1.x = tmp + 0x40; + tmp = sPSSData->field_CB4->pos1.x - (DISPLAY_WIDTH + 16); + sPSSData->field_CB4->pos1.x = tmp + 64; } - if (sPSSData->field_CB4->pos1.x < 0x40) + if (sPSSData->field_CB4->pos1.x < 64) { - tmp = 0x40 - sPSSData->field_CB4->pos1.x; - sPSSData->field_CB4->pos1.x = 0x100 - tmp; + tmp = 64 - sPSSData->field_CB4->pos1.x; + sPSSData->field_CB4->pos1.x = DISPLAY_WIDTH + 16 - tmp; } - if (sPSSData->field_CB4->pos1.y > 0xb0) + if (sPSSData->field_CB4->pos1.y > DISPLAY_HEIGHT + 16) { - tmp = sPSSData->field_CB4->pos1.y - 0xb0; - sPSSData->field_CB4->pos1.y = tmp - 0x10; + tmp = sPSSData->field_CB4->pos1.y - (DISPLAY_HEIGHT + 16); + sPSSData->field_CB4->pos1.y = tmp - 16; } - if (sPSSData->field_CB4->pos1.y < -0x10) + if (sPSSData->field_CB4->pos1.y < -16) { - tmp = -0x10 - sPSSData->field_CB4->pos1.y; - sPSSData->field_CB4->pos1.y = 0xb0 - tmp; + tmp = -16 - sPSSData->field_CB4->pos1.y; + sPSSData->field_CB4->pos1.y = DISPLAY_HEIGHT + 16 - tmp; } if (sPSSData->field_CD7 && --sPSSData->field_CD7 == 0) sPSSData->field_CB4->vFlip = (sPSSData->field_CB4->vFlip == FALSE); @@ -6076,7 +5736,7 @@ static void sub_80CDA68(void) SetMovingMonPriority(1); break; case CURSOR_AREA_BOX: - sub_80CD1A8(TRUE); + AnimateBoxScrollArrows(TRUE); break; case CURSOR_AREA_IN_PARTY: sPSSData->field_CB8->subpriority = 13; @@ -7426,7 +7086,7 @@ static u8 HandleInput_OnBox(void) if (JOY_NEW(A_BUTTON)) { - sub_80CD1A8(FALSE); + AnimateBoxScrollArrows(FALSE); AddBoxMenu(); return 7; } @@ -7447,7 +7107,7 @@ static u8 HandleInput_OnBox(void) if (retVal) { if (cursorArea != CURSOR_AREA_BOX) - sub_80CD1A8(FALSE); + AnimateBoxScrollArrows(FALSE); sub_80CD894(cursorArea, cursorPosition); } @@ -7948,7 +7608,10 @@ static void AddMenu(void) sPSSData->field_CAE = 0; } -static bool8 sub_80D00A8(void) +// Called after AddMenu to determine whether or not the handler callback should +// wait to move on to the next state. Evidently there was no need to wait, and +// now it always returns FALSE +static bool8 IsMenuLoading(void) { return FALSE; } @@ -9451,7 +9114,7 @@ u8 *GetBoxNamePtr(u8 boxId) return NULL; } -u8 GetBoxWallpaper(u8 boxId) +static u8 GetBoxWallpaper(u8 boxId) { if (boxId < TOTAL_BOXES_COUNT) return gPokemonStoragePtr->boxWallpapers[boxId]; @@ -9459,7 +9122,7 @@ u8 GetBoxWallpaper(u8 boxId) return 0; } -void SetBoxWallpaper(u8 boxId, u8 wallpaperId) +static void SetBoxWallpaper(u8 boxId, u8 wallpaperId) { if (boxId < TOTAL_BOXES_COUNT && wallpaperId < WALLPAPER_COUNT) gPokemonStoragePtr->boxWallpapers[boxId] = wallpaperId; @@ -9615,7 +9278,7 @@ u32 GetWaldaWallpaperIconId(void) void SetWaldaWallpaperIconId(u8 id) { - if (id < 30) + if (id < ARRAY_COUNT(sWaldaWallpaperIcons)) gSaveBlock1Ptr->waldaPhrase.iconId = id; } From 838a452363c1296e3c9a0d92ce41f59a75e9c844 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 15 Apr 2021 17:31:50 -0400 Subject: [PATCH 44/63] Doc storage - choose box menu, move wallpaper gfx --- .../box_selection_popup.pal} | 0 .../azumarill/bg.png} | Bin .../azumarill/tilemap.bin} | Bin .../{beach_bg.png => wallpapers/beach/bg.png} | Bin .../beach/frame.png} | Bin .../beach/tilemap.bin} | Bin .../{blank_bg.png => wallpapers/blank/bg.png} | Bin .../blank/tilemap.bin} | Bin .../{block_bg.png => wallpapers/block/bg.png} | Bin .../block/tilemap.bin} | Bin .../{cave_bg.png => wallpapers/cave/bg.png} | Bin .../cave/frame.png} | Bin .../{cave.bin => wallpapers/cave/tilemap.bin} | Bin .../circles/bg.png} | Bin .../circles/tilemap.bin} | Bin .../{city_bg.png => wallpapers/city/bg.png} | Bin .../city/frame.png} | Bin .../{city.bin => wallpapers/city/tilemap.bin} | Bin .../{crag_bg.png => wallpapers/crag/bg.png} | Bin .../crag/frame.png} | Bin .../{crag.bin => wallpapers/crag/tilemap.bin} | Bin .../desert/bg.png} | Bin .../desert/frame.png} | Bin .../desert/tilemap.bin} | Bin .../diagonal/bg.png} | Bin .../diagonal/tilemap.bin} | Bin .../dusclops/bg.png} | Bin .../dusclops/tilemap.bin} | Bin .../forest/bg.png} | Bin .../forest/frame.png} | Bin .../forest/tilemap.bin} | Bin .../{frame_bg.png => wallpapers/frame/bg.png} | Bin .../frame/tilemap.bin} | Bin .../{ => wallpapers}/friends_frame1.png | Bin .../{ => wallpapers}/friends_frame2.png | Bin .../horizontal/bg.png} | Bin .../horizontal/tilemap.bin} | Bin .../icons/aqua.png} | Bin .../icons/asterisk.png} | Bin .../icons/big_asterisk.png} | Bin .../icons/bolt.png} | Bin .../icons/brick.png} | Bin .../icons/circle.png} | Bin .../icons/cross.png} | Bin .../icons/crystal.png} | Bin .../icons/diglett.png} | Bin .../icons/dot.png} | Bin .../icons/five_star.png} | Bin .../icons/footprint.png} | Bin .../icons/four_circles.png} | Bin .../icons/four_star.png} | Bin .../icons/heart.png} | Bin .../icons/koffing.png} | Bin .../icons/latis.png} | Bin .../icons/line_circle.png} | Bin .../icons/lotad.png} | Bin .../icons/luvdisc.png} | Bin .../icons/magma.png} | Bin .../icons/maze.png} | Bin .../icons/minun.png} | Bin .../icons/pichu.png} | Bin .../icons/plusle.png} | Bin .../icons/pokeball.png} | Bin .../icons/ribbon.png} | Bin .../icons/spinda.png} | Bin .../icons/star_in_circle.png} | Bin .../icons/togepi.png} | Bin .../legendary/bg.png} | Bin .../legendary/tilemap.bin} | Bin .../ludicolo/bg.png} | Bin .../ludicolo/tilemap.bin} | Bin .../machine/bg.png} | Bin .../machine/frame.png} | Bin .../machine/tilemap.bin} | Bin .../pikachu/bg.png} | Bin .../pikachu/tilemap.bin} | Bin .../{plain_bg.png => wallpapers/plain/bg.png} | Bin .../plain/frame.png} | Bin .../plain/tilemap.bin} | Bin .../pokecenter/bg.png} | Bin .../pokecenter/frame.png} | Bin .../pokecenter/tilemap.bin} | Bin .../pokecenter2/bg.png} | Bin .../pokecenter2/tilemap.bin} | Bin .../polkadot/bg.png} | Bin .../polkadot/frame.png} | Bin .../polkadot/tilemap.bin} | Bin .../ribbon/bg.png} | Bin .../ribbon/frame.pal} | 0 .../ribbon/tilemap.bin} | Bin .../{river_bg.png => wallpapers/river/bg.png} | Bin .../river/frame.png} | Bin .../river/tilemap.bin} | Bin .../savanna/bg.png} | Bin .../savanna/frame.png} | Bin .../savanna/tilemap.bin} | Bin .../screen/bg.png} | Bin .../screen/tilemap.bin} | Bin .../seafloor/bg.png} | Bin .../seafloor/frame.png} | Bin .../seafloor/tilemap.bin} | Bin .../{sky_bg.png => wallpapers/sky/bg.png} | Bin .../sky/frame.png} | Bin .../{sky.bin => wallpapers/sky/tilemap.bin} | Bin .../{snow_bg.png => wallpapers/snow/bg.png} | Bin .../snow/frame.png} | Bin .../{snow.bin => wallpapers/snow/tilemap.bin} | Bin .../volcano/bg.png} | Bin .../volcano/frame.png} | Bin .../volcano/tilemap.bin} | Bin .../whiscash/bg.png} | Bin .../whiscash/tilemap.bin} | Bin .../zigzagoon/bg.png} | Bin .../zigzagoon/tilemap.bin} | Bin graphics_file_rules.mk | 110 +- include/pokemon_storage_system.h | 1 + include/pokemon_summary_screen.h | 17 +- src/battle_factory_screen.c | 4 +- src/data/wallpapers.h | 294 ++--- src/graphics.c | 22 +- src/party_menu.c | 6 +- src/pokemon_storage_system.c | 1037 +++++++++-------- src/pokemon_summary_screen.c | 52 +- src/trade.c | 4 +- 124 files changed, 792 insertions(+), 755 deletions(-) rename graphics/{unknown/unknown_57173C.pal => pokemon_storage/box_selection_popup.pal} (100%) rename graphics/pokemon_storage/{azumarill_bg.png => wallpapers/azumarill/bg.png} (100%) rename graphics/pokemon_storage/{azumarill.bin => wallpapers/azumarill/tilemap.bin} (100%) rename graphics/pokemon_storage/{beach_bg.png => wallpapers/beach/bg.png} (100%) rename graphics/pokemon_storage/{beach_frame.png => wallpapers/beach/frame.png} (100%) rename graphics/pokemon_storage/{beach.bin => wallpapers/beach/tilemap.bin} (100%) rename graphics/pokemon_storage/{blank_bg.png => wallpapers/blank/bg.png} (100%) rename graphics/pokemon_storage/{blank.bin => wallpapers/blank/tilemap.bin} (100%) rename graphics/pokemon_storage/{block_bg.png => wallpapers/block/bg.png} (100%) rename graphics/pokemon_storage/{block.bin => wallpapers/block/tilemap.bin} (100%) rename graphics/pokemon_storage/{cave_bg.png => wallpapers/cave/bg.png} (100%) rename graphics/pokemon_storage/{cave_frame.png => wallpapers/cave/frame.png} (100%) rename graphics/pokemon_storage/{cave.bin => wallpapers/cave/tilemap.bin} (100%) rename graphics/pokemon_storage/{circles_bg.png => wallpapers/circles/bg.png} (100%) rename graphics/pokemon_storage/{circles.bin => wallpapers/circles/tilemap.bin} (100%) rename graphics/pokemon_storage/{city_bg.png => wallpapers/city/bg.png} (100%) rename graphics/pokemon_storage/{city_frame.png => wallpapers/city/frame.png} (100%) rename graphics/pokemon_storage/{city.bin => wallpapers/city/tilemap.bin} (100%) rename graphics/pokemon_storage/{crag_bg.png => wallpapers/crag/bg.png} (100%) rename graphics/pokemon_storage/{crag_frame.png => wallpapers/crag/frame.png} (100%) rename graphics/pokemon_storage/{crag.bin => wallpapers/crag/tilemap.bin} (100%) rename graphics/pokemon_storage/{desert_bg.png => wallpapers/desert/bg.png} (100%) rename graphics/pokemon_storage/{desert_frame.png => wallpapers/desert/frame.png} (100%) rename graphics/pokemon_storage/{desert.bin => wallpapers/desert/tilemap.bin} (100%) rename graphics/pokemon_storage/{diagonal_bg.png => wallpapers/diagonal/bg.png} (100%) rename graphics/pokemon_storage/{diagonal.bin => wallpapers/diagonal/tilemap.bin} (100%) rename graphics/pokemon_storage/{dusclops_bg.png => wallpapers/dusclops/bg.png} (100%) rename graphics/pokemon_storage/{dusclops.bin => wallpapers/dusclops/tilemap.bin} (100%) rename graphics/pokemon_storage/{forest_bg.png => wallpapers/forest/bg.png} (100%) rename graphics/pokemon_storage/{forest_frame.png => wallpapers/forest/frame.png} (100%) rename graphics/pokemon_storage/{forest.bin => wallpapers/forest/tilemap.bin} (100%) rename graphics/pokemon_storage/{frame_bg.png => wallpapers/frame/bg.png} (100%) rename graphics/pokemon_storage/{frame.bin => wallpapers/frame/tilemap.bin} (100%) rename graphics/pokemon_storage/{ => wallpapers}/friends_frame1.png (100%) rename graphics/pokemon_storage/{ => wallpapers}/friends_frame2.png (100%) rename graphics/pokemon_storage/{horizontal_bg.png => wallpapers/horizontal/bg.png} (100%) rename graphics/pokemon_storage/{horizontal.bin => wallpapers/horizontal/tilemap.bin} (100%) rename graphics/pokemon_storage/{aqua_icon.png => wallpapers/icons/aqua.png} (100%) rename graphics/pokemon_storage/{asterisk_icon.png => wallpapers/icons/asterisk.png} (100%) rename graphics/pokemon_storage/{big_asterisk_icon.png => wallpapers/icons/big_asterisk.png} (100%) rename graphics/pokemon_storage/{bolt_icon.png => wallpapers/icons/bolt.png} (100%) rename graphics/pokemon_storage/{brick_icon.png => wallpapers/icons/brick.png} (100%) rename graphics/pokemon_storage/{circle_icon.png => wallpapers/icons/circle.png} (100%) rename graphics/pokemon_storage/{cross_icon.png => wallpapers/icons/cross.png} (100%) rename graphics/pokemon_storage/{crystal_icon.png => wallpapers/icons/crystal.png} (100%) rename graphics/pokemon_storage/{diglett_icon.png => wallpapers/icons/diglett.png} (100%) rename graphics/pokemon_storage/{dot_icon.png => wallpapers/icons/dot.png} (100%) rename graphics/pokemon_storage/{five_star_icon.png => wallpapers/icons/five_star.png} (100%) rename graphics/pokemon_storage/{footprint_icon.png => wallpapers/icons/footprint.png} (100%) rename graphics/pokemon_storage/{four_circles_icon.png => wallpapers/icons/four_circles.png} (100%) rename graphics/pokemon_storage/{four_star_icon.png => wallpapers/icons/four_star.png} (100%) rename graphics/pokemon_storage/{heart_icon.png => wallpapers/icons/heart.png} (100%) rename graphics/pokemon_storage/{koffing_icon.png => wallpapers/icons/koffing.png} (100%) rename graphics/pokemon_storage/{latis_icon.png => wallpapers/icons/latis.png} (100%) rename graphics/pokemon_storage/{line_circle_icon.png => wallpapers/icons/line_circle.png} (100%) rename graphics/pokemon_storage/{lotad_icon.png => wallpapers/icons/lotad.png} (100%) rename graphics/pokemon_storage/{luvdisc_icon.png => wallpapers/icons/luvdisc.png} (100%) rename graphics/pokemon_storage/{magma_icon.png => wallpapers/icons/magma.png} (100%) rename graphics/pokemon_storage/{maze_icon.png => wallpapers/icons/maze.png} (100%) rename graphics/pokemon_storage/{minun_icon.png => wallpapers/icons/minun.png} (100%) rename graphics/pokemon_storage/{pichu_icon.png => wallpapers/icons/pichu.png} (100%) rename graphics/pokemon_storage/{plusle_icon.png => wallpapers/icons/plusle.png} (100%) rename graphics/pokemon_storage/{pokeball_icon.png => wallpapers/icons/pokeball.png} (100%) rename graphics/pokemon_storage/{ribbon_icon.png => wallpapers/icons/ribbon.png} (100%) rename graphics/pokemon_storage/{spinda_icon.png => wallpapers/icons/spinda.png} (100%) rename graphics/pokemon_storage/{star_in_circle_icon.png => wallpapers/icons/star_in_circle.png} (100%) rename graphics/pokemon_storage/{togepi_icon.png => wallpapers/icons/togepi.png} (100%) rename graphics/pokemon_storage/{legendary_bg.png => wallpapers/legendary/bg.png} (100%) rename graphics/pokemon_storage/{legendary.bin => wallpapers/legendary/tilemap.bin} (100%) rename graphics/pokemon_storage/{ludicolo_bg.png => wallpapers/ludicolo/bg.png} (100%) rename graphics/pokemon_storage/{ludicolo.bin => wallpapers/ludicolo/tilemap.bin} (100%) rename graphics/pokemon_storage/{machine_bg.png => wallpapers/machine/bg.png} (100%) rename graphics/pokemon_storage/{machine_frame.png => wallpapers/machine/frame.png} (100%) rename graphics/pokemon_storage/{machine.bin => wallpapers/machine/tilemap.bin} (100%) rename graphics/pokemon_storage/{pikachu_bg.png => wallpapers/pikachu/bg.png} (100%) rename graphics/pokemon_storage/{pikachu.bin => wallpapers/pikachu/tilemap.bin} (100%) rename graphics/pokemon_storage/{plain_bg.png => wallpapers/plain/bg.png} (100%) rename graphics/pokemon_storage/{plain_frame.png => wallpapers/plain/frame.png} (100%) rename graphics/pokemon_storage/{plain.bin => wallpapers/plain/tilemap.bin} (100%) rename graphics/pokemon_storage/{pokecenter_bg.png => wallpapers/pokecenter/bg.png} (100%) rename graphics/pokemon_storage/{pokecenter_frame.png => wallpapers/pokecenter/frame.png} (100%) rename graphics/pokemon_storage/{pokecenter.bin => wallpapers/pokecenter/tilemap.bin} (100%) rename graphics/pokemon_storage/{pokecenter2_bg.png => wallpapers/pokecenter2/bg.png} (100%) rename graphics/pokemon_storage/{pokecenter2.bin => wallpapers/pokecenter2/tilemap.bin} (100%) rename graphics/pokemon_storage/{polkadot_bg.png => wallpapers/polkadot/bg.png} (100%) rename graphics/pokemon_storage/{polkadot_frame.png => wallpapers/polkadot/frame.png} (100%) rename graphics/pokemon_storage/{polkadot.bin => wallpapers/polkadot/tilemap.bin} (100%) rename graphics/pokemon_storage/{ribbon_bg.png => wallpapers/ribbon/bg.png} (100%) rename graphics/pokemon_storage/{ribbon_frame.pal => wallpapers/ribbon/frame.pal} (100%) rename graphics/pokemon_storage/{ribbon.bin => wallpapers/ribbon/tilemap.bin} (100%) rename graphics/pokemon_storage/{river_bg.png => wallpapers/river/bg.png} (100%) rename graphics/pokemon_storage/{river_frame.png => wallpapers/river/frame.png} (100%) rename graphics/pokemon_storage/{river.bin => wallpapers/river/tilemap.bin} (100%) rename graphics/pokemon_storage/{savanna_bg.png => wallpapers/savanna/bg.png} (100%) rename graphics/pokemon_storage/{savanna_frame.png => wallpapers/savanna/frame.png} (100%) rename graphics/pokemon_storage/{savanna.bin => wallpapers/savanna/tilemap.bin} (100%) rename graphics/pokemon_storage/{screen_bg.png => wallpapers/screen/bg.png} (100%) rename graphics/pokemon_storage/{screen.bin => wallpapers/screen/tilemap.bin} (100%) rename graphics/pokemon_storage/{seafloor_bg.png => wallpapers/seafloor/bg.png} (100%) rename graphics/pokemon_storage/{seafloor_frame.png => wallpapers/seafloor/frame.png} (100%) rename graphics/pokemon_storage/{seafloor.bin => wallpapers/seafloor/tilemap.bin} (100%) rename graphics/pokemon_storage/{sky_bg.png => wallpapers/sky/bg.png} (100%) rename graphics/pokemon_storage/{sky_frame.png => wallpapers/sky/frame.png} (100%) rename graphics/pokemon_storage/{sky.bin => wallpapers/sky/tilemap.bin} (100%) rename graphics/pokemon_storage/{snow_bg.png => wallpapers/snow/bg.png} (100%) rename graphics/pokemon_storage/{snow_frame.png => wallpapers/snow/frame.png} (100%) rename graphics/pokemon_storage/{snow.bin => wallpapers/snow/tilemap.bin} (100%) rename graphics/pokemon_storage/{volcano_bg.png => wallpapers/volcano/bg.png} (100%) rename graphics/pokemon_storage/{volcano_frame.png => wallpapers/volcano/frame.png} (100%) rename graphics/pokemon_storage/{volcano.bin => wallpapers/volcano/tilemap.bin} (100%) rename graphics/pokemon_storage/{whiscash_bg.png => wallpapers/whiscash/bg.png} (100%) rename graphics/pokemon_storage/{whiscash.bin => wallpapers/whiscash/tilemap.bin} (100%) rename graphics/pokemon_storage/{zigzagoon_bg.png => wallpapers/zigzagoon/bg.png} (100%) rename graphics/pokemon_storage/{zigzagoon.bin => wallpapers/zigzagoon/tilemap.bin} (100%) diff --git a/graphics/unknown/unknown_57173C.pal b/graphics/pokemon_storage/box_selection_popup.pal similarity index 100% rename from graphics/unknown/unknown_57173C.pal rename to graphics/pokemon_storage/box_selection_popup.pal diff --git a/graphics/pokemon_storage/azumarill_bg.png b/graphics/pokemon_storage/wallpapers/azumarill/bg.png similarity index 100% rename from graphics/pokemon_storage/azumarill_bg.png rename to graphics/pokemon_storage/wallpapers/azumarill/bg.png diff --git a/graphics/pokemon_storage/azumarill.bin b/graphics/pokemon_storage/wallpapers/azumarill/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/azumarill.bin rename to graphics/pokemon_storage/wallpapers/azumarill/tilemap.bin diff --git a/graphics/pokemon_storage/beach_bg.png b/graphics/pokemon_storage/wallpapers/beach/bg.png similarity index 100% rename from graphics/pokemon_storage/beach_bg.png rename to graphics/pokemon_storage/wallpapers/beach/bg.png diff --git a/graphics/pokemon_storage/beach_frame.png b/graphics/pokemon_storage/wallpapers/beach/frame.png similarity index 100% rename from graphics/pokemon_storage/beach_frame.png rename to graphics/pokemon_storage/wallpapers/beach/frame.png diff --git a/graphics/pokemon_storage/beach.bin b/graphics/pokemon_storage/wallpapers/beach/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/beach.bin rename to graphics/pokemon_storage/wallpapers/beach/tilemap.bin diff --git a/graphics/pokemon_storage/blank_bg.png b/graphics/pokemon_storage/wallpapers/blank/bg.png similarity index 100% rename from graphics/pokemon_storage/blank_bg.png rename to graphics/pokemon_storage/wallpapers/blank/bg.png diff --git a/graphics/pokemon_storage/blank.bin b/graphics/pokemon_storage/wallpapers/blank/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/blank.bin rename to graphics/pokemon_storage/wallpapers/blank/tilemap.bin diff --git a/graphics/pokemon_storage/block_bg.png b/graphics/pokemon_storage/wallpapers/block/bg.png similarity index 100% rename from graphics/pokemon_storage/block_bg.png rename to graphics/pokemon_storage/wallpapers/block/bg.png diff --git a/graphics/pokemon_storage/block.bin b/graphics/pokemon_storage/wallpapers/block/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/block.bin rename to graphics/pokemon_storage/wallpapers/block/tilemap.bin diff --git a/graphics/pokemon_storage/cave_bg.png b/graphics/pokemon_storage/wallpapers/cave/bg.png similarity index 100% rename from graphics/pokemon_storage/cave_bg.png rename to graphics/pokemon_storage/wallpapers/cave/bg.png diff --git a/graphics/pokemon_storage/cave_frame.png b/graphics/pokemon_storage/wallpapers/cave/frame.png similarity index 100% rename from graphics/pokemon_storage/cave_frame.png rename to graphics/pokemon_storage/wallpapers/cave/frame.png diff --git a/graphics/pokemon_storage/cave.bin b/graphics/pokemon_storage/wallpapers/cave/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/cave.bin rename to graphics/pokemon_storage/wallpapers/cave/tilemap.bin diff --git a/graphics/pokemon_storage/circles_bg.png b/graphics/pokemon_storage/wallpapers/circles/bg.png similarity index 100% rename from graphics/pokemon_storage/circles_bg.png rename to graphics/pokemon_storage/wallpapers/circles/bg.png diff --git a/graphics/pokemon_storage/circles.bin b/graphics/pokemon_storage/wallpapers/circles/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/circles.bin rename to graphics/pokemon_storage/wallpapers/circles/tilemap.bin diff --git a/graphics/pokemon_storage/city_bg.png b/graphics/pokemon_storage/wallpapers/city/bg.png similarity index 100% rename from graphics/pokemon_storage/city_bg.png rename to graphics/pokemon_storage/wallpapers/city/bg.png diff --git a/graphics/pokemon_storage/city_frame.png b/graphics/pokemon_storage/wallpapers/city/frame.png similarity index 100% rename from graphics/pokemon_storage/city_frame.png rename to graphics/pokemon_storage/wallpapers/city/frame.png diff --git a/graphics/pokemon_storage/city.bin b/graphics/pokemon_storage/wallpapers/city/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/city.bin rename to graphics/pokemon_storage/wallpapers/city/tilemap.bin diff --git a/graphics/pokemon_storage/crag_bg.png b/graphics/pokemon_storage/wallpapers/crag/bg.png similarity index 100% rename from graphics/pokemon_storage/crag_bg.png rename to graphics/pokemon_storage/wallpapers/crag/bg.png diff --git a/graphics/pokemon_storage/crag_frame.png b/graphics/pokemon_storage/wallpapers/crag/frame.png similarity index 100% rename from graphics/pokemon_storage/crag_frame.png rename to graphics/pokemon_storage/wallpapers/crag/frame.png diff --git a/graphics/pokemon_storage/crag.bin b/graphics/pokemon_storage/wallpapers/crag/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/crag.bin rename to graphics/pokemon_storage/wallpapers/crag/tilemap.bin diff --git a/graphics/pokemon_storage/desert_bg.png b/graphics/pokemon_storage/wallpapers/desert/bg.png similarity index 100% rename from graphics/pokemon_storage/desert_bg.png rename to graphics/pokemon_storage/wallpapers/desert/bg.png diff --git a/graphics/pokemon_storage/desert_frame.png b/graphics/pokemon_storage/wallpapers/desert/frame.png similarity index 100% rename from graphics/pokemon_storage/desert_frame.png rename to graphics/pokemon_storage/wallpapers/desert/frame.png diff --git a/graphics/pokemon_storage/desert.bin b/graphics/pokemon_storage/wallpapers/desert/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/desert.bin rename to graphics/pokemon_storage/wallpapers/desert/tilemap.bin diff --git a/graphics/pokemon_storage/diagonal_bg.png b/graphics/pokemon_storage/wallpapers/diagonal/bg.png similarity index 100% rename from graphics/pokemon_storage/diagonal_bg.png rename to graphics/pokemon_storage/wallpapers/diagonal/bg.png diff --git a/graphics/pokemon_storage/diagonal.bin b/graphics/pokemon_storage/wallpapers/diagonal/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/diagonal.bin rename to graphics/pokemon_storage/wallpapers/diagonal/tilemap.bin diff --git a/graphics/pokemon_storage/dusclops_bg.png b/graphics/pokemon_storage/wallpapers/dusclops/bg.png similarity index 100% rename from graphics/pokemon_storage/dusclops_bg.png rename to graphics/pokemon_storage/wallpapers/dusclops/bg.png diff --git a/graphics/pokemon_storage/dusclops.bin b/graphics/pokemon_storage/wallpapers/dusclops/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/dusclops.bin rename to graphics/pokemon_storage/wallpapers/dusclops/tilemap.bin diff --git a/graphics/pokemon_storage/forest_bg.png b/graphics/pokemon_storage/wallpapers/forest/bg.png similarity index 100% rename from graphics/pokemon_storage/forest_bg.png rename to graphics/pokemon_storage/wallpapers/forest/bg.png diff --git a/graphics/pokemon_storage/forest_frame.png b/graphics/pokemon_storage/wallpapers/forest/frame.png similarity index 100% rename from graphics/pokemon_storage/forest_frame.png rename to graphics/pokemon_storage/wallpapers/forest/frame.png diff --git a/graphics/pokemon_storage/forest.bin b/graphics/pokemon_storage/wallpapers/forest/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/forest.bin rename to graphics/pokemon_storage/wallpapers/forest/tilemap.bin diff --git a/graphics/pokemon_storage/frame_bg.png b/graphics/pokemon_storage/wallpapers/frame/bg.png similarity index 100% rename from graphics/pokemon_storage/frame_bg.png rename to graphics/pokemon_storage/wallpapers/frame/bg.png diff --git a/graphics/pokemon_storage/frame.bin b/graphics/pokemon_storage/wallpapers/frame/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/frame.bin rename to graphics/pokemon_storage/wallpapers/frame/tilemap.bin diff --git a/graphics/pokemon_storage/friends_frame1.png b/graphics/pokemon_storage/wallpapers/friends_frame1.png similarity index 100% rename from graphics/pokemon_storage/friends_frame1.png rename to graphics/pokemon_storage/wallpapers/friends_frame1.png diff --git a/graphics/pokemon_storage/friends_frame2.png b/graphics/pokemon_storage/wallpapers/friends_frame2.png similarity index 100% rename from graphics/pokemon_storage/friends_frame2.png rename to graphics/pokemon_storage/wallpapers/friends_frame2.png diff --git a/graphics/pokemon_storage/horizontal_bg.png b/graphics/pokemon_storage/wallpapers/horizontal/bg.png similarity index 100% rename from graphics/pokemon_storage/horizontal_bg.png rename to graphics/pokemon_storage/wallpapers/horizontal/bg.png diff --git a/graphics/pokemon_storage/horizontal.bin b/graphics/pokemon_storage/wallpapers/horizontal/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/horizontal.bin rename to graphics/pokemon_storage/wallpapers/horizontal/tilemap.bin diff --git a/graphics/pokemon_storage/aqua_icon.png b/graphics/pokemon_storage/wallpapers/icons/aqua.png similarity index 100% rename from graphics/pokemon_storage/aqua_icon.png rename to graphics/pokemon_storage/wallpapers/icons/aqua.png diff --git a/graphics/pokemon_storage/asterisk_icon.png b/graphics/pokemon_storage/wallpapers/icons/asterisk.png similarity index 100% rename from graphics/pokemon_storage/asterisk_icon.png rename to graphics/pokemon_storage/wallpapers/icons/asterisk.png diff --git a/graphics/pokemon_storage/big_asterisk_icon.png b/graphics/pokemon_storage/wallpapers/icons/big_asterisk.png similarity index 100% rename from graphics/pokemon_storage/big_asterisk_icon.png rename to graphics/pokemon_storage/wallpapers/icons/big_asterisk.png diff --git a/graphics/pokemon_storage/bolt_icon.png b/graphics/pokemon_storage/wallpapers/icons/bolt.png similarity index 100% rename from graphics/pokemon_storage/bolt_icon.png rename to graphics/pokemon_storage/wallpapers/icons/bolt.png diff --git a/graphics/pokemon_storage/brick_icon.png b/graphics/pokemon_storage/wallpapers/icons/brick.png similarity index 100% rename from graphics/pokemon_storage/brick_icon.png rename to graphics/pokemon_storage/wallpapers/icons/brick.png diff --git a/graphics/pokemon_storage/circle_icon.png b/graphics/pokemon_storage/wallpapers/icons/circle.png similarity index 100% rename from graphics/pokemon_storage/circle_icon.png rename to graphics/pokemon_storage/wallpapers/icons/circle.png diff --git a/graphics/pokemon_storage/cross_icon.png b/graphics/pokemon_storage/wallpapers/icons/cross.png similarity index 100% rename from graphics/pokemon_storage/cross_icon.png rename to graphics/pokemon_storage/wallpapers/icons/cross.png diff --git a/graphics/pokemon_storage/crystal_icon.png b/graphics/pokemon_storage/wallpapers/icons/crystal.png similarity index 100% rename from graphics/pokemon_storage/crystal_icon.png rename to graphics/pokemon_storage/wallpapers/icons/crystal.png diff --git a/graphics/pokemon_storage/diglett_icon.png b/graphics/pokemon_storage/wallpapers/icons/diglett.png similarity index 100% rename from graphics/pokemon_storage/diglett_icon.png rename to graphics/pokemon_storage/wallpapers/icons/diglett.png diff --git a/graphics/pokemon_storage/dot_icon.png b/graphics/pokemon_storage/wallpapers/icons/dot.png similarity index 100% rename from graphics/pokemon_storage/dot_icon.png rename to graphics/pokemon_storage/wallpapers/icons/dot.png diff --git a/graphics/pokemon_storage/five_star_icon.png b/graphics/pokemon_storage/wallpapers/icons/five_star.png similarity index 100% rename from graphics/pokemon_storage/five_star_icon.png rename to graphics/pokemon_storage/wallpapers/icons/five_star.png diff --git a/graphics/pokemon_storage/footprint_icon.png b/graphics/pokemon_storage/wallpapers/icons/footprint.png similarity index 100% rename from graphics/pokemon_storage/footprint_icon.png rename to graphics/pokemon_storage/wallpapers/icons/footprint.png diff --git a/graphics/pokemon_storage/four_circles_icon.png b/graphics/pokemon_storage/wallpapers/icons/four_circles.png similarity index 100% rename from graphics/pokemon_storage/four_circles_icon.png rename to graphics/pokemon_storage/wallpapers/icons/four_circles.png diff --git a/graphics/pokemon_storage/four_star_icon.png b/graphics/pokemon_storage/wallpapers/icons/four_star.png similarity index 100% rename from graphics/pokemon_storage/four_star_icon.png rename to graphics/pokemon_storage/wallpapers/icons/four_star.png diff --git a/graphics/pokemon_storage/heart_icon.png b/graphics/pokemon_storage/wallpapers/icons/heart.png similarity index 100% rename from graphics/pokemon_storage/heart_icon.png rename to graphics/pokemon_storage/wallpapers/icons/heart.png diff --git a/graphics/pokemon_storage/koffing_icon.png b/graphics/pokemon_storage/wallpapers/icons/koffing.png similarity index 100% rename from graphics/pokemon_storage/koffing_icon.png rename to graphics/pokemon_storage/wallpapers/icons/koffing.png diff --git a/graphics/pokemon_storage/latis_icon.png b/graphics/pokemon_storage/wallpapers/icons/latis.png similarity index 100% rename from graphics/pokemon_storage/latis_icon.png rename to graphics/pokemon_storage/wallpapers/icons/latis.png diff --git a/graphics/pokemon_storage/line_circle_icon.png b/graphics/pokemon_storage/wallpapers/icons/line_circle.png similarity index 100% rename from graphics/pokemon_storage/line_circle_icon.png rename to graphics/pokemon_storage/wallpapers/icons/line_circle.png diff --git a/graphics/pokemon_storage/lotad_icon.png b/graphics/pokemon_storage/wallpapers/icons/lotad.png similarity index 100% rename from graphics/pokemon_storage/lotad_icon.png rename to graphics/pokemon_storage/wallpapers/icons/lotad.png diff --git a/graphics/pokemon_storage/luvdisc_icon.png b/graphics/pokemon_storage/wallpapers/icons/luvdisc.png similarity index 100% rename from graphics/pokemon_storage/luvdisc_icon.png rename to graphics/pokemon_storage/wallpapers/icons/luvdisc.png diff --git a/graphics/pokemon_storage/magma_icon.png b/graphics/pokemon_storage/wallpapers/icons/magma.png similarity index 100% rename from graphics/pokemon_storage/magma_icon.png rename to graphics/pokemon_storage/wallpapers/icons/magma.png diff --git a/graphics/pokemon_storage/maze_icon.png b/graphics/pokemon_storage/wallpapers/icons/maze.png similarity index 100% rename from graphics/pokemon_storage/maze_icon.png rename to graphics/pokemon_storage/wallpapers/icons/maze.png diff --git a/graphics/pokemon_storage/minun_icon.png b/graphics/pokemon_storage/wallpapers/icons/minun.png similarity index 100% rename from graphics/pokemon_storage/minun_icon.png rename to graphics/pokemon_storage/wallpapers/icons/minun.png diff --git a/graphics/pokemon_storage/pichu_icon.png b/graphics/pokemon_storage/wallpapers/icons/pichu.png similarity index 100% rename from graphics/pokemon_storage/pichu_icon.png rename to graphics/pokemon_storage/wallpapers/icons/pichu.png diff --git a/graphics/pokemon_storage/plusle_icon.png b/graphics/pokemon_storage/wallpapers/icons/plusle.png similarity index 100% rename from graphics/pokemon_storage/plusle_icon.png rename to graphics/pokemon_storage/wallpapers/icons/plusle.png diff --git a/graphics/pokemon_storage/pokeball_icon.png b/graphics/pokemon_storage/wallpapers/icons/pokeball.png similarity index 100% rename from graphics/pokemon_storage/pokeball_icon.png rename to graphics/pokemon_storage/wallpapers/icons/pokeball.png diff --git a/graphics/pokemon_storage/ribbon_icon.png b/graphics/pokemon_storage/wallpapers/icons/ribbon.png similarity index 100% rename from graphics/pokemon_storage/ribbon_icon.png rename to graphics/pokemon_storage/wallpapers/icons/ribbon.png diff --git a/graphics/pokemon_storage/spinda_icon.png b/graphics/pokemon_storage/wallpapers/icons/spinda.png similarity index 100% rename from graphics/pokemon_storage/spinda_icon.png rename to graphics/pokemon_storage/wallpapers/icons/spinda.png diff --git a/graphics/pokemon_storage/star_in_circle_icon.png b/graphics/pokemon_storage/wallpapers/icons/star_in_circle.png similarity index 100% rename from graphics/pokemon_storage/star_in_circle_icon.png rename to graphics/pokemon_storage/wallpapers/icons/star_in_circle.png diff --git a/graphics/pokemon_storage/togepi_icon.png b/graphics/pokemon_storage/wallpapers/icons/togepi.png similarity index 100% rename from graphics/pokemon_storage/togepi_icon.png rename to graphics/pokemon_storage/wallpapers/icons/togepi.png diff --git a/graphics/pokemon_storage/legendary_bg.png b/graphics/pokemon_storage/wallpapers/legendary/bg.png similarity index 100% rename from graphics/pokemon_storage/legendary_bg.png rename to graphics/pokemon_storage/wallpapers/legendary/bg.png diff --git a/graphics/pokemon_storage/legendary.bin b/graphics/pokemon_storage/wallpapers/legendary/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/legendary.bin rename to graphics/pokemon_storage/wallpapers/legendary/tilemap.bin diff --git a/graphics/pokemon_storage/ludicolo_bg.png b/graphics/pokemon_storage/wallpapers/ludicolo/bg.png similarity index 100% rename from graphics/pokemon_storage/ludicolo_bg.png rename to graphics/pokemon_storage/wallpapers/ludicolo/bg.png diff --git a/graphics/pokemon_storage/ludicolo.bin b/graphics/pokemon_storage/wallpapers/ludicolo/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/ludicolo.bin rename to graphics/pokemon_storage/wallpapers/ludicolo/tilemap.bin diff --git a/graphics/pokemon_storage/machine_bg.png b/graphics/pokemon_storage/wallpapers/machine/bg.png similarity index 100% rename from graphics/pokemon_storage/machine_bg.png rename to graphics/pokemon_storage/wallpapers/machine/bg.png diff --git a/graphics/pokemon_storage/machine_frame.png b/graphics/pokemon_storage/wallpapers/machine/frame.png similarity index 100% rename from graphics/pokemon_storage/machine_frame.png rename to graphics/pokemon_storage/wallpapers/machine/frame.png diff --git a/graphics/pokemon_storage/machine.bin b/graphics/pokemon_storage/wallpapers/machine/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/machine.bin rename to graphics/pokemon_storage/wallpapers/machine/tilemap.bin diff --git a/graphics/pokemon_storage/pikachu_bg.png b/graphics/pokemon_storage/wallpapers/pikachu/bg.png similarity index 100% rename from graphics/pokemon_storage/pikachu_bg.png rename to graphics/pokemon_storage/wallpapers/pikachu/bg.png diff --git a/graphics/pokemon_storage/pikachu.bin b/graphics/pokemon_storage/wallpapers/pikachu/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/pikachu.bin rename to graphics/pokemon_storage/wallpapers/pikachu/tilemap.bin diff --git a/graphics/pokemon_storage/plain_bg.png b/graphics/pokemon_storage/wallpapers/plain/bg.png similarity index 100% rename from graphics/pokemon_storage/plain_bg.png rename to graphics/pokemon_storage/wallpapers/plain/bg.png diff --git a/graphics/pokemon_storage/plain_frame.png b/graphics/pokemon_storage/wallpapers/plain/frame.png similarity index 100% rename from graphics/pokemon_storage/plain_frame.png rename to graphics/pokemon_storage/wallpapers/plain/frame.png diff --git a/graphics/pokemon_storage/plain.bin b/graphics/pokemon_storage/wallpapers/plain/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/plain.bin rename to graphics/pokemon_storage/wallpapers/plain/tilemap.bin diff --git a/graphics/pokemon_storage/pokecenter_bg.png b/graphics/pokemon_storage/wallpapers/pokecenter/bg.png similarity index 100% rename from graphics/pokemon_storage/pokecenter_bg.png rename to graphics/pokemon_storage/wallpapers/pokecenter/bg.png diff --git a/graphics/pokemon_storage/pokecenter_frame.png b/graphics/pokemon_storage/wallpapers/pokecenter/frame.png similarity index 100% rename from graphics/pokemon_storage/pokecenter_frame.png rename to graphics/pokemon_storage/wallpapers/pokecenter/frame.png diff --git a/graphics/pokemon_storage/pokecenter.bin b/graphics/pokemon_storage/wallpapers/pokecenter/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/pokecenter.bin rename to graphics/pokemon_storage/wallpapers/pokecenter/tilemap.bin diff --git a/graphics/pokemon_storage/pokecenter2_bg.png b/graphics/pokemon_storage/wallpapers/pokecenter2/bg.png similarity index 100% rename from graphics/pokemon_storage/pokecenter2_bg.png rename to graphics/pokemon_storage/wallpapers/pokecenter2/bg.png diff --git a/graphics/pokemon_storage/pokecenter2.bin b/graphics/pokemon_storage/wallpapers/pokecenter2/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/pokecenter2.bin rename to graphics/pokemon_storage/wallpapers/pokecenter2/tilemap.bin diff --git a/graphics/pokemon_storage/polkadot_bg.png b/graphics/pokemon_storage/wallpapers/polkadot/bg.png similarity index 100% rename from graphics/pokemon_storage/polkadot_bg.png rename to graphics/pokemon_storage/wallpapers/polkadot/bg.png diff --git a/graphics/pokemon_storage/polkadot_frame.png b/graphics/pokemon_storage/wallpapers/polkadot/frame.png similarity index 100% rename from graphics/pokemon_storage/polkadot_frame.png rename to graphics/pokemon_storage/wallpapers/polkadot/frame.png diff --git a/graphics/pokemon_storage/polkadot.bin b/graphics/pokemon_storage/wallpapers/polkadot/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/polkadot.bin rename to graphics/pokemon_storage/wallpapers/polkadot/tilemap.bin diff --git a/graphics/pokemon_storage/ribbon_bg.png b/graphics/pokemon_storage/wallpapers/ribbon/bg.png similarity index 100% rename from graphics/pokemon_storage/ribbon_bg.png rename to graphics/pokemon_storage/wallpapers/ribbon/bg.png diff --git a/graphics/pokemon_storage/ribbon_frame.pal b/graphics/pokemon_storage/wallpapers/ribbon/frame.pal similarity index 100% rename from graphics/pokemon_storage/ribbon_frame.pal rename to graphics/pokemon_storage/wallpapers/ribbon/frame.pal diff --git a/graphics/pokemon_storage/ribbon.bin b/graphics/pokemon_storage/wallpapers/ribbon/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/ribbon.bin rename to graphics/pokemon_storage/wallpapers/ribbon/tilemap.bin diff --git a/graphics/pokemon_storage/river_bg.png b/graphics/pokemon_storage/wallpapers/river/bg.png similarity index 100% rename from graphics/pokemon_storage/river_bg.png rename to graphics/pokemon_storage/wallpapers/river/bg.png diff --git a/graphics/pokemon_storage/river_frame.png b/graphics/pokemon_storage/wallpapers/river/frame.png similarity index 100% rename from graphics/pokemon_storage/river_frame.png rename to graphics/pokemon_storage/wallpapers/river/frame.png diff --git a/graphics/pokemon_storage/river.bin b/graphics/pokemon_storage/wallpapers/river/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/river.bin rename to graphics/pokemon_storage/wallpapers/river/tilemap.bin diff --git a/graphics/pokemon_storage/savanna_bg.png b/graphics/pokemon_storage/wallpapers/savanna/bg.png similarity index 100% rename from graphics/pokemon_storage/savanna_bg.png rename to graphics/pokemon_storage/wallpapers/savanna/bg.png diff --git a/graphics/pokemon_storage/savanna_frame.png b/graphics/pokemon_storage/wallpapers/savanna/frame.png similarity index 100% rename from graphics/pokemon_storage/savanna_frame.png rename to graphics/pokemon_storage/wallpapers/savanna/frame.png diff --git a/graphics/pokemon_storage/savanna.bin b/graphics/pokemon_storage/wallpapers/savanna/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/savanna.bin rename to graphics/pokemon_storage/wallpapers/savanna/tilemap.bin diff --git a/graphics/pokemon_storage/screen_bg.png b/graphics/pokemon_storage/wallpapers/screen/bg.png similarity index 100% rename from graphics/pokemon_storage/screen_bg.png rename to graphics/pokemon_storage/wallpapers/screen/bg.png diff --git a/graphics/pokemon_storage/screen.bin b/graphics/pokemon_storage/wallpapers/screen/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/screen.bin rename to graphics/pokemon_storage/wallpapers/screen/tilemap.bin diff --git a/graphics/pokemon_storage/seafloor_bg.png b/graphics/pokemon_storage/wallpapers/seafloor/bg.png similarity index 100% rename from graphics/pokemon_storage/seafloor_bg.png rename to graphics/pokemon_storage/wallpapers/seafloor/bg.png diff --git a/graphics/pokemon_storage/seafloor_frame.png b/graphics/pokemon_storage/wallpapers/seafloor/frame.png similarity index 100% rename from graphics/pokemon_storage/seafloor_frame.png rename to graphics/pokemon_storage/wallpapers/seafloor/frame.png diff --git a/graphics/pokemon_storage/seafloor.bin b/graphics/pokemon_storage/wallpapers/seafloor/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/seafloor.bin rename to graphics/pokemon_storage/wallpapers/seafloor/tilemap.bin diff --git a/graphics/pokemon_storage/sky_bg.png b/graphics/pokemon_storage/wallpapers/sky/bg.png similarity index 100% rename from graphics/pokemon_storage/sky_bg.png rename to graphics/pokemon_storage/wallpapers/sky/bg.png diff --git a/graphics/pokemon_storage/sky_frame.png b/graphics/pokemon_storage/wallpapers/sky/frame.png similarity index 100% rename from graphics/pokemon_storage/sky_frame.png rename to graphics/pokemon_storage/wallpapers/sky/frame.png diff --git a/graphics/pokemon_storage/sky.bin b/graphics/pokemon_storage/wallpapers/sky/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/sky.bin rename to graphics/pokemon_storage/wallpapers/sky/tilemap.bin diff --git a/graphics/pokemon_storage/snow_bg.png b/graphics/pokemon_storage/wallpapers/snow/bg.png similarity index 100% rename from graphics/pokemon_storage/snow_bg.png rename to graphics/pokemon_storage/wallpapers/snow/bg.png diff --git a/graphics/pokemon_storage/snow_frame.png b/graphics/pokemon_storage/wallpapers/snow/frame.png similarity index 100% rename from graphics/pokemon_storage/snow_frame.png rename to graphics/pokemon_storage/wallpapers/snow/frame.png diff --git a/graphics/pokemon_storage/snow.bin b/graphics/pokemon_storage/wallpapers/snow/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/snow.bin rename to graphics/pokemon_storage/wallpapers/snow/tilemap.bin diff --git a/graphics/pokemon_storage/volcano_bg.png b/graphics/pokemon_storage/wallpapers/volcano/bg.png similarity index 100% rename from graphics/pokemon_storage/volcano_bg.png rename to graphics/pokemon_storage/wallpapers/volcano/bg.png diff --git a/graphics/pokemon_storage/volcano_frame.png b/graphics/pokemon_storage/wallpapers/volcano/frame.png similarity index 100% rename from graphics/pokemon_storage/volcano_frame.png rename to graphics/pokemon_storage/wallpapers/volcano/frame.png diff --git a/graphics/pokemon_storage/volcano.bin b/graphics/pokemon_storage/wallpapers/volcano/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/volcano.bin rename to graphics/pokemon_storage/wallpapers/volcano/tilemap.bin diff --git a/graphics/pokemon_storage/whiscash_bg.png b/graphics/pokemon_storage/wallpapers/whiscash/bg.png similarity index 100% rename from graphics/pokemon_storage/whiscash_bg.png rename to graphics/pokemon_storage/wallpapers/whiscash/bg.png diff --git a/graphics/pokemon_storage/whiscash.bin b/graphics/pokemon_storage/wallpapers/whiscash/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/whiscash.bin rename to graphics/pokemon_storage/wallpapers/whiscash/tilemap.bin diff --git a/graphics/pokemon_storage/zigzagoon_bg.png b/graphics/pokemon_storage/wallpapers/zigzagoon/bg.png similarity index 100% rename from graphics/pokemon_storage/zigzagoon_bg.png rename to graphics/pokemon_storage/wallpapers/zigzagoon/bg.png diff --git a/graphics/pokemon_storage/zigzagoon.bin b/graphics/pokemon_storage/wallpapers/zigzagoon/tilemap.bin similarity index 100% rename from graphics/pokemon_storage/zigzagoon.bin rename to graphics/pokemon_storage/wallpapers/zigzagoon/tilemap.bin diff --git a/graphics_file_rules.mk b/graphics_file_rules.mk index 6a3bf4006..be465a57f 100644 --- a/graphics_file_rules.mk +++ b/graphics_file_rules.mk @@ -14,7 +14,7 @@ ROULETTEGFXDIR := graphics/roulette SLOTMACHINEGFXDIR := graphics/slot_machine PKNAVGFXDIR := graphics/pokenav PKNAVOPTIONSGFXDIR := graphics/pokenav/options -PSSGFXDIR := graphics/pokemon_storage +WALLPAPERGFXDIR := graphics/pokemon_storage/wallpapers OBJEVENTGFXDIR := graphics/object_events MISCGFXDIR := graphics/misc @@ -502,7 +502,7 @@ $(BATTRANSGFXDIR)/frontier_square_1.4bpp: $(BATTRANSGFXDIR)/frontier_squares_bla $(BATTRANSGFXDIR)/frontier_square_2.4bpp: $(BATTRANSGFXDIR)/frontier_squares_blanktiles.4bpp \ $(BATTRANSGFXDIR)/frontier_squares_2.4bpp @cat $^ >$@ - + $(BATTRANSGFXDIR)/frontier_square_3.4bpp: $(BATTRANSGFXDIR)/frontier_squares_blanktiles.4bpp \ $(BATTRANSGFXDIR)/frontier_squares_3.4bpp @cat $^ >$@ @@ -520,162 +520,162 @@ $(UNUSEDGFXDIR)/intro_birch_beauty.4bpp: %.4bpp: %.png -### PSS ### +### Pokémon Storage System ### -$(PSSGFXDIR)/forest_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/forest/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 55 -$(PSSGFXDIR)/forest.4bpp: $(PSSGFXDIR)/forest_frame.4bpp $(PSSGFXDIR)/forest_bg.4bpp +$(WALLPAPERGFXDIR)/forest/tiles.4bpp: $(WALLPAPERGFXDIR)/forest/frame.4bpp $(WALLPAPERGFXDIR)/forest/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/city_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/city/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 52 -$(PSSGFXDIR)/city.4bpp: $(PSSGFXDIR)/city_frame.4bpp $(PSSGFXDIR)/city_bg.4bpp +$(WALLPAPERGFXDIR)/city/tiles.4bpp: $(WALLPAPERGFXDIR)/city/frame.4bpp $(WALLPAPERGFXDIR)/city/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/desert.4bpp: $(PSSGFXDIR)/desert_frame.4bpp $(PSSGFXDIR)/desert_bg.4bpp +$(WALLPAPERGFXDIR)/desert/tiles.4bpp: $(WALLPAPERGFXDIR)/desert/frame.4bpp $(WALLPAPERGFXDIR)/desert/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/savanna_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/savanna/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 45 -$(PSSGFXDIR)/savanna_bg.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/savanna/bg.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 23 -$(PSSGFXDIR)/savanna.4bpp: $(PSSGFXDIR)/savanna_frame.4bpp $(PSSGFXDIR)/savanna_bg.4bpp +$(WALLPAPERGFXDIR)/savanna/tiles.4bpp: $(WALLPAPERGFXDIR)/savanna/frame.4bpp $(WALLPAPERGFXDIR)/savanna/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/crag_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/crag/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 49 -$(PSSGFXDIR)/crag.4bpp: $(PSSGFXDIR)/crag_frame.4bpp $(PSSGFXDIR)/crag_bg.4bpp +$(WALLPAPERGFXDIR)/crag/tiles.4bpp: $(WALLPAPERGFXDIR)/crag/frame.4bpp $(WALLPAPERGFXDIR)/crag/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/volcano_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/volcano/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 56 -$(PSSGFXDIR)/volcano.4bpp: $(PSSGFXDIR)/volcano_frame.4bpp $(PSSGFXDIR)/volcano_bg.4bpp +$(WALLPAPERGFXDIR)/volcano/tiles.4bpp: $(WALLPAPERGFXDIR)/volcano/frame.4bpp $(WALLPAPERGFXDIR)/volcano/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/snow_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/snow/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 57 -$(PSSGFXDIR)/snow.4bpp: $(PSSGFXDIR)/snow_frame.4bpp $(PSSGFXDIR)/snow_bg.4bpp +$(WALLPAPERGFXDIR)/snow/tiles.4bpp: $(WALLPAPERGFXDIR)/snow/frame.4bpp $(WALLPAPERGFXDIR)/snow/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/cave_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/cave/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 55 -$(PSSGFXDIR)/cave.4bpp: $(PSSGFXDIR)/cave_frame.4bpp $(PSSGFXDIR)/cave_bg.4bpp +$(WALLPAPERGFXDIR)/cave/tiles.4bpp: $(WALLPAPERGFXDIR)/cave/frame.4bpp $(WALLPAPERGFXDIR)/cave/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/beach_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/beach/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 46 -$(PSSGFXDIR)/beach_bg.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/beach/bg.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 23 -$(PSSGFXDIR)/beach.4bpp: $(PSSGFXDIR)/beach_frame.4bpp $(PSSGFXDIR)/beach_bg.4bpp +$(WALLPAPERGFXDIR)/beach/tiles.4bpp: $(WALLPAPERGFXDIR)/beach/frame.4bpp $(WALLPAPERGFXDIR)/beach/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/seafloor_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/seafloor/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 54 -$(PSSGFXDIR)/seafloor.4bpp: $(PSSGFXDIR)/seafloor_frame.4bpp $(PSSGFXDIR)/seafloor_bg.4bpp +$(WALLPAPERGFXDIR)/seafloor/tiles.4bpp: $(WALLPAPERGFXDIR)/seafloor/frame.4bpp $(WALLPAPERGFXDIR)/seafloor/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/river_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/river/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 51 -$(PSSGFXDIR)/river_bg.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/river/bg.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 11 -$(PSSGFXDIR)/river.4bpp: $(PSSGFXDIR)/river_frame.4bpp $(PSSGFXDIR)/river_bg.4bpp +$(WALLPAPERGFXDIR)/river/tiles.4bpp: $(WALLPAPERGFXDIR)/river/frame.4bpp $(WALLPAPERGFXDIR)/river/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/sky_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/sky/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 45 -$(PSSGFXDIR)/sky.4bpp: $(PSSGFXDIR)/sky_frame.4bpp $(PSSGFXDIR)/sky_bg.4bpp +$(WALLPAPERGFXDIR)/sky/tiles.4bpp: $(WALLPAPERGFXDIR)/sky/frame.4bpp $(WALLPAPERGFXDIR)/sky/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/polkadot_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/polkadot/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 54 -$(PSSGFXDIR)/polkadot.4bpp: $(PSSGFXDIR)/polkadot_frame.4bpp $(PSSGFXDIR)/polkadot_bg.4bpp +$(WALLPAPERGFXDIR)/polkadot/tiles.4bpp: $(WALLPAPERGFXDIR)/polkadot/frame.4bpp $(WALLPAPERGFXDIR)/polkadot/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/pokecenter_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/pokecenter/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 35 -$(PSSGFXDIR)/pokecenter.4bpp: $(PSSGFXDIR)/pokecenter_frame.4bpp $(PSSGFXDIR)/pokecenter_bg.4bpp +$(WALLPAPERGFXDIR)/pokecenter/tiles.4bpp: $(WALLPAPERGFXDIR)/pokecenter/frame.4bpp $(WALLPAPERGFXDIR)/pokecenter/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/machine_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/machine/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 33 -$(PSSGFXDIR)/machine.4bpp: $(PSSGFXDIR)/machine_frame.4bpp $(PSSGFXDIR)/machine_bg.4bpp +$(WALLPAPERGFXDIR)/machine/tiles.4bpp: $(WALLPAPERGFXDIR)/machine/frame.4bpp $(WALLPAPERGFXDIR)/machine/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/plain_frame.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/plain/frame.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 18 -$(PSSGFXDIR)/plain.4bpp: $(PSSGFXDIR)/plain_frame.4bpp $(PSSGFXDIR)/plain_bg.4bpp +$(WALLPAPERGFXDIR)/plain/tiles.4bpp: $(WALLPAPERGFXDIR)/plain/frame.4bpp $(WALLPAPERGFXDIR)/plain/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/friends_frame1.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/friends_frame1.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 57 -$(PSSGFXDIR)/friends_frame2.4bpp: %.4bpp: %.png +$(WALLPAPERGFXDIR)/friends_frame2.4bpp: %.4bpp: %.png $(GFX) $< $@ -num_tiles 57 -$(PSSGFXDIR)/zigzagoon.4bpp: $(PSSGFXDIR)/friends_frame1.4bpp $(PSSGFXDIR)/zigzagoon_bg.4bpp +$(WALLPAPERGFXDIR)/zigzagoon/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame1.4bpp $(WALLPAPERGFXDIR)/zigzagoon/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/screen.4bpp: $(PSSGFXDIR)/friends_frame1.4bpp $(PSSGFXDIR)/screen_bg.4bpp +$(WALLPAPERGFXDIR)/screen/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame1.4bpp $(WALLPAPERGFXDIR)/screen/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/horizontal.4bpp: $(PSSGFXDIR)/friends_frame1.4bpp $(PSSGFXDIR)/horizontal_bg.4bpp +$(WALLPAPERGFXDIR)/horizontal/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame1.4bpp $(WALLPAPERGFXDIR)/horizontal/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/diagonal.4bpp: $(PSSGFXDIR)/friends_frame1.4bpp $(PSSGFXDIR)/diagonal_bg.4bpp +$(WALLPAPERGFXDIR)/diagonal/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame1.4bpp $(WALLPAPERGFXDIR)/diagonal/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/block.4bpp: $(PSSGFXDIR)/friends_frame1.4bpp $(PSSGFXDIR)/block_bg.4bpp +$(WALLPAPERGFXDIR)/block/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame1.4bpp $(WALLPAPERGFXDIR)/block/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/ribbon.4bpp: $(PSSGFXDIR)/friends_frame1.4bpp $(PSSGFXDIR)/ribbon_bg.4bpp +$(WALLPAPERGFXDIR)/ribbon/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame1.4bpp $(WALLPAPERGFXDIR)/ribbon/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/pokecenter2.4bpp: $(PSSGFXDIR)/friends_frame1.4bpp $(PSSGFXDIR)/pokecenter2_bg.4bpp +$(WALLPAPERGFXDIR)/pokecenter2/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame1.4bpp $(WALLPAPERGFXDIR)/pokecenter2/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/frame.4bpp: $(PSSGFXDIR)/friends_frame1.4bpp $(PSSGFXDIR)/frame_bg.4bpp +$(WALLPAPERGFXDIR)/frame/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame1.4bpp $(WALLPAPERGFXDIR)/frame/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/blank.4bpp: $(PSSGFXDIR)/friends_frame1.4bpp $(PSSGFXDIR)/blank_bg.4bpp +$(WALLPAPERGFXDIR)/blank/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame1.4bpp $(WALLPAPERGFXDIR)/blank/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/circles.4bpp: $(PSSGFXDIR)/friends_frame1.4bpp $(PSSGFXDIR)/circles_bg.4bpp +$(WALLPAPERGFXDIR)/circles/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame1.4bpp $(WALLPAPERGFXDIR)/circles/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/azumarill.4bpp: $(PSSGFXDIR)/friends_frame2.4bpp $(PSSGFXDIR)/azumarill_bg.4bpp +$(WALLPAPERGFXDIR)/azumarill/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame2.4bpp $(WALLPAPERGFXDIR)/azumarill/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/pikachu.4bpp: $(PSSGFXDIR)/friends_frame2.4bpp $(PSSGFXDIR)/pikachu_bg.4bpp +$(WALLPAPERGFXDIR)/pikachu/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame2.4bpp $(WALLPAPERGFXDIR)/pikachu/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/legendary.4bpp: $(PSSGFXDIR)/friends_frame2.4bpp $(PSSGFXDIR)/legendary_bg.4bpp +$(WALLPAPERGFXDIR)/legendary/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame2.4bpp $(WALLPAPERGFXDIR)/legendary/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/dusclops.4bpp: $(PSSGFXDIR)/friends_frame2.4bpp $(PSSGFXDIR)/dusclops_bg.4bpp +$(WALLPAPERGFXDIR)/dusclops/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame2.4bpp $(WALLPAPERGFXDIR)/dusclops/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/ludicolo.4bpp: $(PSSGFXDIR)/friends_frame2.4bpp $(PSSGFXDIR)/ludicolo_bg.4bpp +$(WALLPAPERGFXDIR)/ludicolo/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame2.4bpp $(WALLPAPERGFXDIR)/ludicolo/bg.4bpp @cat $^ >$@ -$(PSSGFXDIR)/whiscash.4bpp: $(PSSGFXDIR)/friends_frame2.4bpp $(PSSGFXDIR)/whiscash_bg.4bpp +$(WALLPAPERGFXDIR)/whiscash/tiles.4bpp: $(WALLPAPERGFXDIR)/friends_frame2.4bpp $(WALLPAPERGFXDIR)/whiscash/bg.4bpp @cat $^ >$@ $(OBJEVENTGFXDIR)/pics/effects/unknown_4F6D38/0.4bpp: %.4bpp: %.png diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 4e5ccfcda..6e5eab3f9 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -57,6 +57,7 @@ bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); u32 CountStorageNonEggMons(void); u32 CountAllStorageMons(void); bool32 AnyStorageMonWithMove(u16 moveId); + void ResetWaldaWallpaper(void); void SetWaldaWallpaperLockedOrUnlocked(bool32 unlocked); bool32 IsWaldaWallpaperUnlocked(void); diff --git a/include/pokemon_summary_screen.h b/include/pokemon_summary_screen.h index 151ea3af8..3996c8e15 100755 --- a/include/pokemon_summary_screen.h +++ b/include/pokemon_summary_screen.h @@ -18,19 +18,10 @@ void SummaryScreen_SetAnimDelayTaskId(u8 taskId); // such as move re-ordering, are available in the different modes. enum PokemonSummaryScreenMode { - PSS_MODE_NORMAL, - PSS_MODE_LOCK_MOVES, - PSS_MODE_BOX, - PSS_MODE_SELECT_MOVE, -}; - -enum PokemonSummaryScreenPage -{ - PSS_PAGE_INFO, - PSS_PAGE_SKILLS, - PSS_PAGE_BATTLE_MOVES, - PSS_PAGE_CONTEST_MOVES, - PSS_PAGE_COUNT, + SUMMARY_MODE_NORMAL, + SUMMARY_MODE_LOCK_MOVES, + SUMMARY_MODE_BOX, + SUMMARY_MODE_SELECT_MOVE, }; #endif // GUARD_POKEMON_SUMMARY_SCREEN_H diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 5be53a8b3..680c6e81c 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -1476,7 +1476,7 @@ static void Select_Task_OpenSummaryScreen(u8 taskId) sFactorySelectMons = AllocZeroed(sizeof(struct Pokemon) * SELECTABLE_MONS_COUNT); for (i = 0; i < SELECTABLE_MONS_COUNT; i++) sFactorySelectMons[i] = sFactorySelectScreen->mons[i].monData; - ShowPokemonSummaryScreen(PSS_MODE_LOCK_MOVES, sFactorySelectMons, currMonId, SELECTABLE_MONS_COUNT - 1, CB2_InitSelectScreen); + ShowPokemonSummaryScreen(SUMMARY_MODE_LOCK_MOVES, sFactorySelectMons, currMonId, SELECTABLE_MONS_COUNT - 1, CB2_InitSelectScreen); break; } } @@ -2390,7 +2390,7 @@ static void Swap_Task_OpenSummaryScreen(u8 taskId) DestroyTask(taskId); sFactorySwapScreen->fromSummaryScreen = TRUE; sFactorySwapScreen->speciesNameColorBackup = gPlttBufferUnfaded[244]; - ShowPokemonSummaryScreen(PSS_MODE_NORMAL, gPlayerParty, sFactorySwapScreen->cursorPos, FRONTIER_PARTY_SIZE - 1, CB2_InitSwapScreen); + ShowPokemonSummaryScreen(SUMMARY_MODE_NORMAL, gPlayerParty, sFactorySwapScreen->cursorPos, FRONTIER_PARTY_SIZE - 1, CB2_InitSwapScreen); break; } } diff --git a/src/data/wallpapers.h b/src/data/wallpapers.h index d075753b7..e198423c7 100644 --- a/src/data/wallpapers.h +++ b/src/data/wallpapers.h @@ -22,130 +22,130 @@ enum { static const u16 sWallpaperPalettes_Forest[][16] = { - INCBIN_U16("graphics/pokemon_storage/forest_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/forest_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/forest/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/forest/bg.gbapal"), }; -static const u32 sWallpaperTiles_Forest[] = INCBIN_U32("graphics/pokemon_storage/forest.4bpp.lz"); -static const u32 sWallpaperTilemap_Forest[] = INCBIN_U32("graphics/pokemon_storage/forest.bin.lz"); +static const u32 sWallpaperTiles_Forest[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/forest/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Forest[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/forest/tilemap.bin.lz"); static const u16 sWallpaperPalettes_City[][16] = { - INCBIN_U16("graphics/pokemon_storage/city_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/city_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/city/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/city/bg.gbapal"), }; -static const u32 sWallpaperTiles_City[] = INCBIN_U32("graphics/pokemon_storage/city.4bpp.lz"); -static const u32 sWallpaperTilemap_City[] = INCBIN_U32("graphics/pokemon_storage/city.bin.lz"); +static const u32 sWallpaperTiles_City[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/city/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_City[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/city/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Desert[][16] = { - INCBIN_U16("graphics/pokemon_storage/desert_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/desert_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/desert/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/desert/bg.gbapal"), }; -static const u32 sWallpaperTiles_Desert[] = INCBIN_U32("graphics/pokemon_storage/desert.4bpp.lz"); -static const u32 sWallpaperTilemap_Desert[] = INCBIN_U32("graphics/pokemon_storage/desert.bin.lz"); +static const u32 sWallpaperTiles_Desert[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/desert/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Desert[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/desert/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Savanna[][16] = { - INCBIN_U16("graphics/pokemon_storage/savanna_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/savanna_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/savanna/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/savanna/bg.gbapal"), }; -static const u32 sWallpaperTiles_Savanna[] = INCBIN_U32("graphics/pokemon_storage/savanna.4bpp.lz"); -static const u32 sWallpaperTilemap_Savanna[] = INCBIN_U32("graphics/pokemon_storage/savanna.bin.lz"); +static const u32 sWallpaperTiles_Savanna[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/savanna/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Savanna[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/savanna/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Crag[][16] = { - INCBIN_U16("graphics/pokemon_storage/crag_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/crag_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/crag/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/crag/bg.gbapal"), }; -static const u32 sWallpaperTiles_Crag[] = INCBIN_U32("graphics/pokemon_storage/crag.4bpp.lz"); -static const u32 sWallpaperTilemap_Crag[] = INCBIN_U32("graphics/pokemon_storage/crag.bin.lz"); +static const u32 sWallpaperTiles_Crag[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/crag/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Crag[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/crag/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Volcano[][16] = { - INCBIN_U16("graphics/pokemon_storage/volcano_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/volcano_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/volcano/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/volcano/bg.gbapal"), }; -static const u32 sWallpaperTiles_Volcano[] = INCBIN_U32("graphics/pokemon_storage/volcano.4bpp.lz"); -static const u32 sWallpaperTilemap_Volcano[] = INCBIN_U32("graphics/pokemon_storage/volcano.bin.lz"); +static const u32 sWallpaperTiles_Volcano[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/volcano/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Volcano[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/volcano/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Snow[][16] = { - INCBIN_U16("graphics/pokemon_storage/snow_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/snow_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/snow/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/snow/bg.gbapal"), }; -static const u32 sWallpaperTiles_Snow[] = INCBIN_U32("graphics/pokemon_storage/snow.4bpp.lz"); -static const u32 sWallpaperTilemap_Snow[] = INCBIN_U32("graphics/pokemon_storage/snow.bin.lz"); +static const u32 sWallpaperTiles_Snow[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/snow/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Snow[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/snow/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Cave[][16] = { - INCBIN_U16("graphics/pokemon_storage/cave_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/cave_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/cave/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/cave/bg.gbapal"), }; -static const u32 sWallpaperTiles_Cave[] = INCBIN_U32("graphics/pokemon_storage/cave.4bpp.lz"); -static const u32 sWallpaperTilemap_Cave[] = INCBIN_U32("graphics/pokemon_storage/cave.bin.lz"); +static const u32 sWallpaperTiles_Cave[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/cave/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Cave[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/cave/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Beach[][16] = { - INCBIN_U16("graphics/pokemon_storage/beach_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/beach_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/beach/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/beach/bg.gbapal"), }; -static const u32 sWallpaperTiles_Beach[] = INCBIN_U32("graphics/pokemon_storage/beach.4bpp.lz"); -static const u32 sWallpaperTilemap_Beach[] = INCBIN_U32("graphics/pokemon_storage/beach.bin.lz"); +static const u32 sWallpaperTiles_Beach[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/beach/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Beach[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/beach/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Seafloor[][16] = { - INCBIN_U16("graphics/pokemon_storage/seafloor_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/seafloor_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/seafloor/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/seafloor/bg.gbapal"), }; -static const u32 sWallpaperTiles_Seafloor[] = INCBIN_U32("graphics/pokemon_storage/seafloor.4bpp.lz"); -static const u32 sWallpaperTilemap_Seafloor[] = INCBIN_U32("graphics/pokemon_storage/seafloor.bin.lz"); +static const u32 sWallpaperTiles_Seafloor[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/seafloor/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Seafloor[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/seafloor/tilemap.bin.lz"); static const u16 sWallpaperPalettes_River[][16] = { - INCBIN_U16("graphics/pokemon_storage/river_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/river_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/river/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/river/bg.gbapal"), }; -static const u32 sWallpaperTiles_River[] = INCBIN_U32("graphics/pokemon_storage/river.4bpp.lz"); -static const u32 sWallpaperTilemap_River[] = INCBIN_U32("graphics/pokemon_storage/river.bin.lz"); +static const u32 sWallpaperTiles_River[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/river/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_River[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/river/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Sky[][16] = { - INCBIN_U16("graphics/pokemon_storage/sky_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/sky_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/sky/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/sky/bg.gbapal"), }; -static const u32 sWallpaperTiles_Sky[] = INCBIN_U32("graphics/pokemon_storage/sky.4bpp.lz"); -static const u32 sWallpaperTilemap_Sky[] = INCBIN_U32("graphics/pokemon_storage/sky.bin.lz"); +static const u32 sWallpaperTiles_Sky[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/sky/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Sky[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/sky/tilemap.bin.lz"); static const u16 sWallpaperPalettes_PolkaDot[][16] = { - INCBIN_U16("graphics/pokemon_storage/polkadot_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/polkadot_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/polkadot/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/polkadot/bg.gbapal"), }; -static const u32 sWallpaperTiles_PolkaDot[] = INCBIN_U32("graphics/pokemon_storage/polkadot.4bpp.lz"); -static const u32 sWallpaperTilemap_PolkaDot[] = INCBIN_U32("graphics/pokemon_storage/polkadot.bin.lz"); +static const u32 sWallpaperTiles_PolkaDot[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/polkadot/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_PolkaDot[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/polkadot/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Pokecenter[][16] = { - INCBIN_U16("graphics/pokemon_storage/pokecenter_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/pokecenter_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/pokecenter/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/pokecenter/bg.gbapal"), }; -static const u32 sWallpaperTiles_Pokecenter[] = INCBIN_U32("graphics/pokemon_storage/pokecenter.4bpp.lz"); -static const u32 sWallpaperTilemap_Pokecenter[] = INCBIN_U32("graphics/pokemon_storage/pokecenter.bin.lz"); +static const u32 sWallpaperTiles_Pokecenter[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/pokecenter/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Pokecenter[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/pokecenter/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Machine[][16] = { - INCBIN_U16("graphics/pokemon_storage/machine_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/machine_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/machine/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/machine/bg.gbapal"), }; -static const u32 sWallpaperTiles_Machine[] = INCBIN_U32("graphics/pokemon_storage/machine.4bpp.lz"); -static const u32 sWallpaperTilemap_Machine[] = INCBIN_U32("graphics/pokemon_storage/machine.bin.lz"); +static const u32 sWallpaperTiles_Machine[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/machine/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Machine[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/machine/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Plain[][16] = { - INCBIN_U16("graphics/pokemon_storage/plain_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/plain_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/plain/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/plain/bg.gbapal"), }; -static const u32 sWallpaperTiles_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.4bpp.lz"); -static const u32 sWallpaperTilemap_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.bin.lz"); +static const u32 sWallpaperTiles_Plain[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/plain/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Plain[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/plain/tilemap.bin.lz"); // 12x18 tilemap static const u32 gUnknown_085773C4[] = INCBIN_U32("graphics/unused/tilemap_5773C4.bin"); @@ -200,143 +200,143 @@ static const u8 sArrow_Gfx[] = INCBIN_U8("graphics/pokemon_storage/arrow.4bpp"); static const u16 sWallpaperPalettes_Zigzagoon[][16] = { - INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), - INCBIN_U16("graphics/pokemon_storage/zigzagoon_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/friends_frame1.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/zigzagoon/bg.gbapal"), }; -static const u32 sWallpaperTiles_Zigzagoon[] = INCBIN_U32("graphics/pokemon_storage/zigzagoon.4bpp.lz"); -static const u32 sWallpaperTilemap_Zigzagoon[] = INCBIN_U32("graphics/pokemon_storage/zigzagoon.bin.lz"); +static const u32 sWallpaperTiles_Zigzagoon[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/zigzagoon/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Zigzagoon[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/zigzagoon/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Screen[][16] = { - INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), - INCBIN_U16("graphics/pokemon_storage/screen_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/friends_frame1.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/screen/bg.gbapal"), }; -static const u32 sWallpaperTiles_Screen[] = INCBIN_U32("graphics/pokemon_storage/screen.4bpp.lz"); -static const u32 sWallpaperTilemap_Screen[] = INCBIN_U32("graphics/pokemon_storage/screen.bin.lz"); +static const u32 sWallpaperTiles_Screen[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/screen/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Screen[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/screen/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Diagonal[][16] = { - INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), - INCBIN_U16("graphics/pokemon_storage/diagonal_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/friends_frame1.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/diagonal/bg.gbapal"), }; -static const u32 sWallpaperTiles_Diagonal[] = INCBIN_U32("graphics/pokemon_storage/diagonal.4bpp.lz"); -static const u32 sWallpaperTilemap_Diagonal[] = INCBIN_U32("graphics/pokemon_storage/diagonal.bin.lz"); +static const u32 sWallpaperTiles_Diagonal[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/diagonal/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Diagonal[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/diagonal/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Block[][16] = { - INCBIN_U16("graphics/pokemon_storage/block_bg.gbapal"), - INCBIN_U16("graphics/pokemon_storage/block_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/block/bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/block/bg.gbapal"), }; -static const u32 sWallpaperTiles_Block[] = INCBIN_U32("graphics/pokemon_storage/block.4bpp.lz"); -static const u32 sWallpaperTilemap_Block[] = INCBIN_U32("graphics/pokemon_storage/block.bin.lz"); +static const u32 sWallpaperTiles_Block[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/block/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Block[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/block/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Pokecenter2[][16] = { - INCBIN_U16("graphics/pokemon_storage/pokecenter2_bg.gbapal"), - INCBIN_U16("graphics/pokemon_storage/pokecenter2_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/pokecenter2/bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/pokecenter2/bg.gbapal"), }; -static const u32 sWallpaperTiles_Pokecenter2[] = INCBIN_U32("graphics/pokemon_storage/pokecenter2.4bpp.lz"); -static const u32 sWallpaperTilemap_Pokecenter2[] = INCBIN_U32("graphics/pokemon_storage/pokecenter2.bin.lz"); +static const u32 sWallpaperTiles_Pokecenter2[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/pokecenter2/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Pokecenter2[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/pokecenter2/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Frame[][16] = { - INCBIN_U16("graphics/pokemon_storage/frame_bg.gbapal"), - INCBIN_U16("graphics/pokemon_storage/frame_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/frame/bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/frame/bg.gbapal"), }; -static const u32 sWallpaperTiles_Frame[] = INCBIN_U32("graphics/pokemon_storage/frame.4bpp.lz"); -static const u32 sWallpaperTilemap_Frame[] = INCBIN_U32("graphics/pokemon_storage/frame.bin.lz"); +static const u32 sWallpaperTiles_Frame[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/frame/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Frame[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/frame/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Blank[][16] = { - INCBIN_U16("graphics/pokemon_storage/friends_frame1.gbapal"), - INCBIN_U16("graphics/pokemon_storage/zigzagoon_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/friends_frame1.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/zigzagoon/bg.gbapal"), }; -static const u32 sWallpaperTiles_Blank[] = INCBIN_U32("graphics/pokemon_storage/blank.4bpp.lz"); -static const u32 sWallpaperTilemap_Blank[] = INCBIN_U32("graphics/pokemon_storage/blank.bin.lz"); +static const u32 sWallpaperTiles_Blank[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/blank/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Blank[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/blank/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Circles[][16] = { - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/circles_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/circles/bg.gbapal"), }; -static const u32 sWallpaperTiles_Circles[] = INCBIN_U32("graphics/pokemon_storage/circles.4bpp.lz"); -static const u32 sWallpaperTilemap_Circles[] = INCBIN_U32("graphics/pokemon_storage/circles.bin.lz"); +static const u32 sWallpaperTiles_Circles[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/circles/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Circles[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/circles/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Azumarill[][16] = { - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/azumarill_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/azumarill/bg.gbapal"), }; -static const u32 sWallpaperTiles_Azumarill[] = INCBIN_U32("graphics/pokemon_storage/azumarill.4bpp.lz"); -static const u32 sWallpaperTilemap_Azumarill[] = INCBIN_U32("graphics/pokemon_storage/azumarill.bin.lz"); +static const u32 sWallpaperTiles_Azumarill[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/azumarill/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Azumarill[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/azumarill/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Pikachu[][16] = { - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/pikachu_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/pikachu/bg.gbapal"), }; -static const u32 sWallpaperTiles_Pikachu[] = INCBIN_U32("graphics/pokemon_storage/pikachu.4bpp.lz"); -static const u32 sWallpaperTilemap_Pikachu[] = INCBIN_U32("graphics/pokemon_storage/pikachu.bin.lz"); +static const u32 sWallpaperTiles_Pikachu[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/pikachu/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Pikachu[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/pikachu/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Legendary[][16] = { - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/legendary_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/legendary/bg.gbapal"), }; -static const u32 sWallpaperTiles_Legendary[] = INCBIN_U32("graphics/pokemon_storage/legendary.4bpp.lz"); -static const u32 sWallpaperTilemap_Legendary[] = INCBIN_U32("graphics/pokemon_storage/legendary.bin.lz"); +static const u32 sWallpaperTiles_Legendary[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/legendary/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Legendary[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/legendary/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Dusclops[][16] = { - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/dusclops_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/dusclops/bg.gbapal"), }; -static const u32 sWallpaperTiles_Dusclops[] = INCBIN_U32("graphics/pokemon_storage/dusclops.4bpp.lz"); -static const u32 sWallpaperTilemap_Dusclops[] = INCBIN_U32("graphics/pokemon_storage/dusclops.bin.lz"); +static const u32 sWallpaperTiles_Dusclops[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/dusclops/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Dusclops[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/dusclops/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Ludicolo[][16] = { - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/ludicolo_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/ludicolo/bg.gbapal"), }; -static const u32 sWallpaperTiles_Ludicolo[] = INCBIN_U32("graphics/pokemon_storage/ludicolo.4bpp.lz"); -static const u32 sWallpaperTilemap_Ludicolo[] = INCBIN_U32("graphics/pokemon_storage/ludicolo.bin.lz"); +static const u32 sWallpaperTiles_Ludicolo[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/ludicolo/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Ludicolo[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/ludicolo/tilemap.bin.lz"); static const u16 sWallpaperPalettes_Whiscash[][16] = { - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/whiscash_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/whiscash/bg.gbapal"), }; -static const u32 sWallpaperTiles_Whiscash[] = INCBIN_U32("graphics/pokemon_storage/whiscash.4bpp.lz"); -static const u32 sWallpaperTilemap_Whiscash[] = INCBIN_U32("graphics/pokemon_storage/whiscash.bin.lz"); +static const u32 sWallpaperTiles_Whiscash[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/whiscash/tiles.4bpp.lz"); +static const u32 sWallpaperTilemap_Whiscash[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/whiscash/tilemap.bin.lz"); -static const u32 sWallpaperIcon_Aqua[] = INCBIN_U32("graphics/pokemon_storage/aqua_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Heart[] = INCBIN_U32("graphics/pokemon_storage/heart_icon.4bpp.lz"); -static const u32 sWallpaperIcon_FiveStar[] = INCBIN_U32("graphics/pokemon_storage/five_star_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Brick[] = INCBIN_U32("graphics/pokemon_storage/brick_icon.4bpp.lz"); -static const u32 sWallpaperIcon_FourStar[] = INCBIN_U32("graphics/pokemon_storage/four_star_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Asterisk[] = INCBIN_U32("graphics/pokemon_storage/asterisk_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Dot[] = INCBIN_U32("graphics/pokemon_storage/dot_icon.4bpp.lz"); -static const u32 sWallpaperIcon_LineCircle[] = INCBIN_U32("graphics/pokemon_storage/line_circle_icon.4bpp.lz"); -static const u32 sWallpaperIcon_PokeBall[] = INCBIN_U32("graphics/pokemon_storage/pokeball_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Maze[] = INCBIN_U32("graphics/pokemon_storage/maze_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Footprint[] = INCBIN_U32("graphics/pokemon_storage/footprint_icon.4bpp.lz"); -static const u32 sWallpaperIcon_BigAsterisk[] = INCBIN_U32("graphics/pokemon_storage/big_asterisk_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Circle[] = INCBIN_U32("graphics/pokemon_storage/circle_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Koffing[] = INCBIN_U32("graphics/pokemon_storage/koffing_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Ribbon[] = INCBIN_U32("graphics/pokemon_storage/ribbon_icon.4bpp.lz"); -static const u32 sWallpaperIcon_FourCircles[] = INCBIN_U32("graphics/pokemon_storage/four_circles_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Lotad[] = INCBIN_U32("graphics/pokemon_storage/lotad_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Crystal[] = INCBIN_U32("graphics/pokemon_storage/crystal_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Pichu[] = INCBIN_U32("graphics/pokemon_storage/pichu_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Diglett[] = INCBIN_U32("graphics/pokemon_storage/diglett_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Luvdisc[] = INCBIN_U32("graphics/pokemon_storage/luvdisc_icon.4bpp.lz"); -static const u32 sWallpaperIcon_StarInCircle[] = INCBIN_U32("graphics/pokemon_storage/star_in_circle_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Spinda[] = INCBIN_U32("graphics/pokemon_storage/spinda_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Latis[] = INCBIN_U32("graphics/pokemon_storage/latis_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Minun[] = INCBIN_U32("graphics/pokemon_storage/minun_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Togepi[] = INCBIN_U32("graphics/pokemon_storage/togepi_icon.4bpp.lz"); -static const u32 sWallpaperIcon_Magma[] = INCBIN_U32("graphics/pokemon_storage/magma_icon.4bpp.lz"); +static const u32 sWallpaperIcon_Aqua[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/aqua.4bpp.lz"); +static const u32 sWallpaperIcon_Heart[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/heart.4bpp.lz"); +static const u32 sWallpaperIcon_FiveStar[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/five_star.4bpp.lz"); +static const u32 sWallpaperIcon_Brick[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/brick.4bpp.lz"); +static const u32 sWallpaperIcon_FourStar[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/four_star.4bpp.lz"); +static const u32 sWallpaperIcon_Asterisk[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/asterisk.4bpp.lz"); +static const u32 sWallpaperIcon_Dot[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/dot.4bpp.lz"); +static const u32 sWallpaperIcon_LineCircle[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/line_circle.4bpp.lz"); +static const u32 sWallpaperIcon_PokeBall[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/pokeball.4bpp.lz"); +static const u32 sWallpaperIcon_Maze[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/maze.4bpp.lz"); +static const u32 sWallpaperIcon_Footprint[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/footprint.4bpp.lz"); +static const u32 sWallpaperIcon_BigAsterisk[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/big_asterisk.4bpp.lz"); +static const u32 sWallpaperIcon_Circle[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/circle.4bpp.lz"); +static const u32 sWallpaperIcon_Koffing[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/koffing.4bpp.lz"); +static const u32 sWallpaperIcon_Ribbon[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/ribbon.4bpp.lz"); +static const u32 sWallpaperIcon_FourCircles[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/four_circles.4bpp.lz"); +static const u32 sWallpaperIcon_Lotad[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/lotad.4bpp.lz"); +static const u32 sWallpaperIcon_Crystal[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/crystal.4bpp.lz"); +static const u32 sWallpaperIcon_Pichu[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/pichu.4bpp.lz"); +static const u32 sWallpaperIcon_Diglett[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/diglett.4bpp.lz"); +static const u32 sWallpaperIcon_Luvdisc[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/luvdisc.4bpp.lz"); +static const u32 sWallpaperIcon_StarInCircle[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/star_in_circle.4bpp.lz"); +static const u32 sWallpaperIcon_Spinda[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/spinda.4bpp.lz"); +static const u32 sWallpaperIcon_Latis[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/latis.4bpp.lz"); +static const u32 sWallpaperIcon_Minun[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/minun.4bpp.lz"); +static const u32 sWallpaperIcon_Togepi[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/togepi.4bpp.lz"); +static const u32 sWallpaperIcon_Magma[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/magma.4bpp.lz"); static const struct Wallpaper sWaldaWallpapers[] = { diff --git a/src/graphics.c b/src/graphics.c index 09779eab7..4eb58cc5a 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1484,27 +1484,27 @@ const u16 gTradeMenuMonBox_Tilemap[] = INCBIN_U16("graphics/trade/menu_mon_box.b const u16 gMessageBox_Pal[] = INCBIN_U16("graphics/text_window/message_box.gbapal"); const u8 gMessageBox_Gfx[] = INCBIN_U8("graphics/text_window/message_box.4bpp"); -const u32 gWallpaperIcon_Cross[] = INCBIN_U32("graphics/pokemon_storage/cross_icon.4bpp.lz"); -const u32 gWallpaperIcon_Bolt[] = INCBIN_U32("graphics/pokemon_storage/bolt_icon.4bpp.lz"); -const u32 gWallpaperIcon_Plusle[] = INCBIN_U32("graphics/pokemon_storage/plusle_icon.4bpp.lz"); +const u32 gWallpaperIcon_Cross[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/cross.4bpp.lz"); +const u32 gWallpaperIcon_Bolt[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/bolt.4bpp.lz"); +const u32 gWallpaperIcon_Plusle[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/icons/plusle.4bpp.lz"); const u16 gWallpaperPalettes_Horizontal[][16] = { - INCBIN_U16("graphics/pokemon_storage/friends_frame2.gbapal"), - INCBIN_U16("graphics/pokemon_storage/horizontal_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/friends_frame2.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/horizontal/bg.gbapal"), }; -const u32 gWallpaperTiles_Horizontal[] = INCBIN_U32("graphics/pokemon_storage/horizontal.4bpp.lz"); -const u32 gWallpaperTilemap_Horizontal[] = INCBIN_U32("graphics/pokemon_storage/horizontal.bin.lz"); +const u32 gWallpaperTiles_Horizontal[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/horizontal/tiles.4bpp.lz"); +const u32 gWallpaperTilemap_Horizontal[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/horizontal/tilemap.bin.lz"); const u16 gWallpaperPalettes_Ribbon[][16] = { - INCBIN_U16("graphics/pokemon_storage/ribbon_frame.gbapal"), - INCBIN_U16("graphics/pokemon_storage/ribbon_bg.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/ribbon/frame.gbapal"), + INCBIN_U16("graphics/pokemon_storage/wallpapers/ribbon/bg.gbapal"), }; -const u32 gWallpaperTiles_Ribbon[] = INCBIN_U32("graphics/pokemon_storage/ribbon.4bpp.lz"); -const u32 gWallpaperTilemap_Ribbon[] = INCBIN_U32("graphics/pokemon_storage/ribbon.bin.lz"); +const u32 gWallpaperTiles_Ribbon[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/ribbon/tiles.4bpp.lz"); +const u32 gWallpaperTilemap_Ribbon[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/ribbon/tilemap.bin.lz"); const u16 gPokenavRibbonsSummaryBg_Pal[] = INCBIN_U16("graphics/pokenav/ribbons/summary_bg.gbapal"); const u32 gPokenavRibbonsSummaryBg_Gfx[] = INCBIN_U32("graphics/pokenav/ribbons/summary_bg.4bpp.lz"); diff --git a/src/party_menu.c b/src/party_menu.c index 8a0c01e25..81c39949b 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -2703,11 +2703,11 @@ static void CB2_ShowPokemonSummaryScreen(void) if (gPartyMenu.menuType == PARTY_MENU_TYPE_IN_BATTLE) { UpdatePartyToBattleOrder(); - ShowPokemonSummaryScreen(PSS_MODE_LOCK_MOVES, gPlayerParty, gPartyMenu.slotId, gPlayerPartyCount - 1, CB2_ReturnToPartyMenuFromSummaryScreen); + ShowPokemonSummaryScreen(SUMMARY_MODE_LOCK_MOVES, gPlayerParty, gPartyMenu.slotId, gPlayerPartyCount - 1, CB2_ReturnToPartyMenuFromSummaryScreen); } else { - ShowPokemonSummaryScreen(PSS_MODE_NORMAL, gPlayerParty, gPartyMenu.slotId, gPlayerPartyCount - 1, CB2_ReturnToPartyMenuFromSummaryScreen); + ShowPokemonSummaryScreen(SUMMARY_MODE_NORMAL, gPlayerParty, gPartyMenu.slotId, gPlayerPartyCount - 1, CB2_ReturnToPartyMenuFromSummaryScreen); } } @@ -6265,7 +6265,7 @@ static void Task_BattlePyramidChooseMonHeldItems(u8 taskId) void MoveDeleterChooseMoveToForget(void) { - ShowPokemonSummaryScreen(PSS_MODE_SELECT_MOVE, gPlayerParty, gSpecialVar_0x8004, gPlayerPartyCount - 1, CB2_ReturnToField); + ShowPokemonSummaryScreen(SUMMARY_MODE_SELECT_MOVE, gPlayerParty, gSpecialVar_0x8004, gPlayerPartyCount - 1, CB2_ReturnToField); gFieldCallback = FieldCB_ContinueScriptHandleMusic; } diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 6bcc10afc..07e0931ed 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -42,12 +42,14 @@ #include "constants/rgb.h" #include "constants/songs.h" +// PC main menu options enum { - BOX_OPTION_WITHDRAW, - BOX_OPTION_DEPOSIT, - BOX_OPTION_MOVE_MONS, - BOX_OPTION_MOVE_ITEMS, - BOX_OPTION_EXIT, + OPTION_WITHDRAW, + OPTION_DEPOSIT, + OPTION_MOVE_MONS, + OPTION_MOVE_ITEMS, + OPTION_EXIT, + OPTIONS_COUNT }; // IDs for messages to print with PrintMessage @@ -85,6 +87,7 @@ enum { MSG_CANT_STORE_MAIL, }; +// Formatting for the above messages enum { MSG_FORMAT_NORMAL, MSG_FORMAT_MON_NAME_1, @@ -141,6 +144,37 @@ enum { #define MENU_WALLPAPER_SETS_START MENU_SCENERY_1 #define MENU_WALLPAPERS_START MENU_FOREST +// Return IDs for input handlers +enum { + INPUT_NONE, + INPUT_1, + INPUT_2, // Unused + INPUT_3, // Unused + INPUT_4, + INPUT_5, + INPUT_6, + INPUT_7, + INPUT_8, + INPUT_9, + INPUT_10, + INPUT_11, + INPUT_12, + INPUT_13, + INPUT_14, + INPUT_15, + INPUT_16, + INPUT_17, + INPUT_18, + INPUT_19, + INPUT_20, + INPUT_21, + INPUT_22, + INPUT_23, + INPUT_24, + INPUT_25, + INPUT_26, +}; + enum { SCREEN_CHANGE_EXIT_BOX, SCREEN_CHANGE_SUMMARY_SCREEN, @@ -154,26 +188,6 @@ enum { MODE_MOVE, }; -enum { - FRIENDS_ZIGZAGOON, - FRIENDS_SCREEN, - FRIENDS_HORIZONTAL, - FRIENDS_DIAGONAL, - FRIENDS_BLOCK, - FRIENDS_RIBBON, - FRIENDS_POKECENTER2, - FRIENDS_FRAME, - FRIENDS_BLANK, - FRIENDS_CIRCLES, - FRIENDS_AZUMARILL, - FRIENDS_PIKACHU, - FRIENDS_LEGENDARY, - FRIENDS_DUSCLOPS, - FRIENDS_LUDICOLO, - FRIENDS_WHISCASH, - FRIENDS_WALLPAPERS_COUNT -}; - enum { CURSOR_AREA_IN_BOX, CURSOR_AREA_IN_PARTY, @@ -181,27 +195,32 @@ enum { CURSOR_AREA_BUTTONS, // Party Pokemon and Close Box }; +// Special box ids for the choose box menu +#define BOXID_NONE_CHOSEN 200 +#define BOXID_CANCELED 201 + #define TAG_PAL_WAVEFORM 0xDACA #define TAG_PAL_DAC8 0xDAC8 #define TAG_PAL_DAC6 0xDAC6 #define TAG_PAL_DACE 0xDACE #define TAG_PAL_DAC7 0xDAC7 -#define PALTAG_BOX_TITLE 0xDAC9 +#define PALTAG_BOX_TITLE 0xDAC9 #define TAG_PAL_DAC0 0xDAC0 #define TAG_PAL_DACB 0xDACB -#define TAG_TILE_0 0 -#define TAG_TILE_1 1 -#define TAG_TILE_2 2 -#define GFXTAG_BOX_TITLE 3 -#define GFXTAG_BOX_TITLE_ALT 4 -#define TAG_TILE_WAVEFORM 5 -#define GFXTAG_ARROW 6 -#define TAG_TILE_7 7 -#define TAG_TILE_A 10 -#define TAG_TILE_D 13 -#define TAG_TILE_10 16 -#define TAG_TILE_12 18 +#define TAG_TILE_0 0 +#define TAG_TILE_1 1 +#define TAG_TILE_2 2 +#define GFXTAG_BOX_TITLE 3 +#define GFXTAG_BOX_TITLE_ALT 4 +#define TAG_TILE_WAVEFORM 5 +#define GFXTAG_ARROW 6 +#define TAG_TILE_7 7 +#define GFXTAG_CHOOSE_BOX_MENU 10 +#define GFXTAG_CHOOSE_BOX_MENU_SIDES 11 // Used implicitly in LoadChooseBoxMenuGfx +#define TAG_TILE_D 13 +#define TAG_TILE_10 16 +#define TAG_TILE_12 18 struct Wallpaper @@ -229,12 +248,6 @@ struct StorageMenu int textId; }; -struct PSS_MenuStringPtrs -{ - const u8 *text; - const u8 *desc; -}; - struct UnkStruct_2000028 { const u8 *unk_00; @@ -252,19 +265,19 @@ struct UnkStruct_2000020 u8 unk_05; }; -struct UnkPSSStruct_2002370 +struct ChooseBoxMenu { - struct Sprite *unk_0000; - struct Sprite *unk_0004[4]; + struct Sprite *menuSprite; + struct Sprite *menuSideSprites[4]; u32 unk_0014[3]; struct Sprite *arrowSprites[2]; u8 filler_0028[0x214]; - u32 unk_023c; - u16 unk_0240; - u16 unk_0242; + bool32 loadedPalette; + u16 tileTag; + u16 paletteTag; u8 curBox; u8 unk_0245; - u8 unk_0246; + u8 subpriority; }; struct UnkStorageStruct @@ -297,7 +310,7 @@ struct PokemonStorageSystemData bool8 unk_02C9; s16 newCurrBoxId; u16 bg2_X; - s16 wallpaperScrollSpeed; + s16 scrollSpeed; u16 field_2D0; u8 wallpaperOffset; u8 field_2D3; // Written to, but never read. @@ -394,7 +407,7 @@ struct PokemonStorageSystemData struct Sprite *field_D98[2]; u16 *field_DA0; struct MonMarkingsMenu markMenu; - struct UnkPSSStruct_2002370 field_1E5C; + struct ChooseBoxMenu chooseBoxMenu; struct Pokemon movingMon; struct Pokemon field_2108; s8 field_216C; @@ -408,7 +421,7 @@ struct PokemonStorageSystemData u16 field_2176[8]; u8 field_2186; u8 field_2187; - u8 pokemonSummaryScreenMode; + u8 summaryScreenMode; union { struct Pokemon *mon; @@ -461,16 +474,14 @@ struct UnkStruct_2039D84 u8 field_2D; }; -// IWRAM bss static u32 gUnknown_03000F78[98]; -// EWRAM DATA EWRAM_DATA static u8 sPreviousBoxOption = 0; -EWRAM_DATA static struct UnkPSSStruct_2002370 *gUnknown_02039D04 = NULL; +EWRAM_DATA static struct ChooseBoxMenu *sChooseBoxMenu = NULL; EWRAM_DATA static struct PokemonStorageSystemData *sPSSData = NULL; EWRAM_DATA static bool8 sInPartyMenu = 0; EWRAM_DATA static u8 sCurrentBoxOption = 0; -EWRAM_DATA static u8 gUnknown_02039D0E = 0; +EWRAM_DATA static u8 sDepositBoxId = 0; EWRAM_DATA static u8 sWhichToReshow = 0; EWRAM_DATA static u8 sLastUsedBox = 0; EWRAM_DATA static u16 sMovingItemId = 0; @@ -482,8 +493,7 @@ EWRAM_DATA static u8 sMovingMonOrigBoxId = 0; EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0; EWRAM_DATA static bool8 sCanOnlyMove = 0; -// This file's functions. -static void CreatePCMenu(u8, s16 *); +static void CreateMainMenu(u8, s16 *); static void Cb2_EnterPSS(u8); static u8 GetCurrentBoxOption(void); static u8 HandleInput(void); @@ -494,13 +504,13 @@ static void CreateIncomingBoxTitle(u8, s8); static void StartBoxScrollArrowsSlide(s8); static void SetCurrentBox(u8); static void CreateInitBoxTask(u8); -static void sub_80C7958(u8); +static void ChooseBoxMenu_CreateSprites(u8); static void TrimOldWallpaper(void *); -static void sub_80C7B14(void); -static void sub_80C7BB4(void); +static void ChooseBoxMenu_DestroySprites(void); +static void ChooseBoxMenu_MoveLeft(void); static void ScrollBackground(void); -static void sub_80C7B80(void); -static void sub_80C7BE4(void); +static void ChooseBoxMenu_MoveRight(void); +static void ChooseBoxMenu_PrintInfo(void); static void sub_80CAA14(void); static void sub_80CFDC4(void); static void sub_80CE790(void); @@ -570,7 +580,7 @@ static void sub_80CB950(void); static void sub_80CA9C0(void); static void SetUpDoShowPartyMenu(void); static void BoxSetMosaic(void); -static void SpriteCB_JumpBoxArrow(struct Sprite *); +static void SpriteCB_ChooseBoxArrow(struct Sprite *); static void sub_80CC100(struct Sprite *); static void sub_80CB278(struct Sprite *); static void SpriteCB_Arrow(struct Sprite *); @@ -591,7 +601,7 @@ static bool8 ScrollToBox(void); static bool8 sub_80CD554(void); static bool8 HidePartyMenu(void); static bool8 IsActiveItemMoving(void); -static bool8 sub_80D0580(u8 arg0); +static bool8 sub_80D0580(u8); static bool8 sub_80D0BC0(void); static bool8 sub_80CA2B8(void); static bool8 DoWallpaperGfxChange(void); @@ -604,37 +614,37 @@ static bool8 IsCursorOnBox(void); static bool8 IsCursorInBox(void); static bool8 IsMonBeingMoved(void); static bool8 TryStorePartyMonInBox(u8); -static void Cb_InitPSS(u8 taskId); -static void Cb_PlaceMon(u8 taskId); -static void Cb_ChangeScreen(u8 taskId); -static void Cb_ShowPSS(u8 taskId); -static void Cb_OnBPressed(u8 taskId); -static void Cb_HandleBoxOptions(u8 taskId); -static void Cb_OnSelectedMon(u8 taskId); -static void Cb_OnCloseBoxPressed(u8 taskId); -static void Cb_HidePartyPokemon(u8 taskId); -static void Cb_DepositMenu(u8 taskId); -static void Cb_MoveMon(u8 taskId); -static void Cb_GiveMovingItemToMon(u8 taskId); -static void Cb_SwitchSelectedItem(u8 taskId); -static void Cb_TakeItemForMoving(u8 taskId); -static void Cb_WithdrawMon(u8 taskId); -static void Cb_ShiftMon(u8 taskId); -static void Cb_ShowPartyPokemon(u8 taskId); -static void Cb_ShowItemInfo(u8 taskId); -static void Cb_GiveItemFromBag(u8 taskId); -static void Cb_ItemToBag(u8 taskId); -static void Cb_TakeItemForMoving(u8 taskId); -static void Cb_ShowMarkMenu(u8 taskId); -static void Cb_ShowMonSummary(u8 taskId); -static void Cb_ReleaseMon(u8 taskId); -static void Cb_ReshowPSS(u8 taskId); -static void Cb_MainPSS(u8 taskId); -static void Cb_JumpBox(u8 taskId); -static void Cb_HandleWallpapers(u8 taskId); -static void Cb_NameBox(u8 taskId); -static void Cb_PrintCantStoreMail(u8 taskId); -static void Cb_HandleMovingMonFromParty(u8 taskId); +static void Cb_InitPSS(u8); +static void Cb_PlaceMon(u8); +static void Cb_ChangeScreen(u8); +static void Cb_ShowPSS(u8); +static void Cb_OnBPressed(u8); +static void Cb_HandleBoxOptions(u8); +static void Cb_OnSelectedMon(u8); +static void Cb_OnCloseBoxPressed(u8); +static void Cb_HidePartyPokemon(u8); +static void Cb_DepositMenu(u8); +static void Cb_MoveMon(u8); +static void Cb_GiveMovingItemToMon(u8); +static void Cb_SwitchSelectedItem(u8); +static void Cb_TakeItemForMoving(u8); +static void Cb_WithdrawMon(u8); +static void Cb_ShiftMon(u8); +static void Cb_ShowPartyPokemon(u8); +static void Cb_ShowItemInfo(u8); +static void Cb_GiveItemFromBag(u8); +static void Cb_ItemToBag(u8); +static void Cb_TakeItemForMoving(u8); +static void Cb_ShowMarkMenu(u8); +static void Cb_ShowMonSummary(u8); +static void Cb_ReleaseMon(u8); +static void Cb_ReshowPSS(u8); +static void Cb_MainPSS(u8); +static void Cb_JumpBox(u8); +static void Cb_HandleWallpapers(u8); +static void Cb_NameBox(u8); +static void Cb_PrintCantStoreMail(u8); +static void Cb_HandleMovingMonFromParty(u8); static void SetUpScrollToBox(u8); static void sub_80CFE54(u8); static void SetMovingMonPriority(u8); @@ -654,29 +664,29 @@ static void Item_FromMonToMoving(u8, u8); static void Item_GiveMovingToMon(u8, u8); static void Item_TakeMons(u8, u8); static void Item_SwitchMonsWithMoving(u8, u8); -static struct Sprite *CreateJumpBoxArrows(u16, u16, u8, u8, u8); +static struct Sprite *CreateChooseBoxArrows(u16, u16, u8, u8, u8); static void SetWallpaperForCurrentBox(u8); static void AddWallpapersMenu(u8); static u16 GetMovingItem(void); -static void LoadCursorMonGfx(u16 species, u32 pid); -static void sub_80CA2D0(struct Sprite *sprite); +static void LoadCursorMonGfx(u16, u32); +static void sub_80CA2D0(struct Sprite *); static void SpriteCB_OutgoingBoxTitle(struct Sprite *); -static void sub_80CBA3C(struct Sprite *sprite); +static void sub_80CBA3C(struct Sprite *); static void SpriteCB_IncomingBoxTitle(struct Sprite *); -static void sub_80CBAF0(s16 yDelta); -static void sub_80CAAA8(u8 arg0, bool8 isPartyMon); +static void sub_80CBAF0(s16); +static void sub_80CAAA8(u8, bool8); static const u8 *GetMovingItemName(void); -static void SetMenuText(u8 textId); -static void sub_80D0D8C(u8 cursorArea, u8 cursorPos); -static void sub_80D0E50(u8 cursorArea, u8 cursorPos); -static void sub_80D0F38(u16 item); -static struct Sprite *CreateMonIconSprite(u16 species, u32 personality, s16 x, s16 y, u8 oamPriority, u8 subpriority); -static void DestroyBoxMonIcon(struct Sprite *sprite); +static void SetMenuText(u8); +static void sub_80D0D8C(u8, u8); +static void sub_80D0E50(u8, u8); +static void sub_80D0F38(u16); +static struct Sprite *CreateMonIconSprite(u16, u32, s16, s16, u8, u8); +static void DestroyBoxMonIcon(struct Sprite *); static void SetBoxSpeciesAndPersonalities(u8); static void sub_80CB9D0(struct Sprite *, u16); -static void Task_InitBox(u8 taskId); -static void InitBoxTitle(u8 boxId); -static s8 DetermineBoxScrollDirection(u8 boxId); +static void Task_InitBox(u8); +static void InitBoxTitle(u8); +static s8 DetermineBoxScrollDirection(u8); static void DrawWallpaper(const void *, s8, u8); static s16 GetBoxTitleBaseX(const u8 *); static bool8 MonPlaceChange_Shift(void); @@ -684,12 +694,12 @@ static bool8 MonPlaceChange_Move(void); static bool8 MonPlaceChange_Place(void); static bool8 sub_80CDEC4(void); static bool8 sub_80CDEB4(void); -static void sub_80CD444(u8 cursorArea, u8 cursorPosition, u16 *x, u16 *y); -static void SetShiftedMonData(u8 boxId, u8 position); -static void SetMovedMonData(u8 boxId, u8 position); -static void SetPlacedMonData(u8 boxId, u8 position); -static void PurgeMonOrBoxMon(u8 boxId, u8 position); -static void SetCursorMonData(void *pokemon, u8 mode); +static void sub_80CD444(u8, u8, u16 *, u16 *); +static void SetShiftedMonData(u8, u8); +static void SetMovedMonData(u8, u8); +static void SetPlacedMonData(u8, u8); +static void PurgeMonOrBoxMon(u8, u8); +static void SetCursorMonData(void *, u8); static bool32 AtLeastThreeUsableMons(void); static u8 InBoxInput_Normal(void); static u8 InBoxInput_MovingMultiple(void); @@ -705,47 +715,49 @@ static bool8 sub_80D03B0(void); static bool8 sub_80D0420(void); static bool8 sub_80D04A0(void); static bool8 sub_80D04C8(void); -static void sub_80D07B0(u8 arg0, u8 arg1); -static void sub_80D0834(u8 arg0, u8 arg1); +static void sub_80D07B0(u8, u8); +static void sub_80D0834(u8, u8); static void sub_80D0B5C(void); static void sub_80D062C(void); -static void sub_80D0884(u16 arg0, u16 arg1, u16 arg2); +static void sub_80D0884(u16, u16, u16); static void sub_80D08CC(void); static void sub_80D09A4(void); static void sub_80D0A1C(void); static void sub_80D0AAC(void); static u8 sub_80D0894(void); -static void sub_80D0778(u8 arg0, u8 arg1, u8 arg2); -static void sub_80D0708(u8 arg0, u8 arg1, u8 arg2); -static void sub_80D06D0(u8 arg0, u8 arg1, u8 arg2); -static void sub_80D0740(u8 arg0, u8 arg1, u8 arg2); -static void sub_80D27AC(u8 id, u16 arg1, u16 arg2, u16 arg3, u16 arg4); -static void sub_80D27F4(u8 id, u8 arg1, s8 arg2); -static void sub_80D2644(u8 id, u8 bg, const void *arg2, u16 arg3, u16 arg4); -static void sub_80D2770(u8 id, u16 arg1, u16 arg2); -static void sub_80D259C(u8 count); +static void sub_80D0778(u8, u8, u8); +static void sub_80D0708(u8, u8, u8); +static void sub_80D06D0(u8, u8, u8); +static void sub_80D0740(u8, u8, u8); +static void sub_80D27AC(u8, u16, u16, u16, u16); +static void sub_80D27F4(u8, u8, s8); +static void sub_80D2644(u8, u8, const void *, u16, u16); +static void sub_80D2770(u8, u16, u16); +static void sub_80D259C(u8); static void sub_80D25F0(void); -static void sub_80D2918(u8 id); -static void sub_80D2960(u8 id); -static void sub_80D29F8(u8 id); -static void sub_80D2A90(struct UnkStruct_2000020 *arg0, struct UnkStruct_2000028 *arg1, u32 arg2); +static void sub_80D2918(u8); +static void sub_80D2960(u8); +static void sub_80D29F8(u8); +static void sub_80D2A90(struct UnkStruct_2000020 *, struct UnkStruct_2000028 *, u32); static void sub_80D2AA4(void); -static void sub_80D2B88(struct UnkStruct_2000028 *unkStruct); -static void sub_80D2C1C(struct UnkStruct_2000028 *unkStruct); +static void sub_80D2B88(struct UnkStruct_2000028 *); +static void sub_80D2C1C(struct UnkStruct_2000028 *); static u8 GetBoxWallpaper(u8); static void SetBoxWallpaper(u8, u8); -// static const rom data -static const struct PSS_MenuStringPtrs gUnknown_085716C0[] = +struct { + const u8 *text; + const u8 *desc; +} static const sMainMenuTexts[OPTIONS_COUNT] = { - {gText_WithdrawPokemon, gText_WithdrawMonDescription}, - {gText_DepositPokemon, gText_DepositMonDescription}, - {gText_MovePokemon, gText_MoveMonDescription}, - {gText_MoveItems, gText_MoveItemsDescription}, - {gText_SeeYa, gText_SeeYaDescription} + [OPTION_WITHDRAW] = {gText_WithdrawPokemon, gText_WithdrawMonDescription}, + [OPTION_DEPOSIT] = {gText_DepositPokemon, gText_DepositMonDescription}, + [OPTION_MOVE_MONS] = {gText_MovePokemon, gText_MoveMonDescription}, + [OPTION_MOVE_ITEMS] = {gText_MoveItems, gText_MoveItemsDescription}, + [OPTION_EXIT] = {gText_SeeYa, gText_SeeYaDescription} }; -static const struct WindowTemplate gUnknown_085716E8 = +static const struct WindowTemplate sWindowTemplate_MainMenu = { .bg = 0, .tilemapLeft = 1, @@ -756,55 +768,56 @@ static const struct WindowTemplate gUnknown_085716E8 = .baseBlock = 0x1, }; -static const union AnimCmd sSpriteAnim_85716F0[] = +static const union AnimCmd sAnim_ChooseBoxMenu_TopLeft[] = { ANIMCMD_FRAME(0, 5), ANIMCMD_END }; -static const union AnimCmd sSpriteAnim_85716F8[] = +static const union AnimCmd sAnim_ChooseBoxMenu_BottomLeft[] = { ANIMCMD_FRAME(4, 5), ANIMCMD_END }; -static const union AnimCmd sSpriteAnim_8571700[] = +static const union AnimCmd sAnim_ChooseBoxMenu_TopRight[] = { ANIMCMD_FRAME(6, 5), ANIMCMD_END }; -static const union AnimCmd sSpriteAnim_8571708[] = +static const union AnimCmd sAnim_ChooseBoxMenu_BottomRight[] = { ANIMCMD_FRAME(10, 5), ANIMCMD_END }; -static const union AnimCmd *const sSpriteAnimTable_8571710[] = +static const union AnimCmd *const sAnims_ChooseBoxMenu[] = { - sSpriteAnim_85716F0, - sSpriteAnim_85716F8, - sSpriteAnim_8571700, - sSpriteAnim_8571708 + sAnim_ChooseBoxMenu_TopLeft, + sAnim_ChooseBoxMenu_BottomLeft, + sAnim_ChooseBoxMenu_TopRight, + sAnim_ChooseBoxMenu_BottomRight }; -static const union AffineAnimCmd sSpriteAffineAnim_8571720[] = +static const union AffineAnimCmd sAffineAnim_ChooseBoxMenu[] = { AFFINEANIMCMD_FRAME(0xE0, 0xE0, 0, 0), AFFINEANIMCMD_END }; -static const union AffineAnimCmd *const sSpriteAffineAnimTable_8571730[] = +// Unused +static const union AffineAnimCmd *const sAffineAnims_ChooseBoxMenu[] = { - sSpriteAffineAnim_8571720 + sAffineAnim_ChooseBoxMenu }; -static const u8 sBoxInfoTextColors[] = {TEXT_COLOR_RED, TEXT_DYNAMIC_COLOR_6, TEXT_DYNAMIC_COLOR_5}; +static const u8 sChooseBoxMenu_TextColors[] = {TEXT_COLOR_RED, TEXT_DYNAMIC_COLOR_6, TEXT_DYNAMIC_COLOR_5}; static const u8 sText_OutOf30[] = _("/30"); -static const u16 gBoxSelectionPopupPalette[] = INCBIN_U16("graphics/unknown/unknown_57173C.gbapal"); -static const u8 gBoxSelectionPopupCenterTiles[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_center.4bpp"); -static const u8 gBoxSelectionPopupSidesTiles[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_sides.4bpp"); +static const u16 sChooseBoxMenu_Pal[] = INCBIN_U16("graphics/pokemon_storage/box_selection_popup.gbapal"); +static const u8 sChooseBoxMenuCenter_Gfx[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_center.4bpp"); +static const u8 sChooseBoxMenuSides_Gfx[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_sides.4bpp"); static const u32 gPokemonStorageScrollingBGTileset[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.4bpp.lz"); static const u32 gPokemonStorageScrollingBGTilemap[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.bin.lz"); static const u32 gUnknown_08572280[] = INCBIN_U32("graphics/unknown/unknown_572280.gbapal"); @@ -1381,109 +1394,126 @@ static void sub_80C71A4(u16 *dest, u16 dest_left, u16 dest_top, u16 width, u16 h Dma3FillLarge16_(0, dest, width); } -static void Task_PokemonStorageSystemPC(u8 taskId) +enum { + STATE_LOAD, + STATE_FADE_IN, + STATE_HANDLE_INPUT, + STATE_ERROR_MSG, + STATE_ENTER_PC, +}; + +#define tState data[0] +#define tSelectedOption data[1] +#define tInput data[2] +#define tNextOption data[3] +#define tWindowId data[15] + +static void Task_PCMainMenu(u8 taskId) { struct Task *task = &gTasks[taskId]; - switch (task->data[0]) + switch (task->tState) { - case 0: - CreatePCMenu(task->data[1], &task->data[15]); + case STATE_LOAD: + CreateMainMenu(task->tSelectedOption, &task->tWindowId); LoadMessageBoxAndBorderGfx(); DrawDialogueFrame(0, 0); FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, TEXT_SPEED_FF, NULL, 2, 1, 3); + AddTextPrinterParameterized2(0, 1, sMainMenuTexts[task->tSelectedOption].desc, TEXT_SPEED_FF, NULL, 2, 1, 3); CopyWindowToVram(0, 3); - CopyWindowToVram(task->data[15], 3); - task->data[0]++; + CopyWindowToVram(task->tWindowId, 3); + task->tState++; break; - case 1: + case STATE_FADE_IN: if (IsWeatherNotFadingIn()) - { - task->data[0]++; - } + task->tState++; break; - case 2: - task->data[2] = Menu_ProcessInput(); - switch(task->data[2]) + case STATE_HANDLE_INPUT: + task->tInput = Menu_ProcessInput(); + switch(task->tInput) { case MENU_NOTHING_CHOSEN: - task->data[3] = task->data[1]; - if (JOY_NEW(DPAD_UP) && --task->data[3] < 0) - task->data[3] = 4; + task->tNextOption = task->tSelectedOption; + if (JOY_NEW(DPAD_UP) && --task->tNextOption < 0) + task->tNextOption = OPTIONS_COUNT - 1; + if (JOY_NEW(DPAD_DOWN) && ++task->tNextOption > OPTIONS_COUNT - 1) + task->tNextOption = 0; - if (JOY_NEW(DPAD_DOWN) && ++task->data[3] > 4) - task->data[3] = 0; - if (task->data[1] != task->data[3]) + if (task->tSelectedOption != task->tNextOption) { - task->data[1] = task->data[3]; + task->tSelectedOption = task->tNextOption; FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); + AddTextPrinterParameterized2(0, 1, sMainMenuTexts[task->tSelectedOption].desc, 0, NULL, 2, 1, 3); } break; case MENU_B_PRESSED: - case 4: - ClearStdWindowAndFrame(task->data[15], TRUE); + case OPTION_EXIT: + ClearStdWindowAndFrame(task->tWindowId, TRUE); ScriptContext2_Disable(); EnableBothScriptContexts(); - RemoveWindow(task->data[15]); + RemoveWindow(task->tWindowId); DestroyTask(taskId); break; default: - if (task->data[2] == 0 && CountPartyMons() == PARTY_SIZE) + if (task->tInput == OPTION_WITHDRAW && CountPartyMons() == PARTY_SIZE) { + // Can't withdraw FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gText_PartyFull, 0, NULL, 2, 1, 3); - task->data[0] = 3; + task->tState = STATE_ERROR_MSG; } - else if (task->data[2] == 1 && CountPartyMons() == 1) + else if (task->tInput == OPTION_DEPOSIT && CountPartyMons() == 1) { + // Can't deposit FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gText_JustOnePkmn, 0, NULL, 2, 1, 3); - task->data[0] = 3; + task->tState = STATE_ERROR_MSG; } else { + // Enter PC FadeScreen(FADE_TO_BLACK, 0); - task->data[0] = 4; + task->tState = STATE_ENTER_PC; } break; } break; - case 3: + case STATE_ERROR_MSG: + // Printed "can't do PC option message" + // Wait for new input after message if (JOY_NEW(A_BUTTON | B_BUTTON)) { FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); - task->data[0] = 2; + AddTextPrinterParameterized2(0, 1, sMainMenuTexts[task->tSelectedOption].desc, 0, NULL, 2, 1, 3); + task->tState = STATE_HANDLE_INPUT; } else if (JOY_NEW(DPAD_UP)) { - if (--task->data[1] < 0) - task->data[1] = 4; + if (--task->tSelectedOption < 0) + task->tSelectedOption = OPTIONS_COUNT - 1; Menu_MoveCursor(-1); - task->data[1] = Menu_GetCursorPos(); + task->tSelectedOption = Menu_GetCursorPos(); FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); - task->data[0] = 2; + AddTextPrinterParameterized2(0, 1, sMainMenuTexts[task->tSelectedOption].desc, 0, NULL, 2, 1, 3); + task->tState = STATE_HANDLE_INPUT; } else if (JOY_NEW(DPAD_DOWN)) { - if (++task->data[1] > 3) - task->data[1] = 0; + if (++task->tSelectedOption >= OPTIONS_COUNT - 1) + task->tSelectedOption = 0; Menu_MoveCursor(1); - task->data[1] = Menu_GetCursorPos(); + task->tSelectedOption = Menu_GetCursorPos(); FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); - task->data[0] = 2; + AddTextPrinterParameterized2(0, 1, sMainMenuTexts[task->tSelectedOption].desc, 0, NULL, 2, 1, 3); + task->tState = STATE_HANDLE_INPUT; } break; - case 4: + case STATE_ENTER_PC: if (!gPaletteFade.active) { CleanupOverworldWindowsAndTilemaps(); - Cb2_EnterPSS(task->data[2]); - RemoveWindow(task->data[15]); + Cb2_EnterPSS(task->tInput); + RemoveWindow(task->tWindowId); DestroyTask(taskId); } break; @@ -1492,9 +1522,9 @@ static void Task_PokemonStorageSystemPC(u8 taskId) void ShowPokemonStorageSystemPC(void) { - u8 taskId = CreateTask(Task_PokemonStorageSystemPC, 80); - gTasks[taskId].data[0] = 0; - gTasks[taskId].data[1] = 0; + u8 taskId = CreateTask(Task_PCMainMenu, 80); + gTasks[taskId].tState = 0; + gTasks[taskId].tSelectedOption = 0; ScriptContext2_Enable(); } @@ -1504,24 +1534,30 @@ static void FieldCb_ReturnToPcMenu(void) MainCallback vblankCb = gMain.vblankCallback; SetVBlankCallback(NULL); - taskId = CreateTask(Task_PokemonStorageSystemPC, 80); - gTasks[taskId].data[0] = 0; - gTasks[taskId].data[1] = sPreviousBoxOption; - Task_PokemonStorageSystemPC(taskId); + taskId = CreateTask(Task_PCMainMenu, 80); + gTasks[taskId].tState = 0; + gTasks[taskId].tSelectedOption = sPreviousBoxOption; + Task_PCMainMenu(taskId); SetVBlankCallback(vblankCb); FadeInFromBlack(); } -static void CreatePCMenu(u8 whichMenu, s16 *windowIdPtr) +#undef tState +#undef tSelectedOption +#undef tInput +#undef tNextOption +#undef tWindowId + +static void CreateMainMenu(u8 whichMenu, s16 *windowIdPtr) { s16 windowId; - struct WindowTemplate winTemplate = gUnknown_085716E8; - winTemplate.width = GetMaxWidthInMenuTable((void *)gUnknown_085716C0, ARRAY_COUNT(gUnknown_085716C0)); - windowId = AddWindow(&winTemplate); + struct WindowTemplate template = sWindowTemplate_MainMenu; + template.width = GetMaxWidthInMenuTable((void *)sMainMenuTexts, OPTIONS_COUNT); + windowId = AddWindow(&template); DrawStdWindowFrame(windowId, FALSE); - PrintMenuTable(windowId, ARRAY_COUNT(gUnknown_085716C0), (void *)gUnknown_085716C0); - InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, ARRAY_COUNT(gUnknown_085716C0), whichMenu); + PrintMenuTable(windowId, OPTIONS_COUNT, (void *)sMainMenuTexts); + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, OPTIONS_COUNT, whichMenu); *windowIdPtr = windowId; } @@ -1532,6 +1568,7 @@ static void Cb2_ExitPSS(void) SetMainCallback2(CB2_ReturnToField); } +// Unused static s16 StorageSystemGetNextMonIndex(struct BoxPokemon *box, s8 startIdx, u8 stopIdx, u8 mode) { s16 i; @@ -1585,74 +1622,75 @@ void ResetPokemonStorageSystem(void) ResetWaldaWallpaper(); } -static void sub_80C77E8(struct UnkPSSStruct_2002370 *a0, u16 tileTag, u16 palTag, u8 a3, bool32 loadPal) +static void LoadChooseBoxMenuGfx(struct ChooseBoxMenu *menu, u16 tileTag, u16 palTag, u8 subpriority, bool32 loadPal) { struct SpritePalette palette = { - gBoxSelectionPopupPalette, palTag + sChooseBoxMenu_Pal, palTag }; struct SpriteSheet sheets[] = { - {gBoxSelectionPopupCenterTiles, 0x800, tileTag}, - {gBoxSelectionPopupSidesTiles, 0x180, tileTag + 1}, + {sChooseBoxMenuCenter_Gfx, 0x800, tileTag}, + {sChooseBoxMenuSides_Gfx, 0x180, tileTag + 1}, {} }; - if (loadPal) + if (loadPal) // Always false LoadSpritePalette(&palette); LoadSpriteSheets(sheets); - gUnknown_02039D04 = a0; - a0->unk_0240 = tileTag; - a0->unk_0242 = palTag; - a0->unk_0246 = a3; - a0->unk_023c = loadPal; + sChooseBoxMenu = menu; + menu->tileTag = tileTag; + menu->paletteTag = palTag; + menu->subpriority = subpriority; + menu->loadedPalette = loadPal; } -static void sub_80C7890(void) +static void FreeChooseBoxMenu(void) { - if (gUnknown_02039D04->unk_023c) - FreeSpritePaletteByTag(gUnknown_02039D04->unk_0242); - FreeSpriteTilesByTag(gUnknown_02039D04->unk_0240); - FreeSpriteTilesByTag(gUnknown_02039D04->unk_0240 + 1); + if (sChooseBoxMenu->loadedPalette) + FreeSpritePaletteByTag(sChooseBoxMenu->paletteTag); + FreeSpriteTilesByTag(sChooseBoxMenu->tileTag); + FreeSpriteTilesByTag(sChooseBoxMenu->tileTag + 1); } -static void sub_80C78D4(u8 curBox) +static void CreateChooseBoxMenuSprites(u8 curBox) { - sub_80C7958(curBox); + ChooseBoxMenu_CreateSprites(curBox); } -static void sub_80C78E4(void) +static void DestroyChooseBoxMenuSprites(void) { - sub_80C7B14(); + ChooseBoxMenu_DestroySprites(); } -static u8 HandleBoxChooseSelectionInput(void) +// For the popout window when choosing a box to deposit in or jump to +static u8 HandleChooseBoxMenuInput(void) { if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); - return 201; + return BOXID_CANCELED; } if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); - return gUnknown_02039D04->curBox; + return sChooseBoxMenu->curBox; } if (JOY_NEW(DPAD_LEFT)) { PlaySE(SE_SELECT); - sub_80C7BB4(); + ChooseBoxMenu_MoveLeft(); } else if (JOY_NEW(DPAD_RIGHT)) { PlaySE(SE_SELECT); - sub_80C7B80(); + ChooseBoxMenu_MoveRight(); } - return 200; + return BOXID_NONE_CHOSEN; } -static void sub_80C7958(u8 curBox) +static void ChooseBoxMenu_CreateSprites(u8 curBox) { u16 i; u8 spriteId; @@ -1664,116 +1702,118 @@ static void sub_80C7958(u8 curBox) 0, 0, &oamData, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy }; - gUnknown_02039D04->curBox = curBox; - template.tileTag = gUnknown_02039D04->unk_0240; - template.paletteTag = gUnknown_02039D04->unk_0242; + sChooseBoxMenu->curBox = curBox; + template.tileTag = sChooseBoxMenu->tileTag; + template.paletteTag = sChooseBoxMenu->paletteTag; spriteId = CreateSprite(&template, 160, 96, 0); - gUnknown_02039D04->unk_0000 = gSprites + spriteId; + sChooseBoxMenu->menuSprite = &gSprites[spriteId]; oamData.shape = SPRITE_SHAPE(8x32); oamData.size = SPRITE_SIZE(8x32); - template.tileTag = gUnknown_02039D04->unk_0240 + 1; - template.anims = sSpriteAnimTable_8571710; - for (i = 0; i < 4; i++) + template.tileTag = sChooseBoxMenu->tileTag + 1; + template.anims = sAnims_ChooseBoxMenu; + for (i = 0; i < ARRAY_COUNT(sChooseBoxMenu->menuSideSprites); i++) { - u16 r5; - spriteId = CreateSprite(&template, 124, 80, gUnknown_02039D04->unk_0246); - gUnknown_02039D04->unk_0004[i] = gSprites + spriteId; - r5 = 0; + u16 anim; + spriteId = CreateSprite(&template, 124, 80, sChooseBoxMenu->subpriority); + sChooseBoxMenu->menuSideSprites[i] = &gSprites[spriteId]; + anim = 0; if (i & 2) { - gUnknown_02039D04->unk_0004[i]->pos1.x = 196; - r5 = 2; + sChooseBoxMenu->menuSideSprites[i]->pos1.x = 196; + anim = 2; } if (i & 1) { - gUnknown_02039D04->unk_0004[i]->pos1.y = 112; - gUnknown_02039D04->unk_0004[i]->oam.size = 0; - r5++; + sChooseBoxMenu->menuSideSprites[i]->pos1.y = 112; + sChooseBoxMenu->menuSideSprites[i]->oam.size = 0; + anim++; } - StartSpriteAnim(gUnknown_02039D04->unk_0004[i], r5); + StartSpriteAnim(sChooseBoxMenu->menuSideSprites[i], anim); } - for (i = 0; i < 2; i++) + for (i = 0; i < ARRAY_COUNT(sChooseBoxMenu->arrowSprites); i++) { - gUnknown_02039D04->arrowSprites[i] = CreateJumpBoxArrows(72 * i + 124, 88, i, 0, gUnknown_02039D04->unk_0246); - if (gUnknown_02039D04->arrowSprites[i]) + sChooseBoxMenu->arrowSprites[i] = CreateChooseBoxArrows(72 * i + 124, 88, i, 0, sChooseBoxMenu->subpriority); + if (sChooseBoxMenu->arrowSprites[i]) { - gUnknown_02039D04->arrowSprites[i]->data[0] = (i == 0 ? -1 : 1); - gUnknown_02039D04->arrowSprites[i]->callback = SpriteCB_JumpBoxArrow; + sChooseBoxMenu->arrowSprites[i]->data[0] = (i == 0 ? -1 : 1); + sChooseBoxMenu->arrowSprites[i]->callback = SpriteCB_ChooseBoxArrow; } } - sub_80C7BE4(); + ChooseBoxMenu_PrintInfo(); } -static void sub_80C7B14(void) +static void ChooseBoxMenu_DestroySprites(void) { u16 i; - if (gUnknown_02039D04->unk_0000) + if (sChooseBoxMenu->menuSprite) { - DestroySprite(gUnknown_02039D04->unk_0000); - gUnknown_02039D04->unk_0000 = NULL; + DestroySprite(sChooseBoxMenu->menuSprite); + sChooseBoxMenu->menuSprite = NULL; } - for (i = 0; i < 4; i++) + for (i = 0; i < ARRAY_COUNT(sChooseBoxMenu->menuSideSprites); i++) { - if (gUnknown_02039D04->unk_0004[i]) + if (sChooseBoxMenu->menuSideSprites[i]) { - DestroySprite(gUnknown_02039D04->unk_0004[i]); - gUnknown_02039D04->unk_0004[i] = NULL; + DestroySprite(sChooseBoxMenu->menuSideSprites[i]); + sChooseBoxMenu->menuSideSprites[i] = NULL; } } - for (i = 0; i < 2; i++) + for (i = 0; i < ARRAY_COUNT(sChooseBoxMenu->arrowSprites); i++) { - if (gUnknown_02039D04->arrowSprites[i]) - DestroySprite(gUnknown_02039D04->arrowSprites[i]); + if (sChooseBoxMenu->arrowSprites[i]) + DestroySprite(sChooseBoxMenu->arrowSprites[i]); } } -static void sub_80C7B80(void) +static void ChooseBoxMenu_MoveRight(void) { - if (++gUnknown_02039D04->curBox >= TOTAL_BOXES_COUNT) - gUnknown_02039D04->curBox = 0; - sub_80C7BE4(); + if (++sChooseBoxMenu->curBox >= TOTAL_BOXES_COUNT) + sChooseBoxMenu->curBox = 0; + ChooseBoxMenu_PrintInfo(); } -static void sub_80C7BB4(void) +static void ChooseBoxMenu_MoveLeft(void) { - gUnknown_02039D04->curBox = (gUnknown_02039D04->curBox == 0 ? TOTAL_BOXES_COUNT - 1 : gUnknown_02039D04->curBox - 1); - sub_80C7BE4(); + sChooseBoxMenu->curBox = (sChooseBoxMenu->curBox == 0 ? TOTAL_BOXES_COUNT - 1 : sChooseBoxMenu->curBox - 1); + ChooseBoxMenu_PrintInfo(); } -static void sub_80C7BE4(void) +static void ChooseBoxMenu_PrintInfo(void) { u8 numBoxMonsText[16]; - struct WindowTemplate winTemplate; + struct WindowTemplate template; u8 windowId; - u8 *boxName = GetBoxNamePtr(gUnknown_02039D04->curBox); - u8 nPokemonInBox = CountMonsInBox(gUnknown_02039D04->curBox); + u8 *boxName = GetBoxNamePtr(sChooseBoxMenu->curBox); + u8 numInBox = CountMonsInBox(sChooseBoxMenu->curBox); u32 winTileData; s32 center; - memset(&winTemplate, 0, sizeof(winTemplate)); - winTemplate.width = 8; - winTemplate.height = 4; + memset(&template, 0, sizeof(template)); + template.width = 8; + template.height = 4; - windowId = AddWindow(&winTemplate); + windowId = AddWindow(&template); FillWindowPixelBuffer(windowId, PIXEL_FILL(4)); + // Print box name center = GetStringCenterAlignXOffset(1, boxName, 64); - AddTextPrinterParameterized3(windowId, 1, center, 1, sBoxInfoTextColors, TEXT_SPEED_FF, boxName); + AddTextPrinterParameterized3(windowId, 1, center, 1, sChooseBoxMenu_TextColors, TEXT_SPEED_FF, boxName); - ConvertIntToDecimalStringN(numBoxMonsText, nPokemonInBox, STR_CONV_MODE_RIGHT_ALIGN, 2); + // Print #/30 for number of Pokémon in the box + ConvertIntToDecimalStringN(numBoxMonsText, numInBox, STR_CONV_MODE_RIGHT_ALIGN, 2); StringAppend(numBoxMonsText, sText_OutOf30); center = GetStringCenterAlignXOffset(1, numBoxMonsText, 64); - AddTextPrinterParameterized3(windowId, 1, center, 17, sBoxInfoTextColors, TEXT_SPEED_FF, numBoxMonsText); + AddTextPrinterParameterized3(windowId, 1, center, 17, sChooseBoxMenu_TextColors, TEXT_SPEED_FF, numBoxMonsText); winTileData = GetWindowAttribute(windowId, WINDOW_TILE_DATA); - CpuCopy32((void *)winTileData, (void *)OBJ_VRAM0 + 0x100 + (GetSpriteTileStartByTag(gUnknown_02039D04->unk_0240) * 32), 0x400); + CpuCopy32((void *)winTileData, (void *)OBJ_VRAM0 + 0x100 + (GetSpriteTileStartByTag(sChooseBoxMenu->tileTag) * 32), 0x400); RemoveWindow(windowId); } -static void SpriteCB_JumpBoxArrow(struct Sprite *sprite) +static void SpriteCB_ChooseBoxArrow(struct Sprite *sprite) { if (++sprite->data[1] > 3) { @@ -1877,13 +1917,13 @@ static void sub_80C7E98(void) static void sub_80C7F1C(void) { sub_80CDC0C(); - sInPartyMenu = (sPSSData->boxOption == BOX_OPTION_DEPOSIT); - gUnknown_02039D0E = 0; + sInPartyMenu = (sPSSData->boxOption == OPTION_DEPOSIT); + sDepositBoxId = 0; } static void SetMonIconTransparency(void) { - if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(7, 11)); @@ -1973,7 +2013,7 @@ static void Cb_InitPSS(u8 taskId) if (IsInitBoxActive()) return; - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { sPSSData->markMenu.baseTileTag = TAG_TILE_D; sPSSData->markMenu.basePaletteTag = TAG_PAL_DACE; @@ -1990,12 +2030,12 @@ static void Cb_InitPSS(u8 taskId) SetMonIconTransparency(); if (!sPSSData->isReshowingPSS) { - BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); SetPSSCallback(Cb_ShowPSS); } else { - BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); SetPSSCallback(Cb_ReshowPSS); } SetVBlankCallback(VblankCb_PSS); @@ -2066,12 +2106,12 @@ static void Cb_MainPSS(u8 taskId) case 0: switch (HandleInput()) { - case 1: + case INPUT_1: PlaySE(SE_SELECT); sPSSData->state = 1; break; - case 5: - if (sPSSData->boxOption != BOX_OPTION_MOVE_MONS && sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + case INPUT_5: + if (sPSSData->boxOption != OPTION_MOVE_MONS && sPSSData->boxOption != OPTION_MOVE_ITEMS) { PrintMessage(MSG_WHICH_ONE_WILL_TAKE); sPSSData->state = 3; @@ -2082,38 +2122,38 @@ static void Cb_MainPSS(u8 taskId) SetPSSCallback(Cb_ShowPartyPokemon); } break; - case 6: - if (sPSSData->boxOption == BOX_OPTION_MOVE_MONS) + case INPUT_6: + if (sPSSData->boxOption == OPTION_MOVE_MONS) { if (IsMonBeingMoved() && ItemIsMail(sPSSData->cursorMonItem)) sPSSData->state = 5; else SetPSSCallback(Cb_HidePartyPokemon); } - else if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + else if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { SetPSSCallback(Cb_HidePartyPokemon); } break; - case 4: + case INPUT_4: SetPSSCallback(Cb_OnCloseBoxPressed); break; - case 19: + case INPUT_19: SetPSSCallback(Cb_OnBPressed); break; - case 7: + case INPUT_7: PlaySE(SE_SELECT); SetPSSCallback(Cb_HandleBoxOptions); break; - case 8: + case INPUT_8: SetPSSCallback(Cb_OnSelectedMon); break; - case 9: + case INPUT_9: PlaySE(SE_SELECT); sPSSData->newCurrBoxId = StorageGetCurrentBox() + 1; if (sPSSData->newCurrBoxId >= TOTAL_BOXES_COUNT) sPSSData->newCurrBoxId = 0; - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { SetUpScrollToBox(sPSSData->newCurrBoxId); sPSSData->state = 2; @@ -2124,12 +2164,12 @@ static void Cb_MainPSS(u8 taskId) sPSSData->state = 10; } break; - case 10: + case INPUT_10: PlaySE(SE_SELECT); sPSSData->newCurrBoxId = StorageGetCurrentBox() - 1; if (sPSSData->newCurrBoxId < 0) sPSSData->newCurrBoxId = TOTAL_BOXES_COUNT - 1; - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { SetUpScrollToBox(sPSSData->newCurrBoxId); sPSSData->state = 2; @@ -2140,7 +2180,7 @@ static void Cb_MainPSS(u8 taskId) sPSSData->state = 10; } break; - case 11: + case INPUT_11: if (!CanMovePartyMon()) { if (ItemIsMail(sPSSData->cursorMonItem)) @@ -2158,7 +2198,7 @@ static void Cb_MainPSS(u8 taskId) sPSSData->state = 4; } break; - case 13: + case INPUT_13: if (CanMovePartyMon()) { sPSSData->state = 4; @@ -2169,7 +2209,7 @@ static void Cb_MainPSS(u8 taskId) SetPSSCallback(Cb_MoveMon); } break; - case 14: + case INPUT_14: if (!CanShiftMon()) { sPSSData->state = 4; @@ -2180,55 +2220,55 @@ static void Cb_MainPSS(u8 taskId) SetPSSCallback(Cb_ShiftMon); } break; - case 12: + case INPUT_12: PlaySE(SE_SELECT); SetPSSCallback(Cb_WithdrawMon); break; - case 15: + case INPUT_15: PlaySE(SE_SELECT); SetPSSCallback(Cb_PlaceMon); break; - case 16: + case INPUT_16: PlaySE(SE_SELECT); SetPSSCallback(Cb_TakeItemForMoving); break; - case 17: + case INPUT_17: PlaySE(SE_SELECT); SetPSSCallback(Cb_GiveMovingItemToMon); break; - case 18: + case INPUT_18: PlaySE(SE_SELECT); SetPSSCallback(Cb_SwitchSelectedItem); break; - case 20: + case INPUT_20: PlaySE(SE_SELECT); sub_80D01D0(0); sPSSData->state = 7; break; - case 22: + case INPUT_22: sub_80D01D0(1); sPSSData->state = 8; break; - case 21: + case INPUT_21: PlaySE(SE_SELECT); sub_80D01D0(2); sPSSData->state = 9; break; - case 23: + case INPUT_23: sub_80D01D0(3); sPSSData->state = 7; break; - case 25: + case INPUT_25: PlaySE(SE_SELECT); sub_80D01D0(4); sPSSData->state = 9; break; - case 26: + case INPUT_26: PlaySE(SE_SELECT); sub_80D01D0(5); sPSSData->state = 7; break; - case 24: + case INPUT_24: PlaySE(SE_FAILURE); break; } @@ -2256,7 +2296,7 @@ static void Cb_MainPSS(u8 taskId) BoxSetMosaic(); } - if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { sub_80CFECC(); sPSSData->state = 11; @@ -2371,7 +2411,7 @@ static void Cb_OnSelectedMon(u8 taskId) if (!sub_80CA2B8()) { PlaySE(SE_SELECT); - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) PrintMessage(MSG_IS_SELECTED); else if (IsActiveItemMoving() || sPSSData->cursorMonItem != 0) PrintMessage(MSG_IS_SELECTED2); @@ -2638,31 +2678,29 @@ static void Cb_DepositMenu(u8 taskId) { case 0: PrintMessage(MSG_DEPOSIT_IN_WHICH_BOX); - sub_80C77E8(&sPSSData->field_1E5C, TAG_TILE_A, TAG_PAL_DAC7, 3, FALSE); - sub_80C78D4(gUnknown_02039D0E); + LoadChooseBoxMenuGfx(&sPSSData->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, TAG_PAL_DAC7, 3, FALSE); + CreateChooseBoxMenuSprites(sDepositBoxId); sPSSData->state++; break; case 1: - boxId = HandleBoxChooseSelectionInput(); - if (boxId == 200) - { - // no box chosen yet - } - else if (boxId == 201) + boxId = HandleChooseBoxMenuInput(); + switch (boxId) { + case BOXID_NONE_CHOSEN: + break; + case BOXID_CANCELED: ClearBottomWindow(); - sub_80C78E4(); - sub_80C7890(); + DestroyChooseBoxMenuSprites(); + FreeChooseBoxMenu(); SetPSSCallback(Cb_MainPSS); - } - else - { + break; + default: if (TryStorePartyMonInBox(boxId)) { - gUnknown_02039D0E = boxId; + sDepositBoxId = boxId; ClearBottomWindow(); - sub_80C78E4(); - sub_80C7890(); + DestroyChooseBoxMenuSprites(); + FreeChooseBoxMenu(); sPSSData->state = 2; } else @@ -2670,6 +2708,7 @@ static void Cb_DepositMenu(u8 taskId) PrintMessage(MSG_BOX_IS_FULL); sPSSData->state = 4; } + break; } break; case 2: @@ -3292,21 +3331,21 @@ static void Cb_JumpBox(u8 taskId) { case 0: PrintMessage(MSG_JUMP_TO_WHICH_BOX); - sub_80C77E8(&sPSSData->field_1E5C, TAG_TILE_A, TAG_PAL_DAC7, 3, FALSE); - sub_80C78D4(StorageGetCurrentBox()); + LoadChooseBoxMenuGfx(&sPSSData->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, TAG_PAL_DAC7, 3, FALSE); + CreateChooseBoxMenuSprites(StorageGetCurrentBox()); sPSSData->state++; break; case 1: - sPSSData->newCurrBoxId = HandleBoxChooseSelectionInput(); + sPSSData->newCurrBoxId = HandleChooseBoxMenuInput(); switch (sPSSData->newCurrBoxId) { - case 200: + case BOXID_NONE_CHOSEN: break; default: ClearBottomWindow(); - sub_80C78E4(); - sub_80C7890(); - if (sPSSData->newCurrBoxId == 201 || sPSSData->newCurrBoxId == StorageGetCurrentBox()) + DestroyChooseBoxMenuSprites(); + FreeChooseBoxMenu(); + if (sPSSData->newCurrBoxId == BOXID_CANCELED || sPSSData->newCurrBoxId == StorageGetCurrentBox()) { AnimateBoxScrollArrows(TRUE); SetPSSCallback(Cb_MainPSS); @@ -3519,7 +3558,7 @@ static void Cb_ChangeScreen(u8 taskId) u8 mode, monIndex, maxMonIndex; u8 screenChangeType = sPSSData->screenChangeType; - if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS && IsActiveItemMoving() == TRUE) + if (sPSSData->boxOption == OPTION_MOVE_ITEMS && IsActiveItemMoving() == TRUE) sMovingItemId = GetMovingItem(); else sMovingItemId = ITEM_NONE; @@ -3535,9 +3574,9 @@ static void Cb_ChangeScreen(u8 taskId) boxMons = sPSSData->field_218C.box; monIndex = sPSSData->field_2187; maxMonIndex = sPSSData->field_2186; - mode = sPSSData->pokemonSummaryScreenMode; + mode = sPSSData->summaryScreenMode; FreePSSData(); - if (mode == PSS_MODE_NORMAL && boxMons == &gUnknown_02039D14.box) + if (mode == SUMMARY_MODE_NORMAL && boxMons == &gUnknown_02039D14.box) ShowPokemonSummaryScreenSet40EF(mode, boxMons, monIndex, maxMonIndex, Cb2_ReturnToPSS); else ShowPokemonSummaryScreen(mode, boxMons, monIndex, maxMonIndex, Cb2_ReturnToPSS); @@ -3626,7 +3665,7 @@ static void sub_80CA0D8(void) LoadPalette(gUnknown_085723DC, 0, 0x20); LoadPalette(gUnknown_085723FC, 0x20, 0x20); LoadPalette(gUnknown_085726F4, 0xF0, 0x20); - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) LoadPalette(gUnknown_0857241C, 0x30, 0x20); else LoadPalette(gUnknown_0857243C, 0x30, 0x20); @@ -3765,7 +3804,7 @@ static void LoadCursorMonGfx(u16 species, u32 pid) static void PrintCursorMonInfo(void) { FillWindowPixelBuffer(0, PIXEL_FILL(1)); - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { AddTextPrinterParameterized(0, 1, sPSSData->cursorMonNickText, 6, 0, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(0, 2, sPSSData->cursorMonSpeciesName, 6, 15, TEXT_SPEED_FF, NULL); @@ -3876,7 +3915,7 @@ static void SetUpHidePartyMenu(void) sPSSData->field_2C0 = 0; sPSSData->field_2C2 = 22; sPSSData->field_2C5 = 0; - if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption == OPTION_MOVE_ITEMS) sub_80D11CC(); } @@ -4224,7 +4263,7 @@ static void InitBoxMonSprites(u8 boxId) } // If in item mode, set all Pokémon icons with no item to be transparent - if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { for (boxPosition = 0; boxPosition < IN_BOX_COUNT; boxPosition++) { @@ -4245,7 +4284,7 @@ static void sub_80CB140(u8 boxPosition) u32 personality = GetCurrentBoxMonData(boxPosition, MON_DATA_PERSONALITY); sPSSData->boxMonsSprites[boxPosition] = CreateMonIconSprite(species, personality, x, y, 2, 19 - (boxPosition % IN_BOX_ROWS)); - if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption == OPTION_MOVE_ITEMS) sPSSData->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; } } @@ -4321,7 +4360,7 @@ static u8 sub_80CB2F8(u8 row, u16 times, s16 xDelta) u8 count = 0; u8 boxPosition = row; - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { for (i = 0; i < IN_BOX_COLUMNS; i++) { @@ -4501,7 +4540,7 @@ static void CreatePartyMonsSprites(bool8 arg0) } } - if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { for (i = 0; i < PARTY_SIZE; i++) { @@ -4945,7 +4984,7 @@ static void SetUpScrollToBox(u8 boxId) { s8 direction = DetermineBoxScrollDirection(boxId); - sPSSData->wallpaperScrollSpeed = (direction > 0) ? 6 : -6; + sPSSData->scrollSpeed = (direction > 0) ? 6 : -6; sPSSData->field_2D3 = (direction > 0) ? 1 : 2; sPSSData->field_2D0 = 32; sPSSData->scrollToBoxIdUnused = boxId; @@ -4982,7 +5021,7 @@ static bool8 ScrollToBox(void) var = sub_80CB584(); if (sPSSData->field_2D0 != 0) { - sPSSData->bg2_X += sPSSData->wallpaperScrollSpeed; + sPSSData->bg2_X += sPSSData->scrollSpeed; if (--sPSSData->field_2D0 != 0) return TRUE; CycleBoxTitleSprites(); @@ -5114,10 +5153,8 @@ static bool32 WaitForWallpaperGfxLoad(void) return FALSE; if (sPSSData->wallpaperTiles != NULL) - { - Free(sPSSData->wallpaperTiles); - sPSSData->wallpaperTiles = NULL; - } + FREE_AND_SET_NULL(sPSSData->wallpaperTiles); + return TRUE; } @@ -5431,7 +5468,7 @@ static void SpriteCB_Arrow(struct Sprite *sprite) sprite->sState = 3; break; case 3: - sprite->pos1.x -= sPSSData->wallpaperScrollSpeed; + sprite->pos1.x -= sPSSData->scrollSpeed; if (sprite->pos1.x <= 72 || sprite->pos1.x >= DISPLAY_WIDTH + 8) sprite->invisible = TRUE; if (--sprite->sTimer == 0) @@ -5442,7 +5479,7 @@ static void SpriteCB_Arrow(struct Sprite *sprite) } break; case 4: - sprite->pos1.x -= sPSSData->wallpaperScrollSpeed; + sprite->pos1.x -= sPSSData->scrollSpeed; break; } } @@ -5450,7 +5487,8 @@ static void SpriteCB_Arrow(struct Sprite *sprite) #undef sState #undef sSpeed -static struct Sprite *CreateJumpBoxArrows(u16 x, u16 y, u8 animId, u8 priority, u8 subpriority) +// Arrows for Deposit/Jump Box selection +static struct Sprite *CreateChooseBoxArrows(u16 x, u16 y, u8 animId, u8 priority, u8 subpriority) { u8 spriteId = CreateSprite(&sSpriteTemplate_Arrow, x, y, subpriority); if (spriteId == MAX_SPRITES) @@ -5465,7 +5503,7 @@ static struct Sprite *CreateJumpBoxArrows(u16 x, u16 y, u8 animId, u8 priority, static void sub_80CD36C(void) { - if (sPSSData->boxOption != BOX_OPTION_DEPOSIT) + if (sPSSData->boxOption != OPTION_DEPOSIT) sBoxCursorArea = CURSOR_AREA_IN_BOX; else sBoxCursorArea = CURSOR_AREA_IN_PARTY; @@ -5554,7 +5592,7 @@ static bool8 sub_80CD554(void) if (sPSSData->field_CD0 == 0) { - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return FALSE; else return sub_80D1218(); @@ -5659,7 +5697,7 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) { sub_80CD6AC(newCursorArea, newCursorPosition); sub_80CD70C(); - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { if (sPSSData->inBoxMovingMode == 0 && !sIsMonBeingMoved) StartSpriteAnim(sPSSData->field_CB4, 1); @@ -5670,7 +5708,7 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) StartSpriteAnim(sPSSData->field_CB4, 1); } - if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { if (sBoxCursorArea == CURSOR_AREA_IN_BOX) sub_80D0E50(CURSOR_AREA_IN_BOX, sBoxCursorPosition); @@ -5718,7 +5756,7 @@ static void sub_80CDA68(void) { sBoxCursorArea = sPSSData->field_CD4; sBoxCursorPosition = sPSSData->field_CD5; - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { if (sPSSData->inBoxMovingMode == 0 && !sIsMonBeingMoved) StartSpriteAnim(sPSSData->field_CB4, 0); @@ -6331,21 +6369,21 @@ static void sub_80CE7E8(void) sPSSData->field_218C.mon = &gUnknown_02039D14; sPSSData->field_2187 = 0; sPSSData->field_2186 = 0; - sPSSData->pokemonSummaryScreenMode = PSS_MODE_NORMAL; + sPSSData->summaryScreenMode = SUMMARY_MODE_NORMAL; } else if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) { sPSSData->field_218C.mon = gPlayerParty; sPSSData->field_2187 = sBoxCursorPosition; sPSSData->field_2186 = CountPartyMons() - 1; - sPSSData->pokemonSummaryScreenMode = PSS_MODE_NORMAL; + sPSSData->summaryScreenMode = SUMMARY_MODE_NORMAL; } else { sPSSData->field_218C.box = GetBoxedMonPtr(StorageGetCurrentBox(), 0); sPSSData->field_2187 = sBoxCursorPosition; sPSSData->field_2186 = IN_BOX_COUNT - 1; - sPSSData->pokemonSummaryScreenMode = PSS_MODE_BOX; + sPSSData->summaryScreenMode = SUMMARY_MODE_BOX; } } @@ -6641,7 +6679,7 @@ static u8 InBoxInput_Normal(void) if (JOY_REPEAT(DPAD_UP)) { - retVal = TRUE; + retVal = INPUT_1; if (sBoxCursorPosition >= IN_BOX_ROWS) { cursorPosition -= IN_BOX_ROWS; @@ -6655,7 +6693,7 @@ static u8 InBoxInput_Normal(void) } else if (JOY_REPEAT(DPAD_DOWN)) { - retVal = TRUE; + retVal = INPUT_1; cursorPosition += IN_BOX_ROWS; if (cursorPosition >= IN_BOX_COUNT) { @@ -6669,7 +6707,7 @@ static u8 InBoxInput_Normal(void) } else if (JOY_REPEAT(DPAD_LEFT)) { - retVal = TRUE; + retVal = INPUT_1; if (sBoxCursorPosition % IN_BOX_ROWS != 0) { cursorPosition--; @@ -6683,7 +6721,7 @@ static u8 InBoxInput_Normal(void) } else if (JOY_REPEAT(DPAD_RIGHT)) { - retVal = TRUE; + retVal = INPUT_1; if ((sBoxCursorPosition + 1) % IN_BOX_ROWS != 0) { cursorPosition++; @@ -6697,7 +6735,7 @@ static u8 InBoxInput_Normal(void) } else if (JOY_NEW(START_BUTTON)) { - retVal = TRUE; + retVal = INPUT_1; cursorArea = CURSOR_AREA_BOX; cursorPosition = 0; break; @@ -6706,55 +6744,55 @@ static u8 InBoxInput_Normal(void) if ((JOY_NEW(A_BUTTON)) && sub_80CFA5C()) { if (!sCanOnlyMove) - return 8; + return INPUT_8; - if (sPSSData->boxOption != BOX_OPTION_MOVE_MONS || sIsMonBeingMoved == TRUE) + if (sPSSData->boxOption != OPTION_MOVE_MONS || sIsMonBeingMoved == TRUE) { switch (GetMenuItemTextId(0)) { case MENU_STORE: - return 11; + return INPUT_11; case MENU_WITHDRAW: - return 12; + return INPUT_12; case MENU_MOVE: - return 13; + return INPUT_13; case MENU_SHIFT: - return 14; + return INPUT_14; case MENU_PLACE: - return 15; + return INPUT_15; case MENU_TAKE: - return 16; + return INPUT_16; case MENU_GIVE: - return 17; + return INPUT_17; case MENU_SWITCH: - return 18; + return INPUT_18; } } else { sPSSData->inBoxMovingMode = 1; - return 20; + return INPUT_20; } } if (JOY_NEW(B_BUTTON)) - return 19; + return INPUT_19; if (gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR) { if (JOY_HELD(L_BUTTON)) - return 10; + return INPUT_10; if (JOY_HELD(R_BUTTON)) - return 9; + return INPUT_9; } if (JOY_NEW(SELECT_BUTTON)) { sub_80CFDC4(); - return 0; + return INPUT_NONE; } - retVal = 0; + retVal = INPUT_NONE; } while (0); @@ -6773,11 +6811,11 @@ static u8 InBoxInput_GrabbingMultiple(void) if (sBoxCursorPosition / IN_BOX_ROWS != 0) { sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - IN_BOX_ROWS); - return 21; + return INPUT_21; } else { - return 24; + return INPUT_24; } } else if (JOY_REPEAT(DPAD_DOWN)) @@ -6785,11 +6823,11 @@ static u8 InBoxInput_GrabbingMultiple(void) if (sBoxCursorPosition + IN_BOX_ROWS < IN_BOX_COUNT) { sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + IN_BOX_ROWS); - return 21; + return INPUT_21; } else { - return 24; + return INPUT_24; } } else if (JOY_REPEAT(DPAD_LEFT)) @@ -6797,11 +6835,11 @@ static u8 InBoxInput_GrabbingMultiple(void) if (sBoxCursorPosition % IN_BOX_ROWS != 0) { sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - 1); - return 21; + return INPUT_21; } else { - return 24; + return INPUT_24; } } else if (JOY_REPEAT(DPAD_RIGHT)) @@ -6809,16 +6847,16 @@ static u8 InBoxInput_GrabbingMultiple(void) if ((sBoxCursorPosition + 1) % IN_BOX_ROWS != 0) { sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + 1); - return 21; + return INPUT_21; } else { - return 24; + return INPUT_24; } } else { - return 0; + return INPUT_NONE; } } else @@ -6827,14 +6865,14 @@ static u8 InBoxInput_GrabbingMultiple(void) { sPSSData->inBoxMovingMode = 0; sPSSData->field_CB8->invisible = FALSE; - return 22; + return INPUT_22; } else { sIsMonBeingMoved = (sPSSData->cursorMonSpecies != SPECIES_NONE); sPSSData->inBoxMovingMode = 2; sMovingMonOrigBoxId = StorageGetCurrentBox(); - return 23; + return INPUT_23; } } } @@ -6846,11 +6884,11 @@ static u8 InBoxInput_MovingMultiple(void) if (sub_80D0580(0)) { sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - IN_BOX_ROWS); - return 25; + return INPUT_25; } else { - return 24; + return INPUT_24; } } else if (JOY_REPEAT(DPAD_DOWN)) @@ -6858,11 +6896,11 @@ static u8 InBoxInput_MovingMultiple(void) if (sub_80D0580(1)) { sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + IN_BOX_ROWS); - return 25; + return INPUT_25; } else { - return 24; + return INPUT_24; } } else if (JOY_REPEAT(DPAD_LEFT)) @@ -6870,11 +6908,11 @@ static u8 InBoxInput_MovingMultiple(void) if (sub_80D0580(2)) { sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - 1); - return 25; + return INPUT_25; } else { - return 10; + return INPUT_10; } } else if (JOY_REPEAT(DPAD_RIGHT)) @@ -6882,11 +6920,11 @@ static u8 InBoxInput_MovingMultiple(void) if (sub_80D0580(3)) { sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + 1); - return 25; + return INPUT_25; } else { - return 9; + return INPUT_9; } } else if (JOY_NEW(A_BUTTON)) @@ -6895,28 +6933,28 @@ static u8 InBoxInput_MovingMultiple(void) { sIsMonBeingMoved = FALSE; sPSSData->inBoxMovingMode = 0; - return 26; + return INPUT_26; } else { - return 24; + return INPUT_24; } } else if (JOY_NEW(B_BUTTON)) { - return 24; + return INPUT_24; } else { if (gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR) { if (JOY_HELD(L_BUTTON)) - return 10; + return INPUT_10; if (JOY_HELD(R_BUTTON)) - return 9; + return INPUT_9; } - return 0; + return INPUT_NONE; } } @@ -6935,14 +6973,14 @@ static u8 HandleInput_InParty(void) sPSSData->field_CD2 = 0; sPSSData->field_CD7 = 0; gotoBox = FALSE; - retVal = 0; + retVal = INPUT_NONE; if (JOY_REPEAT(DPAD_UP)) { if (--cursorPosition < 0) cursorPosition = PARTY_SIZE; if (cursorPosition != sBoxCursorPosition) - retVal = 1; + retVal = INPUT_1; break; } else if (JOY_REPEAT(DPAD_DOWN)) @@ -6950,12 +6988,12 @@ static u8 HandleInput_InParty(void) if (++cursorPosition > PARTY_SIZE) cursorPosition = 0; if (cursorPosition != sBoxCursorPosition) - retVal = 1; + retVal = INPUT_1; break; } else if (JOY_REPEAT(DPAD_LEFT) && sBoxCursorPosition != 0) { - retVal = 1; + retVal = INPUT_1; sPSSData->field_CD6 = sBoxCursorPosition; cursorPosition = 0; break; @@ -6964,12 +7002,12 @@ static u8 HandleInput_InParty(void) { if (sBoxCursorPosition == 0) { - retVal = 1; + retVal = INPUT_1; cursorPosition = sPSSData->field_CD6; } else { - retVal = 6; + retVal = INPUT_6; cursorArea = CURSOR_AREA_IN_BOX; cursorPosition = 0; } @@ -6980,63 +7018,63 @@ static u8 HandleInput_InParty(void) { if (sBoxCursorPosition == PARTY_SIZE) { - if (sPSSData->boxOption == BOX_OPTION_DEPOSIT) - return 4; + if (sPSSData->boxOption == OPTION_DEPOSIT) + return INPUT_4; gotoBox = TRUE; } else if (sub_80CFA5C()) { if (!sCanOnlyMove) - return 8; + return INPUT_8; switch (GetMenuItemTextId(0)) { case MENU_STORE: - return 11; + return INPUT_11; case MENU_WITHDRAW: - return 12; + return INPUT_12; case MENU_MOVE: - return 13; + return INPUT_13; case MENU_SHIFT: - return 14; + return INPUT_14; case MENU_PLACE: - return 15; + return INPUT_15; case MENU_TAKE: - return 16; + return INPUT_16; case MENU_GIVE: - return 17; + return INPUT_17; case MENU_SWITCH: - return 18; + return INPUT_18; } } } if (JOY_NEW(B_BUTTON)) { - if (sPSSData->boxOption == BOX_OPTION_DEPOSIT) - return 19; + if (sPSSData->boxOption == OPTION_DEPOSIT) + return INPUT_19; gotoBox = TRUE; } if (gotoBox) { - retVal = 6; + retVal = INPUT_6; cursorArea = CURSOR_AREA_IN_BOX; cursorPosition = 0; } else if (JOY_NEW(SELECT_BUTTON)) { sub_80CFDC4(); - return 0; + return INPUT_NONE; } } while (0); - if (retVal != 0) + if (retVal != INPUT_NONE) { - if (retVal != 6) + if (retVal != INPUT_6) sub_80CD894(cursorArea, cursorPosition); } @@ -7057,7 +7095,7 @@ static u8 HandleInput_OnBox(void) if (JOY_REPEAT(DPAD_UP)) { - retVal = 1; + retVal = INPUT_1; cursorArea = CURSOR_AREA_BUTTONS; cursorPosition = 0; sPSSData->field_CD7 = 1; @@ -7065,46 +7103,46 @@ static u8 HandleInput_OnBox(void) } else if (JOY_REPEAT(DPAD_DOWN)) { - retVal = 1; + retVal = INPUT_1; cursorArea = CURSOR_AREA_IN_BOX; cursorPosition = 2; break; } if (JOY_HELD(DPAD_LEFT)) - return 10; + return INPUT_10; if (JOY_HELD(DPAD_RIGHT)) - return 9; + return INPUT_9; if (gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR) { if (JOY_HELD(L_BUTTON)) - return 10; + return INPUT_10; if (JOY_HELD(R_BUTTON)) - return 9; + return INPUT_9; } if (JOY_NEW(A_BUTTON)) { AnimateBoxScrollArrows(FALSE); AddBoxMenu(); - return 7; + return INPUT_7; } if (JOY_NEW(B_BUTTON)) - return 19; + return INPUT_19; if (JOY_NEW(SELECT_BUTTON)) { sub_80CFDC4(); - return 0; + return INPUT_NONE; } - retVal = 0; + retVal = INPUT_NONE; } while (0); - if (retVal) + if (retVal != INPUT_NONE) { if (cursorArea != CURSOR_AREA_BOX) AnimateBoxScrollArrows(FALSE); @@ -7130,7 +7168,7 @@ static u8 HandleInput_OnButtons(void) if (JOY_REPEAT(DPAD_UP)) { - retVal = 1; + retVal = INPUT_1; cursorArea = CURSOR_AREA_IN_BOX; sPSSData->field_CD2 = -1; if (sBoxCursorPosition == 0) @@ -7143,7 +7181,7 @@ static u8 HandleInput_OnButtons(void) if (JOY_REPEAT(DPAD_DOWN | START_BUTTON)) { - retVal = 1; + retVal = INPUT_1; cursorArea = CURSOR_AREA_BOX; cursorPosition = 0; sPSSData->field_CD7 = 1; @@ -7152,34 +7190,34 @@ static u8 HandleInput_OnButtons(void) if (JOY_REPEAT(DPAD_LEFT)) { - retVal = 1; + retVal = INPUT_1; if (--cursorPosition < 0) cursorPosition = 1; break; } else if (JOY_REPEAT(DPAD_RIGHT)) { - retVal = 1; + retVal = INPUT_1; if (++cursorPosition > 1) cursorPosition = 0; break; } if (JOY_NEW(A_BUTTON)) - return (cursorPosition == 0) ? 5 : 4; + return (cursorPosition == 0) ? INPUT_5 : INPUT_4; if (JOY_NEW(B_BUTTON)) - return 19; + return INPUT_19; if (JOY_NEW(SELECT_BUTTON)) { sub_80CFDC4(); - return 0; + return INPUT_NONE; } - retVal = 0; + retVal = INPUT_NONE; } while (0); - if (retVal != 0) + if (retVal != INPUT_NONE) sub_80CD894(cursorArea, cursorPosition); return retVal; @@ -7191,14 +7229,13 @@ static u8 HandleInput(void) { u8 (*func)(void); s8 area; - } - static const inputFuncs[] = + } static const inputFuncs[] = { - {HandleInput_InBox, CURSOR_AREA_IN_BOX}, - {HandleInput_InParty, CURSOR_AREA_IN_PARTY}, - {HandleInput_OnBox, CURSOR_AREA_BOX}, + {HandleInput_InBox, CURSOR_AREA_IN_BOX}, + {HandleInput_InParty, CURSOR_AREA_IN_PARTY}, + {HandleInput_OnBox, CURSOR_AREA_BOX}, {HandleInput_OnButtons, CURSOR_AREA_BUTTONS}, - {NULL, 0}, + {}, }; u16 i = 0; @@ -7209,7 +7246,7 @@ static u8 HandleInput(void) i++; } - return 0; + return INPUT_NONE; } static void AddBoxMenu(void) @@ -7224,7 +7261,7 @@ static void AddBoxMenu(void) static u8 sub_80CFA5C(void) { InitMenu(); - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return sub_80CFA84(); else return sub_80CFB44(); @@ -7236,19 +7273,19 @@ static bool8 sub_80CFA84(void) switch (sPSSData->boxOption) { - case BOX_OPTION_DEPOSIT: + case OPTION_DEPOSIT: if (var0) SetMenuText(MENU_STORE); else return FALSE; break; - case BOX_OPTION_WITHDRAW: + case OPTION_WITHDRAW: if (var0) SetMenuText(MENU_WITHDRAW); else return FALSE; break; - case BOX_OPTION_MOVE_MONS: + case OPTION_MOVE_MONS: if (sIsMonBeingMoved) { if (var0) @@ -7264,13 +7301,13 @@ static bool8 sub_80CFA84(void) return FALSE; } break; - case BOX_OPTION_MOVE_ITEMS: + case OPTION_MOVE_ITEMS: default: return FALSE; } SetMenuText(MENU_SUMMARY); - if (sPSSData->boxOption == BOX_OPTION_MOVE_MONS) + if (sPSSData->boxOption == OPTION_MOVE_MONS) { if (!sBoxCursorArea) SetMenuText(MENU_WITHDRAW); @@ -8320,7 +8357,7 @@ static void sub_80D0C60(void) struct CompressedSpriteSheet spriteSheet; struct SpriteTemplate spriteTemplate; - if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { spriteSheet.data = gUnknown_03000F78; spriteSheet.size = 0x200; @@ -8368,7 +8405,7 @@ static void sub_80D0D8C(u8 cursorArea, u8 cursorPos) { u16 heldItem; - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; if (sub_80D1324(cursorArea, cursorPos)) return; @@ -8406,7 +8443,7 @@ static void sub_80D0E50(u8 cursorArea, u8 cursorPos) { u8 id; - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; id = sub_80D1370(cursorArea, cursorPos); @@ -8419,7 +8456,7 @@ static void Item_FromMonToMoving(u8 cursorArea, u8 cursorPos) u8 id; u16 item; - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; id = sub_80D1370(cursorArea, cursorPos); @@ -8460,7 +8497,7 @@ static void Item_SwitchMonsWithMoving(u8 cursorArea, u8 cursorPos) u8 id; u16 item; - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; id = sub_80D1370(cursorArea, cursorPos); @@ -8488,7 +8525,7 @@ static void Item_GiveMovingToMon(u8 cursorArea, u8 cursorPos) { u8 id; - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; id = sub_80D1370(2, 0); @@ -8511,7 +8548,7 @@ static void Item_TakeMons(u8 cursorArea, u8 cursorPos) u8 id; u16 item; - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; item = 0; @@ -8532,7 +8569,7 @@ static void Item_TakeMons(u8 cursorArea, u8 cursorPos) static void sub_80D1194(void) { - if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { u8 id = sub_80D1370(2, 0); sub_80D15D4(id, 5); @@ -8544,7 +8581,7 @@ static void sub_80D11CC(void) { s32 i; - if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; for (i = 0; i < 3; i++) @@ -8576,7 +8613,7 @@ static bool8 IsActiveItemMoving(void) { s32 i; - if (sPSSData->boxOption == BOX_OPTION_MOVE_ITEMS) + if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { for (i = 0; i < 3; i++) { @@ -9267,7 +9304,7 @@ u32 GetWaldaWallpaperPatternId(void) void SetWaldaWallpaperPatternId(u8 id) { - if (id < FRIENDS_WALLPAPERS_COUNT) + if (id < ARRAY_COUNT(sWaldaWallpapers)) gSaveBlock1Ptr->waldaPhrase.patternId = id; } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 6adf95ca1..92d2f5073 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -47,6 +47,14 @@ #include "constants/rgb.h" #include "constants/songs.h" +enum { + PSS_PAGE_INFO, + PSS_PAGE_SKILLS, + PSS_PAGE_BATTLE_MOVES, + PSS_PAGE_CONTEST_MOVES, + PSS_PAGE_COUNT, +}; + // Screen titles (upper left) #define PSS_LABEL_WINDOW_POKEMON_INFO_TITLE 0 #define PSS_LABEL_WINDOW_POKEMON_SKILLS_TITLE 1 @@ -1070,24 +1078,24 @@ void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, sMonSummaryScreen->maxMonIndex = maxMonIndex; sMonSummaryScreen->callback = callback; - if (mode == PSS_MODE_BOX) + if (mode == SUMMARY_MODE_BOX) sMonSummaryScreen->isBoxMon = TRUE; else sMonSummaryScreen->isBoxMon = FALSE; switch (mode) { - case PSS_MODE_NORMAL: - case PSS_MODE_BOX: + case SUMMARY_MODE_NORMAL: + case SUMMARY_MODE_BOX: sMonSummaryScreen->minPageIndex = 0; sMonSummaryScreen->maxPageIndex = PSS_PAGE_COUNT - 1; break; - case PSS_MODE_LOCK_MOVES: + case SUMMARY_MODE_LOCK_MOVES: sMonSummaryScreen->minPageIndex = 0; sMonSummaryScreen->maxPageIndex = PSS_PAGE_COUNT - 1; sMonSummaryScreen->lockMovesFlag = TRUE; break; - case PSS_MODE_SELECT_MOVE: + case SUMMARY_MODE_SELECT_MOVE: sMonSummaryScreen->minPageIndex = PSS_PAGE_BATTLE_MOVES; sMonSummaryScreen->maxPageIndex = PSS_PAGE_COUNT - 1; sMonSummaryScreen->lockMonFlag = TRUE; @@ -1105,7 +1113,7 @@ void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void ShowSelectMovePokemonSummaryScreen(struct Pokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void), u16 newMove) { - ShowPokemonSummaryScreen(PSS_MODE_SELECT_MOVE, mons, monIndex, maxMonIndex, callback); + ShowPokemonSummaryScreen(SUMMARY_MODE_SELECT_MOVE, mons, monIndex, maxMonIndex, callback); sMonSummaryScreen->newMove = newMove; } @@ -1240,7 +1248,7 @@ static bool8 LoadGraphics(void) gMain.state++; break; case 22: - if (sMonSummaryScreen->mode != PSS_MODE_SELECT_MOVE) + if (sMonSummaryScreen->mode != SUMMARY_MODE_SELECT_MOVE) CreateTask(Task_HandleInput, 0); else CreateTask(Task_SetHandleReplaceMoveInput, 0); @@ -1393,7 +1401,7 @@ static bool8 ExtractMonDataToSummaryStruct(struct Pokemon *mon) sum->ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES); break; case 2: - if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == PSS_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE) + if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE) { sum->nature = GetNature(mon); sum->currentHP = GetMonData(mon, MON_DATA_HP); @@ -2859,7 +2867,7 @@ static void PutPageWindowTilemaps(u8 page) break; case PSS_PAGE_BATTLE_MOVES: PutWindowTilemap(PSS_LABEL_WINDOW_BATTLE_MOVES_TITLE); - if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) + if (sMonSummaryScreen->mode == SUMMARY_MODE_SELECT_MOVE) { if (sMonSummaryScreen->newMove != MOVE_NONE || sMonSummaryScreen->firstMoveIndex != MAX_MON_MOVES) PutWindowTilemap(PSS_LABEL_WINDOW_MOVES_POWER_ACC); @@ -2871,7 +2879,7 @@ static void PutPageWindowTilemaps(u8 page) break; case PSS_PAGE_CONTEST_MOVES: PutWindowTilemap(PSS_LABEL_WINDOW_CONTEST_MOVES_TITLE); - if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) + if (sMonSummaryScreen->mode == SUMMARY_MODE_SELECT_MOVE) { if (sMonSummaryScreen->newMove != MOVE_NONE || sMonSummaryScreen->firstMoveIndex != MAX_MON_MOVES) PutWindowTilemap(PSS_LABEL_WINDOW_MOVES_APPEAL_JAM); @@ -2907,7 +2915,7 @@ static void ClearPageWindowTilemaps(u8 page) ClearWindowTilemap(PSS_LABEL_WINDOW_POKEMON_SKILLS_EXP); break; case PSS_PAGE_BATTLE_MOVES: - if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) + if (sMonSummaryScreen->mode == SUMMARY_MODE_SELECT_MOVE) { if (sMonSummaryScreen->newMove != MOVE_NONE || sMonSummaryScreen->firstMoveIndex != MAX_MON_MOVES) ClearWindowTilemap(PSS_LABEL_WINDOW_MOVES_POWER_ACC); @@ -2918,7 +2926,7 @@ static void ClearPageWindowTilemaps(u8 page) } break; case PSS_PAGE_CONTEST_MOVES: - if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) + if (sMonSummaryScreen->mode == SUMMARY_MODE_SELECT_MOVE) { if (sMonSummaryScreen->newMove != MOVE_NONE || sMonSummaryScreen->firstMoveIndex != MAX_MON_MOVES) ClearWindowTilemap(PSS_LABEL_WINDOW_MOVES_APPEAL_JAM); @@ -3413,7 +3421,7 @@ static void PrintBattleMoves(void) PrintMoveNameAndPP(2); PrintMoveNameAndPP(3); - if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) + if (sMonSummaryScreen->mode == SUMMARY_MODE_SELECT_MOVE) { PrintNewMoveDetailsOrCancelText(); if (sMonSummaryScreen->firstMoveIndex == MAX_MON_MOVES) @@ -3447,11 +3455,11 @@ static void Task_PrintBattleMoves(u8 taskId) PrintMoveNameAndPP(3); break; case 5: - if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) + if (sMonSummaryScreen->mode == SUMMARY_MODE_SELECT_MOVE) PrintNewMoveDetailsOrCancelText(); break; case 6: - if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) + if (sMonSummaryScreen->mode == SUMMARY_MODE_SELECT_MOVE) { if (sMonSummaryScreen->firstMoveIndex == MAX_MON_MOVES) data[1] = sMonSummaryScreen->newMove; @@ -3460,7 +3468,7 @@ static void Task_PrintBattleMoves(u8 taskId) } break; case 7: - if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) + if (sMonSummaryScreen->mode == SUMMARY_MODE_SELECT_MOVE) { if (sMonSummaryScreen->newMove != MOVE_NONE || sMonSummaryScreen->firstMoveIndex != MAX_MON_MOVES) PrintMoveDetails(data[1]); @@ -3548,7 +3556,7 @@ static void PrintContestMoves(void) PrintMoveNameAndPP(2); PrintMoveNameAndPP(3); - if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) + if (sMonSummaryScreen->mode == SUMMARY_MODE_SELECT_MOVE) { PrintNewMoveDetailsOrCancelText(); PrintContestMoveDescription(sMonSummaryScreen->firstMoveIndex); @@ -3574,11 +3582,11 @@ static void Task_PrintContestMoves(u8 taskId) PrintMoveNameAndPP(3); break; case 5: - if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) + if (sMonSummaryScreen->mode == SUMMARY_MODE_SELECT_MOVE) PrintNewMoveDetailsOrCancelText(); break; case 6: - if (sMonSummaryScreen->mode == PSS_MODE_SELECT_MOVE) + if (sMonSummaryScreen->mode == SUMMARY_MODE_SELECT_MOVE) { if (sMonSummaryScreen->newMove != MOVE_NONE || sMonSummaryScreen->firstMoveIndex != MAX_MON_MOVES) PrintContestMoveDescription(sMonSummaryScreen->firstMoveIndex); @@ -3613,7 +3621,7 @@ static void PrintMoveDetails(u16 move) FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); if (move != MOVE_NONE) { - if (sMonSummaryScreen->currPageIndex == PSS_MODE_BOX) + if (sMonSummaryScreen->currPageIndex == SUMMARY_MODE_BOX) { PrintMovePowerAndAccuracy(move); PrintTextOnWindow(windowId, gMoveDescriptionPointers[move - 1], 6, 1, 0, 0); @@ -3867,14 +3875,14 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state) { if (gMonSpritesGfxPtr != NULL) { - if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == PSS_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE) + if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE) HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid); else HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid); } else { - if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == PSS_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE) + if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE) HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], sub_806F4F8(0, 1), summary->species2, summary->pid); else HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], sub_806F4F8(0, 1), summary->species2, summary->pid); diff --git a/src/trade.c b/src/trade.c index f423b20af..12a2f4b33 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1460,10 +1460,10 @@ static void TradeMenuShowMonSummaryScreen(void) { // Player's party if (sTradeMenuData->cursorPosition < PARTY_SIZE) - ShowPokemonSummaryScreen(PSS_MODE_LOCK_MOVES, gPlayerParty, sTradeMenuData->cursorPosition, sTradeMenuData->partyCounts[TRADE_PLAYER] - 1, CB2_ReturnToTradeMenu); + ShowPokemonSummaryScreen(SUMMARY_MODE_LOCK_MOVES, gPlayerParty, sTradeMenuData->cursorPosition, sTradeMenuData->partyCounts[TRADE_PLAYER] - 1, CB2_ReturnToTradeMenu); // Partner's party else - ShowPokemonSummaryScreen(PSS_MODE_LOCK_MOVES, gEnemyParty, sTradeMenuData->cursorPosition - PARTY_SIZE, sTradeMenuData->partyCounts[TRADE_PARTNER] - 1, CB2_ReturnToTradeMenu); + ShowPokemonSummaryScreen(SUMMARY_MODE_LOCK_MOVES, gEnemyParty, sTradeMenuData->cursorPosition - PARTY_SIZE, sTradeMenuData->partyCounts[TRADE_PARTNER] - 1, CB2_ReturnToTradeMenu); FreeAllWindowBuffers(); } } From 84e1cbaaa651a937712ac95ae97cc1fb7675b735 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 15 Apr 2021 19:17:53 -0400 Subject: [PATCH 45/63] Doc storage - misc gfx, item icons --- ...{unknown_frame.png => item_info_frame.png} | Bin src/pokemon_storage_system.c | 925 ++++++++++-------- 2 files changed, 491 insertions(+), 434 deletions(-) rename graphics/pokemon_storage/{unknown_frame.png => item_info_frame.png} (100%) diff --git a/graphics/pokemon_storage/unknown_frame.png b/graphics/pokemon_storage/item_info_frame.png similarity index 100% rename from graphics/pokemon_storage/unknown_frame.png rename to graphics/pokemon_storage/item_info_frame.png diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 07e0931ed..bcf2d4075 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -195,33 +195,79 @@ enum { CURSOR_AREA_BUTTONS, // Party Pokemon and Close Box }; +#define CURSOR_AREA_IN_HAND CURSOR_AREA_BOX // Alt name for cursor area used by Move Items + // Special box ids for the choose box menu #define BOXID_NONE_CHOSEN 200 #define BOXID_CANCELED 201 -#define TAG_PAL_WAVEFORM 0xDACA -#define TAG_PAL_DAC8 0xDAC8 -#define TAG_PAL_DAC6 0xDAC6 -#define TAG_PAL_DACE 0xDACE -#define TAG_PAL_DAC7 0xDAC7 -#define PALTAG_BOX_TITLE 0xDAC9 -#define TAG_PAL_DAC0 0xDAC0 -#define TAG_PAL_DACB 0xDACB +enum { + PALTAG_MON_ICON_0 = 56000, + PALTAG_MON_ICON_1, // Used implicitly in CreateMonIconSprite + PALTAG_MON_ICON_2, // Used implicitly in CreateMonIconSprite + PALTAG_3, + PALTAG_4, + PALTAG_5, + PALTAG_CURSOR_MON, + PALTAG_7, + PALTAG_MON_MARKING, + PALTAG_BOX_TITLE, + PALTAG_10, + PALTAG_ITEM_ICON_0, + PALTAG_ITEM_ICON_1, // Used implicitly in CreateItemIconSprites + PALTAG_ITEM_ICON_2, // Used implicitly in CreateItemIconSprites + PALTAG_14, +}; -#define TAG_TILE_0 0 -#define TAG_TILE_1 1 -#define TAG_TILE_2 2 -#define GFXTAG_BOX_TITLE 3 -#define GFXTAG_BOX_TITLE_ALT 4 -#define TAG_TILE_WAVEFORM 5 -#define GFXTAG_ARROW 6 -#define TAG_TILE_7 7 -#define GFXTAG_CHOOSE_BOX_MENU 10 -#define GFXTAG_CHOOSE_BOX_MENU_SIDES 11 // Used implicitly in LoadChooseBoxMenuGfx -#define TAG_TILE_D 13 -#define TAG_TILE_10 16 -#define TAG_TILE_12 18 +enum { + TAG_TILE_0, + TAG_TILE_1, + GFXTAG_CURSOR_MON, + GFXTAG_BOX_TITLE, + GFXTAG_BOX_TITLE_ALT, + GFXTAG_WAVEFORM, + GFXTAG_ARROW, + GFXTAG_ITEM_ICON_0, + GFXTAG_ITEM_ICON_1, // Used implicitly in CreateItemIconSprites + GFXTAG_ITEM_ICON_2, // Used implicitly in CreateItemIconSprites + GFXTAG_CHOOSE_BOX_MENU, + GFXTAG_CHOOSE_BOX_MENU_SIDES, // Used implicitly in LoadChooseBoxMenuGfx + GFXTAG_12, + GFXTAG_13, + GFXTAG_14, + GFXTAG_15, + GFXTAG_MON_MARKING, + GFXTAG_17, + GFXTAG_18, +}; +// The maximum number of item icons that can appear on-screen while +// moving held items. 1 in the cursor, and 2 more while switching +// between 2 Pokémon with held items +#define MAX_ITEM_ICONS 3 + +// IDs for the item icons affine anims +enum { + ITEM_ANIM_NONE, + ITEM_ANIM_APPEAR, + ITEM_ANIM_DISAPPEAR, + ITEM_ANIM_PICK_UP, + ITEM_ANIM_PUT_DOWN, + ITEM_ANIM_PUT_AWAY, + ITEM_ANIM_LARGE, +}; + +// IDs for the item icon sprite callbacks +enum { + ITEM_CB_WAIT_ANIM, + ITEM_CB_TO_HAND, + ITEM_CB_TO_MON, + ITEM_CB_SWAP_TO_HAND, + ITEM_CB_SWAP_TO_MON, + ITEM_CB_UNUSED_1, + ITEM_CB_UNUSED_2, + ITEM_CB_HIDE_PARTY, +}; struct Wallpaper { @@ -280,14 +326,14 @@ struct ChooseBoxMenu u8 subpriority; }; -struct UnkStorageStruct +struct ItemIcon { struct Sprite *sprite; u8 *tiles; u16 palIndex; - u8 unk8; - u8 unk9; - u8 unk10; + u8 cursorArea; + u8 cursorPos; + bool8 active; }; struct PokemonStorageSystemData @@ -389,7 +435,7 @@ struct PokemonStorageSystemData const u32 *cursorMonPalette; u32 cursorMonPersonality; u16 cursorMonSpecies; - u16 cursorMonItem; + u16 cursorMonItemId; u16 field_CE8; bool8 setMosaic; u8 cursorMonMarkings; @@ -403,9 +449,9 @@ struct PokemonStorageSystemData bool8 (*monPlaceChangeFunc)(void); u8 monPlaceChangeState; u8 field_D91; - struct Sprite *field_D94; - struct Sprite *field_D98[2]; - u16 *field_DA0; + struct Sprite *markingComboSprite; + struct Sprite *waveformSprites[2]; + u16 *markingComboTilesPtr; struct MonMarkingsMenu markMenu; struct ChooseBoxMenu chooseBoxMenu; struct Pokemon movingMon; @@ -433,15 +479,15 @@ struct PokemonStorageSystemData u8 itemName[20]; u8 inBoxMovingMode; u16 field_2200; - struct UnkStorageStruct field_2204[3]; - u16 movingItem; - u16 field_2236; + struct ItemIcon itemIcons[MAX_ITEM_ICONS]; + u16 movingItemId; + u16 itemInfoWindowOffset; u8 field_2238; // Unused - u16 field_223A; - u16 *field_223C; + u16 cursorMonPalOffset; + u16 *cursorMonTilePtr; struct Sprite *cursorMonSprite; - u16 field_2244[0x40]; - u8 field_22C4[0x800]; + u16 cursorMonPalBuffer[0x40]; + u8 tileBuffer[0x800]; u8 field_2AC4[0x1800]; // Unused u8 field_42C4[0x800]; u8 wallpaperBgTilemapBuffer[0x1000]; @@ -474,7 +520,7 @@ struct UnkStruct_2039D84 u8 field_2D; }; -static u32 gUnknown_03000F78[98]; +static u32 sItemIconGfxBuffer[98]; EWRAM_DATA static u8 sPreviousBoxOption = 0; EWRAM_DATA static struct ChooseBoxMenu *sChooseBoxMenu = NULL; @@ -529,7 +575,7 @@ static void sub_80CEBDC(void); static void SetScrollingBackground(void); static void sub_80CABE0(void); static void sub_80CAEAC(void); -static void sub_80D0C60(void); +static void CreateItemIconSprites(void); static void sub_80CFEA8(void); static void sub_80CDC0C(void); static void sub_80CAF04(void); @@ -540,9 +586,9 @@ static void InitCanRelaseMonVars(void); static void sub_80D01B8(void); static void ReleaseMon(void); static void RefreshCursorMonData(void); -static void LoadCursorMonSprite(void); -static void sub_80CA154(void); -static void sub_80CA1C4(void); +static void CreateCursorMonSprite(void); +static void CreateMarkingComboSprite(void); +static void CreateWaveformSprites(void); static void sub_80CC064(void); static void sub_80CE324(void); static void ClearBottomWindow(void); @@ -551,7 +597,7 @@ static void RemoveMenu(void); static void sub_80CE00C(void); static void sub_80D1194(void); static void PrintCursorMonInfo(void); -static void sub_80CA65C(void); +static void UpdateWaveformAnimation(void); static void AddWallpaperSetsMenu(void); static void CreateBoxScrollArrows(void); static void InitMenu(void); @@ -559,8 +605,8 @@ static void StopBoxScrollArrowsSlide(void); static void sub_80CFC14(void); static void sub_80CEB40(void); static void CycleBoxTitleSprites(void); -static void sub_80D1818(void); -static void sub_80D19B4(u32); +static void InitItemInfoWindow(void); +static void DrawItemInfoWindow(u32); static void sub_80CAA74(void); static void PrintItemDescription(void); static void sub_80CE760(void); @@ -593,17 +639,17 @@ static bool8 IsInitBoxActive(void); static bool8 sub_80D01E4(void); static bool8 sub_80CDED4(void); static bool8 sub_80CDF08(void); -static bool8 sub_80D184C(void); -static bool8 sub_80D18E4(void); +static bool8 UpdateItemInfoWindowSlideIn(void); +static bool8 UpdateItemInfoWindowSlideOut(void); static bool8 DoShowPartyMenu(void); -static bool8 sub_80D1218(void); +static bool8 IsItemIconAnimActive(void); static bool8 ScrollToBox(void); static bool8 sub_80CD554(void); static bool8 HidePartyMenu(void); -static bool8 IsActiveItemMoving(void); +static bool8 IsMovingItem(void); static bool8 sub_80D0580(u8); static bool8 sub_80D0BC0(void); -static bool8 sub_80CA2B8(void); +static bool8 GetCursorMonMosaic(void); static bool8 DoWallpaperGfxChange(void); static bool8 DoMonPlaceChange(void); static bool8 IsMenuLoading(void); @@ -667,7 +713,7 @@ static void Item_SwitchMonsWithMoving(u8, u8); static struct Sprite *CreateChooseBoxArrows(u16, u16, u8, u8, u8); static void SetWallpaperForCurrentBox(u8); static void AddWallpapersMenu(u8); -static u16 GetMovingItem(void); +static u16 GetMovingItemId(void); static void LoadCursorMonGfx(u16, u32); static void sub_80CA2D0(struct Sprite *); static void SpriteCB_OutgoingBoxTitle(struct Sprite *); @@ -928,20 +974,20 @@ static const struct BgTemplate gUnknown_08572734[] = static const struct SpritePalette gWaveformSpritePalette = { - gWaveformPalette, TAG_PAL_WAVEFORM + gWaveformPalette, PALTAG_10 }; -static const struct SpriteSheet gWaveformSpriteSheet = +static const struct SpriteSheet sSpriteSheet_Waveform = { - gWaveformTiles, sizeof(gWaveformTiles), TAG_TILE_WAVEFORM + gWaveformTiles, sizeof(gWaveformTiles), GFXTAG_WAVEFORM }; -static const struct OamData sOamData_857286C; +static const struct OamData sOamData_CursorMon; static const struct SpriteTemplate sSpriteTemplate_CursorMon = { - .tileTag = TAG_TILE_2, - .paletteTag = TAG_PAL_DAC6, - .oam = &sOamData_857286C, + .tileTag = GFXTAG_CURSOR_MON, + .paletteTag = PALTAG_CURSOR_MON, + .oam = &sOamData_CursorMon, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, @@ -994,7 +1040,7 @@ static const struct WindowTemplate sYesNoWindowTemplate = .baseBlock = 0x5C, }; -static const struct OamData sOamData_857286C = +static const struct OamData sOamData_CursorMon = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, @@ -1011,7 +1057,7 @@ static const struct OamData sOamData_857286C = .affineParam = 0 }; -static const struct OamData sOamData_8572874 = +static const struct OamData sOamData_Waveform = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, @@ -1028,13 +1074,13 @@ static const struct OamData sOamData_8572874 = .affineParam = 0 }; -static const union AnimCmd sSpriteAnim_857287C[] = +static const union AnimCmd sAnim_Waveform_LeftOff[] = { ANIMCMD_FRAME(0, 5), ANIMCMD_END }; -static const union AnimCmd sSpriteAnim_8572884[] = +static const union AnimCmd sAnim_Waveform_LeftOn[] = { ANIMCMD_FRAME(2, 8), ANIMCMD_FRAME(4, 8), @@ -1042,13 +1088,13 @@ static const union AnimCmd sSpriteAnim_8572884[] = ANIMCMD_JUMP(0) }; -static const union AnimCmd sSpriteAnim_8572894[] = +static const union AnimCmd sAnim_Waveform_RightOff[] = { ANIMCMD_FRAME(8, 5), ANIMCMD_END }; -static const union AnimCmd sSpriteAnim_857289C[] = +static const union AnimCmd sAnim_Waveform_RightOn[] = { ANIMCMD_FRAME(10, 8), ANIMCMD_FRAME(4, 8), @@ -1056,20 +1102,20 @@ static const union AnimCmd sSpriteAnim_857289C[] = ANIMCMD_JUMP(0) }; -static const union AnimCmd *const sSpriteAnimTable_85728AC[] = +static const union AnimCmd *const sAnims_Waveform[] = { - sSpriteAnim_857287C, - sSpriteAnim_8572884, - sSpriteAnim_8572894, - sSpriteAnim_857289C + sAnim_Waveform_LeftOff, + sAnim_Waveform_LeftOn, + sAnim_Waveform_RightOff, + sAnim_Waveform_RightOn }; static const struct SpriteTemplate sSpriteTemplate_Waveform = { - .tileTag = TAG_TILE_WAVEFORM, - .paletteTag = TAG_PAL_WAVEFORM, - .oam = &sOamData_8572874, - .anims = sSpriteAnimTable_85728AC, + .tileTag = GFXTAG_WAVEFORM, + .paletteTag = PALTAG_10, + .oam = &sOamData_Waveform, + .anims = sAnims_Waveform, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, @@ -1078,8 +1124,8 @@ static const struct SpriteTemplate sSpriteTemplate_Waveform = static const struct OamData sOamData_85728EC; static const struct SpriteTemplate gUnknown_085728D4 = { - .tileTag = TAG_TILE_12, - .paletteTag = TAG_PAL_DAC0, + .tileTag = GFXTAG_18, + .paletteTag = PALTAG_MON_ICON_0, .oam = &sOamData_85728EC, .anims = gDummySpriteAnimTable, .images = NULL, @@ -1125,8 +1171,7 @@ static const union AffineAnimCmd *const gSpriteAffineAnimTable_857291C[] = #include "data/wallpapers.h" -// Unknown Unused data. -static const u16 gUnknown_0857B07C = 0x23BA; +static const u16 sUnusedColor = RGB(26, 29, 8); static const struct SpriteSheet sSpriteSheet_Arrow = {sArrow_Gfx, 0x80, GFXTAG_ARROW}; @@ -1194,7 +1239,7 @@ static const union AnimCmd *const sAnims_Arrow[] = static const struct SpriteTemplate sSpriteTemplate_Arrow = { .tileTag = GFXTAG_ARROW, - .paletteTag = TAG_PAL_WAVEFORM, + .paletteTag = PALTAG_10, .oam = &sOamData_Arrow, .anims = sAnims_Arrow, .images = NULL, @@ -1206,7 +1251,6 @@ static const u16 gHandCursorPalette[] = INCBIN_U16("graphics/pokemon_storage/han static const u8 gHandCursorTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor.4bpp"); static const u8 gHandCursorShadowTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor_shadow.4bpp"); -// code void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero2, s32 bytesToBuffer) { s32 i, tileBytesToBuffer, remainingBytes; @@ -2015,14 +2059,14 @@ static void Cb_InitPSS(u8 taskId) if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { - sPSSData->markMenu.baseTileTag = TAG_TILE_D; - sPSSData->markMenu.basePaletteTag = TAG_PAL_DACE; + sPSSData->markMenu.baseTileTag = GFXTAG_13; + sPSSData->markMenu.basePaletteTag = PALTAG_14; InitMonMarkingsMenu(&sPSSData->markMenu); BufferMonMarkingsMenuTiles(); } else { - sub_80D0C60(); + CreateItemIconSprites(); sub_80CAEAC(); } break; @@ -2125,7 +2169,7 @@ static void Cb_MainPSS(u8 taskId) case INPUT_6: if (sPSSData->boxOption == OPTION_MOVE_MONS) { - if (IsMonBeingMoved() && ItemIsMail(sPSSData->cursorMonItem)) + if (IsMonBeingMoved() && ItemIsMail(sPSSData->cursorMonItemId)) sPSSData->state = 5; else SetPSSCallback(Cb_HidePartyPokemon); @@ -2183,7 +2227,7 @@ static void Cb_MainPSS(u8 taskId) case INPUT_11: if (!CanMovePartyMon()) { - if (ItemIsMail(sPSSData->cursorMonItem)) + if (ItemIsMail(sPSSData->cursorMonItemId)) { sPSSData->state = 5; } @@ -2348,14 +2392,14 @@ static void Cb_MainPSS(u8 taskId) } break; case 10: - if (!sub_80D1218()) + if (!IsItemIconAnimActive()) { SetUpScrollToBox(sPSSData->newCurrBoxId); sPSSData->state = 2; } break; case 11: - if (!sub_80D1218()) + if (!IsItemIconAnimActive()) sPSSData->state = 0; break; } @@ -2408,12 +2452,12 @@ static void Cb_OnSelectedMon(u8 taskId) switch (sPSSData->state) { case 0: - if (!sub_80CA2B8()) + if (!GetCursorMonMosaic()) { PlaySE(SE_SELECT); if (sPSSData->boxOption != OPTION_MOVE_ITEMS) PrintMessage(MSG_IS_SELECTED); - else if (IsActiveItemMoving() || sPSSData->cursorMonItem != 0) + else if (IsMovingItem() || sPSSData->cursorMonItemId != ITEM_NONE) PrintMessage(MSG_IS_SELECTED2); else PrintMessage(MSG_GIVE_TO_MON); @@ -2473,7 +2517,7 @@ static void Cb_OnSelectedMon(u8 taskId) { sPSSData->state = 3; } - else if (ItemIsMail(sPSSData->cursorMonItem)) + else if (ItemIsMail(sPSSData->cursorMonItemId)) { sPSSData->state = 4; } @@ -2493,7 +2537,7 @@ static void Cb_OnSelectedMon(u8 taskId) { sPSSData->state = 5; // Cannot release an Egg. } - else if (ItemIsMail(sPSSData->cursorMonItem)) + else if (ItemIsMail(sPSSData->cursorMonItemId)) { sPSSData->state = 4; } @@ -2678,7 +2722,7 @@ static void Cb_DepositMenu(u8 taskId) { case 0: PrintMessage(MSG_DEPOSIT_IN_WHICH_BOX); - LoadChooseBoxMenuGfx(&sPSSData->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, TAG_PAL_DAC7, 3, FALSE); + LoadChooseBoxMenuGfx(&sPSSData->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, PALTAG_7, 3, FALSE); CreateChooseBoxMenuSprites(sDepositBoxId); sPSSData->state++; break; @@ -2893,7 +2937,7 @@ static void Cb_TakeItemForMoving(u8 taskId) switch (sPSSData->state) { case 0: - if (!ItemIsMail(sPSSData->cursorMonItem)) + if (!ItemIsMail(sPSSData->cursorMonItemId)) { ClearBottomWindow(); sPSSData->state++; @@ -2909,7 +2953,7 @@ static void Cb_TakeItemForMoving(u8 taskId) sPSSData->state++; break; case 2: - if (!sub_80D1218()) + if (!IsItemIconAnimActive()) { sub_80CFE54(3); ClearBottomWindow(); @@ -2939,7 +2983,7 @@ static void Cb_GiveMovingItemToMon(u8 taskId) sPSSData->state++; break; case 2: - if (!sub_80D1218()) + if (!IsItemIconAnimActive()) { sub_80CFE54(0); sub_80CE00C(); @@ -2967,7 +3011,7 @@ static void Cb_ItemToBag(u8 taskId) switch (sPSSData->state) { case 0: - if (!AddBagItem(sPSSData->cursorMonItem, 1)) + if (!AddBagItem(sPSSData->cursorMonItemId, 1)) { PlaySE(SE_FAILURE); PrintMessage(MSG_BAG_FULL); @@ -2981,7 +3025,7 @@ static void Cb_ItemToBag(u8 taskId) } break; case 1: - if (!sub_80D1218()) + if (!IsItemIconAnimActive()) { PrintMessage(MSG_PLACED_IN_BAG); sPSSData->state = 2; @@ -3015,7 +3059,7 @@ static void Cb_SwitchSelectedItem(u8 taskId) switch (sPSSData->state) { case 0: - if (!ItemIsMail(sPSSData->cursorMonItem)) + if (!ItemIsMail(sPSSData->cursorMonItemId)) { ClearBottomWindow(); sPSSData->state++; @@ -3031,7 +3075,7 @@ static void Cb_SwitchSelectedItem(u8 taskId) sPSSData->state++; break; case 2: - if (!sub_80D1218()) + if (!IsItemIconAnimActive()) { sub_80CFE54(3); sub_80CE00C(); @@ -3067,12 +3111,12 @@ static void Cb_ShowItemInfo(u8 taskId) { PlaySE(SE_WIN_OPEN); PrintItemDescription(); - sub_80D1818(); + InitItemInfoWindow(); sPSSData->state++; } break; case 2: - if (!sub_80D184C()) + if (!UpdateItemInfoWindowSlideIn()) sPSSData->state++; break; case 3: @@ -3087,7 +3131,7 @@ static void Cb_ShowItemInfo(u8 taskId) } break; case 5: - if (!sub_80D18E4()) + if (!UpdateItemInfoWindowSlideOut()) sPSSData->state++; break; case 6: @@ -3111,12 +3155,12 @@ static void Cb_CloseBoxWhileHoldingItem(u8 taskId) switch (Menu_ProcessInputNoWrapClearOnChoose()) { case MENU_B_PRESSED: - case 1: + case 1: // No ClearBottomWindow(); SetPSSCallback(Cb_MainPSS); break; - case 0: - if (AddBagItem(sPSSData->movingItem, 1) == TRUE) + case 0:// Yes + if (AddBagItem(sPSSData->movingItemId, 1) == TRUE) { ClearBottomWindow(); sPSSData->state = 3; @@ -3141,7 +3185,7 @@ static void Cb_CloseBoxWhileHoldingItem(u8 taskId) sPSSData->state = 4; break; case 4: - if (!sub_80D1218()) + if (!IsItemIconAnimActive()) { sub_80CFE54(0); SetPSSCallback(Cb_MainPSS); @@ -3331,7 +3375,7 @@ static void Cb_JumpBox(u8 taskId) { case 0: PrintMessage(MSG_JUMP_TO_WHICH_BOX); - LoadChooseBoxMenuGfx(&sPSSData->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, TAG_PAL_DAC7, 3, FALSE); + LoadChooseBoxMenuGfx(&sPSSData->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, PALTAG_7, 3, FALSE); CreateChooseBoxMenuSprites(StorageGetCurrentBox()); sPSSData->state++; break; @@ -3441,7 +3485,7 @@ static void Cb_OnCloseBoxPressed(u8 taskId) PrintMessage(MSG_HOLDING_POKE); sPSSData->state = 1; } - else if (IsActiveItemMoving()) + else if (IsMovingItem()) { SetPSSCallback(Cb_CloseBoxWhileHoldingItem); } @@ -3502,7 +3546,7 @@ static void Cb_OnBPressed(u8 taskId) PrintMessage(MSG_HOLDING_POKE); sPSSData->state = 1; } - else if (IsActiveItemMoving()) + else if (IsMovingItem()) { SetPSSCallback(Cb_CloseBoxWhileHoldingItem); } @@ -3558,8 +3602,8 @@ static void Cb_ChangeScreen(u8 taskId) u8 mode, monIndex, maxMonIndex; u8 screenChangeType = sPSSData->screenChangeType; - if (sPSSData->boxOption == OPTION_MOVE_ITEMS && IsActiveItemMoving() == TRUE) - sMovingItemId = GetMovingItem(); + if (sPSSData->boxOption == OPTION_MOVE_ITEMS && IsMovingItem() == TRUE) + sMovingItemId = GetMovingItemId(); else sMovingItemId = ITEM_NONE; @@ -3671,32 +3715,32 @@ static void sub_80CA0D8(void) LoadPalette(gUnknown_0857243C, 0x30, 0x20); SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) | BGCNT_CHARBASE(1) | BGCNT_16COLOR | BGCNT_SCREENBASE(30)); - LoadCursorMonSprite(); - sub_80CA154(); - sub_80CA1C4(); + CreateCursorMonSprite(); + CreateMarkingComboSprite(); + CreateWaveformSprites(); RefreshCursorMonData(); } -static void sub_80CA154(void) +static void CreateMarkingComboSprite(void) { - sPSSData->field_D94 = CreateMonMarkingComboSprite(TAG_TILE_10, TAG_PAL_DAC8, NULL); - sPSSData->field_D94->oam.priority = 1; - sPSSData->field_D94->subpriority = 1; - sPSSData->field_D94->pos1.x = 40; - sPSSData->field_D94->pos1.y = 150; - sPSSData->field_DA0 = (void*) OBJ_VRAM0 + 32 * GetSpriteTileStartByTag(TAG_TILE_10); + sPSSData->markingComboSprite = CreateMonMarkingComboSprite(GFXTAG_MON_MARKING, PALTAG_MON_MARKING, NULL); + sPSSData->markingComboSprite->oam.priority = 1; + sPSSData->markingComboSprite->subpriority = 1; + sPSSData->markingComboSprite->pos1.x = 40; + sPSSData->markingComboSprite->pos1.y = 150; + sPSSData->markingComboTilesPtr = (void*) OBJ_VRAM0 + 32 * GetSpriteTileStartByTag(GFXTAG_MON_MARKING); } -static void sub_80CA1C4(void) +static void CreateWaveformSprites(void) { u16 i; - struct SpriteSheet sheet = gWaveformSpriteSheet; + struct SpriteSheet sheet = sSpriteSheet_Waveform; LoadSpriteSheet(&sheet); - for (i = 0; i < 2; i++) + for (i = 0; i < ARRAY_COUNT(sPSSData->waveformSprites); i++) { u8 spriteId = CreateSprite(&sSpriteTemplate_Waveform, i * 63 + 8, 9, 2); - sPSSData->field_D98[i] = &gSprites[spriteId]; + sPSSData->waveformSprites[i] = &gSprites[spriteId]; } } @@ -3704,7 +3748,7 @@ static void RefreshCursorMonData(void) { LoadCursorMonGfx(sPSSData->cursorMonSpecies, sPSSData->cursorMonPersonality); PrintCursorMonInfo(); - sub_80CA65C(); + UpdateWaveformAnimation(); ScheduleBgCopyTilemapToVram(0); } @@ -3721,7 +3765,7 @@ static void BoxSetMosaic(void) } } -static u8 sub_80CA2B8(void) +static u8 GetCursorMonMosaic(void) { return sPSSData->cursorMonSprite->oam.mosaic; } @@ -3739,20 +3783,20 @@ static void sub_80CA2D0(struct Sprite *sprite) } } -static void LoadCursorMonSprite(void) +static void CreateCursorMonSprite(void) { u16 i; u16 tileStart; u8 palSlot; u8 spriteId; - struct SpriteSheet sheet = {sPSSData->field_22C4, MON_PIC_SIZE, TAG_TILE_2}; - struct SpritePalette palette = {sPSSData->field_2244, TAG_PAL_DAC6}; + struct SpriteSheet sheet = {sPSSData->tileBuffer, MON_PIC_SIZE, GFXTAG_CURSOR_MON}; + struct SpritePalette palette = {sPSSData->cursorMonPalBuffer, PALTAG_CURSOR_MON}; struct SpriteTemplate template = sSpriteTemplate_CursorMon; for (i = 0; i < MON_PIC_SIZE; i++) - sPSSData->field_22C4[i] = 0; - for (i = 0; i < 0x10; i++) - sPSSData->field_2244[i] = 0; + sPSSData->tileBuffer[i] = 0; + for (i = 0; i < 16; i++) + sPSSData->cursorMonPalBuffer[i] = 0; sPSSData->cursorMonSprite = NULL; @@ -3771,14 +3815,14 @@ static void LoadCursorMonSprite(void) break; sPSSData->cursorMonSprite = &gSprites[spriteId]; - sPSSData->field_223A = palSlot * 16 + 0x100; - sPSSData->field_223C = (void*) OBJ_VRAM0 + tileStart * 32; + sPSSData->cursorMonPalOffset = palSlot * 16 + 0x100; + sPSSData->cursorMonTilePtr = (void*) OBJ_VRAM0 + tileStart * 32; } while (0); if (sPSSData->cursorMonSprite == NULL) { - FreeSpriteTilesByTag(TAG_TILE_2); - FreeSpritePaletteByTag(TAG_PAL_DAC6); + FreeSpriteTilesByTag(GFXTAG_CURSOR_MON); + FreeSpritePaletteByTag(PALTAG_CURSOR_MON); } } @@ -3789,10 +3833,10 @@ static void LoadCursorMonGfx(u16 species, u32 pid) if (species != SPECIES_NONE) { - LoadSpecialPokePic(&gMonFrontPicTable[species], sPSSData->field_22C4, species, pid, TRUE); - LZ77UnCompWram(sPSSData->cursorMonPalette, sPSSData->field_2244); - CpuCopy32(sPSSData->field_22C4, sPSSData->field_223C, MON_PIC_SIZE); - LoadPalette(sPSSData->field_2244, sPSSData->field_223A, 0x20); + LoadSpecialPokePic(&gMonFrontPicTable[species], sPSSData->tileBuffer, species, pid, TRUE); + LZ77UnCompWram(sPSSData->cursorMonPalette, sPSSData->cursorMonPalBuffer); + CpuCopy32(sPSSData->tileBuffer, sPSSData->cursorMonTilePtr, MON_PIC_SIZE); + LoadPalette(sPSSData->cursorMonPalBuffer, sPSSData->cursorMonPalOffset, 0x20); sPSSData->cursorMonSprite->invisible = FALSE; } else @@ -3822,30 +3866,33 @@ static void PrintCursorMonInfo(void) CopyWindowToVram(0, 2); if (sPSSData->cursorMonSpecies != SPECIES_NONE) { - UpdateMonMarkingTiles(sPSSData->cursorMonMarkings, sPSSData->field_DA0); - sPSSData->field_D94->invisible = FALSE; + UpdateMonMarkingTiles(sPSSData->cursorMonMarkings, sPSSData->markingComboTilesPtr); + sPSSData->markingComboSprite->invisible = FALSE; } else { - sPSSData->field_D94->invisible = TRUE; + sPSSData->markingComboSprite->invisible = TRUE; } } -static void sub_80CA65C(void) +// Turn the wave animation on the sides of "Pkmn Data" on/off +static void UpdateWaveformAnimation(void) { u16 i; if (sPSSData->cursorMonSpecies != SPECIES_NONE) { + // Start animation sub_80D27AC(0, 0, 0, 8, 2); - for (i = 0; i < 2; i++) - StartSpriteAnimIfDifferent(sPSSData->field_D98[i], i * 2 + 1); + for (i = 0; i < ARRAY_COUNT(sPSSData->waveformSprites); i++) + StartSpriteAnimIfDifferent(sPSSData->waveformSprites[i], i * 2 + 1); } else { + // Stop animation sub_80D27AC(0, 0, 2, 8, 2); - for (i = 0; i < 2; i++) - StartSpriteAnim(sPSSData->field_D98[i], i * 2); + for (i = 0; i < ARRAY_COUNT(sPSSData->waveformSprites); i++) + StartSpriteAnim(sPSSData->waveformSprites[i], i * 2); } sub_80D2918(0); @@ -4098,7 +4145,7 @@ static void PrintMessage(u8 id) DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->field_21E0); break; case MSG_FORMAT_ITEM_NAME: - if (IsActiveItemMoving()) + if (IsMovingItem()) txtPtr = StringCopy(sPSSData->itemName, GetMovingItemName()); else txtPtr = StringCopy(sPSSData->itemName, sPSSData->cursorMonItemName); @@ -4892,15 +4939,15 @@ static struct Sprite *CreateMonIconSprite(u16 species, u32 personality, s16 x, s { u16 tileNum; u8 spriteId; - struct SpriteTemplate tempalte = gUnknown_085728D4; + struct SpriteTemplate template = gUnknown_085728D4; species = GetIconSpecies(species, personality); - tempalte.paletteTag = 0xDAC0 + gMonIconPaletteIndices[species]; + template.paletteTag = PALTAG_MON_ICON_0 + gMonIconPaletteIndices[species]; tileNum = sub_80CC124(species); if (tileNum == 0xFFFF) return NULL; - spriteId = CreateSprite(&tempalte, x, y, subpriority); + spriteId = CreateSprite(&template, x, y, subpriority); if (spriteId == MAX_SPRITES) { sub_80CC1E0(species); @@ -5595,7 +5642,7 @@ static bool8 sub_80CD554(void) if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return FALSE; else - return sub_80D1218(); + return IsItemIconAnimActive(); } else if (--sPSSData->field_CD0 != 0) { @@ -5704,7 +5751,7 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) } else { - if (!IsActiveItemMoving()) + if (!IsMovingItem()) StartSpriteAnim(sPSSData->field_CB4, 1); } @@ -5763,7 +5810,7 @@ static void sub_80CDA68(void) } else { - if (!IsActiveItemMoving()) + if (!IsMovingItem()) StartSpriteAnim(sPSSData->field_CB4, 0); } @@ -6517,7 +6564,7 @@ static void SetCursorMonData(void *pokemon, u8 mode) u16 gender; bool8 sanityIsBadEgg; - sPSSData->cursorMonItem = 0; + sPSSData->cursorMonItemId = ITEM_NONE; gender = MON_MALE; sanityIsBadEgg = FALSE; if (mode == MODE_PARTY) @@ -6540,7 +6587,7 @@ static void SetCursorMonData(void *pokemon, u8 mode) sPSSData->cursorMonPersonality = GetMonData(mon, MON_DATA_PERSONALITY); sPSSData->cursorMonPalette = GetMonFrontSpritePal(mon); gender = GetMonGender(mon); - sPSSData->cursorMonItem = GetMonData(mon, MON_DATA_HELD_ITEM); + sPSSData->cursorMonItemId = GetMonData(mon, MON_DATA_HELD_ITEM); } } else if (mode == MODE_BOX) @@ -6565,13 +6612,13 @@ static void SetCursorMonData(void *pokemon, u8 mode) sPSSData->cursorMonPersonality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY); sPSSData->cursorMonPalette = GetMonSpritePalFromSpeciesAndPersonality(sPSSData->cursorMonSpecies, otId, sPSSData->cursorMonPersonality); gender = GetGenderFromSpeciesAndPersonality(sPSSData->cursorMonSpecies, sPSSData->cursorMonPersonality); - sPSSData->cursorMonItem = GetBoxMonData(boxMon, MON_DATA_HELD_ITEM); + sPSSData->cursorMonItemId = GetBoxMonData(boxMon, MON_DATA_HELD_ITEM); } } else { sPSSData->cursorMonSpecies = SPECIES_NONE; - sPSSData->cursorMonItem = 0; + sPSSData->cursorMonItemId = ITEM_NONE; } if (sPSSData->cursorMonSpecies == SPECIES_NONE) @@ -6642,8 +6689,8 @@ static void SetCursorMonData(void *pokemon, u8 mode) txtPtr[0] = CHAR_SPACE; txtPtr[1] = EOS; - if (sPSSData->cursorMonItem != 0) - StringCopyPadded(sPSSData->cursorMonItemName, ItemId_GetName(sPSSData->cursorMonItem), CHAR_SPACE, 8); + if (sPSSData->cursorMonItemId != ITEM_NONE) + StringCopyPadded(sPSSData->cursorMonItemName, ItemId_GetName(sPSSData->cursorMonItemId), CHAR_SPACE, 8); else StringFill(sPSSData->cursorMonItemName, CHAR_SPACE, 8); } @@ -7326,9 +7373,9 @@ static bool8 sub_80CFB44(void) if (sPSSData->cursorMonSpecies == SPECIES_EGG) return FALSE; - if (!IsActiveItemMoving()) + if (!IsMovingItem()) { - if (sPSSData->cursorMonItem == 0) + if (sPSSData->cursorMonItemId == ITEM_NONE) { if (sPSSData->cursorMonSpecies == SPECIES_NONE) return FALSE; @@ -7337,7 +7384,7 @@ static bool8 sub_80CFB44(void) } else { - if (!ItemIsMail(sPSSData->cursorMonItem)) + if (!ItemIsMail(sPSSData->cursorMonItemId)) { SetMenuText(MENU_TAKE); SetMenuText(MENU_BAG); @@ -7347,7 +7394,7 @@ static bool8 sub_80CFB44(void) } else { - if (sPSSData->cursorMonItem == 0) + if (sPSSData->cursorMonItemId == ITEM_NONE) { if (sPSSData->cursorMonSpecies == SPECIES_NONE) return FALSE; @@ -7356,7 +7403,7 @@ static bool8 sub_80CFB44(void) } else { - if (ItemIsMail(sPSSData->cursorMonItem) == TRUE) + if (ItemIsMail(sPSSData->cursorMonItemId) == TRUE) return FALSE; SetMenuText(MENU_SWITCH); @@ -7387,7 +7434,7 @@ static void sub_80CFC14(void) struct SpritePalette spritePalettes[] = { - {gHandCursorPalette, TAG_PAL_DAC7}, + {gHandCursorPalette, PALTAG_7}, {} }; @@ -7437,7 +7484,7 @@ static void sub_80CFC14(void) static const struct SpriteTemplate gSpriteTemplate_857BA50 = { .tileTag = TAG_TILE_0, - .paletteTag = TAG_PAL_WAVEFORM, + .paletteTag = PALTAG_10, .oam = &sOamData_857BA0C, .anims = sSpriteAnimTable_857BA40, .images = NULL, @@ -7448,7 +7495,7 @@ static void sub_80CFC14(void) static const struct SpriteTemplate gSpriteTemplate_857BA68 = { .tileTag = TAG_TILE_1, - .paletteTag = TAG_PAL_WAVEFORM, + .paletteTag = PALTAG_10, .oam = &sOamData_857BA14, .anims = gDummySpriteAnimTable, .images = NULL, @@ -7458,8 +7505,8 @@ static void sub_80CFC14(void) LoadSpriteSheets(spriteSheets); LoadSpritePalettes(spritePalettes); - sPSSData->field_CD8[0] = IndexOfSpritePaletteTag(TAG_PAL_WAVEFORM); - sPSSData->field_CD8[1] = IndexOfSpritePaletteTag(TAG_PAL_DAC7); + sPSSData->field_CD8[0] = IndexOfSpritePaletteTag(PALTAG_10); + sPSSData->field_CD8[1] = IndexOfSpritePaletteTag(PALTAG_7); sub_80CD444(sBoxCursorArea, sBoxCursorPosition, &x, &y); spriteId = CreateSprite(&gSpriteTemplate_857BA50, x, y, 6); @@ -8260,9 +8307,28 @@ static bool8 sub_80D0BC0(void) return TRUE; } -static const u32 gUnknown_0857BB24[] = INCBIN_U32("graphics/pokemon_storage/unknown_frame.4bpp"); +// The functions below handle new features of MOVE_ITEMS box option. +static bool32 IsItemIconAtPosition(u8, u8); +static const u32 *GetItemIconPic(u16); +static const u32 *GetItemIconPalette(u16); +static u8 GetNewItemIconIdx(void); +static void SetItemIconPosition(u8, u8, u8); +static void LoadItemIconGfx(u8, const u32 *, const u32 *); +static void SetItemIconAffineAnim(u8, u8); +static void SetItemIconActive(u8, bool8); +static u8 GetItemIconIdxByPosition(u8, u8); +static void SetItemIconCallback(u8, u8, u8, u8); +static void SpriteCB_ItemIcon_SetPosToCursor(struct Sprite *); +static void SpriteCB_ItemIcon_WaitAnim(struct Sprite *); +static void SpriteCB_ItemIcon_ToHand(struct Sprite *); +static void SpriteCB_ItemIcon_ToMon(struct Sprite *); +static void SpriteCB_ItemIcon_SwapToHand(struct Sprite *); +static void SpriteCB_ItemIcon_HideParty(struct Sprite *); +static void SpriteCB_ItemIcon_SwapToMon(struct Sprite *); -static const struct OamData sOamData_857BBA4 = +static const u32 sItemInfoFrame_Gfx[] = INCBIN_U32("graphics/pokemon_storage/item_info_frame.4bpp"); + +static const struct OamData sOamData_ItemIcon = { .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, @@ -8279,27 +8345,27 @@ static const struct OamData sOamData_857BBA4 = .affineParam = 0 }; -static const union AffineAnimCmd sSpriteAffineAnim_857BBAC[] = +static const union AffineAnimCmd sAffineAnim_ItemIcon_Small[] = { AFFINEANIMCMD_FRAME(128, 128, 0, 0), AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_857BBBC[] = +static const union AffineAnimCmd sAffineAnim_ItemIcon_Appear[] = { AFFINEANIMCMD_FRAME(88, 88, 0, 0), AFFINEANIMCMD_FRAME(5, 5, 0, 8), AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_857BBD4[] = +static const union AffineAnimCmd sAffineAnim_ItemIcon_Disappear[] = { AFFINEANIMCMD_FRAME(128, 128, 0, 0), AFFINEANIMCMD_FRAME(-5, -5, 0, 8), AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_857BBEC[] = +static const union AffineAnimCmd sAffineAnim_ItemIcon_PickUp[] = { AFFINEANIMCMD_FRAME(128, 128, 0, 0), AFFINEANIMCMD_FRAME(10, 10, 0, 12), @@ -8307,7 +8373,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_857BBEC[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_857BC0C[] = +static const union AffineAnimCmd sAffineAnim_ItemIcon_PutDown[] = { AFFINEANIMCMD_FRAME(256, 256, 0, 0), AFFINEANIMCMD_FRAME(-10, -10, 0, 12), @@ -8315,42 +8381,42 @@ static const union AffineAnimCmd sSpriteAffineAnim_857BC0C[] = AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_857BC2C[] = +static const union AffineAnimCmd sAffineAnim_ItemIcon_PutAway[] = { AFFINEANIMCMD_FRAME(256, 256, 0, 0), AFFINEANIMCMD_FRAME(-5, -5, 0, 16), AFFINEANIMCMD_END }; -static const union AffineAnimCmd sSpriteAffineAnim_857BC44[] = +static const union AffineAnimCmd sAffineAnim_ItemIcon_Large[] = { AFFINEANIMCMD_FRAME(256, 256, 0, 0), AFFINEANIMCMD_END }; -static const union AffineAnimCmd *const sSpriteAffineAnimTable_857BC44[] = +static const union AffineAnimCmd *const sAffineAnims_ItemIcon[] = { - sSpriteAffineAnim_857BBAC, - sSpriteAffineAnim_857BBBC, - sSpriteAffineAnim_857BBD4, - sSpriteAffineAnim_857BBEC, - sSpriteAffineAnim_857BC0C, - sSpriteAffineAnim_857BC2C, - sSpriteAffineAnim_857BC44 + [ITEM_ANIM_NONE] = sAffineAnim_ItemIcon_Small, + [ITEM_ANIM_APPEAR] = sAffineAnim_ItemIcon_Appear, + [ITEM_ANIM_DISAPPEAR] = sAffineAnim_ItemIcon_Disappear, + [ITEM_ANIM_PICK_UP] = sAffineAnim_ItemIcon_PickUp, + [ITEM_ANIM_PUT_DOWN] = sAffineAnim_ItemIcon_PutDown, + [ITEM_ANIM_PUT_AWAY] = sAffineAnim_ItemIcon_PutAway, + [ITEM_ANIM_LARGE] = sAffineAnim_ItemIcon_Large }; -static const struct SpriteTemplate gSpriteTemplate_857BC70 = +static const struct SpriteTemplate sSpriteTemplate_ItemIcon = { - .tileTag = TAG_TILE_7, - .paletteTag = TAG_PAL_DACB, - .oam = &sOamData_857BBA4, + .tileTag = GFXTAG_ITEM_ICON_0, + .paletteTag = PALTAG_ITEM_ICON_0, + .oam = &sOamData_ItemIcon, .anims = gDummySpriteAnimTable, .images = NULL, - .affineAnims = sSpriteAffineAnimTable_857BC44, + .affineAnims = sAffineAnims_ItemIcon, .callback = SpriteCallbackDummy, }; -static void sub_80D0C60(void) +static void CreateItemIconSprites(void) { s32 i; u8 spriteId; @@ -8359,55 +8425,38 @@ static void sub_80D0C60(void) if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { - spriteSheet.data = gUnknown_03000F78; + spriteSheet.data = sItemIconGfxBuffer; spriteSheet.size = 0x200; - spriteTemplate = gSpriteTemplate_857BC70; + spriteTemplate = sSpriteTemplate_ItemIcon; - for (i = 0; i < 3; i++) + for (i = 0; i < MAX_ITEM_ICONS; i++) { - spriteSheet.tag = TAG_TILE_7 + i; + spriteSheet.tag = GFXTAG_ITEM_ICON_0 + i; LoadCompressedSpriteSheet(&spriteSheet); - sPSSData->field_2204[i].tiles = GetSpriteTileStartByTag(spriteSheet.tag) * 32 + (void*)(OBJ_VRAM0); - sPSSData->field_2204[i].palIndex = AllocSpritePalette(TAG_PAL_DACB + i); - sPSSData->field_2204[i].palIndex *= 16; - sPSSData->field_2204[i].palIndex += 0x100; - spriteTemplate.tileTag = TAG_TILE_7 + i; - spriteTemplate.paletteTag = TAG_PAL_DACB + i; + sPSSData->itemIcons[i].tiles = GetSpriteTileStartByTag(spriteSheet.tag) * 32 + (void*)(OBJ_VRAM0); + sPSSData->itemIcons[i].palIndex = AllocSpritePalette(PALTAG_ITEM_ICON_0 + i); + sPSSData->itemIcons[i].palIndex *= 16; + sPSSData->itemIcons[i].palIndex += 0x100; + spriteTemplate.tileTag = GFXTAG_ITEM_ICON_0 + i; + spriteTemplate.paletteTag = PALTAG_ITEM_ICON_0 + i; spriteId = CreateSprite(&spriteTemplate, 0, 0, 11); - sPSSData->field_2204[i].sprite = &gSprites[spriteId]; - sPSSData->field_2204[i].sprite->invisible = TRUE; - sPSSData->field_2204[i].unk10 = 0; + sPSSData->itemIcons[i].sprite = &gSprites[spriteId]; + sPSSData->itemIcons[i].sprite->invisible = TRUE; + sPSSData->itemIcons[i].active = FALSE; } } - sPSSData->movingItem = 0; + sPSSData->movingItemId = ITEM_NONE; } -// The functions below handle new features of MOVE_ITEMS box option. -static bool32 sub_80D1324(u8 cursorArea, u8 cursorPos); -static const u32 *GetItemIconPic(u16 itemId); -static const u32 *GetItemIconPalette(u16 itemId); -static u8 sub_80D12E8(void); -static void sub_80D140C(u8 id, u8 cursorArea, u8 cursorPos); -static void sub_80D1524(u8 id, const u32 *itemTiles, const u32 *itemPal); -static void sub_80D15D4(u8 id, u8 animNum); -static void sub_80D1740(u8 id, bool8 arg1); -static u8 sub_80D1370(u8 cursorArea, u8 cursorPos); -static void sub_80D1604(u8 id, u8 arg1, u8 arg2, u8 arg3); -static void sub_80D1AD8(struct Sprite *sprite); -static void sub_80D1A48(struct Sprite *sprite); -static void sub_80D1A74(struct Sprite *sprite); -static void sub_80D1B14(struct Sprite *sprite); -static void sub_80D1B94(struct Sprite *sprite); -static void sub_80D1CCC(struct Sprite *sprite); -static void sub_80D1C30(struct Sprite *sprite); - static void sub_80D0D8C(u8 cursorArea, u8 cursorPos) { u16 heldItem; if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; - if (sub_80D1324(cursorArea, cursorPos)) + + // If we've already loaded the item here, stop + if (IsItemIconAtPosition(cursorArea, cursorPos)) return; switch (cursorArea) @@ -8426,16 +8475,16 @@ static void sub_80D0D8C(u8 cursorArea, u8 cursorPos) return; } - if (heldItem != 0) + if (heldItem != ITEM_NONE) { const u32 *tiles = GetItemIconPic(heldItem); const u32 *pal = GetItemIconPalette(heldItem); - u8 id = sub_80D12E8(); + u8 id = GetNewItemIconIdx(); - sub_80D140C(id, cursorArea, cursorPos); - sub_80D1524(id, tiles, pal); - sub_80D15D4(id, 1); - sub_80D1740(id, TRUE); + SetItemIconPosition(id, cursorArea, cursorPos); + LoadItemIconGfx(id, tiles, pal); + SetItemIconAffineAnim(id, ITEM_ANIM_APPEAR); + SetItemIconActive(id, TRUE); } } @@ -8446,79 +8495,78 @@ static void sub_80D0E50(u8 cursorArea, u8 cursorPos) if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; - id = sub_80D1370(cursorArea, cursorPos); - sub_80D15D4(id, 2); - sub_80D1604(id, 0, cursorArea, cursorPos); + id = GetItemIconIdxByPosition(cursorArea, cursorPos); + SetItemIconAffineAnim(id, ITEM_ANIM_DISAPPEAR); + SetItemIconCallback(id, ITEM_CB_WAIT_ANIM, cursorArea, cursorPos); } static void Item_FromMonToMoving(u8 cursorArea, u8 cursorPos) { u8 id; - u16 item; + u16 itemId; if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; - id = sub_80D1370(cursorArea, cursorPos); - item = 0; - sub_80D15D4(id, 3); - sub_80D1604(id, 1, cursorArea, cursorPos); - sub_80D140C(id, 2, 0); - if (cursorArea == CURSOR_AREA_IN_BOX) + id = GetItemIconIdxByPosition(cursorArea, cursorPos); + itemId = ITEM_NONE; + SetItemIconAffineAnim(id, ITEM_ANIM_PICK_UP); + SetItemIconCallback(id, ITEM_CB_TO_HAND, cursorArea, cursorPos); + SetItemIconPosition(id, CURSOR_AREA_IN_HAND, 0); + if (cursorArea == CURSOR_AREA_IN_BOX) { - SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &item); + SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &itemId); SetBoxMonIconObjMode(cursorPos, 1); } else { - SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &item); + SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &itemId); SetPartyMonIconObjMode(cursorPos, 1); } - sPSSData->movingItem = sPSSData->cursorMonItem; + sPSSData->movingItemId = sPSSData->cursorMonItemId; } -static void sub_80D0F38(u16 item) +static void sub_80D0F38(u16 itemId) { - const u32 *tiles = GetItemIconPic(item); - const u32 *pal = GetItemIconPalette(item); - u8 id = sub_80D12E8(); - - sub_80D1524(id, tiles, pal); - sub_80D15D4(id, 6); - sub_80D1604(id, 1, 0, 0); - sub_80D140C(id, 2, 0); - sub_80D1740(id, TRUE); - sPSSData->movingItem = item; + const u32 *tiles = GetItemIconPic(itemId); + const u32 *pal = GetItemIconPalette(itemId); + u8 id = GetNewItemIconIdx(); + LoadItemIconGfx(id, tiles, pal); + SetItemIconAffineAnim(id, ITEM_ANIM_LARGE); + SetItemIconCallback(id, ITEM_CB_TO_HAND, CURSOR_AREA_IN_BOX, 0); + SetItemIconPosition(id, CURSOR_AREA_IN_HAND, 0); + SetItemIconActive(id, TRUE); + sPSSData->movingItemId = itemId; } static void Item_SwitchMonsWithMoving(u8 cursorArea, u8 cursorPos) { u8 id; - u16 item; + u16 itemId; if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; - id = sub_80D1370(cursorArea, cursorPos); - sub_80D15D4(id, 3); - sub_80D1604(id, 3, 2, 0); + id = GetItemIconIdxByPosition(cursorArea, cursorPos); + SetItemIconAffineAnim(id, ITEM_ANIM_PICK_UP); + SetItemIconCallback(id, ITEM_CB_SWAP_TO_HAND, CURSOR_AREA_IN_HAND, 0); if (cursorArea == CURSOR_AREA_IN_BOX) { - item = GetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM); - SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sPSSData->movingItem); - sPSSData->movingItem = item; + itemId = GetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM); + SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sPSSData->movingItemId); + sPSSData->movingItemId = itemId; } else { - item = GetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM); - SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sPSSData->movingItem); - sPSSData->movingItem = item; + itemId = GetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM); + SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sPSSData->movingItemId); + sPSSData->movingItemId = itemId; } - id = sub_80D1370(2, 0); - sub_80D15D4(id, 4); - sub_80D1604(id, 4, cursorArea, cursorPos); + id = GetItemIconIdxByPosition(CURSOR_AREA_IN_HAND, 0); + SetItemIconAffineAnim(id, ITEM_ANIM_PUT_DOWN); + SetItemIconCallback(id, ITEM_CB_SWAP_TO_MON, cursorArea, cursorPos); } static void Item_GiveMovingToMon(u8 cursorArea, u8 cursorPos) @@ -8528,17 +8576,17 @@ static void Item_GiveMovingToMon(u8 cursorArea, u8 cursorPos) if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; - id = sub_80D1370(2, 0); - sub_80D15D4(id, 4); - sub_80D1604(id, 2, cursorArea, cursorPos); + id = GetItemIconIdxByPosition(CURSOR_AREA_IN_HAND, 0); + SetItemIconAffineAnim(id, ITEM_ANIM_PUT_DOWN); + SetItemIconCallback(id, ITEM_CB_TO_MON, cursorArea, cursorPos); if (cursorArea == CURSOR_AREA_IN_BOX) { - SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sPSSData->movingItem); + SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sPSSData->movingItemId); SetBoxMonIconObjMode(cursorPos, 0); } else { - SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sPSSData->movingItem); + SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sPSSData->movingItemId); SetPartyMonIconObjMode(cursorPos, 0); } } @@ -8552,10 +8600,10 @@ static void Item_TakeMons(u8 cursorArea, u8 cursorPos) return; item = 0; - id = sub_80D1370(cursorArea, cursorPos); - sub_80D15D4(id, 2); - sub_80D1604(id, 0, cursorArea, cursorPos); - if (cursorArea == CURSOR_AREA_IN_BOX) + id = GetItemIconIdxByPosition(cursorArea, cursorPos); + SetItemIconAffineAnim(id, ITEM_ANIM_DISAPPEAR); + SetItemIconCallback(id, ITEM_CB_WAIT_ANIM, cursorArea, cursorPos); + if (cursorArea == CURSOR_AREA_IN_BOX) { SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &item); SetBoxMonIconObjMode(cursorPos, 1); @@ -8571,9 +8619,9 @@ static void sub_80D1194(void) { if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { - u8 id = sub_80D1370(2, 0); - sub_80D15D4(id, 5); - sub_80D1604(id, 0, 2, 0); + u8 id = GetItemIconIdxByPosition(CURSOR_AREA_IN_HAND, 0); + SetItemIconAffineAnim(id, ITEM_ANIM_PUT_AWAY); + SetItemIconCallback(id, ITEM_CB_WAIT_ANIM, CURSOR_AREA_IN_HAND, 0); } } @@ -8584,122 +8632,120 @@ static void sub_80D11CC(void) if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; - for (i = 0; i < 3; i++) + for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->field_2204[i].unk10 && sPSSData->field_2204[i].unk8 == 1) - sub_80D1604(i, 7, 2, 0); + if (sPSSData->itemIcons[i].active + && sPSSData->itemIcons[i].cursorArea == CURSOR_AREA_IN_PARTY) + SetItemIconCallback(i, ITEM_CB_HIDE_PARTY, CURSOR_AREA_IN_HAND, 0); } } -static bool8 sub_80D1218(void) +static bool8 IsItemIconAnimActive(void) { s32 i; - for (i = 0; i < 3; i++) + for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->field_2204[i].unk10) + if (sPSSData->itemIcons[i].active) { - if (!sPSSData->field_2204[i].sprite->affineAnimEnded && sPSSData->field_2204[i].sprite->affineAnimBeginning) + if (!sPSSData->itemIcons[i].sprite->affineAnimEnded + && sPSSData->itemIcons[i].sprite->affineAnimBeginning) return TRUE; - if (sPSSData->field_2204[i].sprite->callback != SpriteCallbackDummy && sPSSData->field_2204[i].sprite->callback != sub_80D1AD8) + if (sPSSData->itemIcons[i].sprite->callback != SpriteCallbackDummy + && sPSSData->itemIcons[i].sprite->callback != SpriteCB_ItemIcon_SetPosToCursor) return TRUE; } } - return FALSE; } -static bool8 IsActiveItemMoving(void) +static bool8 IsMovingItem(void) { s32 i; if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { - for (i = 0; i < 3; i++) + for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->field_2204[i].unk10 && sPSSData->field_2204[i].unk8 == 2) + if (sPSSData->itemIcons[i].active + && sPSSData->itemIcons[i].cursorArea == CURSOR_AREA_IN_HAND) return TRUE; } } - return FALSE; } static const u8 *GetMovingItemName(void) { - return ItemId_GetName(sPSSData->movingItem); + return ItemId_GetName(sPSSData->movingItemId); } -static u16 GetMovingItem(void) +static u16 GetMovingItemId(void) { - return sPSSData->movingItem; + return sPSSData->movingItemId; } -static u8 sub_80D12E8(void) +static u8 GetNewItemIconIdx(void) { u8 i; - for (i = 0; i < 3; i++) + for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->field_2204[i].unk10 == 0) + if (!sPSSData->itemIcons[i].active) { - sPSSData->field_2204[i].unk10 = 1; + sPSSData->itemIcons[i].active = TRUE; return i; } } - - return 3; + return MAX_ITEM_ICONS; } -static bool32 sub_80D1324(u8 cursorArea, u8 cursorPos) +static bool32 IsItemIconAtPosition(u8 cursorArea, u8 cursorPos) { s32 i; - for (i = 0; i < 3; i++) + for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->field_2204[i].unk10 - && sPSSData->field_2204[i].unk8 == cursorArea - && sPSSData->field_2204[i].unk9 == cursorPos) + if (sPSSData->itemIcons[i].active + && sPSSData->itemIcons[i].cursorArea == cursorArea + && sPSSData->itemIcons[i].cursorPos == cursorPos) return TRUE; } - return FALSE; } -static u8 sub_80D1370(u8 cursorArea, u8 cursorPos) +static u8 GetItemIconIdxByPosition(u8 cursorArea, u8 cursorPos) { u8 i; - for (i = 0; i < 3; i++) + for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->field_2204[i].unk10 - && sPSSData->field_2204[i].unk8 == cursorArea - && sPSSData->field_2204[i].unk9 == cursorPos) + if (sPSSData->itemIcons[i].active + && sPSSData->itemIcons[i].cursorArea == cursorArea + && sPSSData->itemIcons[i].cursorPos == cursorPos) return i; } - - return 3; + return MAX_ITEM_ICONS; } -static u8 sub_80D13C4(struct Sprite *sprite) +static u8 GetItemIconIdxBySprite(struct Sprite *sprite) { u8 i; - for (i = 0; i < 3; i++) + for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->field_2204[i].unk10 - && sPSSData->field_2204[i].sprite == sprite) + if (sPSSData->itemIcons[i].active + && sPSSData->itemIcons[i].sprite == sprite) return i; } - - return 3; + return MAX_ITEM_ICONS; } -static void sub_80D140C(u8 id, u8 cursorArea, u8 cursorPos) +static void SetItemIconPosition(u8 id, u8 cursorArea, u8 cursorPos) { u8 row, column; - if (id >= 3) + if (id >= MAX_ITEM_ICONS) return; switch (cursorArea) @@ -8707,100 +8753,108 @@ static void sub_80D140C(u8 id, u8 cursorArea, u8 cursorPos) case CURSOR_AREA_IN_BOX: row = cursorPos % IN_BOX_ROWS; column = cursorPos / IN_BOX_ROWS; - sPSSData->field_2204[id].sprite->pos1.x = (24 * row) + 112; - sPSSData->field_2204[id].sprite->pos1.y = (24 * column) + 56; - sPSSData->field_2204[id].sprite->oam.priority = 2; + sPSSData->itemIcons[id].sprite->pos1.x = (24 * row) + 112; + sPSSData->itemIcons[id].sprite->pos1.y = (24 * column) + 56; + sPSSData->itemIcons[id].sprite->oam.priority = 2; break; case CURSOR_AREA_IN_PARTY: if (cursorPos == 0) { - sPSSData->field_2204[id].sprite->pos1.x = 116; - sPSSData->field_2204[id].sprite->pos1.y = 76; + sPSSData->itemIcons[id].sprite->pos1.x = 116; + sPSSData->itemIcons[id].sprite->pos1.y = 76; } else { - sPSSData->field_2204[id].sprite->pos1.x = 164; - sPSSData->field_2204[id].sprite->pos1.y = 24 * (cursorPos - 1) + 28; + sPSSData->itemIcons[id].sprite->pos1.x = 164; + sPSSData->itemIcons[id].sprite->pos1.y = 24 * (cursorPos - 1) + 28; } - sPSSData->field_2204[id].sprite->oam.priority = 1; + sPSSData->itemIcons[id].sprite->oam.priority = 1; break; } - sPSSData->field_2204[id].unk8 = cursorArea; - sPSSData->field_2204[id].unk9 = cursorPos; + sPSSData->itemIcons[id].cursorArea = cursorArea; + sPSSData->itemIcons[id].cursorPos = cursorPos; } -static void sub_80D1524(u8 id, const u32 *itemTiles, const u32 *itemPal) +static void LoadItemIconGfx(u8 id, const u32 *itemTiles, const u32 *itemPal) { s32 i; - if (id >= 3) + if (id >= MAX_ITEM_ICONS) return; CpuFastFill(0, sPSSData->field_42C4, 0x200); - LZ77UnCompWram(itemTiles, sPSSData->field_22C4); + LZ77UnCompWram(itemTiles, sPSSData->tileBuffer); for (i = 0; i < 3; i++) - CpuFastCopy(sPSSData->field_22C4 + (i * 0x60), sPSSData->field_42C4 + (i * 0x80), 0x60); + CpuFastCopy(&sPSSData->tileBuffer[i * 0x60], &sPSSData->field_42C4[i * 0x80], 0x60); - CpuFastCopy(sPSSData->field_42C4, sPSSData->field_2204[id].tiles, 0x200); + CpuFastCopy(sPSSData->field_42C4, sPSSData->itemIcons[id].tiles, 0x200); LZ77UnCompWram(itemPal, sPSSData->field_42C4); - LoadPalette(sPSSData->field_42C4, sPSSData->field_2204[id].palIndex, 0x20); + LoadPalette(sPSSData->field_42C4, sPSSData->itemIcons[id].palIndex, 0x20); } -static void sub_80D15D4(u8 id, u8 animNum) +static void SetItemIconAffineAnim(u8 id, u8 animNum) { - if (id >= 3) + if (id >= MAX_ITEM_ICONS) return; - StartSpriteAffineAnim(sPSSData->field_2204[id].sprite, animNum); + StartSpriteAffineAnim(sPSSData->itemIcons[id].sprite, animNum); } -static void sub_80D1604(u8 id, u8 arg1, u8 arg2, u8 arg3) +#define sItemIconId data[0] +#define sState data[0] +#define sCursorArea data[6] +#define sCursorPos data[7] + +static void SetItemIconCallback(u8 id, u8 callbackId, u8 cursorArea, u8 cursorPos) { - if (id >= 3) + if (id >= MAX_ITEM_ICONS) return; - switch (arg1) + switch (callbackId) { - case 0: - sPSSData->field_2204[id].sprite->data[0] = id; - sPSSData->field_2204[id].sprite->callback = sub_80D1A48; + case ITEM_CB_WAIT_ANIM: + sPSSData->itemIcons[id].sprite->sItemIconId = id; + sPSSData->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_WaitAnim; break; - case 1: - sPSSData->field_2204[id].sprite->data[0] = 0; - sPSSData->field_2204[id].sprite->callback = sub_80D1A74; + case ITEM_CB_TO_HAND: + sPSSData->itemIcons[id].sprite->sState = 0; + sPSSData->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_ToHand; break; - case 2: - sPSSData->field_2204[id].sprite->data[0] = 0; - sPSSData->field_2204[id].sprite->data[6] = arg2; - sPSSData->field_2204[id].sprite->data[7] = arg3; - sPSSData->field_2204[id].sprite->callback = sub_80D1B14; + case ITEM_CB_TO_MON: + sPSSData->itemIcons[id].sprite->sState = 0; + sPSSData->itemIcons[id].sprite->sCursorArea = cursorArea; + sPSSData->itemIcons[id].sprite->sCursorPos = cursorPos; + sPSSData->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_ToMon; break; - case 3: - sPSSData->field_2204[id].sprite->data[0] = 0; - sPSSData->field_2204[id].sprite->callback = sub_80D1B94; - sPSSData->field_2204[id].sprite->data[6] = arg2; - sPSSData->field_2204[id].sprite->data[7] = arg3; + case ITEM_CB_SWAP_TO_HAND: + sPSSData->itemIcons[id].sprite->sState = 0; + sPSSData->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_SwapToHand; + sPSSData->itemIcons[id].sprite->sCursorArea = cursorArea; + sPSSData->itemIcons[id].sprite->sCursorPos = cursorPos; break; - case 4: - sPSSData->field_2204[id].sprite->data[0] = 0; - sPSSData->field_2204[id].sprite->data[6] = arg2; - sPSSData->field_2204[id].sprite->data[7] = arg3; - sPSSData->field_2204[id].sprite->callback = sub_80D1C30; + case ITEM_CB_SWAP_TO_MON: + sPSSData->itemIcons[id].sprite->sState = 0; + sPSSData->itemIcons[id].sprite->sCursorArea = cursorArea; + sPSSData->itemIcons[id].sprite->sCursorPos = cursorPos; + sPSSData->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_SwapToMon; break; - case 7: - sPSSData->field_2204[id].sprite->callback = sub_80D1CCC; + case ITEM_CB_HIDE_PARTY: + // If cursor is on a Pokémon with a held item and + // the player closes the party menu, have the held + // item follow the Pokémon as the menu slides out + sPSSData->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_HideParty; break; } } -static void sub_80D1740(u8 id, bool8 arg1) +static void SetItemIconActive(u8 id, bool8 active) { - if (id >= 3) + if (id >= MAX_ITEM_ICONS) return; - sPSSData->field_2204[id].unk10 = arg1; - sPSSData->field_2204[id].sprite->invisible = (arg1 == FALSE); + sPSSData->itemIcons[id].active = active; + sPSSData->itemIcons[id].sprite->invisible = (active == FALSE); } static const u32 *GetItemIconPic(u16 itemId) @@ -8817,90 +8871,88 @@ static void PrintItemDescription(void) { const u8 *description; - if (IsActiveItemMoving()) - description = ItemId_GetDescription(sPSSData->movingItem); + if (IsMovingItem()) + description = ItemId_GetDescription(sPSSData->movingItemId); else - description = ItemId_GetDescription(sPSSData->cursorMonItem); + description = ItemId_GetDescription(sPSSData->cursorMonItemId); FillWindowPixelBuffer(2, PIXEL_FILL(1)); AddTextPrinterParameterized5(2, 1, description, 4, 0, 0, NULL, 0, 1); } -static void sub_80D1818(void) +static void InitItemInfoWindow(void) { - sPSSData->field_2236 = 0x15; - LoadBgTiles(0, gUnknown_0857BB24, 0x80, 0x13A); - sub_80D19B4(0); + sPSSData->itemInfoWindowOffset = 21; + LoadBgTiles(0, sItemInfoFrame_Gfx, 0x80, 0x13A); + DrawItemInfoWindow(0); } -static bool8 sub_80D184C(void) +static bool8 UpdateItemInfoWindowSlideIn(void) { - s32 i, var; + s32 i, pos; - if (sPSSData->field_2236 == 0) + if (sPSSData->itemInfoWindowOffset == 0) return FALSE; - sPSSData->field_2236--; - var = 0x15 - sPSSData->field_2236; - for (i = 0; i < var; i++) - { - WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + sPSSData->field_2236 + i, i, 13, 1, 7, 15, 21); - } + sPSSData->itemInfoWindowOffset--; + pos = 21 - sPSSData->itemInfoWindowOffset; + for (i = 0; i < pos; i++) + WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + sPSSData->itemInfoWindowOffset + i, i, 13, 1, 7, 15, 21); - sub_80D19B4(var); - return (sPSSData->field_2236 != 0); + DrawItemInfoWindow(pos); + return (sPSSData->itemInfoWindowOffset != 0); } -static bool8 sub_80D18E4(void) +static bool8 UpdateItemInfoWindowSlideOut(void) { - s32 i, var; + s32 i, pos; - if (sPSSData->field_2236 == 0x16) + if (sPSSData->itemInfoWindowOffset == 22) return FALSE; - if (sPSSData->field_2236 == 0) + if (sPSSData->itemInfoWindowOffset == 0) FillBgTilemapBufferRect(0, 0, 21, 12, 1, 9, 17); - sPSSData->field_2236++; - var = 0x15 - sPSSData->field_2236; - for (i = 0; i < var; i++) + sPSSData->itemInfoWindowOffset++; + pos = 21 - sPSSData->itemInfoWindowOffset; + for (i = 0; i < pos; i++) { - WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + sPSSData->field_2236 + i, i, 13, 1, 7, 15, 21); + WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + sPSSData->itemInfoWindowOffset + i, i, 13, 1, 7, 15, 21); } - if (var >= 0) - sub_80D19B4(var); + if (pos >= 0) + DrawItemInfoWindow(pos); - FillBgTilemapBufferRect(0, 0, var + 1, 12, 1, 9, 0x11); + FillBgTilemapBufferRect(0, 0, pos + 1, 12, 1, 9, 0x11); ScheduleBgCopyTilemapToVram(0); return TRUE; } -static void sub_80D19B4(u32 arg0) +static void DrawItemInfoWindow(u32 pos) { - if (arg0 != 0) + if (pos != 0) { - FillBgTilemapBufferRect(0, 0x13A, 0, 0xC, arg0, 1, 0xFu); - FillBgTilemapBufferRect(0, 0x93A, 0, 0x14, arg0, 1, 0xFu); + FillBgTilemapBufferRect(0, 0x13A, 0, 0xC, pos, 1, 0xFu); + FillBgTilemapBufferRect(0, 0x93A, 0, 0x14, pos, 1, 0xFu); } - FillBgTilemapBufferRect(0, 0x13B, arg0, 0xD, 1, 7, 0xFu); - FillBgTilemapBufferRect(0, 0x13C, arg0, 0xC, 1, 1, 0xFu); - FillBgTilemapBufferRect(0, 0x13D, arg0, 0x14, 1, 1, 0xFu); + FillBgTilemapBufferRect(0, 0x13B, pos, 0xD, 1, 7, 0xFu); + FillBgTilemapBufferRect(0, 0x13C, pos, 0xC, 1, 1, 0xFu); + FillBgTilemapBufferRect(0, 0x13D, pos, 0x14, 1, 1, 0xFu); ScheduleBgCopyTilemapToVram(0); } -static void sub_80D1A48(struct Sprite *sprite) +static void SpriteCB_ItemIcon_WaitAnim(struct Sprite *sprite) { if (sprite->affineAnimEnded) { - sub_80D1740(sprite->data[0], FALSE); + SetItemIconActive(sprite->sItemIconId, FALSE); sprite->callback = SpriteCallbackDummy; } } -static void sub_80D1A74(struct Sprite *sprite) +static void SpriteCB_ItemIcon_ToHand(struct Sprite *sprite) { - switch (sprite->data[0]) + switch (sprite->sState) { case 0: sprite->data[1] = sprite->pos1.x << 4; @@ -8908,28 +8960,28 @@ static void sub_80D1A74(struct Sprite *sprite) sprite->data[3] = 10; sprite->data[4] = 21; sprite->data[5] = 0; - sprite->data[0]++; + sprite->sState++; case 1: sprite->data[1] -= sprite->data[3]; sprite->data[2] -= sprite->data[4]; sprite->pos1.x = sprite->data[1] >> 4; sprite->pos1.y = sprite->data[2] >> 4; if (++sprite->data[5] > 11) - sprite->callback = sub_80D1AD8; + sprite->callback = SpriteCB_ItemIcon_SetPosToCursor; break; } } -static void sub_80D1AD8(struct Sprite *sprite) +static void SpriteCB_ItemIcon_SetPosToCursor(struct Sprite *sprite) { sprite->pos1.x = sPSSData->field_CB4->pos1.x + 4; sprite->pos1.y = sPSSData->field_CB4->pos1.y + sPSSData->field_CB4->pos2.y + 8; sprite->oam.priority = sPSSData->field_CB4->oam.priority; } -static void sub_80D1B14(struct Sprite *sprite) +static void SpriteCB_ItemIcon_ToMon(struct Sprite *sprite) { - switch (sprite->data[0]) + switch (sprite->sState) { case 0: sprite->data[1] = sprite->pos1.x << 4; @@ -8937,7 +8989,7 @@ static void sub_80D1B14(struct Sprite *sprite) sprite->data[3] = 10; sprite->data[4] = 21; sprite->data[5] = 0; - sprite->data[0]++; + sprite->sState++; case 1: sprite->data[1] += sprite->data[3]; sprite->data[2] += sprite->data[4]; @@ -8945,16 +8997,16 @@ static void sub_80D1B14(struct Sprite *sprite) sprite->pos1.y = sprite->data[2] >> 4; if (++sprite->data[5] > 11) { - sub_80D140C(sub_80D13C4(sprite), sprite->data[6], sprite->data[7]); + SetItemIconPosition(GetItemIconIdxBySprite(sprite), sprite->sCursorArea, sprite->sCursorPos); sprite->callback = SpriteCallbackDummy; } break; } } -static void sub_80D1B94(struct Sprite *sprite) +static void SpriteCB_ItemIcon_SwapToHand(struct Sprite *sprite) { - switch (sprite->data[0]) + switch (sprite->sState) { case 0: sprite->data[1] = sprite->pos1.x << 4; @@ -8962,7 +9014,7 @@ static void sub_80D1B94(struct Sprite *sprite) sprite->data[3] = 10; sprite->data[4] = 21; sprite->data[5] = 0; - sprite->data[0]++; + sprite->sState++; case 1: sprite->data[1] -= sprite->data[3]; sprite->data[2] -= sprite->data[4]; @@ -8971,17 +9023,17 @@ static void sub_80D1B94(struct Sprite *sprite) sprite->pos2.x = gSineTable[sprite->data[5] * 8] >> 4; if (++sprite->data[5] > 11) { - sub_80D140C(sub_80D13C4(sprite), sprite->data[6], sprite->data[7]); + SetItemIconPosition(GetItemIconIdxBySprite(sprite), sprite->sCursorArea, sprite->sCursorPos); sprite->pos2.x = 0; - sprite->callback = sub_80D1AD8; + sprite->callback = SpriteCB_ItemIcon_SetPosToCursor; } break; } } -static void sub_80D1C30(struct Sprite *sprite) +static void SpriteCB_ItemIcon_SwapToMon(struct Sprite *sprite) { - switch (sprite->data[0]) + switch (sprite->sState) { case 0: sprite->data[1] = sprite->pos1.x << 4; @@ -8989,7 +9041,7 @@ static void sub_80D1C30(struct Sprite *sprite) sprite->data[3] = 10; sprite->data[4] = 21; sprite->data[5] = 0; - sprite->data[0]++; + sprite->sState++; case 1: sprite->data[1] += sprite->data[3]; sprite->data[2] += sprite->data[4]; @@ -8998,7 +9050,7 @@ static void sub_80D1C30(struct Sprite *sprite) sprite->pos2.x = -(gSineTable[sprite->data[5] * 8] >> 4); if (++sprite->data[5] > 11) { - sub_80D140C(sub_80D13C4(sprite), sprite->data[6], sprite->data[7]); + SetItemIconPosition(GetItemIconIdxBySprite(sprite), sprite->sCursorArea, sprite->sCursorPos); sprite->callback = SpriteCallbackDummy; sprite->pos2.x = 0; } @@ -9006,22 +9058,27 @@ static void sub_80D1C30(struct Sprite *sprite) } } -static void sub_80D1CCC(struct Sprite *sprite) +static void SpriteCB_ItemIcon_HideParty(struct Sprite *sprite) { sprite->pos1.y -= 8; if (sprite->pos1.y + sprite->pos2.y < -16) { sprite->callback = SpriteCallbackDummy; - sub_80D1740(sub_80D13C4(sprite), FALSE); + SetItemIconActive(GetItemIconIdxBySprite(sprite), FALSE); } } -void nullsub_pss(void) +#undef sState +#undef sItemIconId +#undef sCursorArea +#undef sCursorPos + +static void ItemIconDummy_1(void) { } -void nullsub_98(void) +static void ItemIconDummy_2(void) { } From 3e804cb7d118bb2716c5ab7ffaa3f2b1ef699272 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 16 Apr 2021 00:58:54 -0400 Subject: [PATCH 46/63] document decoding buffer --- src/m4a_1.s | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/m4a_1.s b/src/m4a_1.s index d72336c18..62b913c86 100644 --- a/src/m4a_1.s +++ b/src/m4a_1.s @@ -678,7 +678,7 @@ sub_82DF758: ldr r1, [r4, o_SoundChannel_wav] add r2, r2, r1 add r2, r2, 0x10 - ldr r5, =gUnknown_03001300 + ldr r5, =gDecodingBuffer ldr r6, =gDeltaEncodingTable mov r7, 0x40 ldrb lr, [r2], 1 @@ -699,7 +699,7 @@ _081DD57C: subs r7, r7, 2 bgt _081DD568 _081DD594: - ldr r5, =gUnknown_03001300 + ldr r5, =gDecodingBuffer and r0, r3, 0x3F ldrsb r1, [r5, r0] pop {r0,r2,r5-r7,pc} @@ -1909,9 +1909,9 @@ _081DDD90: .align 2, 0 @ Don't pad with nop. .bss -gUnknown_03001300: +gDecodingBuffer: @ Used as a buffer for audio decoded from compressed DPCM .space 0x40 - .size gUnknown_03001300, .-gUnknown_03001300 + .size gDecodingBuffer, .-gDecodingBuffer .global gMPlayTrack_BGM gMPlayTrack_BGM: From e5f0d2f736ef4f1331430734e3c894cdbe4750b2 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 15 Apr 2021 23:27:05 -0400 Subject: [PATCH 47/63] Doc storage - releasing, some cursor --- src/pokemon.c | 6 +- src/pokemon_storage_system.c | 1196 ++++++++++++++++++---------------- 2 files changed, 625 insertions(+), 577 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 0b50a72f3..1d736be74 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3926,9 +3926,9 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) { u16 move = moves[i]; if (substruct1->moves[0] == move - || substruct1->moves[1] == move - || substruct1->moves[2] == move - || substruct1->moves[3] == move) + || substruct1->moves[1] == move + || substruct1->moves[2] == move + || substruct1->moves[3] == move) retVal |= gBitTable[i]; i++; } diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index bcf2d4075..f86a4bbbf 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -87,16 +87,16 @@ enum { MSG_CANT_STORE_MAIL, }; -// Formatting for the above messages +// IDs for how to resolve variables in the above messages enum { - MSG_FORMAT_NORMAL, - MSG_FORMAT_MON_NAME_1, - MSG_FORMAT_MON_NAME_2, // Unused - MSG_FORMAT_MON_NAME_3, // Unused - MSG_FORMAT_MON_NAME_4, - MSG_FORMAT_MON_NAME_5, // Unused - MSG_FORMAT_MON_NAME_6, - MSG_FORMAT_ITEM_NAME, + MSG_VAR_NONE, + MSG_VAR_MON_NAME_1, + MSG_VAR_MON_NAME_2, // Unused + MSG_VAR_MON_NAME_3, // Unused + MSG_VAR_RELEASE_MON_1, + MSG_VAR_RELEASE_MON_2, // Unused + MSG_VAR_RELEASE_MON_3, + MSG_VAR_ITEM_NAME, }; // IDs for menu selection items. See SetMenuText, HandleMenuInput, etc @@ -194,9 +194,15 @@ enum { CURSOR_AREA_BOX, CURSOR_AREA_BUTTONS, // Party Pokemon and Close Box }; - #define CURSOR_AREA_IN_HAND CURSOR_AREA_BOX // Alt name for cursor area used by Move Items +enum { + CURSOR_ANIM_BOUNCE, + CURSOR_ANIM_STILL, + CURSOR_ANIM_OPEN, + CURSOR_ANIM_FIST, +}; + // Special box ids for the choose box menu #define BOXID_NONE_CHOSEN 200 #define BOXID_CANCELED 201 @@ -205,24 +211,24 @@ enum { PALTAG_MON_ICON_0 = 56000, PALTAG_MON_ICON_1, // Used implicitly in CreateMonIconSprite PALTAG_MON_ICON_2, // Used implicitly in CreateMonIconSprite - PALTAG_3, - PALTAG_4, - PALTAG_5, - PALTAG_CURSOR_MON, + PALTAG_3, // Unused + PALTAG_4, // Unused + PALTAG_5, // Unused + PALTAG_DISPLAY_MON, PALTAG_7, - PALTAG_MON_MARKING, + PALTAG_MARKING_COMBO, PALTAG_BOX_TITLE, PALTAG_10, PALTAG_ITEM_ICON_0, PALTAG_ITEM_ICON_1, // Used implicitly in CreateItemIconSprites PALTAG_ITEM_ICON_2, // Used implicitly in CreateItemIconSprites - PALTAG_14, + PALTAG_MARKING_MENU, }; enum { - TAG_TILE_0, - TAG_TILE_1, - GFXTAG_CURSOR_MON, + GFXTAG_CURSOR, + GFXTAG_CURSOR_SHADOW, + GFXTAG_DISPLAY_MON, GFXTAG_BOX_TITLE, GFXTAG_BOX_TITLE_ALT, GFXTAG_WAVEFORM, @@ -232,15 +238,19 @@ enum { GFXTAG_ITEM_ICON_2, // Used implicitly in CreateItemIconSprites GFXTAG_CHOOSE_BOX_MENU, GFXTAG_CHOOSE_BOX_MENU_SIDES, // Used implicitly in LoadChooseBoxMenuGfx - GFXTAG_12, - GFXTAG_13, - GFXTAG_14, - GFXTAG_15, - GFXTAG_MON_MARKING, - GFXTAG_17, + GFXTAG_12, // Unused + GFXTAG_MARKING_MENU, + GFXTAG_14, // Unused + GFXTAG_15, // Unused + GFXTAG_MARKING_COMBO, + GFXTAG_17, // Unused GFXTAG_18, }; +// The maximum number of Pokémon icons that can appear on-screen. +// By default the limit is 40 (though in practice only 37 can be). +#define MAX_MON_ICONS (IN_BOX_COUNT + PARTY_SIZE + 1 >= 40 ? IN_BOX_COUNT + PARTY_SIZE + 1 : 40) + // The maximum number of item icons that can appear on-screen while // moving held items. 1 in the cursor, and 2 more while switching // between 2 Pokémon with held items @@ -269,6 +279,11 @@ enum { ITEM_CB_HIDE_PARTY, }; +enum { + RELEASE_ANIM_RELEASE, + RELEASE_ANIM_CAME_BACK, +}; + struct Wallpaper { const u32 *tiles; @@ -315,14 +330,14 @@ struct ChooseBoxMenu { struct Sprite *menuSprite; struct Sprite *menuSideSprites[4]; - u32 unk_0014[3]; + u32 unused1[3]; struct Sprite *arrowSprites[2]; - u8 filler_0028[0x214]; + u8 unused2[0x214]; bool32 loadedPalette; u16 tileTag; u16 paletteTag; u8 curBox; - u8 unk_0245; + u8 unused3; u8 subpriority; }; @@ -331,8 +346,8 @@ struct ItemIcon struct Sprite *sprite; u8 *tiles; u16 palIndex; - u8 cursorArea; - u8 cursorPos; + u8 area; + u8 pos; bool8 active; }; @@ -394,9 +409,9 @@ struct PokemonStorageSystemData struct Sprite *partySprites[PARTY_SIZE]; struct Sprite *boxMonsSprites[IN_BOX_COUNT]; struct Sprite **field_B00; - struct Sprite **field_B04; - u16 field_B08[40]; - u16 field_B58[40]; + struct Sprite **releaseMonSpritePtr; + u16 numIconsPerSpecies[MAX_MON_ICONS]; + u16 iconSpeciesList[MAX_MON_ICONS]; u16 boxSpecies[IN_BOX_COUNT]; u32 boxPersonalities[IN_BOX_COUNT]; u8 field_C5C; @@ -416,7 +431,7 @@ struct PokemonStorageSystemData u8 menuWidth; u8 field_CAE; // Written to, but never read. u16 menuWindowId; - struct Sprite *field_CB4; + struct Sprite *cursorSprite; struct Sprite *field_CB8; s32 field_CBC; s32 field_CC0; @@ -431,21 +446,21 @@ struct PokemonStorageSystemData u8 field_CD5; u8 field_CD6; u8 field_CD7; - u8 field_CD8[2]; - const u32 *cursorMonPalette; - u32 cursorMonPersonality; - u16 cursorMonSpecies; - u16 cursorMonItemId; + u8 cursorPalNums[2]; + const u32 *displayMonPalette; + u32 displayMonPersonality; + u16 displayMonSpecies; + u16 displayMonItemId; u16 field_CE8; bool8 setMosaic; - u8 cursorMonMarkings; - u8 cursorMonLevel; - bool8 cursorMonIsEgg; - u8 cursorMonNick[POKEMON_NAME_LENGTH + 1]; - u8 cursorMonNickText[36]; - u8 cursorMonSpeciesName[36]; - u8 cursorMonGenderLvlText[36]; - u8 cursorMonItemName[36]; + u8 displayMonMarkings; + u8 displayMonLevel; + bool8 displayMonIsEgg; + u8 displayMonName[POKEMON_NAME_LENGTH + 1]; + u8 displayMonNameText[36]; + u8 displayMonSpeciesName[36]; + u8 displayMonGenderLvlText[36]; + u8 displayMonItemName[36]; bool8 (*monPlaceChangeFunc)(void); u8 monPlaceChangeState; u8 field_D91; @@ -455,16 +470,16 @@ struct PokemonStorageSystemData struct MonMarkingsMenu markMenu; struct ChooseBoxMenu chooseBoxMenu; struct Pokemon movingMon; - struct Pokemon field_2108; - s8 field_216C; - u8 field_216D; - s8 field_216E; - s8 field_216F; - s8 field_2170; - s8 field_2171; - u16 field_2172; - u16 field_2174; - u16 field_2176[8]; + struct Pokemon tempMon; + s8 canReleaseMon; + bool8 releaseStatusResolved; + s8 releaseCheckBoxId; + s8 releaseCheckBoxPos; + s8 releaseBoxId; + s8 releaseBoxPos; + u16 releaseCheckState; + u16 restrictedReleaseMonMoves; + u16 restrictedMoveList[8]; u8 field_2186; u8 field_2187; u8 summaryScreenMode; @@ -475,7 +490,7 @@ struct PokemonStorageSystemData } field_218C; u8 field_2190[40]; u8 boxTitleText[40]; - u8 field_21E0[POKEMON_NAME_LENGTH + 1]; + u8 releaseMonName[POKEMON_NAME_LENGTH + 1]; u8 itemName[20]; u8 inBoxMovingMode; u16 field_2200; @@ -483,10 +498,10 @@ struct PokemonStorageSystemData u16 movingItemId; u16 itemInfoWindowOffset; u8 field_2238; // Unused - u16 cursorMonPalOffset; - u16 *cursorMonTilePtr; - struct Sprite *cursorMonSprite; - u16 cursorMonPalBuffer[0x40]; + u16 displayMonPalOffset; + u16 *displayMonTilePtr; + struct Sprite *displayMonSprite; + u16 displayMonPalBuffer[0x40]; u8 tileBuffer[0x800]; u8 field_2AC4[0x1800]; // Unused u8 field_42C4[0x800]; @@ -578,25 +593,25 @@ static void sub_80CAEAC(void); static void CreateItemIconSprites(void); static void sub_80CFEA8(void); static void sub_80CDC0C(void); -static void sub_80CAF04(void); +static void InitMonIconFields(void); static void sub_80CA0D8(void); static void AddMenu(void); -static void sub_80CE250(void); -static void InitCanRelaseMonVars(void); +static void InitReleaseMon(void); +static void InitCanReleaseMonVars(void); static void sub_80D01B8(void); static void ReleaseMon(void); -static void RefreshCursorMonData(void); -static void CreateCursorMonSprite(void); +static void RefreshDisplayMonData(void); +static void CreateDisplayMonSprite(void); static void CreateMarkingComboSprite(void); static void CreateWaveformSprites(void); -static void sub_80CC064(void); -static void sub_80CE324(void); +static void ReshowReleaseMon(void); +static void TrySetCursorFistAnim(void); static void ClearBottomWindow(void); static void sub_80CA704(void); static void RemoveMenu(void); static void sub_80CE00C(void); static void sub_80D1194(void); -static void PrintCursorMonInfo(void); +static void PrintDisplayMonInfo(void); static void UpdateWaveformAnimation(void); static void AddWallpaperSetsMenu(void); static void CreateBoxScrollArrows(void); @@ -625,15 +640,15 @@ static void sub_80CDA68(void); static void sub_80CB950(void); static void sub_80CA9C0(void); static void SetUpDoShowPartyMenu(void); -static void BoxSetMosaic(void); +static void StartDisplayMonMosaicEffect(void); static void SpriteCB_ChooseBoxArrow(struct Sprite *); -static void sub_80CC100(struct Sprite *); +static void SpriteCB_HeldMon(struct Sprite *); static void sub_80CB278(struct Sprite *); static void SpriteCB_Arrow(struct Sprite *); static bool32 WaitForWallpaperGfxLoad(void); static bool8 InitPSSWindows(void); -static bool8 sub_80CC0A0(void); -static bool8 sub_80CE2A8(void); +static bool8 ResetReleaseMonSpritePtr(void); +static bool8 TryHideReleaseMon(void); static bool8 sub_80D0164(void); static bool8 IsInitBoxActive(void); static bool8 sub_80D01E4(void); @@ -649,7 +664,7 @@ static bool8 HidePartyMenu(void); static bool8 IsMovingItem(void); static bool8 sub_80D0580(u8); static bool8 sub_80D0BC0(void); -static bool8 GetCursorMonMosaic(void); +static bool8 IsDisplayMosaicActive(void); static bool8 DoWallpaperGfxChange(void); static bool8 DoMonPlaceChange(void); static bool8 IsMenuLoading(void); @@ -692,7 +707,7 @@ static void Cb_NameBox(u8); static void Cb_PrintCantStoreMail(u8); static void Cb_HandleMovingMonFromParty(u8); static void SetUpScrollToBox(u8); -static void sub_80CFE54(u8); +static void StartCursorAnim(u8); static void SetMovingMonPriority(u8); static void InitMonPlaceChange(u8); static void SetMonMarkings(u8); @@ -714,8 +729,8 @@ static struct Sprite *CreateChooseBoxArrows(u16, u16, u8, u8, u8); static void SetWallpaperForCurrentBox(u8); static void AddWallpapersMenu(u8); static u16 GetMovingItemId(void); -static void LoadCursorMonGfx(u16, u32); -static void sub_80CA2D0(struct Sprite *); +static void LoadDisplayMonGfx(u16, u32); +static void SpriteCB_DisplayMonMosaic(struct Sprite *); static void SpriteCB_OutgoingBoxTitle(struct Sprite *); static void sub_80CBA3C(struct Sprite *); static void SpriteCB_IncomingBoxTitle(struct Sprite *); @@ -740,12 +755,12 @@ static bool8 MonPlaceChange_Move(void); static bool8 MonPlaceChange_Place(void); static bool8 sub_80CDEC4(void); static bool8 sub_80CDEB4(void); -static void sub_80CD444(u8, u8, u16 *, u16 *); +static void GetCursorCoordsByPos(u8, u8, u16 *, u16 *); static void SetShiftedMonData(u8, u8); static void SetMovedMonData(u8, u8); static void SetPlacedMonData(u8, u8); static void PurgeMonOrBoxMon(u8, u8); -static void SetCursorMonData(void *, u8); +static void SetDisplayMonData(void *, u8); static bool32 AtLeastThreeUsableMons(void); static u8 InBoxInput_Normal(void); static u8 InBoxInput_MovingMultiple(void); @@ -864,8 +879,8 @@ static const u8 sText_OutOf30[] = _("/30"); static const u16 sChooseBoxMenu_Pal[] = INCBIN_U16("graphics/pokemon_storage/box_selection_popup.gbapal"); static const u8 sChooseBoxMenuCenter_Gfx[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_center.4bpp"); static const u8 sChooseBoxMenuSides_Gfx[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_sides.4bpp"); -static const u32 gPokemonStorageScrollingBGTileset[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.4bpp.lz"); -static const u32 gPokemonStorageScrollingBGTilemap[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.bin.lz"); +static const u32 sScrollingBg_Gfx[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.4bpp.lz"); +static const u32 sScrollingBg_Tilemap[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.bin.lz"); static const u32 gUnknown_08572280[] = INCBIN_U32("graphics/unknown/unknown_572280.gbapal"); static const u32 gUnknown_085722A0[] = INCBIN_U32("graphics/unknown/unknown_5722A0.bin.lz"); @@ -895,14 +910,14 @@ static const u16 gUnknown_085724BC[] = 0x1143, 0x1144, 0x1144, 0x1145, 0x1153, 0x1154, 0x1154, 0x1155, 0x1163, 0x1164, 0x1164, 0x1165, }; -static const u16 gWaveformPalette[] = INCBIN_U16("graphics/pokemon_storage/waveform.gbapal"); -static const u32 gWaveformTiles[] = INCBIN_U32("graphics/pokemon_storage/waveform.4bpp"); +static const u16 sWaveform_Pal[] = INCBIN_U16("graphics/pokemon_storage/waveform.gbapal"); +static const u32 sWaveform_Gfx[] = INCBIN_U32("graphics/pokemon_storage/waveform.4bpp"); static const u32 gUnknown_085726B4[] = INCBIN_U32("graphics/unused/unknown_5726B4.gbapal"); static const u32 gUnknown_085726F4[] = INCBIN_U32("graphics/unknown/unknown_5726F4.gbapal"); -static const struct WindowTemplate gUnknown_08572714[] = +static const struct WindowTemplate sWindowTemplates[] = { - { // 0 + { .bg = 1, .tilemapLeft = 0, .tilemapTop = 11, @@ -911,7 +926,7 @@ static const struct WindowTemplate gUnknown_08572714[] = .paletteNum = 3, .baseBlock = 0xC0, }, - { // 1 + { .bg = 0, .tilemapLeft = 11, .tilemapTop = 17, @@ -920,7 +935,7 @@ static const struct WindowTemplate gUnknown_08572714[] = .paletteNum = 15, .baseBlock = 0x14, }, - { // 2 + { .bg = 0, .tilemapLeft = 0, .tilemapTop = 13, @@ -974,20 +989,20 @@ static const struct BgTemplate gUnknown_08572734[] = static const struct SpritePalette gWaveformSpritePalette = { - gWaveformPalette, PALTAG_10 + sWaveform_Pal, PALTAG_10 }; static const struct SpriteSheet sSpriteSheet_Waveform = { - gWaveformTiles, sizeof(gWaveformTiles), GFXTAG_WAVEFORM + sWaveform_Gfx, sizeof(sWaveform_Gfx), GFXTAG_WAVEFORM }; -static const struct OamData sOamData_CursorMon; -static const struct SpriteTemplate sSpriteTemplate_CursorMon = +static const struct OamData sOamData_DisplayMon; +static const struct SpriteTemplate sSpriteTemplate_DisplayMon = { - .tileTag = GFXTAG_CURSOR_MON, - .paletteTag = PALTAG_CURSOR_MON, - .oam = &sOamData_CursorMon, + .tileTag = GFXTAG_DISPLAY_MON, + .paletteTag = PALTAG_DISPLAY_MON, + .oam = &sOamData_DisplayMon, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, @@ -996,37 +1011,37 @@ static const struct SpriteTemplate sSpriteTemplate_CursorMon = static const struct StorageMessage sMessages[] = { - [MSG_EXIT_BOX] = {gText_ExitFromBox, MSG_FORMAT_NORMAL}, - [MSG_WHAT_YOU_DO] = {gText_WhatDoYouWantToDo, MSG_FORMAT_NORMAL}, - [MSG_PICK_A_THEME] = {gText_PleasePickATheme, MSG_FORMAT_NORMAL}, - [MSG_PICK_A_WALLPAPER] = {gText_PickTheWallpaper, MSG_FORMAT_NORMAL}, - [MSG_IS_SELECTED] = {gText_PkmnIsSelected, MSG_FORMAT_MON_NAME_1}, - [MSG_JUMP_TO_WHICH_BOX] = {gText_JumpToWhichBox, MSG_FORMAT_NORMAL}, - [MSG_DEPOSIT_IN_WHICH_BOX] = {gText_DepositInWhichBox, MSG_FORMAT_NORMAL}, - [MSG_WAS_DEPOSITED] = {gText_PkmnWasDeposited, MSG_FORMAT_MON_NAME_1}, - [MSG_BOX_IS_FULL] = {gText_BoxIsFull2, MSG_FORMAT_NORMAL}, - [MSG_RELEASE_POKE] = {gText_ReleaseThisPokemon, MSG_FORMAT_NORMAL}, - [MSG_WAS_RELEASED] = {gText_PkmnWasReleased, MSG_FORMAT_MON_NAME_4}, - [MSG_BYE_BYE] = {gText_ByeByePkmn, MSG_FORMAT_MON_NAME_6}, - [MSG_MARK_POKE] = {gText_MarkYourPkmn, MSG_FORMAT_NORMAL}, - [MSG_LAST_POKE] = {gText_ThatsYourLastPkmn, MSG_FORMAT_NORMAL}, - [MSG_PARTY_FULL] = {gText_YourPartysFull, MSG_FORMAT_NORMAL}, - [MSG_HOLDING_POKE] = {gText_YoureHoldingAPkmn, MSG_FORMAT_NORMAL}, - [MSG_WHICH_ONE_WILL_TAKE] = {gText_WhichOneWillYouTake, MSG_FORMAT_NORMAL}, - [MSG_CANT_RELEASE_EGG] = {gText_YouCantReleaseAnEgg, MSG_FORMAT_NORMAL}, - [MSG_CONTINUE_BOX] = {gText_ContinueBoxOperations, MSG_FORMAT_NORMAL}, - [MSG_CAME_BACK] = {gText_PkmnCameBack, MSG_FORMAT_MON_NAME_1}, - [MSG_WORRIED] = {gText_WasItWorriedAboutYou, MSG_FORMAT_NORMAL}, - [MSG_SURPRISE] = {gText_FourEllipsesExclamation, MSG_FORMAT_NORMAL}, - [MSG_PLEASE_REMOVE_MAIL] = {gText_PleaseRemoveTheMail, MSG_FORMAT_NORMAL}, - [MSG_IS_SELECTED2] = {gText_PkmnIsSelected, MSG_FORMAT_ITEM_NAME}, - [MSG_GIVE_TO_MON] = {gText_GiveToAPkmn, MSG_FORMAT_NORMAL}, - [MSG_PLACED_IN_BAG] = {gText_PlacedItemInBag, MSG_FORMAT_ITEM_NAME}, - [MSG_BAG_FULL] = {gText_BagIsFull2, MSG_FORMAT_NORMAL}, - [MSG_PUT_IN_BAG] = {gText_PutItemInBag, MSG_FORMAT_NORMAL}, - [MSG_ITEM_IS_HELD] = {gText_ItemIsNowHeld, MSG_FORMAT_ITEM_NAME}, - [MSG_CHANGED_TO_ITEM] = {gText_ChangedToNewItem, MSG_FORMAT_ITEM_NAME}, - [MSG_CANT_STORE_MAIL] = {gText_MailCantBeStored, MSG_FORMAT_NORMAL}, + [MSG_EXIT_BOX] = {gText_ExitFromBox, MSG_VAR_NONE}, + [MSG_WHAT_YOU_DO] = {gText_WhatDoYouWantToDo, MSG_VAR_NONE}, + [MSG_PICK_A_THEME] = {gText_PleasePickATheme, MSG_VAR_NONE}, + [MSG_PICK_A_WALLPAPER] = {gText_PickTheWallpaper, MSG_VAR_NONE}, + [MSG_IS_SELECTED] = {gText_PkmnIsSelected, MSG_VAR_MON_NAME_1}, + [MSG_JUMP_TO_WHICH_BOX] = {gText_JumpToWhichBox, MSG_VAR_NONE}, + [MSG_DEPOSIT_IN_WHICH_BOX] = {gText_DepositInWhichBox, MSG_VAR_NONE}, + [MSG_WAS_DEPOSITED] = {gText_PkmnWasDeposited, MSG_VAR_MON_NAME_1}, + [MSG_BOX_IS_FULL] = {gText_BoxIsFull2, MSG_VAR_NONE}, + [MSG_RELEASE_POKE] = {gText_ReleaseThisPokemon, MSG_VAR_NONE}, + [MSG_WAS_RELEASED] = {gText_PkmnWasReleased, MSG_VAR_RELEASE_MON_1}, + [MSG_BYE_BYE] = {gText_ByeByePkmn, MSG_VAR_RELEASE_MON_3}, + [MSG_MARK_POKE] = {gText_MarkYourPkmn, MSG_VAR_NONE}, + [MSG_LAST_POKE] = {gText_ThatsYourLastPkmn, MSG_VAR_NONE}, + [MSG_PARTY_FULL] = {gText_YourPartysFull, MSG_VAR_NONE}, + [MSG_HOLDING_POKE] = {gText_YoureHoldingAPkmn, MSG_VAR_NONE}, + [MSG_WHICH_ONE_WILL_TAKE] = {gText_WhichOneWillYouTake, MSG_VAR_NONE}, + [MSG_CANT_RELEASE_EGG] = {gText_YouCantReleaseAnEgg, MSG_VAR_NONE}, + [MSG_CONTINUE_BOX] = {gText_ContinueBoxOperations, MSG_VAR_NONE}, + [MSG_CAME_BACK] = {gText_PkmnCameBack, MSG_VAR_MON_NAME_1}, + [MSG_WORRIED] = {gText_WasItWorriedAboutYou, MSG_VAR_NONE}, + [MSG_SURPRISE] = {gText_FourEllipsesExclamation, MSG_VAR_NONE}, + [MSG_PLEASE_REMOVE_MAIL] = {gText_PleaseRemoveTheMail, MSG_VAR_NONE}, + [MSG_IS_SELECTED2] = {gText_PkmnIsSelected, MSG_VAR_ITEM_NAME}, + [MSG_GIVE_TO_MON] = {gText_GiveToAPkmn, MSG_VAR_NONE}, + [MSG_PLACED_IN_BAG] = {gText_PlacedItemInBag, MSG_VAR_ITEM_NAME}, + [MSG_BAG_FULL] = {gText_BagIsFull2, MSG_VAR_NONE}, + [MSG_PUT_IN_BAG] = {gText_PutItemInBag, MSG_VAR_NONE}, + [MSG_ITEM_IS_HELD] = {gText_ItemIsNowHeld, MSG_VAR_ITEM_NAME}, + [MSG_CHANGED_TO_ITEM] = {gText_ChangedToNewItem, MSG_VAR_ITEM_NAME}, + [MSG_CANT_STORE_MAIL] = {gText_MailCantBeStored, MSG_VAR_NONE}, }; static const struct WindowTemplate sYesNoWindowTemplate = @@ -1040,7 +1055,7 @@ static const struct WindowTemplate sYesNoWindowTemplate = .baseBlock = 0x5C, }; -static const struct OamData sOamData_CursorMon = +static const struct OamData sOamData_DisplayMon = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, @@ -1121,19 +1136,19 @@ static const struct SpriteTemplate sSpriteTemplate_Waveform = .callback = SpriteCallbackDummy, }; -static const struct OamData sOamData_85728EC; -static const struct SpriteTemplate gUnknown_085728D4 = +static const struct OamData sOamData_MonIcon; +static const struct SpriteTemplate sSpriteTemplate_MonIcon = { .tileTag = GFXTAG_18, .paletteTag = PALTAG_MON_ICON_0, - .oam = &sOamData_85728EC, + .oam = &sOamData_MonIcon, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }; -static const struct OamData sOamData_85728EC = +static const struct OamData sOamData_MonIcon = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, @@ -1150,23 +1165,23 @@ static const struct OamData sOamData_85728EC = .affineParam = 0 }; -static const union AffineAnimCmd gSpriteAffineAnim_85728F4[] = +static const union AffineAnimCmd sAffineAnim_ReleaseMon_Release[] = { AFFINEANIMCMD_FRAME(-2, -2, 0, 120), AFFINEANIMCMD_END }; -static const union AffineAnimCmd gSpriteAffineAnim_8572904[] = +static const union AffineAnimCmd sAffineAnim_ReleaseMon_CameBack[] = { AFFINEANIMCMD_FRAME(16, 16, 0, 0), AFFINEANIMCMD_FRAME(16, 16, 0, 15), AFFINEANIMCMD_END }; -static const union AffineAnimCmd *const gSpriteAffineAnimTable_857291C[] = +static const union AffineAnimCmd *const sAffineAnims_ReleaseMon[] = { - gSpriteAffineAnim_85728F4, - gSpriteAffineAnim_8572904 + [RELEASE_ANIM_RELEASE] = sAffineAnim_ReleaseMon_Release, + [RELEASE_ANIM_CAME_BACK] = sAffineAnim_ReleaseMon_CameBack }; #include "data/wallpapers.h" @@ -1247,9 +1262,9 @@ static const struct SpriteTemplate sSpriteTemplate_Arrow = .callback = SpriteCB_Arrow }; -static const u16 gHandCursorPalette[] = INCBIN_U16("graphics/pokemon_storage/hand_cursor.gbapal"); -static const u8 gHandCursorTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor.4bpp"); -static const u8 gHandCursorShadowTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor_shadow.4bpp"); +static const u16 sHandCursor_Pal[] = INCBIN_U16("graphics/pokemon_storage/hand_cursor.gbapal"); +static const u8 sHandCursor_Gfx[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor.4bpp"); +static const u8 sHandCursorShadow_Gfx[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor_shadow.4bpp"); void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero2, s32 bytesToBuffer) { @@ -2026,7 +2041,7 @@ static void Cb_InitPSS(u8 taskId) sub_80C7F1C(); break; case 4: - sub_80CAF04(); + InitMonIconFields(); if (!sPSSData->isReshowingPSS) sub_80CD36C(); else @@ -2059,8 +2074,8 @@ static void Cb_InitPSS(u8 taskId) if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { - sPSSData->markMenu.baseTileTag = GFXTAG_13; - sPSSData->markMenu.basePaletteTag = PALTAG_14; + sPSSData->markMenu.baseTileTag = GFXTAG_MARKING_MENU; + sPSSData->markMenu.basePaletteTag = PALTAG_MARKING_MENU; InitMonMarkingsMenu(&sPSSData->markMenu); BufferMonMarkingsMenuTiles(); } @@ -2169,7 +2184,7 @@ static void Cb_MainPSS(u8 taskId) case INPUT_6: if (sPSSData->boxOption == OPTION_MOVE_MONS) { - if (IsMonBeingMoved() && ItemIsMail(sPSSData->cursorMonItemId)) + if (IsMonBeingMoved() && ItemIsMail(sPSSData->displayMonItemId)) sPSSData->state = 5; else SetPSSCallback(Cb_HidePartyPokemon); @@ -2227,7 +2242,7 @@ static void Cb_MainPSS(u8 taskId) case INPUT_11: if (!CanMovePartyMon()) { - if (ItemIsMail(sPSSData->cursorMonItemId)) + if (ItemIsMail(sPSSData->displayMonItemId)) { sPSSData->state = 5; } @@ -2326,7 +2341,7 @@ static void Cb_MainPSS(u8 taskId) sub_80CA9EC(); if (sPSSData->setMosaic) - BoxSetMosaic(); + StartDisplayMonMosaicEffect(); sPSSData->state = 0; } break; @@ -2337,7 +2352,7 @@ static void Cb_MainPSS(u8 taskId) if (!sInPartyMenu && !IsMonBeingMoved()) { sub_80CE00C(); - BoxSetMosaic(); + StartDisplayMonMosaicEffect(); } if (sPSSData->boxOption == OPTION_MOVE_ITEMS) @@ -2387,7 +2402,7 @@ static void Cb_MainPSS(u8 taskId) if (!sub_80D01E4()) { if (sPSSData->setMosaic) - BoxSetMosaic(); + StartDisplayMonMosaicEffect(); sPSSData->state = 0; } break; @@ -2440,7 +2455,7 @@ static void Cb_HidePartyPokemon(u8 taskId) if (!sub_80CD554()) { if (sPSSData->setMosaic) - BoxSetMosaic(); + StartDisplayMonMosaicEffect(); SetPSSCallback(Cb_MainPSS); } break; @@ -2452,12 +2467,12 @@ static void Cb_OnSelectedMon(u8 taskId) switch (sPSSData->state) { case 0: - if (!GetCursorMonMosaic()) + if (!IsDisplayMosaicActive()) { PlaySE(SE_SELECT); if (sPSSData->boxOption != OPTION_MOVE_ITEMS) PrintMessage(MSG_IS_SELECTED); - else if (IsMovingItem() || sPSSData->cursorMonItemId != ITEM_NONE) + else if (IsMovingItem() || sPSSData->displayMonItemId != ITEM_NONE) PrintMessage(MSG_IS_SELECTED2); else PrintMessage(MSG_GIVE_TO_MON); @@ -2517,7 +2532,7 @@ static void Cb_OnSelectedMon(u8 taskId) { sPSSData->state = 3; } - else if (ItemIsMail(sPSSData->cursorMonItemId)) + else if (ItemIsMail(sPSSData->displayMonItemId)) { sPSSData->state = 4; } @@ -2533,11 +2548,11 @@ static void Cb_OnSelectedMon(u8 taskId) { sPSSData->state = 3; } - else if (sPSSData->cursorMonIsEgg) + else if (sPSSData->displayMonIsEgg) { sPSSData->state = 5; // Cannot release an Egg. } - else if (ItemIsMail(sPSSData->cursorMonItemId)) + else if (ItemIsMail(sPSSData->displayMonItemId)) { sPSSData->state = 4; } @@ -2655,7 +2670,7 @@ static void Cb_ShiftMon(u8 taskId) case 1: if (!DoMonPlaceChange()) { - BoxSetMosaic(); + StartDisplayMonMosaicEffect(); SetPSSCallback(Cb_MainPSS); } break; @@ -2764,7 +2779,7 @@ static void Cb_DepositMenu(u8 taskId) if (!sub_80CB9BC()) { sub_80CE22C(); - BoxSetMosaic(); + StartDisplayMonMosaicEffect(); sub_80CAB20(); SetPSSCallback(Cb_MainPSS); } @@ -2792,33 +2807,33 @@ static void Cb_ReleaseMon(u8 taskId) switch (Menu_ProcessInputNoWrapClearOnChoose()) { case MENU_B_PRESSED: - case 1: + case 1: // No ClearBottomWindow(); SetPSSCallback(Cb_MainPSS); break; - case 0: + case 0: // Yes ClearBottomWindow(); - InitCanRelaseMonVars(); - sub_80CE250(); + InitCanReleaseMonVars(); + InitReleaseMon(); sPSSData->state++; break; } break; case 2: RunCanReleaseMon(); - if (!sub_80CE2A8()) + if (!TryHideReleaseMon()) { while (1) { - s8 r0 = RunCanReleaseMon(); - if (r0 == 1) + s8 canRelease = RunCanReleaseMon(); + if (canRelease == TRUE) { sPSSData->state++; break; } - else if (r0 == 0) + else if (!canRelease) { - sPSSData->state = 8; // Can't release the mon. + sPSSData->state = 8; break; } } @@ -2826,7 +2841,7 @@ static void Cb_ReleaseMon(u8 taskId) break; case 3: ReleaseMon(); - RefreshCursorMonData(); + RefreshDisplayMonData(); PrintMessage(MSG_WAS_RELEASED); sPSSData->state++; break; @@ -2857,7 +2872,7 @@ static void Cb_ReleaseMon(u8 taskId) if (!sub_80CB9BC()) { sub_80CE00C(); - BoxSetMosaic(); + StartDisplayMonMosaicEffect(); sub_80CAB20(); sPSSData->state++; } @@ -2866,6 +2881,7 @@ static void Cb_ReleaseMon(u8 taskId) SetPSSCallback(Cb_MainPSS); break; case 8: + // Start "can't release" sequence PrintMessage(MSG_WAS_RELEASED); sPSSData->state++; break; @@ -2880,14 +2896,14 @@ static void Cb_ReleaseMon(u8 taskId) if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - sub_80CC064(); + ReshowReleaseMon(); sPSSData->state++; } break; case 11: - if (!sub_80CC0A0()) + if (!ResetReleaseMonSpritePtr()) { - sub_80CE324(); + TrySetCursorFistAnim(); PrintMessage(MSG_CAME_BACK); sPSSData->state++; } @@ -2915,8 +2931,8 @@ static void Cb_ShowMarkMenu(u8 taskId) { case 0: PrintMessage(MSG_MARK_POKE); - sPSSData->markMenu.markings = sPSSData->cursorMonMarkings; - OpenMonMarkingsMenu(sPSSData->cursorMonMarkings, 0xb0, 0x10); + sPSSData->markMenu.markings = sPSSData->displayMonMarkings; + OpenMonMarkingsMenu(sPSSData->displayMonMarkings, 0xb0, 0x10); sPSSData->state++; break; case 1: @@ -2925,7 +2941,7 @@ static void Cb_ShowMarkMenu(u8 taskId) FreeMonMarkingsMenu(); ClearBottomWindow(); SetMonMarkings(sPSSData->markMenu.markings); - RefreshCursorMonData(); + RefreshDisplayMonData(); SetPSSCallback(Cb_MainPSS); } break; @@ -2937,7 +2953,7 @@ static void Cb_TakeItemForMoving(u8 taskId) switch (sPSSData->state) { case 0: - if (!ItemIsMail(sPSSData->cursorMonItemId)) + if (!ItemIsMail(sPSSData->displayMonItemId)) { ClearBottomWindow(); sPSSData->state++; @@ -2948,17 +2964,17 @@ static void Cb_TakeItemForMoving(u8 taskId) } break; case 1: - sub_80CFE54(2); + StartCursorAnim(CURSOR_ANIM_OPEN); Item_FromMonToMoving((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); sPSSData->state++; break; case 2: if (!IsItemIconAnimActive()) { - sub_80CFE54(3); + StartCursorAnim(CURSOR_ANIM_FIST); ClearBottomWindow(); sub_80CE00C(); - PrintCursorMonInfo(); + PrintDisplayMonInfo(); sPSSData->state++; } break; @@ -2978,16 +2994,16 @@ static void Cb_GiveMovingItemToMon(u8 taskId) sPSSData->state++; break; case 1: - sub_80CFE54(2); + StartCursorAnim(CURSOR_ANIM_OPEN); Item_GiveMovingToMon((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); sPSSData->state++; break; case 2: if (!IsItemIconAnimActive()) { - sub_80CFE54(0); + StartCursorAnim(CURSOR_ANIM_BOUNCE); sub_80CE00C(); - PrintCursorMonInfo(); + PrintDisplayMonInfo(); PrintMessage(MSG_ITEM_IS_HELD); sPSSData->state++; } @@ -3011,7 +3027,7 @@ static void Cb_ItemToBag(u8 taskId) switch (sPSSData->state) { case 0: - if (!AddBagItem(sPSSData->cursorMonItemId, 1)) + if (!AddBagItem(sPSSData->displayMonItemId, 1)) { PlaySE(SE_FAILURE); PrintMessage(MSG_BAG_FULL); @@ -3036,7 +3052,7 @@ static void Cb_ItemToBag(u8 taskId) { ClearBottomWindow(); sub_80CE00C(); - PrintCursorMonInfo(); + PrintDisplayMonInfo(); sPSSData->state = 4; } break; @@ -3059,7 +3075,7 @@ static void Cb_SwitchSelectedItem(u8 taskId) switch (sPSSData->state) { case 0: - if (!ItemIsMail(sPSSData->cursorMonItemId)) + if (!ItemIsMail(sPSSData->displayMonItemId)) { ClearBottomWindow(); sPSSData->state++; @@ -3070,16 +3086,16 @@ static void Cb_SwitchSelectedItem(u8 taskId) } break; case 1: - sub_80CFE54(2); + StartCursorAnim(CURSOR_ANIM_OPEN); Item_SwitchMonsWithMoving((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); sPSSData->state++; break; case 2: if (!IsItemIconAnimActive()) { - sub_80CFE54(3); + StartCursorAnim(CURSOR_ANIM_FIST); sub_80CE00C(); - PrintCursorMonInfo(); + PrintDisplayMonInfo(); PrintMessage(MSG_CHANGED_TO_ITEM); sPSSData->state++; } @@ -3187,7 +3203,7 @@ static void Cb_CloseBoxWhileHoldingItem(u8 taskId) case 4: if (!IsItemIconAnimActive()) { - sub_80CFE54(0); + StartCursorAnim(CURSOR_ANIM_BOUNCE); SetPSSCallback(Cb_MainPSS); } break; @@ -3666,8 +3682,8 @@ static void FreePSSData(void) static void SetScrollingBackground(void) { SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) | BGCNT_CHARBASE(3) | BGCNT_16COLOR | BGCNT_SCREENBASE(31)); - DecompressAndLoadBgGfxUsingHeap(3, gPokemonStorageScrollingBGTileset, 0, 0, 0); - LZ77UnCompVram(gPokemonStorageScrollingBGTilemap, (void *)BG_SCREEN_ADDR(31)); + DecompressAndLoadBgGfxUsingHeap(3, sScrollingBg_Gfx, 0, 0, 0); + LZ77UnCompVram(sScrollingBg_Tilemap, (void *)BG_SCREEN_ADDR(31)); } static void ScrollBackground(void) @@ -3688,7 +3704,7 @@ static void LoadPSSMenuGfx(void) static bool8 InitPSSWindows(void) { - if (!InitWindows(gUnknown_08572714)) + if (!InitWindows(sWindowTemplates)) { return FALSE; } @@ -3715,20 +3731,20 @@ static void sub_80CA0D8(void) LoadPalette(gUnknown_0857243C, 0x30, 0x20); SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) | BGCNT_CHARBASE(1) | BGCNT_16COLOR | BGCNT_SCREENBASE(30)); - CreateCursorMonSprite(); + CreateDisplayMonSprite(); CreateMarkingComboSprite(); CreateWaveformSprites(); - RefreshCursorMonData(); + RefreshDisplayMonData(); } static void CreateMarkingComboSprite(void) { - sPSSData->markingComboSprite = CreateMonMarkingComboSprite(GFXTAG_MON_MARKING, PALTAG_MON_MARKING, NULL); + sPSSData->markingComboSprite = CreateMonMarkingComboSprite(GFXTAG_MARKING_COMBO, PALTAG_MARKING_COMBO, NULL); sPSSData->markingComboSprite->oam.priority = 1; sPSSData->markingComboSprite->subpriority = 1; sPSSData->markingComboSprite->pos1.x = 40; sPSSData->markingComboSprite->pos1.y = 150; - sPSSData->markingComboTilesPtr = (void*) OBJ_VRAM0 + 32 * GetSpriteTileStartByTag(GFXTAG_MON_MARKING); + sPSSData->markingComboTilesPtr = (void*) OBJ_VRAM0 + 32 * GetSpriteTileStartByTag(GFXTAG_MARKING_COMBO); } static void CreateWaveformSprites(void) @@ -3744,33 +3760,33 @@ static void CreateWaveformSprites(void) } } -static void RefreshCursorMonData(void) +static void RefreshDisplayMonData(void) { - LoadCursorMonGfx(sPSSData->cursorMonSpecies, sPSSData->cursorMonPersonality); - PrintCursorMonInfo(); + LoadDisplayMonGfx(sPSSData->displayMonSpecies, sPSSData->displayMonPersonality); + PrintDisplayMonInfo(); UpdateWaveformAnimation(); ScheduleBgCopyTilemapToVram(0); } -static void BoxSetMosaic(void) +static void StartDisplayMonMosaicEffect(void) { - RefreshCursorMonData(); - if (sPSSData->cursorMonSprite) + RefreshDisplayMonData(); + if (sPSSData->displayMonSprite) { - sPSSData->cursorMonSprite->oam.mosaic = TRUE; - sPSSData->cursorMonSprite->data[0] = 10; - sPSSData->cursorMonSprite->data[1] = 1; - sPSSData->cursorMonSprite->callback = sub_80CA2D0; - SetGpuReg(REG_OFFSET_MOSAIC, (sPSSData->cursorMonSprite->data[0] << 12) | (sPSSData->cursorMonSprite->data[0] << 8)); + sPSSData->displayMonSprite->oam.mosaic = TRUE; + sPSSData->displayMonSprite->data[0] = 10; + sPSSData->displayMonSprite->data[1] = 1; + sPSSData->displayMonSprite->callback = SpriteCB_DisplayMonMosaic; + SetGpuReg(REG_OFFSET_MOSAIC, (sPSSData->displayMonSprite->data[0] << 12) | (sPSSData->displayMonSprite->data[0] << 8)); } } -static u8 GetCursorMonMosaic(void) +static u8 IsDisplayMosaicActive(void) { - return sPSSData->cursorMonSprite->oam.mosaic; + return sPSSData->displayMonSprite->oam.mosaic; } -static void sub_80CA2D0(struct Sprite *sprite) +static void SpriteCB_DisplayMonMosaic(struct Sprite *sprite) { sprite->data[0] -= sprite->data[1]; if (sprite->data[0] < 0) @@ -3783,22 +3799,22 @@ static void sub_80CA2D0(struct Sprite *sprite) } } -static void CreateCursorMonSprite(void) +static void CreateDisplayMonSprite(void) { u16 i; u16 tileStart; u8 palSlot; u8 spriteId; - struct SpriteSheet sheet = {sPSSData->tileBuffer, MON_PIC_SIZE, GFXTAG_CURSOR_MON}; - struct SpritePalette palette = {sPSSData->cursorMonPalBuffer, PALTAG_CURSOR_MON}; - struct SpriteTemplate template = sSpriteTemplate_CursorMon; + struct SpriteSheet sheet = {sPSSData->tileBuffer, MON_PIC_SIZE, GFXTAG_DISPLAY_MON}; + struct SpritePalette palette = {sPSSData->displayMonPalBuffer, PALTAG_DISPLAY_MON}; + struct SpriteTemplate template = sSpriteTemplate_DisplayMon; for (i = 0; i < MON_PIC_SIZE; i++) sPSSData->tileBuffer[i] = 0; for (i = 0; i < 16; i++) - sPSSData->cursorMonPalBuffer[i] = 0; + sPSSData->displayMonPalBuffer[i] = 0; - sPSSData->cursorMonSprite = NULL; + sPSSData->displayMonSprite = NULL; do { @@ -3814,59 +3830,59 @@ static void CreateCursorMonSprite(void) if (spriteId == MAX_SPRITES) break; - sPSSData->cursorMonSprite = &gSprites[spriteId]; - sPSSData->cursorMonPalOffset = palSlot * 16 + 0x100; - sPSSData->cursorMonTilePtr = (void*) OBJ_VRAM0 + tileStart * 32; + sPSSData->displayMonSprite = &gSprites[spriteId]; + sPSSData->displayMonPalOffset = palSlot * 16 + 0x100; + sPSSData->displayMonTilePtr = (void*) OBJ_VRAM0 + tileStart * 32; } while (0); - if (sPSSData->cursorMonSprite == NULL) + if (sPSSData->displayMonSprite == NULL) { - FreeSpriteTilesByTag(GFXTAG_CURSOR_MON); - FreeSpritePaletteByTag(PALTAG_CURSOR_MON); + FreeSpriteTilesByTag(GFXTAG_DISPLAY_MON); + FreeSpritePaletteByTag(PALTAG_DISPLAY_MON); } } -static void LoadCursorMonGfx(u16 species, u32 pid) +static void LoadDisplayMonGfx(u16 species, u32 pid) { - if (sPSSData->cursorMonSprite == NULL) + if (sPSSData->displayMonSprite == NULL) return; if (species != SPECIES_NONE) { LoadSpecialPokePic(&gMonFrontPicTable[species], sPSSData->tileBuffer, species, pid, TRUE); - LZ77UnCompWram(sPSSData->cursorMonPalette, sPSSData->cursorMonPalBuffer); - CpuCopy32(sPSSData->tileBuffer, sPSSData->cursorMonTilePtr, MON_PIC_SIZE); - LoadPalette(sPSSData->cursorMonPalBuffer, sPSSData->cursorMonPalOffset, 0x20); - sPSSData->cursorMonSprite->invisible = FALSE; + LZ77UnCompWram(sPSSData->displayMonPalette, sPSSData->displayMonPalBuffer); + CpuCopy32(sPSSData->tileBuffer, sPSSData->displayMonTilePtr, MON_PIC_SIZE); + LoadPalette(sPSSData->displayMonPalBuffer, sPSSData->displayMonPalOffset, 0x20); + sPSSData->displayMonSprite->invisible = FALSE; } else { - sPSSData->cursorMonSprite->invisible = TRUE; + sPSSData->displayMonSprite->invisible = TRUE; } } -static void PrintCursorMonInfo(void) +static void PrintDisplayMonInfo(void) { FillWindowPixelBuffer(0, PIXEL_FILL(1)); if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { - AddTextPrinterParameterized(0, 1, sPSSData->cursorMonNickText, 6, 0, TEXT_SPEED_FF, NULL); - AddTextPrinterParameterized(0, 2, sPSSData->cursorMonSpeciesName, 6, 15, TEXT_SPEED_FF, NULL); - AddTextPrinterParameterized(0, 2, sPSSData->cursorMonGenderLvlText, 10, 29, TEXT_SPEED_FF, NULL); - AddTextPrinterParameterized(0, 0, sPSSData->cursorMonItemName, 6, 43, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 1, sPSSData->displayMonNameText, 6, 0, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 2, sPSSData->displayMonSpeciesName, 6, 15, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 2, sPSSData->displayMonGenderLvlText, 10, 29, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 0, sPSSData->displayMonItemName, 6, 43, TEXT_SPEED_FF, NULL); } else { - AddTextPrinterParameterized(0, 0, sPSSData->cursorMonItemName, 6, 0, TEXT_SPEED_FF, NULL); - AddTextPrinterParameterized(0, 1, sPSSData->cursorMonNickText, 6, 13, TEXT_SPEED_FF, NULL); - AddTextPrinterParameterized(0, 2, sPSSData->cursorMonSpeciesName, 6, 28, TEXT_SPEED_FF, NULL); - AddTextPrinterParameterized(0, 2, sPSSData->cursorMonGenderLvlText, 10, 42, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 0, sPSSData->displayMonItemName, 6, 0, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 1, sPSSData->displayMonNameText, 6, 13, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 2, sPSSData->displayMonSpeciesName, 6, 28, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 2, sPSSData->displayMonGenderLvlText, 10, 42, TEXT_SPEED_FF, NULL); } CopyWindowToVram(0, 2); - if (sPSSData->cursorMonSpecies != SPECIES_NONE) + if (sPSSData->displayMonSpecies != SPECIES_NONE) { - UpdateMonMarkingTiles(sPSSData->cursorMonMarkings, sPSSData->markingComboTilesPtr); + UpdateMonMarkingTiles(sPSSData->displayMonMarkings, sPSSData->markingComboTilesPtr); sPSSData->markingComboSprite->invisible = FALSE; } else @@ -3880,7 +3896,7 @@ static void UpdateWaveformAnimation(void) { u16 i; - if (sPSSData->cursorMonSpecies != SPECIES_NONE) + if (sPSSData->displayMonSpecies != SPECIES_NONE) { // Start animation sub_80D27AC(0, 0, 0, 8, 2); @@ -4039,7 +4055,7 @@ static void sub_80CAA74(void) for (i = 1; i < PARTY_SIZE; i++) { - s32 species = GetMonData(gPlayerParty + i, MON_DATA_SPECIES); + s32 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES); sub_80CAAA8(i, (species != SPECIES_NONE)); } } @@ -4098,7 +4114,7 @@ static bool8 DoShowPartyMenu(void) if (!sub_80CD554()) { if (sPSSData->setMosaic) - BoxSetMosaic(); + StartDisplayMonMosaicEffect(); sPSSData->showPartyMenuState++; } break; @@ -4132,23 +4148,23 @@ static void PrintMessage(u8 id) DynamicPlaceholderTextUtil_Reset(); switch (sMessages[id].format) { - case MSG_FORMAT_NORMAL: + case MSG_VAR_NONE: break; - case MSG_FORMAT_MON_NAME_1: - case MSG_FORMAT_MON_NAME_2: - case MSG_FORMAT_MON_NAME_3: - DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->cursorMonNick); + case MSG_VAR_MON_NAME_1: + case MSG_VAR_MON_NAME_2: + case MSG_VAR_MON_NAME_3: + DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->displayMonName); break; - case MSG_FORMAT_MON_NAME_4: - case MSG_FORMAT_MON_NAME_5: - case MSG_FORMAT_MON_NAME_6: - DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->field_21E0); + case MSG_VAR_RELEASE_MON_1: + case MSG_VAR_RELEASE_MON_2: + case MSG_VAR_RELEASE_MON_3: + DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->releaseMonName); break; - case MSG_FORMAT_ITEM_NAME: + case MSG_VAR_ITEM_NAME: if (IsMovingItem()) txtPtr = StringCopy(sPSSData->itemName, GetMovingItemName()); else - txtPtr = StringCopy(sPSSData->itemName, sPSSData->cursorMonItemName); + txtPtr = StringCopy(sPSSData->itemName, sPSSData->displayMonItemName); while (*(txtPtr - 1) == CHAR_SPACE) txtPtr--; @@ -4242,19 +4258,19 @@ static void sub_80CAEAC(void) if (sMovingItemId != ITEM_NONE) { sub_80D0F38(sMovingItemId); - sub_80CFE54(3); + StartCursorAnim(CURSOR_ANIM_FIST); } } -static void sub_80CAF04(void) +static void InitMonIconFields(void) { u16 i; LoadMonIconPalettes(); - for (i = 0; i < 40; i++) - sPSSData->field_B08[i] = 0; - for (i = 0; i < 40; i++) - sPSSData->field_B58[i] = 0; + for (i = 0; i < MAX_MON_ICONS; i++) + sPSSData->numIconsPerSpecies[i] = 0; + for (i = 0; i < MAX_MON_ICONS; i++) + sPSSData->iconSpeciesList[i] = SPECIES_NONE; for (i = 0; i < PARTY_SIZE; i++) sPSSData->partySprites[i] = NULL; for (i = 0; i < IN_BOX_COUNT; i++) @@ -4264,7 +4280,7 @@ static void sub_80CAF04(void) sPSSData->field_78C = 0; } -static u8 sub_80CAFAC(void) +static u8 GetMonIconPriorityByCursorPos(void) { return (IsCursorInBox() ? 2 : 1); } @@ -4273,10 +4289,10 @@ static void CreateMovingMonIcon(void) { u32 personality = GetMonData(&sPSSData->movingMon, MON_DATA_PERSONALITY); u16 species = GetMonData(&sPSSData->movingMon, MON_DATA_SPECIES2); - u8 priority = sub_80CAFAC(); + u8 priority = GetMonIconPriorityByCursorPos(); sPSSData->movingMonSprite = CreateMonIconSprite(species, personality, 0, 0, priority, 7); - sPSSData->movingMonSprite->callback = sub_80CC100; + sPSSData->movingMonSprite->callback = SpriteCB_HeldMon; } static void InitBoxMonSprites(u8 boxId) @@ -4744,8 +4760,8 @@ static void sub_80CBC14(u8 mode, u8 id) return; } - sPSSData->movingMonSprite->callback = sub_80CC100; - sPSSData->movingMonSprite->oam.priority = sub_80CAFAC(); + sPSSData->movingMonSprite->callback = SpriteCB_HeldMon; + sPSSData->movingMonSprite->oam.priority = GetMonIconPriorityByCursorPos(); sPSSData->movingMonSprite->subpriority = 7; } @@ -4796,7 +4812,7 @@ static bool8 sub_80CBDC4(void) { sPSSData->movingMonSprite->oam.priority = (*sPSSData->field_B00)->oam.priority; sPSSData->movingMonSprite->subpriority = (*sPSSData->field_B00)->subpriority; - (*sPSSData->field_B00)->oam.priority = sub_80CAFAC(); + (*sPSSData->field_B00)->oam.priority = GetMonIconPriorityByCursorPos(); (*sPSSData->field_B00)->subpriority = 7; } @@ -4806,76 +4822,77 @@ static bool8 sub_80CBDC4(void) sPSSData->movingMonSprite = (*sPSSData->field_B00); *sPSSData->field_B00 = sprite; - sPSSData->movingMonSprite->callback = sub_80CC100; + sPSSData->movingMonSprite->callback = SpriteCB_HeldMon; (*sPSSData->field_B00)->callback = SpriteCallbackDummy; } return TRUE; } -static void sub_80CBF14(u8 mode, u8 position) +static void SetReleaseMon(u8 mode, u8 position) { switch (mode) { case MODE_PARTY: - sPSSData->field_B04 = &sPSSData->partySprites[position]; + sPSSData->releaseMonSpritePtr = &sPSSData->partySprites[position]; break; case MODE_BOX: - sPSSData->field_B04 = &sPSSData->boxMonsSprites[position]; + sPSSData->releaseMonSpritePtr = &sPSSData->boxMonsSprites[position]; break; case MODE_MOVE: - sPSSData->field_B04 = &sPSSData->movingMonSprite; + sPSSData->releaseMonSpritePtr = &sPSSData->movingMonSprite; break; default: return; } - if (*sPSSData->field_B04 != NULL) + if (*sPSSData->releaseMonSpritePtr != NULL) { - InitSpriteAffineAnim(*sPSSData->field_B04); - (*sPSSData->field_B04)->oam.affineMode = ST_OAM_AFFINE_NORMAL; - (*sPSSData->field_B04)->affineAnims = gSpriteAffineAnimTable_857291C; - StartSpriteAffineAnim(*sPSSData->field_B04, 0); + InitSpriteAffineAnim(*sPSSData->releaseMonSpritePtr); + (*sPSSData->releaseMonSpritePtr)->oam.affineMode = ST_OAM_AFFINE_NORMAL; + (*sPSSData->releaseMonSpritePtr)->affineAnims = sAffineAnims_ReleaseMon; + StartSpriteAffineAnim(*sPSSData->releaseMonSpritePtr, RELEASE_ANIM_RELEASE); } } -static bool8 sub_80CBFD8(void) +static bool8 TryHideReleaseMonSprite(void) { - if (*sPSSData->field_B04 == NULL || (*sPSSData->field_B04)->invisible) + if (*sPSSData->releaseMonSpritePtr == NULL + || (*sPSSData->releaseMonSpritePtr)->invisible) return FALSE; - if ((*sPSSData->field_B04)->affineAnimEnded) - (*sPSSData->field_B04)->invisible = TRUE; + if ((*sPSSData->releaseMonSpritePtr)->affineAnimEnded) + (*sPSSData->releaseMonSpritePtr)->invisible = TRUE; return TRUE; } -static void sub_80CC020(void) +static void DestroyReleaseMonIcon(void) { - if (*sPSSData->field_B04 != NULL) + if (*sPSSData->releaseMonSpritePtr != NULL) { - FreeOamMatrix((*sPSSData->field_B04)->oam.matrixNum); - DestroyBoxMonIcon(*sPSSData->field_B04); - *sPSSData->field_B04 = NULL; + FreeOamMatrix((*sPSSData->releaseMonSpritePtr)->oam.matrixNum); + DestroyBoxMonIcon(*sPSSData->releaseMonSpritePtr); + *sPSSData->releaseMonSpritePtr = NULL; } } -static void sub_80CC064(void) +static void ReshowReleaseMon(void) { - if (*sPSSData->field_B04 != NULL) + if (*sPSSData->releaseMonSpritePtr != NULL) { - (*sPSSData->field_B04)->invisible = FALSE; - StartSpriteAffineAnim(*sPSSData->field_B04, 1); + (*sPSSData->releaseMonSpritePtr)->invisible = FALSE; + StartSpriteAffineAnim(*sPSSData->releaseMonSpritePtr, RELEASE_ANIM_CAME_BACK); } } -static bool8 sub_80CC0A0(void) +static bool8 ResetReleaseMonSpritePtr(void) { - if (sPSSData->field_B04 == NULL) + if (sPSSData->releaseMonSpritePtr == NULL) return FALSE; - if ((*sPSSData->field_B04)->affineAnimEnded) - sPSSData->field_B04 = NULL; + if ((*sPSSData->releaseMonSpritePtr)->affineAnimEnded) + sPSSData->releaseMonSpritePtr = NULL; return TRUE; } @@ -4885,51 +4902,57 @@ static void SetMovingMonPriority(u8 priority) sPSSData->movingMonSprite->oam.priority = priority; } -static void sub_80CC100(struct Sprite *sprite) +static void SpriteCB_HeldMon(struct Sprite *sprite) { - sprite->pos1.x = sPSSData->field_CB4->pos1.x; - sprite->pos1.y = sPSSData->field_CB4->pos1.y + sPSSData->field_CB4->pos2.y + 4; + sprite->pos1.x = sPSSData->cursorSprite->pos1.x; + sprite->pos1.y = sPSSData->cursorSprite->pos1.y + sPSSData->cursorSprite->pos2.y + 4; } -static u16 sub_80CC124(u16 species) +static u16 TryLoadMonIconTiles(u16 species) { - u16 i, var; + u16 i, offset; - for (i = 0; i < 40; i++) + // Search icon list for this species + for (i = 0; i < MAX_MON_ICONS; i++) { - if (sPSSData->field_B58[i] == species) + if (sPSSData->iconSpeciesList[i] == species) break; } - if (i == 40) + if (i == MAX_MON_ICONS) { - for (i = 0; i < 40; i++) + // Species not present in the list + // Find first empty spot in the list to put it + for (i = 0; i < MAX_MON_ICONS; i++) { - if (sPSSData->field_B58[i] == 0) + if (sPSSData->iconSpeciesList[i] == 0) break; } - if (i == 40) + + // Failed to find an empty spot + if (i == MAX_MON_ICONS) return 0xFFFF; } - sPSSData->field_B58[i] = species; - sPSSData->field_B08[i]++; - var = 16 * i; - CpuCopy32(GetMonIconTiles(species, TRUE), (void*)(OBJ_VRAM0) + var * 32, 0x200); + // Add species to icon list and load tiles + sPSSData->iconSpeciesList[i] = species; + sPSSData->numIconsPerSpecies[i]++; + offset = 16 * i; + CpuCopy32(GetMonIconTiles(species, TRUE), (void*)(OBJ_VRAM0) + offset * 32, 0x200); - return var; + return offset; } -static void sub_80CC1E0(u16 species) +static void RemoveSpeciesFromIconList(u16 species) { u16 i; - for (i = 0; i < 40; i++) + for (i = 0; i < MAX_MON_ICONS; i++) { - if (sPSSData->field_B58[i] == species) + if (sPSSData->iconSpeciesList[i] == species) { - if (--sPSSData->field_B08[i] == 0) - sPSSData->field_B58[i] = 0; + if (--sPSSData->numIconsPerSpecies[i] == 0) + sPSSData->iconSpeciesList[i] = SPECIES_NONE; break; } } @@ -4939,18 +4962,18 @@ static struct Sprite *CreateMonIconSprite(u16 species, u32 personality, s16 x, s { u16 tileNum; u8 spriteId; - struct SpriteTemplate template = gUnknown_085728D4; + struct SpriteTemplate template = sSpriteTemplate_MonIcon; species = GetIconSpecies(species, personality); template.paletteTag = PALTAG_MON_ICON_0 + gMonIconPaletteIndices[species]; - tileNum = sub_80CC124(species); + tileNum = TryLoadMonIconTiles(species); if (tileNum == 0xFFFF) return NULL; spriteId = CreateSprite(&template, x, y, subpriority); if (spriteId == MAX_SPRITES) { - sub_80CC1E0(species); + RemoveSpeciesFromIconList(species); return NULL; } @@ -4962,7 +4985,7 @@ static struct Sprite *CreateMonIconSprite(u16 species, u32 personality, s16 x, s static void DestroyBoxMonIcon(struct Sprite *sprite) { - sub_80CC1E0(sprite->data[0]); + RemoveSpeciesFromIconList(sprite->data[0]); DestroySprite(sprite); } @@ -5580,7 +5603,7 @@ static void sub_80CD3EC(void) } } -static void sub_80CD444(u8 cursorArea, u8 cursorPosition, u16 *x, u16 *y) +static void GetCursorCoordsByPos(u8 cursorArea, u8 cursorPosition, u16 *x, u16 *y) { switch (cursorArea) { @@ -5591,36 +5614,36 @@ static void sub_80CD444(u8 cursorArea, u8 cursorPosition, u16 *x, u16 *y) case CURSOR_AREA_IN_PARTY: if (cursorPosition == 0) { - *x = 0x68; - *y = 0x34; + *x = 104; + *y = 52; } else if (cursorPosition == PARTY_SIZE) { - *x = 0x98; - *y = 0x84; + *x = 152; + *y = 132; } else { - *x = 0x98; + *x = 152; *y = (cursorPosition - 1) * 24 + 4; } break; case CURSOR_AREA_BOX: - *x = 0xa2; - *y = 0x0c; + *x = 162; + *y = 12; break; case CURSOR_AREA_BUTTONS: *y = sIsMonBeingMoved ? 8 : 14; - *x = cursorPosition * 0x58 + 0x78; + *x = cursorPosition * 88 + 120; break; case 4: - *x = 0xa0; - *y = 0x60; + *x = 160; + *y = 96; break; } } -static u16 sub_80CD504(void) +static u16 GetSpeciesAtCursorPosition(void) { switch (sBoxCursorArea) { @@ -5648,35 +5671,35 @@ static bool8 sub_80CD554(void) { sPSSData->field_CBC += sPSSData->field_CC4; sPSSData->field_CC0 += sPSSData->field_CC8; - sPSSData->field_CB4->pos1.x = sPSSData->field_CBC >> 8; - sPSSData->field_CB4->pos1.y = sPSSData->field_CC0 >> 8; - if (sPSSData->field_CB4->pos1.x > DISPLAY_WIDTH + 16) + sPSSData->cursorSprite->pos1.x = sPSSData->field_CBC >> 8; + sPSSData->cursorSprite->pos1.y = sPSSData->field_CC0 >> 8; + if (sPSSData->cursorSprite->pos1.x > DISPLAY_WIDTH + 16) { - tmp = sPSSData->field_CB4->pos1.x - (DISPLAY_WIDTH + 16); - sPSSData->field_CB4->pos1.x = tmp + 64; + tmp = sPSSData->cursorSprite->pos1.x - (DISPLAY_WIDTH + 16); + sPSSData->cursorSprite->pos1.x = tmp + 64; } - if (sPSSData->field_CB4->pos1.x < 64) + if (sPSSData->cursorSprite->pos1.x < 64) { - tmp = 64 - sPSSData->field_CB4->pos1.x; - sPSSData->field_CB4->pos1.x = DISPLAY_WIDTH + 16 - tmp; + tmp = 64 - sPSSData->cursorSprite->pos1.x; + sPSSData->cursorSprite->pos1.x = DISPLAY_WIDTH + 16 - tmp; } - if (sPSSData->field_CB4->pos1.y > DISPLAY_HEIGHT + 16) + if (sPSSData->cursorSprite->pos1.y > DISPLAY_HEIGHT + 16) { - tmp = sPSSData->field_CB4->pos1.y - (DISPLAY_HEIGHT + 16); - sPSSData->field_CB4->pos1.y = tmp - 16; + tmp = sPSSData->cursorSprite->pos1.y - (DISPLAY_HEIGHT + 16); + sPSSData->cursorSprite->pos1.y = tmp - 16; } - if (sPSSData->field_CB4->pos1.y < -16) + if (sPSSData->cursorSprite->pos1.y < -16) { - tmp = -16 - sPSSData->field_CB4->pos1.y; - sPSSData->field_CB4->pos1.y = DISPLAY_HEIGHT + 16 - tmp; + tmp = -16 - sPSSData->cursorSprite->pos1.y; + sPSSData->cursorSprite->pos1.y = DISPLAY_HEIGHT + 16 - tmp; } if (sPSSData->field_CD7 && --sPSSData->field_CD7 == 0) - sPSSData->field_CB4->vFlip = (sPSSData->field_CB4->vFlip == FALSE); + sPSSData->cursorSprite->vFlip = (sPSSData->cursorSprite->vFlip == FALSE); } else { - sPSSData->field_CB4->pos1.x = sPSSData->field_CCC; - sPSSData->field_CB4->pos1.y = sPSSData->field_CCE; + sPSSData->cursorSprite->pos1.x = sPSSData->field_CCC; + sPSSData->cursorSprite->pos1.y = sPSSData->field_CCE; sub_80CDA68(); } @@ -5687,7 +5710,7 @@ static void sub_80CD6AC(u8 newCursorArea, u8 newCursorPosition) { u16 x, y; - sub_80CD444(newCursorArea, newCursorPosition, &x, &y); + GetCursorCoordsByPos(newCursorArea, newCursorPosition, &x, &y); sPSSData->field_CD4 = newCursorArea; sPSSData->field_CD5 = newCursorPosition; sPSSData->field_CCC = x; @@ -5709,26 +5732,26 @@ static void sub_80CD70C(void) switch (sPSSData->field_CD2) { default: - r7 = sPSSData->field_CCE - sPSSData->field_CB4->pos1.y; + r7 = sPSSData->field_CCE - sPSSData->cursorSprite->pos1.y; break; case -1: - r7 = sPSSData->field_CCE - 0xc0 - sPSSData->field_CB4->pos1.y; + r7 = sPSSData->field_CCE - 0xc0 - sPSSData->cursorSprite->pos1.y; break; case 1: - r7 = sPSSData->field_CCE + 0xc0 - sPSSData->field_CB4->pos1.y; + r7 = sPSSData->field_CCE + 0xc0 - sPSSData->cursorSprite->pos1.y; break; } switch (sPSSData->field_CD3) { default: - r0 = sPSSData->field_CCC - sPSSData->field_CB4->pos1.x; + r0 = sPSSData->field_CCC - sPSSData->cursorSprite->pos1.x; break; case -1: - r0 = sPSSData->field_CCC - 0xc0 - sPSSData->field_CB4->pos1.x; + r0 = sPSSData->field_CCC - 0xc0 - sPSSData->cursorSprite->pos1.x; break; case 1: - r0 = sPSSData->field_CCC + 0xc0 - sPSSData->field_CB4->pos1.x; + r0 = sPSSData->field_CCC + 0xc0 - sPSSData->cursorSprite->pos1.x; break; } @@ -5736,8 +5759,8 @@ static void sub_80CD70C(void) r0 <<= 8; sPSSData->field_CC4 = r0 / sPSSData->field_CD0; sPSSData->field_CC8 = r7 / sPSSData->field_CD0; - sPSSData->field_CBC = sPSSData->field_CB4->pos1.x << 8; - sPSSData->field_CC0 = sPSSData->field_CB4->pos1.y << 8; + sPSSData->field_CBC = sPSSData->cursorSprite->pos1.x << 8; + sPSSData->field_CC0 = sPSSData->cursorSprite->pos1.y << 8; } static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) @@ -5747,12 +5770,12 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { if (sPSSData->inBoxMovingMode == 0 && !sIsMonBeingMoved) - StartSpriteAnim(sPSSData->field_CB4, 1); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_STILL); } else { if (!IsMovingItem()) - StartSpriteAnim(sPSSData->field_CB4, 1); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_STILL); } if (sPSSData->boxOption == OPTION_MOVE_ITEMS) @@ -5779,19 +5802,19 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) case CURSOR_AREA_IN_PARTY: case CURSOR_AREA_BOX: case CURSOR_AREA_BUTTONS: - sPSSData->field_CB4->oam.priority = 1; + sPSSData->cursorSprite->oam.priority = 1; sPSSData->field_CB8->invisible = TRUE; sPSSData->field_CB8->oam.priority = 1; break; case CURSOR_AREA_IN_BOX: if (sPSSData->inBoxMovingMode != 0) { - sPSSData->field_CB4->oam.priority = 0; + sPSSData->cursorSprite->oam.priority = 0; sPSSData->field_CB8->invisible = TRUE; } else { - sPSSData->field_CB4->oam.priority = 2; + sPSSData->cursorSprite->oam.priority = 2; if (sBoxCursorArea == CURSOR_AREA_IN_BOX && sIsMonBeingMoved) SetMovingMonPriority(2); } @@ -5806,12 +5829,12 @@ static void sub_80CDA68(void) if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { if (sPSSData->inBoxMovingMode == 0 && !sIsMonBeingMoved) - StartSpriteAnim(sPSSData->field_CB4, 0); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); } else { if (!IsMovingItem()) - StartSpriteAnim(sPSSData->field_CB4, 0); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); } sub_80CEB40(); @@ -5830,7 +5853,7 @@ static void sub_80CDA68(void) case CURSOR_AREA_IN_BOX: if (sPSSData->inBoxMovingMode == 0) { - sPSSData->field_CB4->oam.priority = 1; + sPSSData->cursorSprite->oam.priority = 1; sPSSData->field_CB8->oam.priority = 2; sPSSData->field_CB8->subpriority = 21; sPSSData->field_CB8->invisible = FALSE; @@ -5854,7 +5877,7 @@ static void sub_80CDBA0(void) if (partyCount >= PARTY_SIZE) partyCount = PARTY_SIZE - 1; } - if (sPSSData->field_CB4->vFlip) + if (sPSSData->cursorSprite->vFlip) sPSSData->field_CD7 = 1; sub_80CD894(CURSOR_AREA_IN_PARTY, partyCount); } @@ -5916,13 +5939,13 @@ static bool8 MonPlaceChange_Move(void) case 0: if (sIsMonBeingMoved) return FALSE; - StartSpriteAnim(sPSSData->field_CB4, 2); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_OPEN); sPSSData->monPlaceChangeState++; break; case 1: if (!sub_80CDED4()) { - StartSpriteAnim(sPSSData->field_CB4, 3); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_FIST); MoveMon(); sPSSData->monPlaceChangeState++; } @@ -5945,7 +5968,7 @@ static bool8 MonPlaceChange_Place(void) case 0: if (!sub_80CDED4()) { - StartSpriteAnim(sPSSData->field_CB4, 2); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_OPEN); PlaceMon(); sPSSData->monPlaceChangeState++; } @@ -5953,7 +5976,7 @@ static bool8 MonPlaceChange_Place(void) case 1: if (!sub_80CDF08()) { - StartSpriteAnim(sPSSData->field_CB4, 0); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); sPSSData->monPlaceChangeState++; } break; @@ -5980,14 +6003,14 @@ static bool8 MonPlaceChange_Shift(void) default: return FALSE; } - StartSpriteAnim(sPSSData->field_CB4, 2); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_OPEN); sub_80CBD5C(sPSSData->field_D91, sBoxCursorPosition); sPSSData->monPlaceChangeState++; break; case 1: if (!sub_80CBDC4()) { - StartSpriteAnim(sPSSData->field_CB4, 3); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_FIST); SetShiftedMonData(sPSSData->field_D91, sBoxCursorPosition); sPSSData->monPlaceChangeState++; } @@ -6011,13 +6034,13 @@ static bool8 sub_80CDEC4(void) static bool8 sub_80CDED4(void) { - switch (sPSSData->field_CB4->pos2.y) + switch (sPSSData->cursorSprite->pos2.y) { default: - sPSSData->field_CB4->pos2.y++; + sPSSData->cursorSprite->pos2.y++; break; case 0: - sPSSData->field_CB4->pos2.y++; + sPSSData->cursorSprite->pos2.y++; break; case 8: return FALSE; @@ -6028,12 +6051,12 @@ static bool8 sub_80CDED4(void) static bool8 sub_80CDF08(void) { - switch (sPSSData->field_CB4->pos2.y) + switch (sPSSData->cursorSprite->pos2.y) { case 0: return FALSE; default: - sPSSData->field_CB4->pos2.y--; + sPSSData->cursorSprite->pos2.y--; break; } @@ -6125,13 +6148,13 @@ static void PurgeMonOrBoxMon(u8 boxId, u8 position) static void SetShiftedMonData(u8 boxId, u8 position) { if (boxId == TOTAL_BOXES_COUNT) - sPSSData->field_2108 = gPlayerParty[position]; + sPSSData->tempMon = gPlayerParty[position]; else - BoxMonAtToMon(boxId, position, &sPSSData->field_2108); + BoxMonAtToMon(boxId, position, &sPSSData->tempMon); SetPlacedMonData(boxId, position); - sPSSData->movingMon = sPSSData->field_2108; - SetCursorMonData(&sPSSData->movingMon, MODE_PARTY); + sPSSData->movingMon = sPSSData->tempMon; + SetDisplayMonData(&sPSSData->movingMon, MODE_PARTY); sMovingMonOrigBoxId = boxId; sMovingMonOrigBoxPos = position; } @@ -6158,17 +6181,17 @@ static bool8 TryStorePartyMonInBox(u8 boxId) if (boxId == StorageGetCurrentBox()) sub_80CB140(boxPosition); - StartSpriteAnim(sPSSData->field_CB4, 1); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_STILL); return TRUE; } static void sub_80CE22C(void) { - StartSpriteAnim(sPSSData->field_CB4, 0); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); sub_80CEB40(); } -static void sub_80CE250(void) +static void InitReleaseMon(void) { u8 mode; @@ -6179,15 +6202,15 @@ static void sub_80CE250(void) else mode = MODE_BOX; - sub_80CBF14(mode, sBoxCursorPosition); - StringCopy(sPSSData->field_21E0, sPSSData->cursorMonNick); + SetReleaseMon(mode, sBoxCursorPosition); + StringCopy(sPSSData->releaseMonName, sPSSData->displayMonName); } -static bool8 sub_80CE2A8(void) +static bool8 TryHideReleaseMon(void) { - if (!sub_80CBFD8()) + if (!TryHideReleaseMonSprite()) { - StartSpriteAnim(sPSSData->field_CB4, 0); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); return FALSE; } else @@ -6200,7 +6223,7 @@ static void ReleaseMon(void) { u8 boxId; - sub_80CC020(); + DestroyReleaseMonIcon(); if (sIsMonBeingMoved) { sIsMonBeingMoved = FALSE; @@ -6217,18 +6240,22 @@ static void ReleaseMon(void) sub_80CEB40(); } -static void sub_80CE324(void) +static void TrySetCursorFistAnim(void) { if (sIsMonBeingMoved) - StartSpriteAnim(sPSSData->field_CB4, 3); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_FIST); } +// If the player is on the listed map (or any map, if none is specified), +// they may not release their last Pokémon that knows the specified move. +// This is to stop the player from softlocking themselves by not having +// a Pokémon that knows a required field move. struct { s8 mapGroup; s8 mapNum; u16 move; -} static const gUnknown_0857B9A4[] = +} static const sRestrictedReleaseMoves[] = { {MAP_GROUPS_COUNT, 0, MOVE_SURF}, {MAP_GROUPS_COUNT, 0, MOVE_DIVE}, @@ -6238,73 +6265,79 @@ struct {MAP_GROUP(EVER_GRANDE_CITY_POKEMON_LEAGUE_2F), MAP_NUM(EVER_GRANDE_CITY_POKEMON_LEAGUE_2F), MOVE_ROCK_SMASH}, }; -static void sub_80CE350(u16 *moves) +static void GetRestrictedReleaseMoves(u16 *moves) { s32 i; - for (i = 0; i < ARRAY_COUNT(gUnknown_0857B9A4); i++) + for (i = 0; i < ARRAY_COUNT(sRestrictedReleaseMoves); i++) { - if (gUnknown_0857B9A4[i].mapGroup == MAP_GROUPS_COUNT - || (gUnknown_0857B9A4[i].mapGroup == gSaveBlock1Ptr->location.mapGroup && gUnknown_0857B9A4[i].mapNum == gSaveBlock1Ptr->location.mapNum)) + if (sRestrictedReleaseMoves[i].mapGroup == MAP_GROUPS_COUNT + || (sRestrictedReleaseMoves[i].mapGroup == gSaveBlock1Ptr->location.mapGroup + && sRestrictedReleaseMoves[i].mapNum == gSaveBlock1Ptr->location.mapNum)) { - *moves = gUnknown_0857B9A4[i].move; + *moves = sRestrictedReleaseMoves[i].move; moves++; } } - *moves = MOVES_COUNT; } -static void InitCanRelaseMonVars(void) +static void InitCanReleaseMonVars(void) { if (!AtLeastThreeUsableMons()) { - sPSSData->field_216D = 1; - sPSSData->field_216C = 0; + // The player only has 1 or 2 usable + // Pokémon, this one can't be released + sPSSData->releaseStatusResolved = TRUE; + sPSSData->canReleaseMon = FALSE; return; } if (sIsMonBeingMoved) { - sPSSData->field_2108 = sPSSData->movingMon; - sPSSData->field_2170 = -1; - sPSSData->field_2171 = -1; + sPSSData->tempMon = sPSSData->movingMon; + sPSSData->releaseBoxId = -1; + sPSSData->releaseBoxPos = -1; } else { if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) { - sPSSData->field_2108 = gPlayerParty[sBoxCursorPosition]; - sPSSData->field_2170 = TOTAL_BOXES_COUNT; + sPSSData->tempMon = gPlayerParty[sBoxCursorPosition]; + sPSSData->releaseBoxId = TOTAL_BOXES_COUNT; } else { - BoxMonAtToMon(StorageGetCurrentBox(), sBoxCursorPosition, &sPSSData->field_2108); - sPSSData->field_2170 = StorageGetCurrentBox(); + BoxMonAtToMon(StorageGetCurrentBox(), sBoxCursorPosition, &sPSSData->tempMon); + sPSSData->releaseBoxId = StorageGetCurrentBox(); } - sPSSData->field_2171 = sBoxCursorPosition; + sPSSData->releaseBoxPos = sBoxCursorPosition; } - sub_80CE350(sPSSData->field_2176); - sPSSData->field_2174 = GetMonData(&sPSSData->field_2108, MON_DATA_KNOWN_MOVES, (u8*)sPSSData->field_2176); - if (sPSSData->field_2174 != 0) + GetRestrictedReleaseMoves(sPSSData->restrictedMoveList); + sPSSData->restrictedReleaseMonMoves = GetMonData(&sPSSData->tempMon, MON_DATA_KNOWN_MOVES, (u8*)sPSSData->restrictedMoveList); + if (sPSSData->restrictedReleaseMonMoves != 0) { - sPSSData->field_216D = 0; + // Pokémon knows at least one restricted release move + // Need to check if another Pokémon has this move first + sPSSData->releaseStatusResolved = FALSE; } else { - sPSSData->field_216D = 1; - sPSSData->field_216C = 1; + // Pokémon knows no restricted moves, can be released + sPSSData->releaseStatusResolved = TRUE; + sPSSData->canReleaseMon = TRUE; } - sPSSData->field_2172 = 0; + sPSSData->releaseCheckState = 0; } static bool32 AtLeastThreeUsableMons(void) { - s32 i, j, count; - - count = (sIsMonBeingMoved != FALSE); + s32 i, j; + s32 count = (sIsMonBeingMoved != FALSE); + + // Check party for usable Pokémon for (j = 0; j < PARTY_SIZE; j++) { if (GetMonData(&gPlayerParty[j], MON_DATA_SANITY_HAS_SPECIES)) @@ -6314,6 +6347,7 @@ static bool32 AtLeastThreeUsableMons(void) if (count >= 3) return TRUE; + // Check PC for usable Pokémon for (i = 0; i < TOTAL_BOXES_COUNT; i++) { for (j = 0; j < IN_BOX_COUNT; j++) @@ -6334,54 +6368,69 @@ static s8 RunCanReleaseMon(void) u16 i; u16 knownMoves; - if (sPSSData->field_216D) - return sPSSData->field_216C; + if (sPSSData->releaseStatusResolved) + return sPSSData->canReleaseMon; - switch (sPSSData->field_2172) + switch (sPSSData->releaseCheckState) { case 0: + // Check party for other Pokémon that know any restricted + // moves the release Pokémon knows for (i = 0; i < PARTY_SIZE; i++) { - if (sPSSData->field_2170 != TOTAL_BOXES_COUNT || sPSSData->field_2171 != i) + // Make sure party Pokémon isn't the one we're releasing first + if (sPSSData->releaseBoxId != TOTAL_BOXES_COUNT || sPSSData->releaseBoxPos != i) { - knownMoves = GetMonData(gPlayerParty + i, MON_DATA_KNOWN_MOVES, (u8*)sPSSData->field_2176); - sPSSData->field_2174 &= ~(knownMoves); + knownMoves = GetMonData(&gPlayerParty[i], MON_DATA_KNOWN_MOVES, (u8*)sPSSData->restrictedMoveList); + sPSSData->restrictedReleaseMonMoves &= ~(knownMoves); } } - if (sPSSData->field_2174 == 0) + if (sPSSData->restrictedReleaseMonMoves == 0) { - sPSSData->field_216D = 1; - sPSSData->field_216C = 1; + // No restricted moves on release Pokémon that + // aren't resolved by the party, it can be released. + sPSSData->releaseStatusResolved = TRUE; + sPSSData->canReleaseMon = TRUE; } else { - sPSSData->field_216E = 0; - sPSSData->field_216F = 0; - sPSSData->field_2172++; + // Release Pokémon has restricted moves not resolved by the party. + // Continue and check the PC next + sPSSData->releaseCheckBoxId = 0; + sPSSData->releaseCheckBoxPos = 0; + sPSSData->releaseCheckState++; } break; case 1: + // Check PC for other Pokémon that know any restricted + // moves the release Pokémon knows for (i = 0; i < IN_BOX_COUNT; i++) { - knownMoves = GetAndCopyBoxMonDataAt(sPSSData->field_216E, sPSSData->field_216F, MON_DATA_KNOWN_MOVES, (u8*)sPSSData->field_2176); - if (knownMoves != 0 - && !(sPSSData->field_2170 == sPSSData->field_216E && sPSSData->field_2171 == sPSSData->field_216F)) + knownMoves = GetAndCopyBoxMonDataAt(sPSSData->releaseCheckBoxId, sPSSData->releaseCheckBoxPos, MON_DATA_KNOWN_MOVES, (u8*)sPSSData->restrictedMoveList); + if (knownMoves != 0 && !(sPSSData->releaseBoxId == sPSSData->releaseCheckBoxId + && sPSSData->releaseBoxPos == sPSSData->releaseCheckBoxPos)) { - sPSSData->field_2174 &= ~(knownMoves); - if (sPSSData->field_2174 == 0) + // Found PC Pokémon with restricted move, clear move from list + sPSSData->restrictedReleaseMonMoves &= ~(knownMoves); + if (sPSSData->restrictedReleaseMonMoves == 0) { - sPSSData->field_216D = 1; - sPSSData->field_216C = 1; + // No restricted moves on release Pokémon that + // aren't resolved, it can be released. + sPSSData->releaseStatusResolved = TRUE; + sPSSData->canReleaseMon = TRUE; break; } } - if (++sPSSData->field_216F >= IN_BOX_COUNT) + if (++sPSSData->releaseCheckBoxPos >= IN_BOX_COUNT) { - sPSSData->field_216F = 0; - if (++sPSSData->field_216E >= TOTAL_BOXES_COUNT) + sPSSData->releaseCheckBoxPos = 0; + if (++sPSSData->releaseCheckBoxId >= TOTAL_BOXES_COUNT) { - sPSSData->field_216D = 1; - sPSSData->field_216C = 0; + // Checked every Pokémon in the PC, release Pokémon is + // the sole owner of at least one restricted move. + // It cannot be released. + sPSSData->releaseStatusResolved = TRUE; + sPSSData->canReleaseMon = FALSE; } } } @@ -6449,7 +6498,7 @@ s16 CompactPartySlots(void) for (i = 0, last = 0; i < PARTY_SIZE; i++) { - u16 species = GetMonData(gPlayerParty + i, MON_DATA_SPECIES); + u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES); if (species != SPECIES_NONE) { if (i != last) @@ -6462,14 +6511,14 @@ s16 CompactPartySlots(void) } } for (; last < PARTY_SIZE; last++) - ZeroMonData(gPlayerParty + last); + ZeroMonData(&gPlayerParty[last]); return retVal; } static void SetMonMarkings(u8 markings) { - sPSSData->cursorMonMarkings = markings; + sPSSData->displayMonMarkings = markings; if (sIsMonBeingMoved) { SetMonData(&sPSSData->movingMon, MON_DATA_MARKINGS, &markings); @@ -6477,7 +6526,7 @@ static void SetMonMarkings(u8 markings) else { if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) - SetMonData(gPlayerParty + sBoxCursorPosition, MON_DATA_MARKINGS, &markings); + SetMonData(&gPlayerParty[sBoxCursorPosition], MON_DATA_MARKINGS, &markings); if (sBoxCursorArea == CURSOR_AREA_IN_BOX) SetCurrentBoxMonData(sBoxCursorPosition, MON_DATA_MARKINGS, &markings); } @@ -6497,7 +6546,7 @@ static bool8 CanShiftMon(void) { if (sBoxCursorArea == CURSOR_AREA_IN_PARTY && CountPartyAliveNonEggMonsExcept(sBoxCursorPosition) == 0) { - if (sPSSData->cursorMonIsEgg || GetMonData(&sPSSData->movingMon, MON_DATA_HP) == 0) + if (sPSSData->displayMonIsEgg || GetMonData(&sPSSData->movingMon, MON_DATA_HP) == 0) return FALSE; } return TRUE; @@ -6535,16 +6584,16 @@ static void sub_80CEB40(void) case CURSOR_AREA_IN_PARTY: if (sBoxCursorPosition < PARTY_SIZE) { - SetCursorMonData(&gPlayerParty[sBoxCursorPosition], MODE_PARTY); + SetDisplayMonData(&gPlayerParty[sBoxCursorPosition], MODE_PARTY); break; } // fallthrough case CURSOR_AREA_BUTTONS: case CURSOR_AREA_BOX: - SetCursorMonData(NULL, MODE_MOVE); + SetDisplayMonData(NULL, MODE_MOVE); break; case CURSOR_AREA_IN_BOX: - SetCursorMonData(GetBoxedMonPtr(StorageGetCurrentBox(), sBoxCursorPosition), MODE_BOX); + SetDisplayMonData(GetBoxedMonPtr(StorageGetCurrentBox(), sBoxCursorPosition), MODE_BOX); break; } } @@ -6553,105 +6602,105 @@ static void sub_80CEB40(void) static void sub_80CEBDC(void) { if (sIsMonBeingMoved) - SetCursorMonData(&gUnknown_02039D14, MODE_PARTY); + SetDisplayMonData(&gUnknown_02039D14, MODE_PARTY); else sub_80CEB40(); } -static void SetCursorMonData(void *pokemon, u8 mode) +static void SetDisplayMonData(void *pokemon, u8 mode) { u8 *txtPtr; u16 gender; bool8 sanityIsBadEgg; - sPSSData->cursorMonItemId = ITEM_NONE; + sPSSData->displayMonItemId = ITEM_NONE; gender = MON_MALE; sanityIsBadEgg = FALSE; if (mode == MODE_PARTY) { struct Pokemon *mon = (struct Pokemon *)pokemon; - sPSSData->cursorMonSpecies = GetMonData(mon, MON_DATA_SPECIES2); - if (sPSSData->cursorMonSpecies != SPECIES_NONE) + sPSSData->displayMonSpecies = GetMonData(mon, MON_DATA_SPECIES2); + if (sPSSData->displayMonSpecies != SPECIES_NONE) { sanityIsBadEgg = GetMonData(mon, MON_DATA_SANITY_IS_BAD_EGG); if (sanityIsBadEgg) - sPSSData->cursorMonIsEgg = TRUE; + sPSSData->displayMonIsEgg = TRUE; else - sPSSData->cursorMonIsEgg = GetMonData(mon, MON_DATA_IS_EGG); + sPSSData->displayMonIsEgg = GetMonData(mon, MON_DATA_IS_EGG); - GetMonData(mon, MON_DATA_NICKNAME, sPSSData->cursorMonNick); - StringGetEnd10(sPSSData->cursorMonNick); - sPSSData->cursorMonLevel = GetMonData(mon, MON_DATA_LEVEL); - sPSSData->cursorMonMarkings = GetMonData(mon, MON_DATA_MARKINGS); - sPSSData->cursorMonPersonality = GetMonData(mon, MON_DATA_PERSONALITY); - sPSSData->cursorMonPalette = GetMonFrontSpritePal(mon); + GetMonData(mon, MON_DATA_NICKNAME, sPSSData->displayMonName); + StringGetEnd10(sPSSData->displayMonName); + sPSSData->displayMonLevel = GetMonData(mon, MON_DATA_LEVEL); + sPSSData->displayMonMarkings = GetMonData(mon, MON_DATA_MARKINGS); + sPSSData->displayMonPersonality = GetMonData(mon, MON_DATA_PERSONALITY); + sPSSData->displayMonPalette = GetMonFrontSpritePal(mon); gender = GetMonGender(mon); - sPSSData->cursorMonItemId = GetMonData(mon, MON_DATA_HELD_ITEM); + sPSSData->displayMonItemId = GetMonData(mon, MON_DATA_HELD_ITEM); } } else if (mode == MODE_BOX) { struct BoxPokemon *boxMon = (struct BoxPokemon *)pokemon; - sPSSData->cursorMonSpecies = GetBoxMonData(pokemon, MON_DATA_SPECIES2); - if (sPSSData->cursorMonSpecies != SPECIES_NONE) + sPSSData->displayMonSpecies = GetBoxMonData(pokemon, MON_DATA_SPECIES2); + if (sPSSData->displayMonSpecies != SPECIES_NONE) { u32 otId = GetBoxMonData(boxMon, MON_DATA_OT_ID); sanityIsBadEgg = GetBoxMonData(boxMon, MON_DATA_SANITY_IS_BAD_EGG); if (sanityIsBadEgg) - sPSSData->cursorMonIsEgg = TRUE; + sPSSData->displayMonIsEgg = TRUE; else - sPSSData->cursorMonIsEgg = GetBoxMonData(boxMon, MON_DATA_IS_EGG); + sPSSData->displayMonIsEgg = GetBoxMonData(boxMon, MON_DATA_IS_EGG); - GetBoxMonData(boxMon, MON_DATA_NICKNAME, sPSSData->cursorMonNick); - StringGetEnd10(sPSSData->cursorMonNick); - sPSSData->cursorMonLevel = GetLevelFromBoxMonExp(boxMon); - sPSSData->cursorMonMarkings = GetBoxMonData(boxMon, MON_DATA_MARKINGS); - sPSSData->cursorMonPersonality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY); - sPSSData->cursorMonPalette = GetMonSpritePalFromSpeciesAndPersonality(sPSSData->cursorMonSpecies, otId, sPSSData->cursorMonPersonality); - gender = GetGenderFromSpeciesAndPersonality(sPSSData->cursorMonSpecies, sPSSData->cursorMonPersonality); - sPSSData->cursorMonItemId = GetBoxMonData(boxMon, MON_DATA_HELD_ITEM); + GetBoxMonData(boxMon, MON_DATA_NICKNAME, sPSSData->displayMonName); + StringGetEnd10(sPSSData->displayMonName); + sPSSData->displayMonLevel = GetLevelFromBoxMonExp(boxMon); + sPSSData->displayMonMarkings = GetBoxMonData(boxMon, MON_DATA_MARKINGS); + sPSSData->displayMonPersonality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY); + sPSSData->displayMonPalette = GetMonSpritePalFromSpeciesAndPersonality(sPSSData->displayMonSpecies, otId, sPSSData->displayMonPersonality); + gender = GetGenderFromSpeciesAndPersonality(sPSSData->displayMonSpecies, sPSSData->displayMonPersonality); + sPSSData->displayMonItemId = GetBoxMonData(boxMon, MON_DATA_HELD_ITEM); } } else { - sPSSData->cursorMonSpecies = SPECIES_NONE; - sPSSData->cursorMonItemId = ITEM_NONE; + sPSSData->displayMonSpecies = SPECIES_NONE; + sPSSData->displayMonItemId = ITEM_NONE; } - if (sPSSData->cursorMonSpecies == SPECIES_NONE) + if (sPSSData->displayMonSpecies == SPECIES_NONE) { - StringFill(sPSSData->cursorMonNick, CHAR_SPACE, 5); - StringFill(sPSSData->cursorMonNickText, CHAR_SPACE, 8); - StringFill(sPSSData->cursorMonSpeciesName, CHAR_SPACE, 8); - StringFill(sPSSData->cursorMonGenderLvlText, CHAR_SPACE, 8); - StringFill(sPSSData->cursorMonItemName, CHAR_SPACE, 8); + StringFill(sPSSData->displayMonName, CHAR_SPACE, 5); + StringFill(sPSSData->displayMonNameText, CHAR_SPACE, 8); + StringFill(sPSSData->displayMonSpeciesName, CHAR_SPACE, 8); + StringFill(sPSSData->displayMonGenderLvlText, CHAR_SPACE, 8); + StringFill(sPSSData->displayMonItemName, CHAR_SPACE, 8); } - else if (sPSSData->cursorMonIsEgg) + else if (sPSSData->displayMonIsEgg) { if (sanityIsBadEgg) - StringCopyPadded(sPSSData->cursorMonNickText, sPSSData->cursorMonNick, CHAR_SPACE, 5); + StringCopyPadded(sPSSData->displayMonNameText, sPSSData->displayMonName, CHAR_SPACE, 5); else - StringCopyPadded(sPSSData->cursorMonNickText, gText_EggNickname, CHAR_SPACE, 8); + StringCopyPadded(sPSSData->displayMonNameText, gText_EggNickname, CHAR_SPACE, 8); - StringFill(sPSSData->cursorMonSpeciesName, CHAR_SPACE, 8); - StringFill(sPSSData->cursorMonGenderLvlText, CHAR_SPACE, 8); - StringFill(sPSSData->cursorMonItemName, CHAR_SPACE, 8); + StringFill(sPSSData->displayMonSpeciesName, CHAR_SPACE, 8); + StringFill(sPSSData->displayMonGenderLvlText, CHAR_SPACE, 8); + StringFill(sPSSData->displayMonItemName, CHAR_SPACE, 8); } else { - if (sPSSData->cursorMonSpecies == SPECIES_NIDORAN_F || sPSSData->cursorMonSpecies == SPECIES_NIDORAN_M) + if (sPSSData->displayMonSpecies == SPECIES_NIDORAN_F || sPSSData->displayMonSpecies == SPECIES_NIDORAN_M) gender = MON_GENDERLESS; - StringCopyPadded(sPSSData->cursorMonNickText, sPSSData->cursorMonNick, CHAR_SPACE, 5); + StringCopyPadded(sPSSData->displayMonNameText, sPSSData->displayMonName, CHAR_SPACE, 5); - txtPtr = sPSSData->cursorMonSpeciesName; + txtPtr = sPSSData->displayMonSpeciesName; *(txtPtr)++ = CHAR_SLASH; - StringCopyPadded(txtPtr, gSpeciesNames[sPSSData->cursorMonSpecies], CHAR_SPACE, 5); + StringCopyPadded(txtPtr, gSpeciesNames[sPSSData->displayMonSpecies], CHAR_SPACE, 5); - txtPtr = sPSSData->cursorMonGenderLvlText; + txtPtr = sPSSData->displayMonGenderLvlText; *(txtPtr)++ = EXT_CTRL_CODE_BEGIN; *(txtPtr)++ = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW; switch (gender) @@ -6685,14 +6734,14 @@ static void SetCursorMonData(void *pokemon, u8 mode) *(txtPtr++) = CHAR_EXTRA_SYMBOL; *(txtPtr++) = CHAR_LV_2; - txtPtr = ConvertIntToDecimalStringN(txtPtr, sPSSData->cursorMonLevel, STR_CONV_MODE_LEFT_ALIGN, 3); + txtPtr = ConvertIntToDecimalStringN(txtPtr, sPSSData->displayMonLevel, STR_CONV_MODE_LEFT_ALIGN, 3); txtPtr[0] = CHAR_SPACE; txtPtr[1] = EOS; - if (sPSSData->cursorMonItemId != ITEM_NONE) - StringCopyPadded(sPSSData->cursorMonItemName, ItemId_GetName(sPSSData->cursorMonItemId), CHAR_SPACE, 8); + if (sPSSData->displayMonItemId != ITEM_NONE) + StringCopyPadded(sPSSData->displayMonItemName, ItemId_GetName(sPSSData->displayMonItemId), CHAR_SPACE, 8); else - StringFill(sPSSData->cursorMonItemName, CHAR_SPACE, 8); + StringFill(sPSSData->displayMonItemName, CHAR_SPACE, 8); } } @@ -6916,7 +6965,7 @@ static u8 InBoxInput_GrabbingMultiple(void) } else { - sIsMonBeingMoved = (sPSSData->cursorMonSpecies != SPECIES_NONE); + sIsMonBeingMoved = (sPSSData->displayMonSpecies != SPECIES_NONE); sPSSData->inBoxMovingMode = 2; sMovingMonOrigBoxId = StorageGetCurrentBox(); return INPUT_23; @@ -7316,18 +7365,18 @@ static u8 sub_80CFA5C(void) static bool8 sub_80CFA84(void) { - u16 var0 = sub_80CD504(); + u16 species = GetSpeciesAtCursorPosition(); switch (sPSSData->boxOption) { case OPTION_DEPOSIT: - if (var0) + if (species != SPECIES_NONE) SetMenuText(MENU_STORE); else return FALSE; break; case OPTION_WITHDRAW: - if (var0) + if (species != SPECIES_NONE) SetMenuText(MENU_WITHDRAW); else return FALSE; @@ -7335,14 +7384,14 @@ static bool8 sub_80CFA84(void) case OPTION_MOVE_MONS: if (sIsMonBeingMoved) { - if (var0) + if (species != SPECIES_NONE) SetMenuText(MENU_SHIFT); else SetMenuText(MENU_PLACE); } else { - if (var0) + if (species != SPECIES_NONE) SetMenuText(MENU_MOVE); else return FALSE; @@ -7370,21 +7419,21 @@ static bool8 sub_80CFA84(void) static bool8 sub_80CFB44(void) { - if (sPSSData->cursorMonSpecies == SPECIES_EGG) + if (sPSSData->displayMonSpecies == SPECIES_EGG) return FALSE; if (!IsMovingItem()) { - if (sPSSData->cursorMonItemId == ITEM_NONE) + if (sPSSData->displayMonItemId == ITEM_NONE) { - if (sPSSData->cursorMonSpecies == SPECIES_NONE) + if (sPSSData->displayMonSpecies == SPECIES_NONE) return FALSE; SetMenuText(MENU_GIVE_2); } else { - if (!ItemIsMail(sPSSData->cursorMonItemId)) + if (!ItemIsMail(sPSSData->displayMonItemId)) { SetMenuText(MENU_TAKE); SetMenuText(MENU_BAG); @@ -7394,16 +7443,16 @@ static bool8 sub_80CFB44(void) } else { - if (sPSSData->cursorMonItemId == ITEM_NONE) + if (sPSSData->displayMonItemId == ITEM_NONE) { - if (sPSSData->cursorMonSpecies == SPECIES_NONE) + if (sPSSData->displayMonSpecies == SPECIES_NONE) return FALSE; SetMenuText(MENU_GIVE); } else { - if (ItemIsMail(sPSSData->cursorMonItemId) == TRUE) + if (ItemIsMail(sPSSData->displayMonItemId) == TRUE) return FALSE; SetMenuText(MENU_SWITCH); @@ -7414,10 +7463,10 @@ static bool8 sub_80CFB44(void) return TRUE; } -static void sub_80CFBF4(struct Sprite *sprite) +static void SpriteCB_CursorShadow(struct Sprite *sprite) { - sprite->pos1.x = sPSSData->field_CB4->pos1.x; - sprite->pos1.y = sPSSData->field_CB4->pos1.y + 20; + sprite->pos1.x = sPSSData->cursorSprite->pos1.x; + sprite->pos1.y = sPSSData->cursorSprite->pos1.y + 20; } static void sub_80CFC14(void) @@ -7427,100 +7476,100 @@ static void sub_80CFC14(void) u8 priority, subpriority; struct SpriteSheet spriteSheets[] = { - {gHandCursorTiles, 0x800, 0}, - {gHandCursorShadowTiles, 0x80, 1}, + {sHandCursor_Gfx, 0x800, GFXTAG_CURSOR}, + {sHandCursorShadow_Gfx, 0x80, GFXTAG_CURSOR_SHADOW}, {} }; struct SpritePalette spritePalettes[] = { - {gHandCursorPalette, PALTAG_7}, + {sHandCursor_Pal, PALTAG_7}, {} }; - static const struct OamData sOamData_857BA0C = + static const struct OamData sOamData_Cursor = { .shape = SPRITE_SHAPE(32x32), .size = SPRITE_SIZE(32x32), .priority = 1, }; - static const struct OamData sOamData_857BA14 = + static const struct OamData sOamData_CursorShadow = { .shape = SPRITE_SHAPE(16x16), .size = SPRITE_SIZE(16x16), .priority = 1, }; - static const union AnimCmd sSpriteAnim_857BA1C[] = + static const union AnimCmd sAnim_Cursor_Bouncing[] = { ANIMCMD_FRAME(0, 30), ANIMCMD_FRAME(16, 30), ANIMCMD_JUMP(0) }; - static const union AnimCmd sSpriteAnim_857BA28[] = + static const union AnimCmd sAnim_Cursor_Still[] = { ANIMCMD_FRAME(0, 5), ANIMCMD_END }; - static const union AnimCmd sSpriteAnim_857BA30[] = + static const union AnimCmd sAnim_Cursor_Open[] = { ANIMCMD_FRAME(32, 5), ANIMCMD_END }; - static const union AnimCmd sSpriteAnim_857BA38[] = + static const union AnimCmd sAnim_Cursor_Fist[] = { ANIMCMD_FRAME(48, 5), ANIMCMD_END }; - static const union AnimCmd *const sSpriteAnimTable_857BA40[] = + static const union AnimCmd *const sAnims_Cursor[] = { - sSpriteAnim_857BA1C, - sSpriteAnim_857BA28, - sSpriteAnim_857BA30, - sSpriteAnim_857BA38 + [CURSOR_ANIM_BOUNCE] = sAnim_Cursor_Bouncing, + [CURSOR_ANIM_STILL] = sAnim_Cursor_Still, + [CURSOR_ANIM_OPEN] = sAnim_Cursor_Open, + [CURSOR_ANIM_FIST] = sAnim_Cursor_Fist }; - static const struct SpriteTemplate gSpriteTemplate_857BA50 = + static const struct SpriteTemplate sSpriteTemplate_Cursor = { - .tileTag = TAG_TILE_0, + .tileTag = GFXTAG_CURSOR, .paletteTag = PALTAG_10, - .oam = &sOamData_857BA0C, - .anims = sSpriteAnimTable_857BA40, + .oam = &sOamData_Cursor, + .anims = sAnims_Cursor, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }; - static const struct SpriteTemplate gSpriteTemplate_857BA68 = + static const struct SpriteTemplate sSpriteTemplate_CursorShadow = { - .tileTag = TAG_TILE_1, + .tileTag = GFXTAG_CURSOR_SHADOW, .paletteTag = PALTAG_10, - .oam = &sOamData_857BA14, + .oam = &sOamData_CursorShadow, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80CFBF4, + .callback = SpriteCB_CursorShadow, }; LoadSpriteSheets(spriteSheets); LoadSpritePalettes(spritePalettes); - sPSSData->field_CD8[0] = IndexOfSpritePaletteTag(PALTAG_10); - sPSSData->field_CD8[1] = IndexOfSpritePaletteTag(PALTAG_7); + sPSSData->cursorPalNums[0] = IndexOfSpritePaletteTag(PALTAG_10); + sPSSData->cursorPalNums[1] = IndexOfSpritePaletteTag(PALTAG_7); - sub_80CD444(sBoxCursorArea, sBoxCursorPosition, &x, &y); - spriteId = CreateSprite(&gSpriteTemplate_857BA50, x, y, 6); + GetCursorCoordsByPos(sBoxCursorArea, sBoxCursorPosition, &x, &y); + spriteId = CreateSprite(&sSpriteTemplate_Cursor, x, y, 6); if (spriteId != MAX_SPRITES) { - sPSSData->field_CB4 = &gSprites[spriteId]; - sPSSData->field_CB4->oam.paletteNum = sPSSData->field_CD8[sCanOnlyMove]; - sPSSData->field_CB4->oam.priority = 1; + sPSSData->cursorSprite = &gSprites[spriteId]; + sPSSData->cursorSprite->oam.paletteNum = sPSSData->cursorPalNums[sCanOnlyMove]; + sPSSData->cursorSprite->oam.priority = 1; if (sIsMonBeingMoved) - StartSpriteAnim(sPSSData->field_CB4, 3); + StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_FIST); } else { - sPSSData->field_CB4 = NULL; + sPSSData->cursorSprite = NULL; } if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) @@ -7534,7 +7583,7 @@ static void sub_80CFC14(void) priority = 2; } - spriteId = CreateSprite(&gSpriteTemplate_857BA68, 0, 0, subpriority); + spriteId = CreateSprite(&sSpriteTemplate_CursorShadow, 0, 0, subpriority); if (spriteId != MAX_SPRITES) { sPSSData->field_CB8 = &gSprites[spriteId]; @@ -7551,7 +7600,7 @@ static void sub_80CFC14(void) static void sub_80CFDC4(void) { sCanOnlyMove = !sCanOnlyMove; - sPSSData->field_CB4->oam.paletteNum = sPSSData->field_CD8[sCanOnlyMove]; + sPSSData->cursorSprite->oam.paletteNum = sPSSData->cursorPalNums[sCanOnlyMove]; } static u8 GetBoxCursorPosition(void) @@ -7573,9 +7622,9 @@ static void sub_80CFE14(u8 *arg0, u8 *arg1) } } -static void sub_80CFE54(u8 animNum) +static void StartCursorAnim(u8 animNum) { - StartSpriteAnim(sPSSData->field_CB4, animNum); + StartSpriteAnim(sPSSData->cursorSprite, animNum); } static u8 sub_80CFE78(void) @@ -7583,9 +7632,9 @@ static u8 sub_80CFE78(void) return sMovingMonOrigBoxId; } -static void sub_80CFE84(void) +static void SetCursorPriorityTo1(void) { - sPSSData->field_CB4->oam.priority = 1; + sPSSData->cursorSprite->oam.priority = 1; } static void sub_80CFEA8(void) @@ -7777,8 +7826,7 @@ EWRAM_DATA static struct u16 bgY; u16 field_10; struct BoxPokemon boxMons[IN_BOX_COUNT]; -} -*sMoveMonsPtr = NULL; +} *sMoveMonsPtr = NULL; static bool8 sub_80D0164(void) { @@ -7851,7 +7899,7 @@ static bool8 sub_80D024C(void) PutWindowTilemap(sPSSData->field_2200); CopyWindowToVram8Bit(sPSSData->field_2200, 3); BlendPalettes(0x3F00, 8, RGB_WHITE); - sub_80CFE54(2); + StartCursorAnim(CURSOR_ANIM_OPEN); SetGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR); sMoveMonsPtr->state++; break; @@ -7877,13 +7925,13 @@ static bool8 sub_80D0344(void) break; case 1: sub_80D0B5C(); - sub_80CFE54(0); + StartCursorAnim(CURSOR_ANIM_BOUNCE); sMoveMonsPtr->state++; break; case 2: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_80CFE84(); + SetCursorPriorityTo1(); LoadPalette(GetTextWindowPalette(3), 0xD0, 0x20); ShowBg(0); return FALSE; @@ -7931,7 +7979,7 @@ static bool8 sub_80D0420(void) case 1: if (!DoMonPlaceChange()) { - sub_80CFE54(3); + StartCursorAnim(CURSOR_ANIM_FIST); sub_80D0884(0, 256, 8); sub_80CDC64(TRUE); sMoveMonsPtr->state++; @@ -7973,7 +8021,7 @@ static bool8 sub_80D04C8(void) if (!DoMonPlaceChange() && !sub_80D0894()) { sub_80D0A1C(); - sub_80CFE54(2); + StartCursorAnim(CURSOR_ANIM_OPEN); sub_80CDC64(TRUE); HideBg(0); sMoveMonsPtr->state++; @@ -7982,7 +8030,7 @@ static bool8 sub_80D04C8(void) case 2: if (!DoMonPlaceChange()) { - sub_80CFE54(0); + StartCursorAnim(CURSOR_ANIM_BOUNCE); sub_80D0B5C(); sMoveMonsPtr->state++; } @@ -7991,7 +8039,7 @@ static bool8 sub_80D04C8(void) if (!IsDma3ManagerBusyWithBgCopy()) { LoadPalette(GetTextWindowPalette(3), 0xD0, 0x20); - sub_80CFE84(); + SetCursorPriorityTo1(); ShowBg(0); return FALSE; } @@ -8524,7 +8572,7 @@ static void Item_FromMonToMoving(u8 cursorArea, u8 cursorPos) SetPartyMonIconObjMode(cursorPos, 1); } - sPSSData->movingItemId = sPSSData->cursorMonItemId; + sPSSData->movingItemId = sPSSData->displayMonItemId; } static void sub_80D0F38(u16 itemId) @@ -8635,7 +8683,7 @@ static void sub_80D11CC(void) for (i = 0; i < MAX_ITEM_ICONS; i++) { if (sPSSData->itemIcons[i].active - && sPSSData->itemIcons[i].cursorArea == CURSOR_AREA_IN_PARTY) + && sPSSData->itemIcons[i].area == CURSOR_AREA_IN_PARTY) SetItemIconCallback(i, ITEM_CB_HIDE_PARTY, CURSOR_AREA_IN_HAND, 0); } } @@ -8668,7 +8716,7 @@ static bool8 IsMovingItem(void) for (i = 0; i < MAX_ITEM_ICONS; i++) { if (sPSSData->itemIcons[i].active - && sPSSData->itemIcons[i].cursorArea == CURSOR_AREA_IN_HAND) + && sPSSData->itemIcons[i].area == CURSOR_AREA_IN_HAND) return TRUE; } } @@ -8707,8 +8755,8 @@ static bool32 IsItemIconAtPosition(u8 cursorArea, u8 cursorPos) for (i = 0; i < MAX_ITEM_ICONS; i++) { if (sPSSData->itemIcons[i].active - && sPSSData->itemIcons[i].cursorArea == cursorArea - && sPSSData->itemIcons[i].cursorPos == cursorPos) + && sPSSData->itemIcons[i].area == cursorArea + && sPSSData->itemIcons[i].pos == cursorPos) return TRUE; } return FALSE; @@ -8721,8 +8769,8 @@ static u8 GetItemIconIdxByPosition(u8 cursorArea, u8 cursorPos) for (i = 0; i < MAX_ITEM_ICONS; i++) { if (sPSSData->itemIcons[i].active - && sPSSData->itemIcons[i].cursorArea == cursorArea - && sPSSData->itemIcons[i].cursorPos == cursorPos) + && sPSSData->itemIcons[i].area == cursorArea + && sPSSData->itemIcons[i].pos == cursorPos) return i; } return MAX_ITEM_ICONS; @@ -8772,8 +8820,8 @@ static void SetItemIconPosition(u8 id, u8 cursorArea, u8 cursorPos) break; } - sPSSData->itemIcons[id].cursorArea = cursorArea; - sPSSData->itemIcons[id].cursorPos = cursorPos; + sPSSData->itemIcons[id].area = cursorArea; + sPSSData->itemIcons[id].pos = cursorPos; } static void LoadItemIconGfx(u8 id, const u32 *itemTiles, const u32 *itemPal) @@ -8874,7 +8922,7 @@ static void PrintItemDescription(void) if (IsMovingItem()) description = ItemId_GetDescription(sPSSData->movingItemId); else - description = ItemId_GetDescription(sPSSData->cursorMonItemId); + description = ItemId_GetDescription(sPSSData->displayMonItemId); FillWindowPixelBuffer(2, PIXEL_FILL(1)); AddTextPrinterParameterized5(2, 1, description, 4, 0, 0, NULL, 0, 1); @@ -8974,9 +9022,9 @@ static void SpriteCB_ItemIcon_ToHand(struct Sprite *sprite) static void SpriteCB_ItemIcon_SetPosToCursor(struct Sprite *sprite) { - sprite->pos1.x = sPSSData->field_CB4->pos1.x + 4; - sprite->pos1.y = sPSSData->field_CB4->pos1.y + sPSSData->field_CB4->pos2.y + 8; - sprite->oam.priority = sPSSData->field_CB4->oam.priority; + sprite->pos1.x = sPSSData->cursorSprite->pos1.x + 4; + sprite->pos1.y = sPSSData->cursorSprite->pos1.y + sPSSData->cursorSprite->pos2.y + 8; + sprite->oam.priority = sPSSData->cursorSprite->oam.priority; } static void SpriteCB_ItemIcon_ToMon(struct Sprite *sprite) @@ -9133,9 +9181,9 @@ u32 GetBoxMonLevelAt(u8 boxId, u8 boxPosition) if (boxId < TOTAL_BOXES_COUNT && boxPosition < IN_BOX_COUNT && GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_HAS_SPECIES)) lvl = GetLevelFromBoxMonExp(&gPokemonStoragePtr->boxes[boxId][boxPosition]); - #ifdef BUGFIX +#ifdef BUGFIX else - #endif +#endif lvl = 0; return lvl; From 80cc7d46aeab92cf00e508d6c595cb7b590b3615 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 16 Apr 2021 05:14:35 -0400 Subject: [PATCH 48/63] Doc storage - fix row/column flip --- include/pokemon_storage_system.h | 10 +- src/pokemon_storage_system.c | 226 +++++++++++++++---------------- 2 files changed, 118 insertions(+), 118 deletions(-) diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 6e5eab3f9..24e92a449 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -2,13 +2,13 @@ #define GUARD_POKEMON_STORAGE_SYSTEM_H #define TOTAL_BOXES_COUNT 14 -#define IN_BOX_ROWS 6 -#define IN_BOX_COLUMNS 5 +#define IN_BOX_ROWS 5 // Number of rows, 6 Pokémon per row +#define IN_BOX_COLUMNS 6 // Number of columns, 5 Pokémon per column #define IN_BOX_COUNT (IN_BOX_ROWS * IN_BOX_COLUMNS) -/* - ROWS -COLUMNS 0 1 2 3 4 5 +/* + COLUMNS +ROWS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index f86a4bbbf..3b97b9153 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -4306,9 +4306,9 @@ static void InitBoxMonSprites(u8 boxId) boxPosition = 0; // For each box slot, create a Pokémon icon if a species is present - for (i = 0; i < IN_BOX_COLUMNS; i++) + for (i = 0; i < IN_BOX_ROWS; i++) { - for (j = 0; j < IN_BOX_ROWS; j++) + for (j = 0; j < IN_BOX_COLUMNS; j++) { species = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES2); if (species != SPECIES_NONE) @@ -4342,11 +4342,11 @@ static void sub_80CB140(u8 boxPosition) if (species != SPECIES_NONE) { - s16 x = 8 * (3 * (boxPosition % IN_BOX_ROWS)) + 100; - s16 y = 8 * (3 * (boxPosition / IN_BOX_ROWS)) + 44; + s16 x = 8 * (3 * (boxPosition % IN_BOX_COLUMNS)) + 100; + s16 y = 8 * (3 * (boxPosition / IN_BOX_COLUMNS)) + 44; u32 personality = GetCurrentBoxMonData(boxPosition, MON_DATA_PERSONALITY); - sPSSData->boxMonsSprites[boxPosition] = CreateMonIconSprite(species, personality, x, y, 2, 19 - (boxPosition % IN_BOX_ROWS)); + sPSSData->boxMonsSprites[boxPosition] = CreateMonIconSprite(species, personality, x, y, 2, 19 - (boxPosition % IN_BOX_COLUMNS)); if (sPSSData->boxOption == OPTION_MOVE_ITEMS) sPSSData->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; } @@ -4397,19 +4397,19 @@ static void sub_80CB278(struct Sprite *sprite) } } -static void DestroyAllIconsInRow(u8 row) +static void DestroyAllIconsInColumn(u8 column) { - u16 column; - u8 boxPosition = row; + u16 row; + u8 boxPosition = column; - for (column = 0; column < IN_BOX_COLUMNS; column++) + for (row = 0; row < IN_BOX_ROWS; row++) { if (sPSSData->boxMonsSprites[boxPosition] != NULL) { DestroyBoxMonIcon(sPSSData->boxMonsSprites[boxPosition]); sPSSData->boxMonsSprites[boxPosition] = NULL; } - boxPosition += IN_BOX_ROWS; + boxPosition += IN_BOX_COLUMNS; } } @@ -4425,7 +4425,7 @@ static u8 sub_80CB2F8(u8 row, u16 times, s16 xDelta) if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { - for (i = 0; i < IN_BOX_COLUMNS; i++) + for (i = 0; i < IN_BOX_ROWS; i++) { if (sPSSData->boxSpecies[boxPosition] != SPECIES_NONE) { @@ -4441,13 +4441,13 @@ static u8 sub_80CB2F8(u8 row, u16 times, s16 xDelta) count++; } } - boxPosition += IN_BOX_ROWS; + boxPosition += IN_BOX_COLUMNS; y += 24; } } else { - for (i = 0; i < IN_BOX_COLUMNS; i++) + for (i = 0; i < IN_BOX_ROWS; i++) { if (sPSSData->boxSpecies[boxPosition] != SPECIES_NONE) { @@ -4465,7 +4465,7 @@ static u8 sub_80CB2F8(u8 row, u16 times, s16 xDelta) count++; } } - boxPosition += IN_BOX_ROWS; + boxPosition += IN_BOX_COLUMNS; y += 24; } } @@ -4485,7 +4485,7 @@ static void sub_80CB4CC(u8 boxId, s8 direction) if (direction > 0) sPSSData->field_C68 = 0; else - sPSSData->field_C68 = IN_BOX_ROWS - 1; + sPSSData->field_C68 = IN_BOX_COLUMNS - 1; sPSSData->field_C62 = (24 * sPSSData->field_C68) + 100; sub_80CB1F0(sPSSData->field_C64); @@ -4502,7 +4502,7 @@ static bool8 sub_80CB584(void) sPSSData->field_C62 += sPSSData->field_C64; if (sPSSData->field_C62 <= 64 || sPSSData->field_C62 >= 252) { - DestroyAllIconsInRow(sPSSData->field_C68); + DestroyAllIconsInColumn(sPSSData->field_C68); sPSSData->field_C62 += sPSSData->field_C69 * 24; sPSSData->field_C6A++; } @@ -4510,7 +4510,7 @@ static bool8 sub_80CB584(void) case 1: sPSSData->field_C62 += sPSSData->field_C64; sPSSData->field_C66 += sub_80CB2F8(sPSSData->field_C68, sPSSData->field_C60, sPSSData->field_C64); - if ((sPSSData->field_C69 > 0 && sPSSData->field_C68 == IN_BOX_ROWS - 1) + if ((sPSSData->field_C69 > 0 && sPSSData->field_C68 == IN_BOX_COLUMNS - 1) || (sPSSData->field_C69 < 0 && sPSSData->field_C68 == 0)) { sPSSData->field_C6A++; @@ -4540,9 +4540,9 @@ static void SetBoxSpeciesAndPersonalities(u8 boxId) s32 i, j, boxPosition; boxPosition = 0; - for (i = 0; i < IN_BOX_COLUMNS; i++) + for (i = 0; i < IN_BOX_ROWS; i++) { - for (j = 0; j < IN_BOX_ROWS; j++) + for (j = 0; j < IN_BOX_COLUMNS; j++) { sPSSData->boxSpecies[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES2); if (sPSSData->boxSpecies[boxPosition] != SPECIES_NONE) @@ -4777,7 +4777,7 @@ static void sub_80CBCAC(u8 boxId, u8 position) { sPSSData->boxMonsSprites[position] = sPSSData->movingMonSprite; sPSSData->boxMonsSprites[position]->oam.priority = 2; - sPSSData->boxMonsSprites[position]->subpriority = 19 - (position % IN_BOX_ROWS); + sPSSData->boxMonsSprites[position]->subpriority = 19 - (position % IN_BOX_COLUMNS); } sPSSData->movingMonSprite->callback = SpriteCallbackDummy; sPSSData->movingMonSprite = NULL; @@ -5608,8 +5608,8 @@ static void GetCursorCoordsByPos(u8 cursorArea, u8 cursorPosition, u16 *x, u16 * switch (cursorArea) { case CURSOR_AREA_IN_BOX: - *x = (cursorPosition % IN_BOX_ROWS) * 24 + 100; - *y = (cursorPosition / IN_BOX_ROWS) * 24 + 32; + *x = (cursorPosition % IN_BOX_COLUMNS) * 24 + 100; + *y = (cursorPosition / IN_BOX_COLUMNS) * 24 + 32; break; case CURSOR_AREA_IN_PARTY: if (cursorPosition == 0) @@ -6776,9 +6776,9 @@ static u8 InBoxInput_Normal(void) if (JOY_REPEAT(DPAD_UP)) { retVal = INPUT_1; - if (sBoxCursorPosition >= IN_BOX_ROWS) + if (sBoxCursorPosition >= IN_BOX_COLUMNS) { - cursorPosition -= IN_BOX_ROWS; + cursorPosition -= IN_BOX_COLUMNS; } else { @@ -6790,7 +6790,7 @@ static u8 InBoxInput_Normal(void) else if (JOY_REPEAT(DPAD_DOWN)) { retVal = INPUT_1; - cursorPosition += IN_BOX_ROWS; + cursorPosition += IN_BOX_COLUMNS; if (cursorPosition >= IN_BOX_COUNT) { cursorArea = CURSOR_AREA_BUTTONS; @@ -6804,28 +6804,28 @@ static u8 InBoxInput_Normal(void) else if (JOY_REPEAT(DPAD_LEFT)) { retVal = INPUT_1; - if (sBoxCursorPosition % IN_BOX_ROWS != 0) + if (sBoxCursorPosition % IN_BOX_COLUMNS != 0) { cursorPosition--; } else { sPSSData->field_CD3 = -1; - cursorPosition += (IN_BOX_ROWS - 1); + cursorPosition += (IN_BOX_COLUMNS - 1); } break; } else if (JOY_REPEAT(DPAD_RIGHT)) { retVal = INPUT_1; - if ((sBoxCursorPosition + 1) % IN_BOX_ROWS != 0) + if ((sBoxCursorPosition + 1) % IN_BOX_COLUMNS != 0) { cursorPosition++; } else { sPSSData->field_CD3 = 1; - cursorPosition -= (IN_BOX_ROWS - 1); + cursorPosition -= (IN_BOX_COLUMNS - 1); } break; } @@ -6904,9 +6904,9 @@ static u8 InBoxInput_GrabbingMultiple(void) { if (JOY_REPEAT(DPAD_UP)) { - if (sBoxCursorPosition / IN_BOX_ROWS != 0) + if (sBoxCursorPosition / IN_BOX_COLUMNS != 0) { - sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - IN_BOX_ROWS); + sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - IN_BOX_COLUMNS); return INPUT_21; } else @@ -6916,9 +6916,9 @@ static u8 InBoxInput_GrabbingMultiple(void) } else if (JOY_REPEAT(DPAD_DOWN)) { - if (sBoxCursorPosition + IN_BOX_ROWS < IN_BOX_COUNT) + if (sBoxCursorPosition + IN_BOX_COLUMNS < IN_BOX_COUNT) { - sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + IN_BOX_ROWS); + sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + IN_BOX_COLUMNS); return INPUT_21; } else @@ -6928,7 +6928,7 @@ static u8 InBoxInput_GrabbingMultiple(void) } else if (JOY_REPEAT(DPAD_LEFT)) { - if (sBoxCursorPosition % IN_BOX_ROWS != 0) + if (sBoxCursorPosition % IN_BOX_COLUMNS != 0) { sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - 1); return INPUT_21; @@ -6940,7 +6940,7 @@ static u8 InBoxInput_GrabbingMultiple(void) } else if (JOY_REPEAT(DPAD_RIGHT)) { - if ((sBoxCursorPosition + 1) % IN_BOX_ROWS != 0) + if ((sBoxCursorPosition + 1) % IN_BOX_COLUMNS != 0) { sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + 1); return INPUT_21; @@ -6979,7 +6979,7 @@ static u8 InBoxInput_MovingMultiple(void) { if (sub_80D0580(0)) { - sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - IN_BOX_ROWS); + sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - IN_BOX_COLUMNS); return INPUT_25; } else @@ -6991,7 +6991,7 @@ static u8 InBoxInput_MovingMultiple(void) { if (sub_80D0580(1)) { - sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + IN_BOX_ROWS); + sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + IN_BOX_COLUMNS); return INPUT_25; } else @@ -7608,17 +7608,17 @@ static u8 GetBoxCursorPosition(void) return sBoxCursorPosition; } -static void sub_80CFE14(u8 *arg0, u8 *arg1) +static void sub_80CFE14(u8 *x, u8 *y) { if (sBoxCursorArea == CURSOR_AREA_IN_BOX) { - *arg0 = sBoxCursorPosition % IN_BOX_ROWS; - *arg1 = sBoxCursorPosition / IN_BOX_ROWS; + *x = sBoxCursorPosition % IN_BOX_COLUMNS; + *y = sBoxCursorPosition / IN_BOX_COLUMNS; } else { - *arg0 = 0; - *arg1 = 0; + *x = 0; + *y = 0; } } @@ -7812,16 +7812,16 @@ EWRAM_DATA static struct { u8 field_0; u8 state; - u8 fromRow; u8 fromColumn; - u8 toRow; + u8 fromRow; u8 toColumn; + u8 toRow; u8 field_6; u8 field_7; - u8 minRow; u8 minColumn; + u8 minRow; + u8 columnsTotal; u8 rowsTotal; - u8 columsTotal; u16 bgX; u16 bgY; u16 field_10; @@ -7887,14 +7887,14 @@ static bool8 sub_80D024C(void) sMoveMonsPtr->state++; break; case 1: - sub_80CFE14(&sMoveMonsPtr->fromRow, &sMoveMonsPtr->fromColumn); - sMoveMonsPtr->toRow = sMoveMonsPtr->fromRow; + sub_80CFE14(&sMoveMonsPtr->fromColumn, &sMoveMonsPtr->fromRow); sMoveMonsPtr->toColumn = sMoveMonsPtr->fromColumn; + sMoveMonsPtr->toRow = sMoveMonsPtr->fromRow; ChangeBgX(0, -1024, 0); ChangeBgY(0, -1024, 0); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); FillWindowPixelBuffer8Bit(sPSSData->field_2200, PIXEL_FILL(0)); - sub_80D07B0(sMoveMonsPtr->fromRow, sMoveMonsPtr->fromColumn); + sub_80D07B0(sMoveMonsPtr->fromColumn, sMoveMonsPtr->fromRow); SetBgAttribute(0, BG_ATTR_PALETTEMODE, 1); PutWindowTilemap(sPSSData->field_2200); CopyWindowToVram8Bit(sPSSData->field_2200, 3); @@ -7951,8 +7951,8 @@ static bool8 sub_80D03B0(void) { sub_80CFE14(&sMoveMonsPtr->field_6, &sMoveMonsPtr->field_7); sub_80D062C(); - sMoveMonsPtr->toRow = sMoveMonsPtr->field_6; - sMoveMonsPtr->toColumn = sMoveMonsPtr->field_7; + sMoveMonsPtr->toColumn = sMoveMonsPtr->field_6; + sMoveMonsPtr->toRow = sMoveMonsPtr->field_7; CopyWindowToVram8Bit(sPSSData->field_2200, 2); sMoveMonsPtr->state++; } @@ -8054,27 +8054,27 @@ static bool8 sub_80D0580(u8 arg0) switch (arg0) { case 0: - if (sMoveMonsPtr->minColumn == 0) - return FALSE; - sMoveMonsPtr->minColumn--; - sub_80D0884(0, 1024, 6); - break; - case 1: - if (sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal >= 5) - return FALSE; - sMoveMonsPtr->minColumn++; - sub_80D0884(0, -1024, 6); - break; - case 2: if (sMoveMonsPtr->minRow == 0) return FALSE; sMoveMonsPtr->minRow--; + sub_80D0884(0, 1024, 6); + break; + case 1: + if (sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal >= IN_BOX_ROWS) + return FALSE; + sMoveMonsPtr->minRow++; + sub_80D0884(0, -1024, 6); + break; + case 2: + if (sMoveMonsPtr->minColumn == 0) + return FALSE; + sMoveMonsPtr->minColumn--; sub_80D0884(1024, 0, 6); break; case 3: - if (sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal > 5) + if (sMoveMonsPtr->minColumn + sMoveMonsPtr->columnsTotal >= IN_BOX_COLUMNS) return FALSE; - sMoveMonsPtr->minRow++; + sMoveMonsPtr->minColumn++; sub_80D0884(-1024, 0, 6); break; } @@ -8084,25 +8084,25 @@ static bool8 sub_80D0580(u8 arg0) static void sub_80D062C(void) { - s16 var = (abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->field_6)) - (abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->toRow)); - s16 var2 = (abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->field_7)) - (abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->toColumn)); + s16 var = (abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->field_6)) - (abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->toColumn)); + s16 var2 = (abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->field_7)) - (abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->toRow)); if (var > 0) - sub_80D06D0(sMoveMonsPtr->field_6, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); + sub_80D06D0(sMoveMonsPtr->field_6, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); if (var < 0) { - sub_80D0740(sMoveMonsPtr->toRow, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); - sub_80D06D0(sMoveMonsPtr->field_6, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); + sub_80D0740(sMoveMonsPtr->toColumn, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); + sub_80D06D0(sMoveMonsPtr->field_6, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); } if (var2 > 0) - sub_80D0708(sMoveMonsPtr->field_7, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); + sub_80D0708(sMoveMonsPtr->field_7, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); if (var2 < 0) { - sub_80D0778(sMoveMonsPtr->toColumn, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); - sub_80D0708(sMoveMonsPtr->field_7, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); + sub_80D0778(sMoveMonsPtr->toRow, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); + sub_80D0708(sMoveMonsPtr->field_7, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); } } @@ -8162,9 +8162,9 @@ static void sub_80D0778(u8 arg0, u8 arg1, u8 arg2) sub_80D0834(arg1++, arg0); } -static void sub_80D07B0(u8 arg0, u8 arg1) +static void sub_80D07B0(u8 x, u8 y) { - u8 position = arg0 + (6 * arg1); + u8 position = x + (IN_BOX_COLUMNS * y); u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2); u32 personality = GetCurrentBoxMonData(position, MON_DATA_PERSONALITY); @@ -8179,34 +8179,34 @@ static void sub_80D07B0(u8 arg0, u8 arg1) 0, 32, 32, - 24 * arg0, - 24 * arg1, + 24 * x, + 24 * y, 32, 32, index); } } -static void sub_80D0834(u8 arg0, u8 arg1) +static void sub_80D0834(u8 x, u8 y) { - u8 position = arg0 + (6 * arg1); + u8 position = x + (IN_BOX_COLUMNS * y); u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2); if (species != SPECIES_NONE) { FillWindowPixelRect8Bit(sPSSData->field_2200, PIXEL_FILL(0), - 24 * arg0, - 24 * arg1, + 24 * x, + 24 * y, 32, 32); } } -static void sub_80D0884(u16 arg0, u16 arg1, u16 arg2) +static void sub_80D0884(u16 x, u16 y, u16 arg2) { - sMoveMonsPtr->bgX = arg0; - sMoveMonsPtr->bgY = arg1; + sMoveMonsPtr->bgX = x; + sMoveMonsPtr->bgY = y; sMoveMonsPtr->field_10 = arg2; } @@ -8225,22 +8225,22 @@ static u8 sub_80D0894(void) static void sub_80D08CC(void) { s32 i, j; - s32 rowCount, columnCount; + s32 columnCount, rowCount; u8 boxId; u8 monArrayId; - sMoveMonsPtr->minRow = min(sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); sMoveMonsPtr->minColumn = min(sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); + sMoveMonsPtr->minRow = min(sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); + sMoveMonsPtr->columnsTotal = abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->toColumn) + 1; sMoveMonsPtr->rowsTotal = abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->toRow) + 1; - sMoveMonsPtr->columsTotal = abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->toColumn) + 1; boxId = StorageGetCurrentBox(); monArrayId = 0; + columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columnsTotal; rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; - columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal; - for (i = sMoveMonsPtr->minColumn; i < columnCount; i++) + for (i = sMoveMonsPtr->minRow; i < rowCount; i++) { - u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow; - for (j = sMoveMonsPtr->minRow; j < rowCount; j++) + u8 boxPosition = (IN_BOX_COLUMNS * i) + sMoveMonsPtr->minColumn; + for (j = sMoveMonsPtr->minColumn; j < columnCount; j++) { struct BoxPokemon *boxMon = GetBoxedMonPtr(boxId, boxPosition); // UB: possible null dereference @@ -8259,14 +8259,14 @@ static void sub_80D08CC(void) static void sub_80D09A4(void) { s32 i, j; + s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columnsTotal; s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; - s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal; u8 boxId = StorageGetCurrentBox(); - for (i = sMoveMonsPtr->minColumn; i < columnCount; i++) + for (i = sMoveMonsPtr->minRow; i < rowCount; i++) { - u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow; - for (j = sMoveMonsPtr->minRow; j < rowCount; j++) + u8 boxPosition = (IN_BOX_COLUMNS * i) + sMoveMonsPtr->minColumn; + for (j = sMoveMonsPtr->minColumn; j < columnCount; j++) { DestroyBoxMonIconAtPosition(boxPosition); ZeroBoxMonAt(boxId, boxPosition); @@ -8278,14 +8278,14 @@ static void sub_80D09A4(void) static void sub_80D0A1C(void) { s32 i, j; + s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columnsTotal; s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; - s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal; u8 monArrayId = 0; - for (i = sMoveMonsPtr->minColumn; i < columnCount; i++) + for (i = sMoveMonsPtr->minRow; i < rowCount; i++) { - u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow; - for (j = sMoveMonsPtr->minRow; j < rowCount; j++) + u8 boxPosition = (IN_BOX_COLUMNS * i) + sMoveMonsPtr->minColumn; + for (j = sMoveMonsPtr->minColumn; j < columnCount; j++) { if (GetBoxMonData(&sMoveMonsPtr->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES)) sub_80CB140(boxPosition); @@ -8298,15 +8298,15 @@ static void sub_80D0A1C(void) static void sub_80D0AAC(void) { s32 i, j; + s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columnsTotal; s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; - s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal; u8 boxId = StorageGetCurrentBox(); u8 monArrayId = 0; - for (i = sMoveMonsPtr->minColumn; i < columnCount; i++) + for (i = sMoveMonsPtr->minRow; i < rowCount; i++) { - u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow; - for (j = sMoveMonsPtr->minRow; j < rowCount; j++) + u8 boxPosition = (IN_BOX_COLUMNS * i) + sMoveMonsPtr->minColumn; + for (j = sMoveMonsPtr->minColumn; j < columnCount; j++) { if (GetBoxMonData(&sMoveMonsPtr->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES)) SetBoxMonAt(boxId, boxPosition, &sMoveMonsPtr->boxMons[monArrayId]); @@ -8328,20 +8328,20 @@ static void sub_80D0B5C(void) static u8 sub_80D0BA4(void) { - return (IN_BOX_ROWS * sMoveMonsPtr->fromColumn) + sMoveMonsPtr->fromRow; + return (IN_BOX_COLUMNS * sMoveMonsPtr->fromRow) + sMoveMonsPtr->fromColumn; } static bool8 sub_80D0BC0(void) { s32 i, j; + s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columnsTotal; s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; - s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columsTotal; u8 monArrayId = 0; - for (i = sMoveMonsPtr->minColumn; i < columnCount; i++) + for (i = sMoveMonsPtr->minRow; i < rowCount; i++) { - u8 boxPosition = (IN_BOX_ROWS * i) + sMoveMonsPtr->minRow; - for (j = sMoveMonsPtr->minRow; j < rowCount; j++) + u8 boxPosition = (IN_BOX_COLUMNS * i) + sMoveMonsPtr->minColumn; + for (j = sMoveMonsPtr->minColumn; j < columnCount; j++) { if (GetBoxMonData(&sMoveMonsPtr->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES) && GetCurrentBoxMonData(boxPosition, MON_DATA_SANITY_HAS_SPECIES)) @@ -8791,7 +8791,7 @@ static u8 GetItemIconIdxBySprite(struct Sprite *sprite) static void SetItemIconPosition(u8 id, u8 cursorArea, u8 cursorPos) { - u8 row, column; + u8 x, y; if (id >= MAX_ITEM_ICONS) return; @@ -8799,10 +8799,10 @@ static void SetItemIconPosition(u8 id, u8 cursorArea, u8 cursorPos) switch (cursorArea) { case CURSOR_AREA_IN_BOX: - row = cursorPos % IN_BOX_ROWS; - column = cursorPos / IN_BOX_ROWS; - sPSSData->itemIcons[id].sprite->pos1.x = (24 * row) + 112; - sPSSData->itemIcons[id].sprite->pos1.y = (24 * column) + 56; + x = cursorPos % IN_BOX_COLUMNS; + y = cursorPos / IN_BOX_COLUMNS; + sPSSData->itemIcons[id].sprite->pos1.x = (24 * x) + 112; + sPSSData->itemIcons[id].sprite->pos1.y = (24 * y) + 56; sPSSData->itemIcons[id].sprite->oam.priority = 2; break; case CURSOR_AREA_IN_PARTY: From 96dabc1a7f991a57d955723f67989e2d4101f2bd Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 16 Apr 2021 17:05:44 -0400 Subject: [PATCH 49/63] Doc storage - multi move --- src/pokemon_storage_system.c | 1208 ++++++++++++++++++---------------- 1 file changed, 629 insertions(+), 579 deletions(-) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 3b97b9153..5b16011fb 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -150,29 +150,29 @@ enum { INPUT_1, INPUT_2, // Unused INPUT_3, // Unused - INPUT_4, - INPUT_5, - INPUT_6, - INPUT_7, - INPUT_8, - INPUT_9, - INPUT_10, - INPUT_11, - INPUT_12, - INPUT_13, - INPUT_14, - INPUT_15, - INPUT_16, - INPUT_17, - INPUT_18, - INPUT_19, - INPUT_20, - INPUT_21, - INPUT_22, - INPUT_23, - INPUT_24, - INPUT_25, - INPUT_26, + INPUT_CLOSE_BOX, + INPUT_SHOW_PARTY, + INPUT_HIDE_PARTY, + INPUT_BOX_OPTIONS, + INPUT_IN_MENU, + INPUT_SCROLL_RIGHT, + INPUT_SCROLL_LEFT, + INPUT_DEPOSIT, + INPUT_WITHDRAW, + INPUT_MOVE_MON, + INPUT_SHIFT_MON, + INPUT_PLACE_MON, + INPUT_TAKE_ITEM, + INPUT_GIVE_ITEM, + INPUT_SWITCH_ITEMS, + INPUT_PRESSED_B, + INPUT_MULTIMOVE_START, + INPUT_MULTIMOVE_CHANGE_SELECTION, + INPUT_MULTIMOVE_SINGLE, + INPUT_MULTIMOVE_GRAB_SELECTION, + INPUT_MULTIMOVE_UNABLE, + INPUT_MULTIMOVE_MOVE_MONS, + INPUT_MULTIMOVE_PLACE_MONS, }; enum { @@ -284,6 +284,31 @@ enum { RELEASE_ANIM_CAME_BACK, }; +// Modes for selecting and moving Pokémon in the box. +// "MULTIPLE" mode allows up to an entire box to be +// picked up at once by pressing Select then holding +// down the A button. While holding A down, the player +// may move the cursor around to select multiple Pokémon. +// This is MOVE_MODE_MULTIPLE_SELECTING. After releasing A +// those Pokémon will be picked up and can be moved around +// as a single unit. This is MOVE_MODE_MULTIPLE_MOVING +enum { + MOVE_MODE_NORMAL, + MOVE_MODE_MULTIPLE_SELECTING, + MOVE_MODE_MULTIPLE_MOVING, +}; + +// IDs for the main functions for moving multiple Pokémon. +// Given as arguments to MultiMove_SetFunction +enum { + MULTIMOVE_START, + MULTIMOVE_CANCEL, + MULTIMOVE_CHANGE_SELECTION, + MULTIMOVE_GRAB_SELECTION, + MULTIMOVE_MOVE_MONS, + MULTIMOVE_PLACE_MONS, +}; + struct Wallpaper { const u32 *tiles; @@ -439,7 +464,7 @@ struct PokemonStorageSystemData u32 field_CC8; s16 field_CCC; s16 field_CCE; - u16 field_CD0; + u16 cursorMoveSteps; s8 field_CD2; s8 field_CD3; u8 field_CD4; @@ -493,7 +518,7 @@ struct PokemonStorageSystemData u8 releaseMonName[POKEMON_NAME_LENGTH + 1]; u8 itemName[20]; u8 inBoxMovingMode; - u16 field_2200; + u16 multiMoveWindowId; struct ItemIcon itemIcons[MAX_ITEM_ICONS]; u16 movingItemId; u16 itemInfoWindowOffset; @@ -547,12 +572,12 @@ EWRAM_DATA static u8 sWhichToReshow = 0; EWRAM_DATA static u8 sLastUsedBox = 0; EWRAM_DATA static u16 sMovingItemId = 0; EWRAM_DATA static struct Pokemon gUnknown_02039D14 = {0}; -EWRAM_DATA static s8 sBoxCursorArea = 0; -EWRAM_DATA static s8 sBoxCursorPosition = 0; +EWRAM_DATA static s8 sCursorArea = 0; +EWRAM_DATA static s8 sCursorPosition = 0; EWRAM_DATA static bool8 sIsMonBeingMoved = 0; EWRAM_DATA static u8 sMovingMonOrigBoxId = 0; EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0; -EWRAM_DATA static bool8 sCanOnlyMove = 0; +EWRAM_DATA static bool8 sAutoActionOn = 0; static void CreateMainMenu(u8, s16 *); static void Cb2_EnterPSS(u8); @@ -573,7 +598,7 @@ static void ScrollBackground(void); static void ChooseBoxMenu_MoveRight(void); static void ChooseBoxMenu_PrintInfo(void); static void sub_80CAA14(void); -static void sub_80CFDC4(void); +static void ToggleCursorAutoAction(void); static void sub_80CE790(void); static void sub_80CE8E4(void); static void GiveChosenBagItem(void); @@ -598,7 +623,6 @@ static void sub_80CA0D8(void); static void AddMenu(void); static void InitReleaseMon(void); static void InitCanReleaseMonVars(void); -static void sub_80D01B8(void); static void ReleaseMon(void); static void RefreshDisplayMonData(void); static void CreateDisplayMonSprite(void); @@ -649,9 +673,7 @@ static bool32 WaitForWallpaperGfxLoad(void); static bool8 InitPSSWindows(void); static bool8 ResetReleaseMonSpritePtr(void); static bool8 TryHideReleaseMon(void); -static bool8 sub_80D0164(void); static bool8 IsInitBoxActive(void); -static bool8 sub_80D01E4(void); static bool8 sub_80CDED4(void); static bool8 sub_80CDF08(void); static bool8 UpdateItemInfoWindowSlideIn(void); @@ -659,16 +681,14 @@ static bool8 UpdateItemInfoWindowSlideOut(void); static bool8 DoShowPartyMenu(void); static bool8 IsItemIconAnimActive(void); static bool8 ScrollToBox(void); -static bool8 sub_80CD554(void); +static bool8 UpdateCursorPos(void); static bool8 HidePartyMenu(void); static bool8 IsMovingItem(void); -static bool8 sub_80D0580(u8); -static bool8 sub_80D0BC0(void); static bool8 IsDisplayMosaicActive(void); static bool8 DoWallpaperGfxChange(void); static bool8 DoMonPlaceChange(void); static bool8 IsMenuLoading(void); -static bool8 CanMovePartyMon(void); +static bool8 IsRemovingLastPartyMon(void); static bool8 CanShiftMon(void); static bool8 IsCursorOnCloseBox(void); static bool8 IsCursorOnBox(void); @@ -713,14 +733,13 @@ static void InitMonPlaceChange(u8); static void SetMonMarkings(u8); static void ShowYesNoWindow(s8); static void sub_80CDBF8(u8); -static void sub_80D01D0(u8); static void AnimateBoxScrollArrows(bool8); static void sub_80CA984(bool8); static void CreatePartyMonsSprites(bool8); static void PrintMessage(u8 id); static s16 HandleMenuInput(void); static s8 RunCanReleaseMon(void); -static u8 GetBoxCursorPosition(void); +static u8 GetCursorPosition(void); static void Item_FromMonToMoving(u8, u8); static void Item_GiveMovingToMon(u8, u8); static void Item_TakeMons(u8, u8); @@ -764,32 +783,11 @@ static void SetDisplayMonData(void *, u8); static bool32 AtLeastThreeUsableMons(void); static u8 InBoxInput_Normal(void); static u8 InBoxInput_MovingMultiple(void); -static u8 InBoxInput_GrabbingMultiple(void); +static u8 InBoxInput_SelectingMultiple(void); static s8 GetMenuItemTextId(u8); -static u8 sub_80CFA5C(void); -static u8 sub_80D0BA4(void); -static bool8 sub_80CFA84(void); -static bool8 sub_80CFB44(void); -static bool8 sub_80D024C(void); -static bool8 sub_80D0344(void); -static bool8 sub_80D03B0(void); -static bool8 sub_80D0420(void); -static bool8 sub_80D04A0(void); -static bool8 sub_80D04C8(void); -static void sub_80D07B0(u8, u8); -static void sub_80D0834(u8, u8); -static void sub_80D0B5C(void); -static void sub_80D062C(void); -static void sub_80D0884(u16, u16, u16); -static void sub_80D08CC(void); -static void sub_80D09A4(void); -static void sub_80D0A1C(void); -static void sub_80D0AAC(void); -static u8 sub_80D0894(void); -static void sub_80D0778(u8, u8, u8); -static void sub_80D0708(u8, u8, u8); -static void sub_80D06D0(u8, u8, u8); -static void sub_80D0740(u8, u8, u8); +static u8 SetSelectionMenuTexts(void); +static bool8 SetMenuTexts_Mon(void); +static bool8 SetMenuTexts_Item(void); static void sub_80D27AC(u8, u16, u16, u16, u16); static void sub_80D27F4(u8, u8, s8); static void sub_80D2644(u8, u8, const void *, u16, u16); @@ -806,6 +804,35 @@ static void sub_80D2C1C(struct UnkStruct_2000028 *); static u8 GetBoxWallpaper(u8); static void SetBoxWallpaper(u8, u8); +// Functions for moving multiple Pokémon at once +static void MultiMove_Free(void); +static bool8 MultiMove_Init(void); +static bool8 MultiMove_RunFunction(void); +static bool8 MultiMove_TryMoveGroup(u8); +static bool8 MultiMove_CanPlaceSelection(void); +static void MultiMove_SetFunction(u8); +static u8 MultiMove_GetOrigin(void); +static bool8 MultiMove_Start(void); +static bool8 MultiMove_Cancel(void); +static bool8 MultiMove_ChangeSelection(void); +static bool8 MultiMove_GrabSelection(void); +static bool8 MultiMove_MoveMons(void); +static bool8 MultiMove_PlaceMons(void); +static void MultiMove_SetIconToBg(u8, u8); +static void MultiMove_ClearIconFromBg(u8, u8); +static void MultiMove_ResetBg(void); +static void MultiMove_UpdateSelectedIcons(void); +static void MultiMove_InitMove(u16, u16, u16); +static void MultiMove_GetMonsFromSelection(void); +static void MultiMove_RemoveMonsFromBox(void); +static void MultiMove_CreatePlacedMonIcons(void); +static void MultiMove_SetPlacedMonData(void); +static u8 MultiMove_UpdateMove(void); +static void MultiMove_DeselectRow(u8, u8, u8); +static void MultiMove_SelectRow(u8, u8, u8); +static void MultiMove_SelectColumn(u8, u8, u8); +static void MultiMove_DeselectColumn(u8, u8, u8); + struct { const u8 *text; const u8 *desc; @@ -2048,7 +2075,7 @@ static void Cb_InitPSS(u8 taskId) sub_80CD3EC(); break; case 5: - if (!sub_80D0164()) + if (!MultiMove_Init()) { SetPSSCallback(Cb_ChangeScreen); return; @@ -2158,22 +2185,38 @@ static void Cb_ReshowPSS(u8 taskId) } } +// States for the outer switch in Cb_MainPSS +enum { + MSTATE_HANDLE_INPUT, + MSTATE_1, + MSTATE_SCROLL_BOX, + MSTATE_WAIT_MSG, + MSTATE_ERROR_LAST_PARTY_MON, + MSTATE_ERROR_HAS_MAIL, + MSTATE_WAIT_ERROR_MSG, + MSTATE_MULTIMOVE_RUN, + MSTATE_MULTIMOVE_RUN_CANCEL, + MSTATE_MULTIMOVE_RUN_MOVED, + MSTATE_SCROLL_BOX_ITEM, + MSTATE_WAIT_ITEM_ANIM, +}; + static void Cb_MainPSS(u8 taskId) { switch (sPSSData->state) { - case 0: + case MSTATE_HANDLE_INPUT: switch (HandleInput()) { case INPUT_1: PlaySE(SE_SELECT); - sPSSData->state = 1; + sPSSData->state = MSTATE_1; break; - case INPUT_5: + case INPUT_SHOW_PARTY: if (sPSSData->boxOption != OPTION_MOVE_MONS && sPSSData->boxOption != OPTION_MOVE_ITEMS) { PrintMessage(MSG_WHICH_ONE_WILL_TAKE); - sPSSData->state = 3; + sPSSData->state = MSTATE_WAIT_MSG; } else { @@ -2181,11 +2224,11 @@ static void Cb_MainPSS(u8 taskId) SetPSSCallback(Cb_ShowPartyPokemon); } break; - case INPUT_6: + case INPUT_HIDE_PARTY: if (sPSSData->boxOption == OPTION_MOVE_MONS) { if (IsMonBeingMoved() && ItemIsMail(sPSSData->displayMonItemId)) - sPSSData->state = 5; + sPSSData->state = MSTATE_ERROR_HAS_MAIL; else SetPSSCallback(Cb_HidePartyPokemon); } @@ -2194,20 +2237,20 @@ static void Cb_MainPSS(u8 taskId) SetPSSCallback(Cb_HidePartyPokemon); } break; - case INPUT_4: + case INPUT_CLOSE_BOX: SetPSSCallback(Cb_OnCloseBoxPressed); break; - case INPUT_19: + case INPUT_PRESSED_B: SetPSSCallback(Cb_OnBPressed); break; - case INPUT_7: + case INPUT_BOX_OPTIONS: PlaySE(SE_SELECT); SetPSSCallback(Cb_HandleBoxOptions); break; - case INPUT_8: + case INPUT_IN_MENU: SetPSSCallback(Cb_OnSelectedMon); break; - case INPUT_9: + case INPUT_SCROLL_RIGHT: PlaySE(SE_SELECT); sPSSData->newCurrBoxId = StorageGetCurrentBox() + 1; if (sPSSData->newCurrBoxId >= TOTAL_BOXES_COUNT) @@ -2215,15 +2258,15 @@ static void Cb_MainPSS(u8 taskId) if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { SetUpScrollToBox(sPSSData->newCurrBoxId); - sPSSData->state = 2; + sPSSData->state = MSTATE_SCROLL_BOX; } else { sub_80CFEA8(); - sPSSData->state = 10; + sPSSData->state = MSTATE_SCROLL_BOX_ITEM; } break; - case INPUT_10: + case INPUT_SCROLL_LEFT: PlaySE(SE_SELECT); sPSSData->newCurrBoxId = StorageGetCurrentBox() - 1; if (sPSSData->newCurrBoxId < 0) @@ -2231,20 +2274,20 @@ static void Cb_MainPSS(u8 taskId) if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { SetUpScrollToBox(sPSSData->newCurrBoxId); - sPSSData->state = 2; + sPSSData->state = MSTATE_SCROLL_BOX; } else { sub_80CFEA8(); - sPSSData->state = 10; + sPSSData->state = MSTATE_SCROLL_BOX_ITEM; } break; - case INPUT_11: - if (!CanMovePartyMon()) + case INPUT_DEPOSIT: + if (!IsRemovingLastPartyMon()) { if (ItemIsMail(sPSSData->displayMonItemId)) { - sPSSData->state = 5; + sPSSData->state = MSTATE_ERROR_HAS_MAIL; } else { @@ -2254,13 +2297,13 @@ static void Cb_MainPSS(u8 taskId) } else { - sPSSData->state = 4; + sPSSData->state = MSTATE_ERROR_LAST_PARTY_MON; } break; - case INPUT_13: - if (CanMovePartyMon()) + case INPUT_MOVE_MON: + if (IsRemovingLastPartyMon()) { - sPSSData->state = 4; + sPSSData->state = MSTATE_ERROR_LAST_PARTY_MON; } else { @@ -2268,10 +2311,10 @@ static void Cb_MainPSS(u8 taskId) SetPSSCallback(Cb_MoveMon); } break; - case INPUT_14: + case INPUT_SHIFT_MON: if (!CanShiftMon()) { - sPSSData->state = 4; + sPSSData->state = MSTATE_ERROR_LAST_PARTY_MON; } else { @@ -2279,61 +2322,63 @@ static void Cb_MainPSS(u8 taskId) SetPSSCallback(Cb_ShiftMon); } break; - case INPUT_12: + case INPUT_WITHDRAW: PlaySE(SE_SELECT); SetPSSCallback(Cb_WithdrawMon); break; - case INPUT_15: + case INPUT_PLACE_MON: PlaySE(SE_SELECT); SetPSSCallback(Cb_PlaceMon); break; - case INPUT_16: + case INPUT_TAKE_ITEM: PlaySE(SE_SELECT); SetPSSCallback(Cb_TakeItemForMoving); break; - case INPUT_17: + case INPUT_GIVE_ITEM: PlaySE(SE_SELECT); SetPSSCallback(Cb_GiveMovingItemToMon); break; - case INPUT_18: + case INPUT_SWITCH_ITEMS: PlaySE(SE_SELECT); SetPSSCallback(Cb_SwitchSelectedItem); break; - case INPUT_20: + case INPUT_MULTIMOVE_START: PlaySE(SE_SELECT); - sub_80D01D0(0); - sPSSData->state = 7; + MultiMove_SetFunction(MULTIMOVE_START); + sPSSData->state = MSTATE_MULTIMOVE_RUN; break; - case INPUT_22: - sub_80D01D0(1); - sPSSData->state = 8; + case INPUT_MULTIMOVE_SINGLE: + MultiMove_SetFunction(MULTIMOVE_CANCEL); + sPSSData->state = MSTATE_MULTIMOVE_RUN_CANCEL; break; - case INPUT_21: + case INPUT_MULTIMOVE_CHANGE_SELECTION: PlaySE(SE_SELECT); - sub_80D01D0(2); - sPSSData->state = 9; + MultiMove_SetFunction(MULTIMOVE_CHANGE_SELECTION); + sPSSData->state = MSTATE_MULTIMOVE_RUN_MOVED; break; - case INPUT_23: - sub_80D01D0(3); - sPSSData->state = 7; + case INPUT_MULTIMOVE_GRAB_SELECTION: + MultiMove_SetFunction(MULTIMOVE_GRAB_SELECTION); + sPSSData->state = MSTATE_MULTIMOVE_RUN; break; - case INPUT_25: + case INPUT_MULTIMOVE_MOVE_MONS: PlaySE(SE_SELECT); - sub_80D01D0(4); - sPSSData->state = 9; + MultiMove_SetFunction(MULTIMOVE_MOVE_MONS); + sPSSData->state = MSTATE_MULTIMOVE_RUN_MOVED; break; - case INPUT_26: + case INPUT_MULTIMOVE_PLACE_MONS: PlaySE(SE_SELECT); - sub_80D01D0(5); - sPSSData->state = 7; + MultiMove_SetFunction(MULTIMOVE_PLACE_MONS); + sPSSData->state = MSTATE_MULTIMOVE_RUN; break; - case INPUT_24: + case INPUT_MULTIMOVE_UNABLE: + // When selecting/moving multiple Pokémon the + // cursor may not wrap around the edges. PlaySE(SE_FAILURE); break; } break; - case 1: - if (!sub_80CD554()) + case MSTATE_1: + if (!UpdateCursorPos()) { if (IsCursorOnCloseBox()) sub_80CA9C0(); @@ -2342,10 +2387,10 @@ static void Cb_MainPSS(u8 taskId) if (sPSSData->setMosaic) StartDisplayMonMosaicEffect(); - sPSSData->state = 0; + sPSSData->state = MSTATE_HANDLE_INPUT; } break; - case 2: + case MSTATE_SCROLL_BOX: if (!ScrollToBox()) { SetCurrentBox(sPSSData->newCurrBoxId); @@ -2358,64 +2403,68 @@ static void Cb_MainPSS(u8 taskId) if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { sub_80CFECC(); - sPSSData->state = 11; + sPSSData->state = MSTATE_WAIT_ITEM_ANIM; } else { - sPSSData->state = 0; + sPSSData->state = MSTATE_HANDLE_INPUT; } } break; - case 3: + case MSTATE_WAIT_MSG: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - sPSSData->state = 0; + sPSSData->state = MSTATE_HANDLE_INPUT; } break; - case 4: + case MSTATE_ERROR_LAST_PARTY_MON: PlaySE(SE_FAILURE); PrintMessage(MSG_LAST_POKE); - sPSSData->state = 6; + sPSSData->state = MSTATE_WAIT_ERROR_MSG; break; - case 5: + case MSTATE_ERROR_HAS_MAIL: PlaySE(SE_FAILURE); PrintMessage(MSG_PLEASE_REMOVE_MAIL); - sPSSData->state = 6; + sPSSData->state = MSTATE_WAIT_ERROR_MSG; break; - case 6: + case MSTATE_WAIT_ERROR_MSG: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); SetPSSCallback(Cb_MainPSS); } break; - case 7: - if (!sub_80D01E4()) - sPSSData->state = 0; + case MSTATE_MULTIMOVE_RUN: + if (!MultiMove_RunFunction()) + sPSSData->state = MSTATE_HANDLE_INPUT; break; - case 8: - if (!sub_80D01E4()) + case MSTATE_MULTIMOVE_RUN_CANCEL: + // Began a multiple Pokémon selection but + // ended up selecting a single Pokémon. + // Wait for multi move to cancel, then + // do a normal move. + if (!MultiMove_RunFunction()) SetPSSCallback(Cb_MoveMon); break; - case 9: - if (!sub_80D01E4()) + case MSTATE_MULTIMOVE_RUN_MOVED: + if (!MultiMove_RunFunction()) { if (sPSSData->setMosaic) StartDisplayMonMosaicEffect(); - sPSSData->state = 0; + sPSSData->state = MSTATE_HANDLE_INPUT; } break; - case 10: + case MSTATE_SCROLL_BOX_ITEM: if (!IsItemIconAnimActive()) { SetUpScrollToBox(sPSSData->newCurrBoxId); - sPSSData->state = 2; + sPSSData->state = MSTATE_SCROLL_BOX; } break; - case 11: + case MSTATE_WAIT_ITEM_ANIM: if (!IsItemIconAnimActive()) - sPSSData->state = 0; + sPSSData->state = MSTATE_HANDLE_INPUT; break; } } @@ -2452,7 +2501,7 @@ static void Cb_HidePartyPokemon(u8 taskId) } break; case 2: - if (!sub_80CD554()) + if (!UpdateCursorPos()) { if (sPSSData->setMosaic) StartDisplayMonMosaicEffect(); @@ -2494,7 +2543,7 @@ static void Cb_OnSelectedMon(u8 taskId) SetPSSCallback(Cb_MainPSS); break; case MENU_MOVE: - if (CanMovePartyMon()) + if (IsRemovingLastPartyMon()) { sPSSData->state = 3; } @@ -2528,7 +2577,7 @@ static void Cb_OnSelectedMon(u8 taskId) SetPSSCallback(Cb_WithdrawMon); break; case MENU_STORE: - if (CanMovePartyMon()) + if (IsRemovingLastPartyMon()) { sPSSData->state = 3; } @@ -2544,7 +2593,7 @@ static void Cb_OnSelectedMon(u8 taskId) } break; case MENU_RELEASE: - if (CanMovePartyMon()) + if (IsRemovingLastPartyMon()) { sPSSData->state = 3; } @@ -2965,7 +3014,7 @@ static void Cb_TakeItemForMoving(u8 taskId) break; case 1: StartCursorAnim(CURSOR_ANIM_OPEN); - Item_FromMonToMoving((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); + Item_FromMonToMoving((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); sPSSData->state++; break; case 2: @@ -2995,7 +3044,7 @@ static void Cb_GiveMovingItemToMon(u8 taskId) break; case 1: StartCursorAnim(CURSOR_ANIM_OPEN); - Item_GiveMovingToMon((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); + Item_GiveMovingToMon((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); sPSSData->state++; break; case 2: @@ -3036,7 +3085,7 @@ static void Cb_ItemToBag(u8 taskId) else { PlaySE(SE_SELECT); - Item_TakeMons((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); + Item_TakeMons((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); sPSSData->state = 1; } break; @@ -3087,7 +3136,7 @@ static void Cb_SwitchSelectedItem(u8 taskId) break; case 1: StartCursorAnim(CURSOR_ANIM_OPEN); - Item_SwitchMonsWithMoving((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); + Item_SwitchMonsWithMoving((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); sPSSData->state++; break; case 2: @@ -3259,6 +3308,7 @@ static void Cb_PrintCantStoreMail(u8 taskId) } } +// Handle options menu that shows when the box title bar is selected static void Cb_HandleBoxOptions(u8 taskId) { switch (sPSSData->state) @@ -3656,25 +3706,24 @@ static void Cb_ChangeScreen(u8 taskId) static void GiveChosenBagItem(void) { - u16 item = gSpecialVar_ItemId; + u16 itemId = gSpecialVar_ItemId; - if (item != 0) + if (itemId != ITEM_NONE) { - u8 id = GetBoxCursorPosition(); - + u8 pos = GetCursorPosition(); if (sInPartyMenu) - SetMonData(&gPlayerParty[id], MON_DATA_HELD_ITEM, &item); + SetMonData(&gPlayerParty[pos], MON_DATA_HELD_ITEM, &itemId); else - SetCurrentBoxMonData(id, MON_DATA_HELD_ITEM, &item); + SetCurrentBoxMonData(pos, MON_DATA_HELD_ITEM, &itemId); - RemoveBagItem(item, 1); + RemoveBagItem(itemId, 1); } } static void FreePSSData(void) { sub_80D25F0(); - sub_80D01B8(); + MultiMove_Free(); FREE_AND_SET_NULL(sPSSData); FreeAllWindowBuffers(); } @@ -4111,7 +4160,7 @@ static bool8 DoShowPartyMenu(void) } break; case 1: - if (!sub_80CD554()) + if (!UpdateCursorPos()) { if (sPSSData->setMosaic) StartDisplayMonMosaicEffect(); @@ -4250,9 +4299,9 @@ static void sub_80CAEAC(void) if (!IsCursorOnBox()) { if (sInPartyMenu) - sub_80D0D8C(CURSOR_AREA_IN_PARTY, GetBoxCursorPosition()); + sub_80D0D8C(CURSOR_AREA_IN_PARTY, GetCursorPosition()); else - sub_80D0D8C(CURSOR_AREA_IN_BOX, GetBoxCursorPosition()); + sub_80D0D8C(CURSOR_AREA_IN_BOX, GetCursorPosition()); } if (sMovingItemId != ITEM_NONE) @@ -5574,19 +5623,19 @@ static struct Sprite *CreateChooseBoxArrows(u16 x, u16 y, u8 animId, u8 priority static void sub_80CD36C(void) { if (sPSSData->boxOption != OPTION_DEPOSIT) - sBoxCursorArea = CURSOR_AREA_IN_BOX; + sCursorArea = CURSOR_AREA_IN_BOX; else - sBoxCursorArea = CURSOR_AREA_IN_PARTY; + sCursorArea = CURSOR_AREA_IN_PARTY; - sBoxCursorPosition = 0; + sCursorPosition = 0; sIsMonBeingMoved = FALSE; sMovingMonOrigBoxId = 0; sMovingMonOrigBoxPos = 0; - sCanOnlyMove = FALSE; + sAutoActionOn = FALSE; sub_80CDC0C(); sub_80CFC14(); sPSSData->field_CD6 = 1; - sPSSData->inBoxMovingMode = 0; + sPSSData->inBoxMovingMode = MOVE_MODE_NORMAL; sub_80CEB40(); } @@ -5595,7 +5644,7 @@ static void sub_80CD3EC(void) sub_80CFC14(); sub_80CEBDC(); sPSSData->field_CD6 = 1; - sPSSData->inBoxMovingMode = 0; + sPSSData->inBoxMovingMode = MOVE_MODE_NORMAL; if (sIsMonBeingMoved) { sPSSData->movingMon = gUnknown_02039D14; @@ -5645,29 +5694,29 @@ static void GetCursorCoordsByPos(u8 cursorArea, u8 cursorPosition, u16 *x, u16 * static u16 GetSpeciesAtCursorPosition(void) { - switch (sBoxCursorArea) + switch (sCursorArea) { case CURSOR_AREA_IN_PARTY: - return GetMonData(&gPlayerParty[sBoxCursorPosition], MON_DATA_SPECIES); + return GetMonData(&gPlayerParty[sCursorPosition], MON_DATA_SPECIES); case CURSOR_AREA_IN_BOX: - return GetCurrentBoxMonData(sBoxCursorPosition, MON_DATA_SPECIES); + return GetCurrentBoxMonData(sCursorPosition, MON_DATA_SPECIES); default: return SPECIES_NONE; } } -static bool8 sub_80CD554(void) +static bool8 UpdateCursorPos(void) { s16 tmp; - if (sPSSData->field_CD0 == 0) + if (sPSSData->cursorMoveSteps == 0) { if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return FALSE; else return IsItemIconAnimActive(); } - else if (--sPSSData->field_CD0 != 0) + else if (--sPSSData->cursorMoveSteps != 0) { sPSSData->field_CBC += sPSSData->field_CC4; sPSSData->field_CC0 += sPSSData->field_CC8; @@ -5722,12 +5771,12 @@ static void sub_80CD70C(void) int r7, r0; if (sPSSData->field_CD2 != 0 || sPSSData->field_CD3 != 0) - sPSSData->field_CD0 = 12; + sPSSData->cursorMoveSteps = 12; else - sPSSData->field_CD0 = 6; + sPSSData->cursorMoveSteps = 6; if (sPSSData->field_CD7) - sPSSData->field_CD7 = sPSSData->field_CD0 >> 1; + sPSSData->field_CD7 = sPSSData->cursorMoveSteps >> 1; switch (sPSSData->field_CD2) { @@ -5757,8 +5806,8 @@ static void sub_80CD70C(void) r7 <<= 8; r0 <<= 8; - sPSSData->field_CC4 = r0 / sPSSData->field_CD0; - sPSSData->field_CC8 = r7 / sPSSData->field_CD0; + sPSSData->field_CC4 = r0 / sPSSData->cursorMoveSteps; + sPSSData->field_CC8 = r7 / sPSSData->cursorMoveSteps; sPSSData->field_CBC = sPSSData->cursorSprite->pos1.x << 8; sPSSData->field_CC0 = sPSSData->cursorSprite->pos1.y << 8; } @@ -5769,7 +5818,7 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) sub_80CD70C(); if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { - if (sPSSData->inBoxMovingMode == 0 && !sIsMonBeingMoved) + if (sPSSData->inBoxMovingMode == MOVE_MODE_NORMAL && !sIsMonBeingMoved) StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_STILL); } else @@ -5780,10 +5829,10 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { - if (sBoxCursorArea == CURSOR_AREA_IN_BOX) - sub_80D0E50(CURSOR_AREA_IN_BOX, sBoxCursorPosition); - else if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) - sub_80D0E50(CURSOR_AREA_IN_PARTY, sBoxCursorPosition); + if (sCursorArea == CURSOR_AREA_IN_BOX) + sub_80D0E50(CURSOR_AREA_IN_BOX, sCursorPosition); + else if (sCursorArea == CURSOR_AREA_IN_PARTY) + sub_80D0E50(CURSOR_AREA_IN_PARTY, sCursorPosition); if (newCursorArea == CURSOR_AREA_IN_BOX) sub_80D0D8C(newCursorArea, newCursorPosition); @@ -5791,7 +5840,7 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) sub_80D0D8C(newCursorArea, newCursorPosition); } - if (newCursorArea == CURSOR_AREA_IN_PARTY && sBoxCursorArea != CURSOR_AREA_IN_PARTY) + if (newCursorArea == CURSOR_AREA_IN_PARTY && sCursorArea != CURSOR_AREA_IN_PARTY) { sPSSData->field_CD6 = newCursorArea; sPSSData->field_CB8->invisible = TRUE; @@ -5807,7 +5856,7 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) sPSSData->field_CB8->oam.priority = 1; break; case CURSOR_AREA_IN_BOX: - if (sPSSData->inBoxMovingMode != 0) + if (sPSSData->inBoxMovingMode != MOVE_MODE_NORMAL) { sPSSData->cursorSprite->oam.priority = 0; sPSSData->field_CB8->invisible = TRUE; @@ -5815,7 +5864,7 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) else { sPSSData->cursorSprite->oam.priority = 2; - if (sBoxCursorArea == CURSOR_AREA_IN_BOX && sIsMonBeingMoved) + if (sCursorArea == CURSOR_AREA_IN_BOX && sIsMonBeingMoved) SetMovingMonPriority(2); } break; @@ -5824,11 +5873,11 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) static void sub_80CDA68(void) { - sBoxCursorArea = sPSSData->field_CD4; - sBoxCursorPosition = sPSSData->field_CD5; + sCursorArea = sPSSData->field_CD4; + sCursorPosition = sPSSData->field_CD5; if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { - if (sPSSData->inBoxMovingMode == 0 && !sIsMonBeingMoved) + if (sPSSData->inBoxMovingMode == MOVE_MODE_NORMAL && !sIsMonBeingMoved) StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); } else @@ -5838,7 +5887,7 @@ static void sub_80CDA68(void) } sub_80CEB40(); - switch (sBoxCursorArea) + switch (sCursorArea) { case CURSOR_AREA_BUTTONS: SetMovingMonPriority(1); @@ -5851,7 +5900,7 @@ static void sub_80CDA68(void) SetMovingMonPriority(1); break; case CURSOR_AREA_IN_BOX: - if (sPSSData->inBoxMovingMode == 0) + if (sPSSData->inBoxMovingMode == MOVE_MODE_NORMAL) { sPSSData->cursorSprite->oam.priority = 1; sPSSData->field_CB8->oam.priority = 2; @@ -5896,7 +5945,7 @@ static void sub_80CDC0C(void) static void sub_80CDC18(void) { - gUnknown_02039D7E = sBoxCursorPosition; + gUnknown_02039D7E = sCursorPosition; } static u8 sub_80CDC2C(void) @@ -5992,7 +6041,7 @@ static bool8 MonPlaceChange_Shift(void) switch (sPSSData->monPlaceChangeState) { case 0: - switch (sBoxCursorArea) + switch (sCursorArea) { case CURSOR_AREA_IN_PARTY: sPSSData->field_D91 = TOTAL_BOXES_COUNT; @@ -6004,14 +6053,14 @@ static bool8 MonPlaceChange_Shift(void) return FALSE; } StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_OPEN); - sub_80CBD5C(sPSSData->field_D91, sBoxCursorPosition); + sub_80CBD5C(sPSSData->field_D91, sCursorPosition); sPSSData->monPlaceChangeState++; break; case 1: if (!sub_80CBDC4()) { StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_FIST); - SetShiftedMonData(sPSSData->field_D91, sBoxCursorPosition); + SetShiftedMonData(sPSSData->field_D91, sCursorPosition); sPSSData->monPlaceChangeState++; } break; @@ -6065,17 +6114,17 @@ static bool8 sub_80CDF08(void) static void MoveMon(void) { - switch (sBoxCursorArea) + switch (sCursorArea) { case CURSOR_AREA_IN_PARTY: - SetMovedMonData(TOTAL_BOXES_COUNT, sBoxCursorPosition); - sub_80CBC14(MODE_PARTY, sBoxCursorPosition); + SetMovedMonData(TOTAL_BOXES_COUNT, sCursorPosition); + sub_80CBC14(MODE_PARTY, sCursorPosition); break; case CURSOR_AREA_IN_BOX: - if (sPSSData->inBoxMovingMode == 0) + if (sPSSData->inBoxMovingMode == MOVE_MODE_NORMAL) { - SetMovedMonData(StorageGetCurrentBox(), sBoxCursorPosition); - sub_80CBC14(MODE_BOX, sBoxCursorPosition); + SetMovedMonData(StorageGetCurrentBox(), sCursorPosition); + sub_80CBC14(MODE_BOX, sCursorPosition); } break; default: @@ -6089,16 +6138,16 @@ static void PlaceMon(void) { u8 boxId; - switch (sBoxCursorArea) + switch (sCursorArea) { case CURSOR_AREA_IN_PARTY: - SetPlacedMonData(TOTAL_BOXES_COUNT, sBoxCursorPosition); - sub_80CBCAC(TOTAL_BOXES_COUNT, sBoxCursorPosition); + SetPlacedMonData(TOTAL_BOXES_COUNT, sCursorPosition); + sub_80CBCAC(TOTAL_BOXES_COUNT, sCursorPosition); break; case CURSOR_AREA_IN_BOX: boxId = StorageGetCurrentBox(); - SetPlacedMonData(boxId, sBoxCursorPosition); - sub_80CBCAC(boxId, sBoxCursorPosition); + SetPlacedMonData(boxId, sCursorPosition); + sub_80CBCAC(boxId, sCursorPosition); break; default: return; @@ -6115,7 +6164,7 @@ static void sub_80CE00C(void) static void SetMovedMonData(u8 boxId, u8 position) { if (boxId == TOTAL_BOXES_COUNT) - sPSSData->movingMon = gPlayerParty[sBoxCursorPosition]; + sPSSData->movingMon = gPlayerParty[sCursorPosition]; else BoxMonAtToMon(boxId, position, &sPSSData->movingMon); @@ -6173,9 +6222,9 @@ static bool8 TryStorePartyMonInBox(u8 boxId) } else { - SetMovedMonData(TOTAL_BOXES_COUNT, sBoxCursorPosition); + SetMovedMonData(TOTAL_BOXES_COUNT, sCursorPosition); SetPlacedMonData(boxId, boxPosition); - DestroyPartyMonIcon(sBoxCursorPosition); + DestroyPartyMonIcon(sCursorPosition); } if (boxId == StorageGetCurrentBox()) @@ -6197,12 +6246,12 @@ static void InitReleaseMon(void) if (sIsMonBeingMoved) mode = MODE_MOVE; - else if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) + else if (sCursorArea == CURSOR_AREA_IN_PARTY) mode = MODE_PARTY; else mode = MODE_BOX; - SetReleaseMon(mode, sBoxCursorPosition); + SetReleaseMon(mode, sCursorPosition); StringCopy(sPSSData->releaseMonName, sPSSData->displayMonName); } @@ -6230,12 +6279,12 @@ static void ReleaseMon(void) } else { - if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) + if (sCursorArea == CURSOR_AREA_IN_PARTY) boxId = TOTAL_BOXES_COUNT; else boxId = StorageGetCurrentBox(); - PurgeMonOrBoxMon(boxId, sBoxCursorPosition); + PurgeMonOrBoxMon(boxId, sCursorPosition); } sub_80CEB40(); } @@ -6301,17 +6350,17 @@ static void InitCanReleaseMonVars(void) } else { - if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) + if (sCursorArea == CURSOR_AREA_IN_PARTY) { - sPSSData->tempMon = gPlayerParty[sBoxCursorPosition]; + sPSSData->tempMon = gPlayerParty[sCursorPosition]; sPSSData->releaseBoxId = TOTAL_BOXES_COUNT; } else { - BoxMonAtToMon(StorageGetCurrentBox(), sBoxCursorPosition, &sPSSData->tempMon); + BoxMonAtToMon(StorageGetCurrentBox(), sCursorPosition, &sPSSData->tempMon); sPSSData->releaseBoxId = StorageGetCurrentBox(); } - sPSSData->releaseBoxPos = sBoxCursorPosition; + sPSSData->releaseBoxPos = sCursorPosition; } GetRestrictedReleaseMoves(sPSSData->restrictedMoveList); @@ -6467,17 +6516,17 @@ static void sub_80CE7E8(void) sPSSData->field_2186 = 0; sPSSData->summaryScreenMode = SUMMARY_MODE_NORMAL; } - else if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) + else if (sCursorArea == CURSOR_AREA_IN_PARTY) { sPSSData->field_218C.mon = gPlayerParty; - sPSSData->field_2187 = sBoxCursorPosition; + sPSSData->field_2187 = sCursorPosition; sPSSData->field_2186 = CountPartyMons() - 1; sPSSData->summaryScreenMode = SUMMARY_MODE_NORMAL; } else { sPSSData->field_218C.box = GetBoxedMonPtr(StorageGetCurrentBox(), 0); - sPSSData->field_2187 = sBoxCursorPosition; + sPSSData->field_2187 = sCursorPosition; sPSSData->field_2186 = IN_BOX_COUNT - 1; sPSSData->summaryScreenMode = SUMMARY_MODE_BOX; } @@ -6488,7 +6537,7 @@ static void sub_80CE8E4(void) if (sIsMonBeingMoved) sub_80CE790(); else - sBoxCursorPosition = gLastViewedMonIndex; + sCursorPosition = gLastViewedMonIndex; } s16 CompactPartySlots(void) @@ -6525,16 +6574,16 @@ static void SetMonMarkings(u8 markings) } else { - if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) - SetMonData(&gPlayerParty[sBoxCursorPosition], MON_DATA_MARKINGS, &markings); - if (sBoxCursorArea == CURSOR_AREA_IN_BOX) - SetCurrentBoxMonData(sBoxCursorPosition, MON_DATA_MARKINGS, &markings); + if (sCursorArea == CURSOR_AREA_IN_PARTY) + SetMonData(&gPlayerParty[sCursorPosition], MON_DATA_MARKINGS, &markings); + if (sCursorArea == CURSOR_AREA_IN_BOX) + SetCurrentBoxMonData(sCursorPosition, MON_DATA_MARKINGS, &markings); } } -static bool8 CanMovePartyMon(void) +static bool8 IsRemovingLastPartyMon(void) { - if (sBoxCursorArea == CURSOR_AREA_IN_PARTY && !sIsMonBeingMoved && CountPartyAliveNonEggMonsExcept(sBoxCursorPosition) == 0) + if (sCursorArea == CURSOR_AREA_IN_PARTY && !sIsMonBeingMoved && CountPartyAliveNonEggMonsExcept(sCursorPosition) == 0) return TRUE; else return FALSE; @@ -6544,7 +6593,7 @@ static bool8 CanShiftMon(void) { if (sIsMonBeingMoved) { - if (sBoxCursorArea == CURSOR_AREA_IN_PARTY && CountPartyAliveNonEggMonsExcept(sBoxCursorPosition) == 0) + if (sCursorArea == CURSOR_AREA_IN_PARTY && CountPartyAliveNonEggMonsExcept(sCursorPosition) == 0) { if (sPSSData->displayMonIsEgg || GetMonData(&sPSSData->movingMon, MON_DATA_HP) == 0) return FALSE; @@ -6561,17 +6610,17 @@ static bool8 IsMonBeingMoved(void) static bool8 IsCursorOnBox(void) { - return (sBoxCursorArea == CURSOR_AREA_BOX); + return (sCursorArea == CURSOR_AREA_BOX); } static bool8 IsCursorOnCloseBox(void) { - return (sBoxCursorArea == CURSOR_AREA_BUTTONS && sBoxCursorPosition == 1); + return (sCursorArea == CURSOR_AREA_BUTTONS && sCursorPosition == 1); } static bool8 IsCursorInBox(void) { - return (sBoxCursorArea == CURSOR_AREA_IN_BOX); + return (sCursorArea == CURSOR_AREA_IN_BOX); } static void sub_80CEB40(void) @@ -6579,12 +6628,12 @@ static void sub_80CEB40(void) sPSSData->setMosaic = (sIsMonBeingMoved == FALSE); if (!sIsMonBeingMoved) { - switch (sBoxCursorArea) + switch (sCursorArea) { case CURSOR_AREA_IN_PARTY: - if (sBoxCursorPosition < PARTY_SIZE) + if (sCursorPosition < PARTY_SIZE) { - SetDisplayMonData(&gPlayerParty[sBoxCursorPosition], MODE_PARTY); + SetDisplayMonData(&gPlayerParty[sCursorPosition], MODE_PARTY); break; } // fallthrough @@ -6593,7 +6642,7 @@ static void sub_80CEB40(void) SetDisplayMonData(NULL, MODE_MOVE); break; case CURSOR_AREA_IN_BOX: - SetDisplayMonData(GetBoxedMonPtr(StorageGetCurrentBox(), sBoxCursorPosition), MODE_BOX); + SetDisplayMonData(GetBoxedMonPtr(StorageGetCurrentBox(), sCursorPosition), MODE_BOX); break; } } @@ -6749,12 +6798,12 @@ static u8 HandleInput_InBox(void) { switch (sPSSData->inBoxMovingMode) { - case 0: + case MOVE_MODE_NORMAL: default: return InBoxInput_Normal(); - case 1: - return InBoxInput_GrabbingMultiple(); - case 2: + case MOVE_MODE_MULTIPLE_SELECTING: + return InBoxInput_SelectingMultiple(); + case MOVE_MODE_MULTIPLE_MOVING: return InBoxInput_MovingMultiple(); } } @@ -6767,8 +6816,8 @@ static u8 InBoxInput_Normal(void) do { - cursorArea = sBoxCursorArea; - cursorPosition = sBoxCursorPosition; + cursorArea = sCursorArea; + cursorPosition = sCursorPosition; sPSSData->field_CD2 = 0; sPSSData->field_CD3 = 0; sPSSData->field_CD7 = 0; @@ -6776,7 +6825,7 @@ static u8 InBoxInput_Normal(void) if (JOY_REPEAT(DPAD_UP)) { retVal = INPUT_1; - if (sBoxCursorPosition >= IN_BOX_COLUMNS) + if (sCursorPosition >= IN_BOX_COLUMNS) { cursorPosition -= IN_BOX_COLUMNS; } @@ -6804,7 +6853,7 @@ static u8 InBoxInput_Normal(void) else if (JOY_REPEAT(DPAD_LEFT)) { retVal = INPUT_1; - if (sBoxCursorPosition % IN_BOX_COLUMNS != 0) + if (sCursorPosition % IN_BOX_COLUMNS != 0) { cursorPosition--; } @@ -6818,7 +6867,7 @@ static u8 InBoxInput_Normal(void) else if (JOY_REPEAT(DPAD_RIGHT)) { retVal = INPUT_1; - if ((sBoxCursorPosition + 1) % IN_BOX_COLUMNS != 0) + if ((sCursorPosition + 1) % IN_BOX_COLUMNS != 0) { cursorPosition++; } @@ -6837,54 +6886,54 @@ static u8 InBoxInput_Normal(void) break; } - if ((JOY_NEW(A_BUTTON)) && sub_80CFA5C()) + if ((JOY_NEW(A_BUTTON)) && SetSelectionMenuTexts()) { - if (!sCanOnlyMove) - return INPUT_8; + if (!sAutoActionOn) + return INPUT_IN_MENU; if (sPSSData->boxOption != OPTION_MOVE_MONS || sIsMonBeingMoved == TRUE) { switch (GetMenuItemTextId(0)) { case MENU_STORE: - return INPUT_11; + return INPUT_DEPOSIT; case MENU_WITHDRAW: - return INPUT_12; + return INPUT_WITHDRAW; case MENU_MOVE: - return INPUT_13; + return INPUT_MOVE_MON; case MENU_SHIFT: - return INPUT_14; + return INPUT_SHIFT_MON; case MENU_PLACE: - return INPUT_15; + return INPUT_PLACE_MON; case MENU_TAKE: - return INPUT_16; + return INPUT_TAKE_ITEM; case MENU_GIVE: - return INPUT_17; + return INPUT_GIVE_ITEM; case MENU_SWITCH: - return INPUT_18; + return INPUT_SWITCH_ITEMS; } } else { - sPSSData->inBoxMovingMode = 1; - return INPUT_20; + sPSSData->inBoxMovingMode = MOVE_MODE_MULTIPLE_SELECTING; + return INPUT_MULTIMOVE_START; } } if (JOY_NEW(B_BUTTON)) - return INPUT_19; + return INPUT_PRESSED_B; if (gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR) { if (JOY_HELD(L_BUTTON)) - return INPUT_10; + return INPUT_SCROLL_LEFT; if (JOY_HELD(R_BUTTON)) - return INPUT_9; + return INPUT_SCROLL_RIGHT; } if (JOY_NEW(SELECT_BUTTON)) { - sub_80CFDC4(); + ToggleCursorAutoAction(); return INPUT_NONE; } @@ -6898,56 +6947,56 @@ static u8 InBoxInput_Normal(void) return retVal; } -static u8 InBoxInput_GrabbingMultiple(void) +static u8 InBoxInput_SelectingMultiple(void) { if (JOY_HELD(A_BUTTON)) { if (JOY_REPEAT(DPAD_UP)) { - if (sBoxCursorPosition / IN_BOX_COLUMNS != 0) + if (sCursorPosition / IN_BOX_COLUMNS != 0) { - sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - IN_BOX_COLUMNS); - return INPUT_21; + sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition - IN_BOX_COLUMNS); + return INPUT_MULTIMOVE_CHANGE_SELECTION; } else { - return INPUT_24; + return INPUT_MULTIMOVE_UNABLE; } } else if (JOY_REPEAT(DPAD_DOWN)) { - if (sBoxCursorPosition + IN_BOX_COLUMNS < IN_BOX_COUNT) + if (sCursorPosition + IN_BOX_COLUMNS < IN_BOX_COUNT) { - sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + IN_BOX_COLUMNS); - return INPUT_21; + sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition + IN_BOX_COLUMNS); + return INPUT_MULTIMOVE_CHANGE_SELECTION; } else { - return INPUT_24; + return INPUT_MULTIMOVE_UNABLE; } } else if (JOY_REPEAT(DPAD_LEFT)) { - if (sBoxCursorPosition % IN_BOX_COLUMNS != 0) + if (sCursorPosition % IN_BOX_COLUMNS != 0) { - sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - 1); - return INPUT_21; + sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition - 1); + return INPUT_MULTIMOVE_CHANGE_SELECTION; } else { - return INPUT_24; + return INPUT_MULTIMOVE_UNABLE; } } else if (JOY_REPEAT(DPAD_RIGHT)) { - if ((sBoxCursorPosition + 1) % IN_BOX_COLUMNS != 0) + if ((sCursorPosition + 1) % IN_BOX_COLUMNS != 0) { - sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + 1); - return INPUT_21; + sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition + 1); + return INPUT_MULTIMOVE_CHANGE_SELECTION; } else { - return INPUT_24; + return INPUT_MULTIMOVE_UNABLE; } } else @@ -6957,18 +7006,19 @@ static u8 InBoxInput_GrabbingMultiple(void) } else { - if (sub_80D0BA4() == sBoxCursorPosition) + if (MultiMove_GetOrigin() == sCursorPosition) { - sPSSData->inBoxMovingMode = 0; + // Doing a multiple mon selection but only chose 1 mon + sPSSData->inBoxMovingMode = MOVE_MODE_NORMAL; sPSSData->field_CB8->invisible = FALSE; - return INPUT_22; + return INPUT_MULTIMOVE_SINGLE; } else { sIsMonBeingMoved = (sPSSData->displayMonSpecies != SPECIES_NONE); - sPSSData->inBoxMovingMode = 2; + sPSSData->inBoxMovingMode = MOVE_MODE_MULTIPLE_MOVING; sMovingMonOrigBoxId = StorageGetCurrentBox(); - return INPUT_23; + return INPUT_MULTIMOVE_GRAB_SELECTION; } } } @@ -6977,77 +7027,77 @@ static u8 InBoxInput_MovingMultiple(void) { if (JOY_REPEAT(DPAD_UP)) { - if (sub_80D0580(0)) + if (MultiMove_TryMoveGroup(0)) { - sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - IN_BOX_COLUMNS); - return INPUT_25; + sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition - IN_BOX_COLUMNS); + return INPUT_MULTIMOVE_MOVE_MONS; } else { - return INPUT_24; + return INPUT_MULTIMOVE_UNABLE; } } else if (JOY_REPEAT(DPAD_DOWN)) { - if (sub_80D0580(1)) + if (MultiMove_TryMoveGroup(1)) { - sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + IN_BOX_COLUMNS); - return INPUT_25; + sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition + IN_BOX_COLUMNS); + return INPUT_MULTIMOVE_MOVE_MONS; } else { - return INPUT_24; + return INPUT_MULTIMOVE_UNABLE; } } else if (JOY_REPEAT(DPAD_LEFT)) { - if (sub_80D0580(2)) + if (MultiMove_TryMoveGroup(2)) { - sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition - 1); - return INPUT_25; + sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition - 1); + return INPUT_MULTIMOVE_MOVE_MONS; } else { - return INPUT_10; + return INPUT_SCROLL_LEFT; } } else if (JOY_REPEAT(DPAD_RIGHT)) { - if (sub_80D0580(3)) + if (MultiMove_TryMoveGroup(3)) { - sub_80CD894(CURSOR_AREA_IN_BOX, sBoxCursorPosition + 1); - return INPUT_25; + sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition + 1); + return INPUT_MULTIMOVE_MOVE_MONS; } else { - return INPUT_9; + return INPUT_SCROLL_RIGHT; } } else if (JOY_NEW(A_BUTTON)) { - if (sub_80D0BC0()) + if (MultiMove_CanPlaceSelection()) { sIsMonBeingMoved = FALSE; - sPSSData->inBoxMovingMode = 0; - return INPUT_26; + sPSSData->inBoxMovingMode = MOVE_MODE_NORMAL; + return INPUT_MULTIMOVE_PLACE_MONS; } else { - return INPUT_24; + return INPUT_MULTIMOVE_UNABLE; } } else if (JOY_NEW(B_BUTTON)) { - return INPUT_24; + return INPUT_MULTIMOVE_UNABLE; } else { if (gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR) { if (JOY_HELD(L_BUTTON)) - return INPUT_10; + return INPUT_SCROLL_LEFT; if (JOY_HELD(R_BUTTON)) - return INPUT_9; + return INPUT_SCROLL_RIGHT; } return INPUT_NONE; @@ -7063,8 +7113,8 @@ static u8 HandleInput_InParty(void) do { - cursorArea = sBoxCursorArea; - cursorPosition = sBoxCursorPosition; + cursorArea = sCursorArea; + cursorPosition = sCursorPosition; sPSSData->field_CD3 = 0; sPSSData->field_CD2 = 0; sPSSData->field_CD7 = 0; @@ -7075,7 +7125,7 @@ static u8 HandleInput_InParty(void) { if (--cursorPosition < 0) cursorPosition = PARTY_SIZE; - if (cursorPosition != sBoxCursorPosition) + if (cursorPosition != sCursorPosition) retVal = INPUT_1; break; } @@ -7083,27 +7133,27 @@ static u8 HandleInput_InParty(void) { if (++cursorPosition > PARTY_SIZE) cursorPosition = 0; - if (cursorPosition != sBoxCursorPosition) + if (cursorPosition != sCursorPosition) retVal = INPUT_1; break; } - else if (JOY_REPEAT(DPAD_LEFT) && sBoxCursorPosition != 0) + else if (JOY_REPEAT(DPAD_LEFT) && sCursorPosition != 0) { retVal = INPUT_1; - sPSSData->field_CD6 = sBoxCursorPosition; + sPSSData->field_CD6 = sCursorPosition; cursorPosition = 0; break; } else if (JOY_REPEAT(DPAD_RIGHT)) { - if (sBoxCursorPosition == 0) + if (sCursorPosition == 0) { retVal = INPUT_1; cursorPosition = sPSSData->field_CD6; } else { - retVal = INPUT_6; + retVal = INPUT_HIDE_PARTY; cursorArea = CURSOR_AREA_IN_BOX; cursorPosition = 0; } @@ -7112,36 +7162,36 @@ static u8 HandleInput_InParty(void) if (JOY_NEW(A_BUTTON)) { - if (sBoxCursorPosition == PARTY_SIZE) + if (sCursorPosition == PARTY_SIZE) { if (sPSSData->boxOption == OPTION_DEPOSIT) - return INPUT_4; + return INPUT_CLOSE_BOX; gotoBox = TRUE; } - else if (sub_80CFA5C()) + else if (SetSelectionMenuTexts()) { - if (!sCanOnlyMove) - return INPUT_8; + if (!sAutoActionOn) + return INPUT_IN_MENU; switch (GetMenuItemTextId(0)) { case MENU_STORE: - return INPUT_11; + return INPUT_DEPOSIT; case MENU_WITHDRAW: - return INPUT_12; + return INPUT_WITHDRAW; case MENU_MOVE: - return INPUT_13; + return INPUT_MOVE_MON; case MENU_SHIFT: - return INPUT_14; + return INPUT_SHIFT_MON; case MENU_PLACE: - return INPUT_15; + return INPUT_PLACE_MON; case MENU_TAKE: - return INPUT_16; + return INPUT_TAKE_ITEM; case MENU_GIVE: - return INPUT_17; + return INPUT_GIVE_ITEM; case MENU_SWITCH: - return INPUT_18; + return INPUT_SWITCH_ITEMS; } } } @@ -7149,20 +7199,20 @@ static u8 HandleInput_InParty(void) if (JOY_NEW(B_BUTTON)) { if (sPSSData->boxOption == OPTION_DEPOSIT) - return INPUT_19; + return INPUT_PRESSED_B; gotoBox = TRUE; } if (gotoBox) { - retVal = INPUT_6; + retVal = INPUT_HIDE_PARTY; cursorArea = CURSOR_AREA_IN_BOX; cursorPosition = 0; } else if (JOY_NEW(SELECT_BUTTON)) { - sub_80CFDC4(); + ToggleCursorAutoAction(); return INPUT_NONE; } @@ -7170,7 +7220,7 @@ static u8 HandleInput_InParty(void) if (retVal != INPUT_NONE) { - if (retVal != INPUT_6) + if (retVal != INPUT_HIDE_PARTY) sub_80CD894(cursorArea, cursorPosition); } @@ -7206,31 +7256,31 @@ static u8 HandleInput_OnBox(void) } if (JOY_HELD(DPAD_LEFT)) - return INPUT_10; + return INPUT_SCROLL_LEFT; if (JOY_HELD(DPAD_RIGHT)) - return INPUT_9; + return INPUT_SCROLL_RIGHT; if (gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR) { if (JOY_HELD(L_BUTTON)) - return INPUT_10; + return INPUT_SCROLL_LEFT; if (JOY_HELD(R_BUTTON)) - return INPUT_9; + return INPUT_SCROLL_RIGHT; } if (JOY_NEW(A_BUTTON)) { AnimateBoxScrollArrows(FALSE); AddBoxMenu(); - return INPUT_7; + return INPUT_BOX_OPTIONS; } if (JOY_NEW(B_BUTTON)) - return INPUT_19; + return INPUT_PRESSED_B; if (JOY_NEW(SELECT_BUTTON)) { - sub_80CFDC4(); + ToggleCursorAutoAction(); return INPUT_NONE; } @@ -7256,8 +7306,8 @@ static u8 HandleInput_OnButtons(void) do { - cursorArea = sBoxCursorArea; - cursorPosition = sBoxCursorPosition; + cursorArea = sCursorArea; + cursorPosition = sCursorPosition; sPSSData->field_CD3 = 0; sPSSData->field_CD2 = 0; sPSSData->field_CD7 = 0; @@ -7267,7 +7317,7 @@ static u8 HandleInput_OnButtons(void) retVal = INPUT_1; cursorArea = CURSOR_AREA_IN_BOX; sPSSData->field_CD2 = -1; - if (sBoxCursorPosition == 0) + if (sCursorPosition == 0) cursorPosition = IN_BOX_COUNT - 1 - 5; else cursorPosition = IN_BOX_COUNT - 1; @@ -7299,14 +7349,16 @@ static u8 HandleInput_OnButtons(void) break; } + // Button was pressed, determine which if (JOY_NEW(A_BUTTON)) - return (cursorPosition == 0) ? INPUT_5 : INPUT_4; + return (cursorPosition == 0) ? INPUT_SHOW_PARTY : INPUT_CLOSE_BOX; + if (JOY_NEW(B_BUTTON)) - return INPUT_19; + return INPUT_PRESSED_B; if (JOY_NEW(SELECT_BUTTON)) { - sub_80CFDC4(); + ToggleCursorAutoAction(); return INPUT_NONE; } @@ -7337,7 +7389,7 @@ static u8 HandleInput(void) u16 i = 0; while (inputFuncs[i].func != NULL) { - if (inputFuncs[i].area == sBoxCursorArea) + if (inputFuncs[i].area == sCursorArea) return inputFuncs[i].func(); i++; } @@ -7354,16 +7406,16 @@ static void AddBoxMenu(void) SetMenuText(MENU_CANCEL); } -static u8 sub_80CFA5C(void) +static u8 SetSelectionMenuTexts(void) { InitMenu(); if (sPSSData->boxOption != OPTION_MOVE_ITEMS) - return sub_80CFA84(); + return SetMenuTexts_Mon(); else - return sub_80CFB44(); + return SetMenuTexts_Item(); } -static bool8 sub_80CFA84(void) +static bool8 SetMenuTexts_Mon(void) { u16 species = GetSpeciesAtCursorPosition(); @@ -7405,7 +7457,7 @@ static bool8 sub_80CFA84(void) SetMenuText(MENU_SUMMARY); if (sPSSData->boxOption == OPTION_MOVE_MONS) { - if (!sBoxCursorArea) + if (sCursorArea == CURSOR_AREA_IN_BOX) SetMenuText(MENU_WITHDRAW); else SetMenuText(MENU_STORE); @@ -7417,7 +7469,7 @@ static bool8 sub_80CFA84(void) return TRUE; } -static bool8 sub_80CFB44(void) +static bool8 SetMenuTexts_Item(void) { if (sPSSData->displayMonSpecies == SPECIES_EGG) return FALSE; @@ -7554,15 +7606,15 @@ static void sub_80CFC14(void) LoadSpriteSheets(spriteSheets); LoadSpritePalettes(spritePalettes); - sPSSData->cursorPalNums[0] = IndexOfSpritePaletteTag(PALTAG_10); - sPSSData->cursorPalNums[1] = IndexOfSpritePaletteTag(PALTAG_7); + sPSSData->cursorPalNums[0] = IndexOfSpritePaletteTag(PALTAG_10); // White hand, normal + sPSSData->cursorPalNums[1] = IndexOfSpritePaletteTag(PALTAG_7); // Yellow hand, when auto-action is on - GetCursorCoordsByPos(sBoxCursorArea, sBoxCursorPosition, &x, &y); + GetCursorCoordsByPos(sCursorArea, sCursorPosition, &x, &y); spriteId = CreateSprite(&sSpriteTemplate_Cursor, x, y, 6); if (spriteId != MAX_SPRITES) { sPSSData->cursorSprite = &gSprites[spriteId]; - sPSSData->cursorSprite->oam.paletteNum = sPSSData->cursorPalNums[sCanOnlyMove]; + sPSSData->cursorSprite->oam.paletteNum = sPSSData->cursorPalNums[sAutoActionOn]; sPSSData->cursorSprite->oam.priority = 1; if (sIsMonBeingMoved) StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_FIST); @@ -7572,7 +7624,7 @@ static void sub_80CFC14(void) sPSSData->cursorSprite = NULL; } - if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) + if (sCursorArea == CURSOR_AREA_IN_PARTY) { subpriority = 13; priority = 1; @@ -7588,7 +7640,7 @@ static void sub_80CFC14(void) { sPSSData->field_CB8 = &gSprites[spriteId]; sPSSData->field_CB8->oam.priority = priority; - if (sBoxCursorArea) + if (sCursorArea) sPSSData->field_CB8->invisible = 1; } else @@ -7597,28 +7649,28 @@ static void sub_80CFC14(void) } } -static void sub_80CFDC4(void) +static void ToggleCursorAutoAction(void) { - sCanOnlyMove = !sCanOnlyMove; - sPSSData->cursorSprite->oam.paletteNum = sPSSData->cursorPalNums[sCanOnlyMove]; + sAutoActionOn = !sAutoActionOn; + sPSSData->cursorSprite->oam.paletteNum = sPSSData->cursorPalNums[sAutoActionOn]; } -static u8 GetBoxCursorPosition(void) +static u8 GetCursorPosition(void) { - return sBoxCursorPosition; + return sCursorPosition; } -static void sub_80CFE14(u8 *x, u8 *y) +static void GetCursorBoxColumnAndRow(u8 *column, u8 *row) { - if (sBoxCursorArea == CURSOR_AREA_IN_BOX) + if (sCursorArea == CURSOR_AREA_IN_BOX) { - *x = sBoxCursorPosition % IN_BOX_COLUMNS; - *y = sBoxCursorPosition / IN_BOX_COLUMNS; + *column = sCursorPosition % IN_BOX_COLUMNS; + *row = sCursorPosition / IN_BOX_COLUMNS; } else { - *x = 0; - *y = 0; + *column = 0; + *row = 0; } } @@ -7639,14 +7691,14 @@ static void SetCursorPriorityTo1(void) static void sub_80CFEA8(void) { - if (sBoxCursorArea == CURSOR_AREA_IN_BOX) - sub_80D0E50(CURSOR_AREA_IN_BOX, sBoxCursorPosition); + if (sCursorArea == CURSOR_AREA_IN_BOX) + sub_80D0E50(CURSOR_AREA_IN_BOX, sCursorPosition); } static void sub_80CFECC(void) { - if (sBoxCursorArea == CURSOR_AREA_IN_BOX) - sub_80D0D8C(CURSOR_AREA_IN_BOX, sBoxCursorPosition); + if (sCursorArea == CURSOR_AREA_IN_BOX) + sub_80D0D8C(CURSOR_AREA_IN_BOX, sCursorPosition); } static void InitMenu(void) @@ -7793,11 +7845,17 @@ static void RemoveMenu(void) RemoveWindow(sPSSData->menuWindowId); } -// The functions below handle moving and grabbing multiple mons at once. -// The icons are converted to background 0 which coordinates are changed while moving mons. -// There is also a bit of math involved in determining how many column/rows of mons to grab/move. -static const struct WindowTemplate gUnknown_0857BB1C = +//------------------------------------------------------------------------------ +// MultiMove +// +// The functions below handle moving and selecting multiple Pokémon at once. +// The icon sprites are moved to bg 0, and this bg is manipulated to move +// them as a group. +//------------------------------------------------------------------------------ + + +static const struct WindowTemplate sWindowTemplate_MultiMove = { .bg = 0, .tilemapLeft = 10, @@ -7810,33 +7868,33 @@ static const struct WindowTemplate gUnknown_0857BB1C = EWRAM_DATA static struct { - u8 field_0; + u8 funcId; u8 state; u8 fromColumn; u8 fromRow; u8 toColumn; u8 toRow; - u8 field_6; - u8 field_7; + u8 cursorColumn; + u8 cursorRow; u8 minColumn; u8 minRow; u8 columnsTotal; u8 rowsTotal; u16 bgX; u16 bgY; - u16 field_10; + u16 bgMoveSteps; struct BoxPokemon boxMons[IN_BOX_COUNT]; -} *sMoveMonsPtr = NULL; +} *sMultiMove = NULL; -static bool8 sub_80D0164(void) +static bool8 MultiMove_Init(void) { - sMoveMonsPtr = Alloc(sizeof(*sMoveMonsPtr)); - if (sMoveMonsPtr != NULL) + sMultiMove = Alloc(sizeof(*sMultiMove)); + if (sMultiMove != NULL) { - sPSSData->field_2200 = AddWindow8Bit(&gUnknown_0857BB1C); - if (sPSSData->field_2200 != 0xFF) + sPSSData->multiMoveWindowId = AddWindow8Bit(&sWindowTemplate_MultiMove); + if (sPSSData->multiMoveWindowId != WINDOW_NONE) { - FillWindowPixelBuffer(sPSSData->field_2200, PIXEL_FILL(0)); + FillWindowPixelBuffer(sPSSData->multiMoveWindowId, PIXEL_FILL(0)); return TRUE; } } @@ -7844,64 +7902,64 @@ static bool8 sub_80D0164(void) return FALSE; } -static void sub_80D01B8(void) +static void MultiMove_Free(void) { - if (sMoveMonsPtr != NULL) - Free(sMoveMonsPtr); + if (sMultiMove != NULL) + Free(sMultiMove); } -static void sub_80D01D0(u8 arg0) +static void MultiMove_SetFunction(u8 id) { - sMoveMonsPtr->field_0 = arg0; - sMoveMonsPtr->state = 0; + sMultiMove->funcId = id; + sMultiMove->state = 0; } -static bool8 sub_80D01E4(void) +// Returns TRUE if the called function has more to do, FALSE otherwise +static bool8 MultiMove_RunFunction(void) { - switch (sMoveMonsPtr->field_0) + switch (sMultiMove->funcId) { - case 0: - return sub_80D024C(); - case 1: - return sub_80D0344(); - case 2: - return sub_80D03B0(); - case 3: - return sub_80D0420(); - case 4: - return sub_80D04A0(); - case 5: - return sub_80D04C8(); + case MULTIMOVE_START: + return MultiMove_Start(); + case MULTIMOVE_CANCEL: + return MultiMove_Cancel(); + case MULTIMOVE_CHANGE_SELECTION: + return MultiMove_ChangeSelection(); + case MULTIMOVE_GRAB_SELECTION: + return MultiMove_GrabSelection(); + case MULTIMOVE_MOVE_MONS: + return MultiMove_MoveMons(); + case MULTIMOVE_PLACE_MONS: + return MultiMove_PlaceMons(); } - return FALSE; } -static bool8 sub_80D024C(void) +static bool8 MultiMove_Start(void) { - switch (sMoveMonsPtr->state) + switch (sMultiMove->state) { case 0: HideBg(0); sub_80D304C(0x80); - sMoveMonsPtr->state++; + sMultiMove->state++; break; case 1: - sub_80CFE14(&sMoveMonsPtr->fromColumn, &sMoveMonsPtr->fromRow); - sMoveMonsPtr->toColumn = sMoveMonsPtr->fromColumn; - sMoveMonsPtr->toRow = sMoveMonsPtr->fromRow; + GetCursorBoxColumnAndRow(&sMultiMove->fromColumn, &sMultiMove->fromRow); + sMultiMove->toColumn = sMultiMove->fromColumn; + sMultiMove->toRow = sMultiMove->fromRow; ChangeBgX(0, -1024, 0); ChangeBgY(0, -1024, 0); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); - FillWindowPixelBuffer8Bit(sPSSData->field_2200, PIXEL_FILL(0)); - sub_80D07B0(sMoveMonsPtr->fromColumn, sMoveMonsPtr->fromRow); + FillWindowPixelBuffer8Bit(sPSSData->multiMoveWindowId, PIXEL_FILL(0)); + MultiMove_SetIconToBg(sMultiMove->fromColumn, sMultiMove->fromRow); SetBgAttribute(0, BG_ATTR_PALETTEMODE, 1); - PutWindowTilemap(sPSSData->field_2200); - CopyWindowToVram8Bit(sPSSData->field_2200, 3); + PutWindowTilemap(sPSSData->multiMoveWindowId); + CopyWindowToVram8Bit(sPSSData->multiMoveWindowId, 3); BlendPalettes(0x3F00, 8, RGB_WHITE); StartCursorAnim(CURSOR_ANIM_OPEN); SetGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR); - sMoveMonsPtr->state++; + sMultiMove->state++; break; case 2: if (!IsDma3ManagerBusyWithBgCopy()) @@ -7915,18 +7973,18 @@ static bool8 sub_80D024C(void) return TRUE; } -static bool8 sub_80D0344(void) +static bool8 MultiMove_Cancel(void) { - switch (sMoveMonsPtr->state) + switch (sMultiMove->state) { case 0: HideBg(0); - sMoveMonsPtr->state++; + sMultiMove->state++; break; case 1: - sub_80D0B5C(); + MultiMove_ResetBg(); StartCursorAnim(CURSOR_ANIM_BOUNCE); - sMoveMonsPtr->state++; + sMultiMove->state++; break; case 2: if (!IsDma3ManagerBusyWithBgCopy()) @@ -7942,19 +8000,19 @@ static bool8 sub_80D0344(void) return TRUE; } -static bool8 sub_80D03B0(void) +static bool8 MultiMove_ChangeSelection(void) { - switch (sMoveMonsPtr->state) + switch (sMultiMove->state) { case 0: - if (!sub_80CD554()) + if (!UpdateCursorPos()) { - sub_80CFE14(&sMoveMonsPtr->field_6, &sMoveMonsPtr->field_7); - sub_80D062C(); - sMoveMonsPtr->toColumn = sMoveMonsPtr->field_6; - sMoveMonsPtr->toRow = sMoveMonsPtr->field_7; - CopyWindowToVram8Bit(sPSSData->field_2200, 2); - sMoveMonsPtr->state++; + GetCursorBoxColumnAndRow(&sMultiMove->cursorColumn, &sMultiMove->cursorRow); + MultiMove_UpdateSelectedIcons(); + sMultiMove->toColumn = sMultiMove->cursorColumn; + sMultiMove->toRow = sMultiMove->cursorRow; + CopyWindowToVram8Bit(sPSSData->multiMoveWindowId, 2); + sMultiMove->state++; } break; case 1: @@ -7964,75 +8022,75 @@ static bool8 sub_80D03B0(void) return TRUE; } -static bool8 sub_80D0420(void) +static bool8 MultiMove_GrabSelection(void) { - u8 var1, var2; + bool8 movingBg, movingMon; - switch (sMoveMonsPtr->state) + switch (sMultiMove->state) { case 0: - sub_80D08CC(); - sub_80D09A4(); + MultiMove_GetMonsFromSelection(); + MultiMove_RemoveMonsFromBox(); sub_80CDC64(FALSE); - sMoveMonsPtr->state++; + sMultiMove->state++; break; case 1: if (!DoMonPlaceChange()) { StartCursorAnim(CURSOR_ANIM_FIST); - sub_80D0884(0, 256, 8); + MultiMove_InitMove(0, 256, 8); sub_80CDC64(TRUE); - sMoveMonsPtr->state++; + sMultiMove->state++; } break; case 2: - var1 = sub_80D0894(); - var2 = DoMonPlaceChange(); - if (!var1 && !var2) - return FALSE; + movingBg = MultiMove_UpdateMove(); + movingMon = DoMonPlaceChange(); + if (!movingBg && !movingMon) + return FALSE; // Finished break; } return TRUE; } -static bool8 sub_80D04A0(void) +static bool8 MultiMove_MoveMons(void) { - u8 var1 = sub_80CD554(); - u8 var2 = sub_80D0894(); + bool8 movingCursor = UpdateCursorPos(); + bool8 movingBg = MultiMove_UpdateMove(); - if (!var1 && !var2) + if (!movingCursor && !movingBg) return FALSE; else return TRUE; } -static bool8 sub_80D04C8(void) +static bool8 MultiMove_PlaceMons(void) { - switch (sMoveMonsPtr->state) + switch (sMultiMove->state) { case 0: - sub_80D0AAC(); - sub_80D0884(0, -256, 8); + MultiMove_SetPlacedMonData(); + MultiMove_InitMove(0, -256, 8); sub_80CDC64(FALSE); - sMoveMonsPtr->state++; + sMultiMove->state++; break; case 1: - if (!DoMonPlaceChange() && !sub_80D0894()) + if (!DoMonPlaceChange() && !MultiMove_UpdateMove()) { - sub_80D0A1C(); + MultiMove_CreatePlacedMonIcons(); StartCursorAnim(CURSOR_ANIM_OPEN); sub_80CDC64(TRUE); HideBg(0); - sMoveMonsPtr->state++; + sMultiMove->state++; } break; case 2: if (!DoMonPlaceChange()) { StartCursorAnim(CURSOR_ANIM_BOUNCE); - sub_80D0B5C(); - sMoveMonsPtr->state++; + MultiMove_ResetBg(); + sMultiMove->state++; } break; case 3: @@ -8045,124 +8103,115 @@ static bool8 sub_80D04C8(void) } break; } - return TRUE; } -static bool8 sub_80D0580(u8 arg0) +// Returns TRUE if the movement was successful, FALSE otherwise +static bool8 MultiMove_TryMoveGroup(u8 dir) { - switch (arg0) + switch (dir) { - case 0: - if (sMoveMonsPtr->minRow == 0) + case 0: // Up + if (sMultiMove->minRow == 0) return FALSE; - sMoveMonsPtr->minRow--; - sub_80D0884(0, 1024, 6); + sMultiMove->minRow--; + MultiMove_InitMove(0, 1024, 6); break; - case 1: - if (sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal >= IN_BOX_ROWS) + case 1: // Down + if (sMultiMove->minRow + sMultiMove->rowsTotal >= IN_BOX_ROWS) return FALSE; - sMoveMonsPtr->minRow++; - sub_80D0884(0, -1024, 6); + sMultiMove->minRow++; + MultiMove_InitMove(0, -1024, 6); break; - case 2: - if (sMoveMonsPtr->minColumn == 0) + case 2: // Left + if (sMultiMove->minColumn == 0) return FALSE; - sMoveMonsPtr->minColumn--; - sub_80D0884(1024, 0, 6); + sMultiMove->minColumn--; + MultiMove_InitMove(1024, 0, 6); break; - case 3: - if (sMoveMonsPtr->minColumn + sMoveMonsPtr->columnsTotal >= IN_BOX_COLUMNS) + case 3: // Right + if (sMultiMove->minColumn + sMultiMove->columnsTotal >= IN_BOX_COLUMNS) return FALSE; - sMoveMonsPtr->minColumn++; - sub_80D0884(-1024, 0, 6); + sMultiMove->minColumn++; + MultiMove_InitMove(-1024, 0, 6); break; } - return TRUE; } -static void sub_80D062C(void) +static void MultiMove_UpdateSelectedIcons(void) { - s16 var = (abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->field_6)) - (abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->toColumn)); - s16 var2 = (abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->field_7)) - (abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->toRow)); + s16 columnChange = (abs(sMultiMove->fromColumn - sMultiMove->cursorColumn)) - (abs(sMultiMove->fromColumn - sMultiMove->toColumn)); + s16 rowChange = (abs(sMultiMove->fromRow - sMultiMove->cursorRow)) - (abs(sMultiMove->fromRow - sMultiMove->toRow)); - if (var > 0) - sub_80D06D0(sMoveMonsPtr->field_6, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); + if (columnChange > 0) + MultiMove_SelectColumn(sMultiMove->cursorColumn, sMultiMove->fromRow, sMultiMove->toRow); - if (var < 0) + if (columnChange < 0) { - sub_80D0740(sMoveMonsPtr->toColumn, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); - sub_80D06D0(sMoveMonsPtr->field_6, sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); + MultiMove_DeselectColumn(sMultiMove->toColumn, sMultiMove->fromRow, sMultiMove->toRow); + MultiMove_SelectColumn(sMultiMove->cursorColumn, sMultiMove->fromRow, sMultiMove->toRow); } - if (var2 > 0) - sub_80D0708(sMoveMonsPtr->field_7, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); + if (rowChange > 0) + MultiMove_SelectRow(sMultiMove->cursorRow, sMultiMove->fromColumn, sMultiMove->toColumn); - if (var2 < 0) + if (rowChange < 0) { - sub_80D0778(sMoveMonsPtr->toRow, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); - sub_80D0708(sMoveMonsPtr->field_7, sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); + MultiMove_DeselectRow(sMultiMove->toRow, sMultiMove->fromColumn, sMultiMove->toColumn); + MultiMove_SelectRow(sMultiMove->cursorRow, sMultiMove->fromColumn, sMultiMove->toColumn); } } -static void sub_80D06D0(u8 arg0, u8 arg1, u8 arg2) +static void MultiMove_SelectColumn(u8 column, u8 minRow, u8 maxRow) { - u8 var1 = arg1; - - if (arg1 > arg2) + if (minRow > maxRow) { - arg1 = arg2; - arg2 = var1; + u8 temp; + SWAP(minRow, maxRow, temp); } - while (arg1 <= arg2) - sub_80D07B0(arg0, arg1++); + while (minRow <= maxRow) + MultiMove_SetIconToBg(column, minRow++); } -static void sub_80D0708(u8 arg0, u8 arg1, u8 arg2) +static void MultiMove_SelectRow(u8 row, u8 minColumn, u8 maxColumn) { - u8 var1 = arg1; - - if (arg1 > arg2) + if (minColumn > maxColumn) { - arg1 = arg2; - arg2 = var1; + u8 temp; + SWAP(minColumn, maxColumn, temp); } - while (arg1 <= arg2) - sub_80D07B0(arg1++, arg0); + while (minColumn <= maxColumn) + MultiMove_SetIconToBg(minColumn++, row); } -static void sub_80D0740(u8 arg0, u8 arg1, u8 arg2) +static void MultiMove_DeselectColumn(u8 column, u8 minRow, u8 maxRow) { - u8 var1 = arg1; - - if (arg1 > arg2) + if (minRow > maxRow) { - arg1 = arg2; - arg2 = var1; + u8 temp; + SWAP(minRow, maxRow, temp); } - while (arg1 <= arg2) - sub_80D0834(arg0, arg1++); + while (minRow <= maxRow) + MultiMove_ClearIconFromBg(column, minRow++); } -static void sub_80D0778(u8 arg0, u8 arg1, u8 arg2) +static void MultiMove_DeselectRow(u8 row, u8 minColumn, u8 maxColumn) { - u8 var1 = arg1; - - if (arg1 > arg2) + if (minColumn > maxColumn) { - arg1 = arg2; - arg2 = var1; + u8 temp; + SWAP(minColumn, maxColumn, temp); } - while (arg1 <= arg2) - sub_80D0834(arg1++, arg0); + while (minColumn <= maxColumn) + MultiMove_ClearIconFromBg(minColumn++, row); } -static void sub_80D07B0(u8 x, u8 y) +static void MultiMove_SetIconToBg(u8 x, u8 y) { u8 position = x + (IN_BOX_COLUMNS * y); u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2); @@ -8173,7 +8222,7 @@ static void sub_80D07B0(u8 x, u8 y) const u8 *iconGfx = GetMonIconPtr(species, personality, 1); u8 index = GetValidMonIconPalIndex(species) + 8; - BlitBitmapRectToWindow4BitTo8Bit(sPSSData->field_2200, + BlitBitmapRectToWindow4BitTo8Bit(sPSSData->multiMoveWindowId, iconGfx, 0, 0, @@ -8187,14 +8236,14 @@ static void sub_80D07B0(u8 x, u8 y) } } -static void sub_80D0834(u8 x, u8 y) +static void MultiMove_ClearIconFromBg(u8 x, u8 y) { u8 position = x + (IN_BOX_COLUMNS * y); u16 species = GetCurrentBoxMonData(position, MON_DATA_SPECIES2); if (species != SPECIES_NONE) { - FillWindowPixelRect8Bit(sPSSData->field_2200, + FillWindowPixelRect8Bit(sPSSData->multiMoveWindowId, PIXEL_FILL(0), 24 * x, 24 * y, @@ -8203,70 +8252,72 @@ static void sub_80D0834(u8 x, u8 y) } } -static void sub_80D0884(u16 x, u16 y, u16 arg2) +static void MultiMove_InitMove(u16 x, u16 y, u16 arg2) { - sMoveMonsPtr->bgX = x; - sMoveMonsPtr->bgY = y; - sMoveMonsPtr->field_10 = arg2; + sMultiMove->bgX = x; + sMultiMove->bgY = y; + sMultiMove->bgMoveSteps = arg2; } -static u8 sub_80D0894(void) +static u8 MultiMove_UpdateMove(void) { - if (sMoveMonsPtr->field_10 != 0) + if (sMultiMove->bgMoveSteps != 0) { - ChangeBgX(0, sMoveMonsPtr->bgX, 1); - ChangeBgY(0, sMoveMonsPtr->bgY, 1); - sMoveMonsPtr->field_10--; + ChangeBgX(0, sMultiMove->bgX, 1); + ChangeBgY(0, sMultiMove->bgY, 1); + sMultiMove->bgMoveSteps--; } - return sMoveMonsPtr->field_10; + return sMultiMove->bgMoveSteps; } -static void sub_80D08CC(void) +// Store the Pokémon that the player is picking up +static void MultiMove_GetMonsFromSelection(void) { s32 i, j; s32 columnCount, rowCount; u8 boxId; u8 monArrayId; - sMoveMonsPtr->minColumn = min(sMoveMonsPtr->fromColumn, sMoveMonsPtr->toColumn); - sMoveMonsPtr->minRow = min(sMoveMonsPtr->fromRow, sMoveMonsPtr->toRow); - sMoveMonsPtr->columnsTotal = abs(sMoveMonsPtr->fromColumn - sMoveMonsPtr->toColumn) + 1; - sMoveMonsPtr->rowsTotal = abs(sMoveMonsPtr->fromRow - sMoveMonsPtr->toRow) + 1; + sMultiMove->minColumn = min(sMultiMove->fromColumn, sMultiMove->toColumn); + sMultiMove->minRow = min(sMultiMove->fromRow, sMultiMove->toRow); + sMultiMove->columnsTotal = abs(sMultiMove->fromColumn - sMultiMove->toColumn) + 1; + sMultiMove->rowsTotal = abs(sMultiMove->fromRow - sMultiMove->toRow) + 1; boxId = StorageGetCurrentBox(); monArrayId = 0; - columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columnsTotal; - rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; - for (i = sMoveMonsPtr->minRow; i < rowCount; i++) + columnCount = sMultiMove->minColumn + sMultiMove->columnsTotal; + rowCount = sMultiMove->minRow + sMultiMove->rowsTotal; + for (i = sMultiMove->minRow; i < rowCount; i++) { - u8 boxPosition = (IN_BOX_COLUMNS * i) + sMoveMonsPtr->minColumn; - for (j = sMoveMonsPtr->minColumn; j < columnCount; j++) + u8 boxPosition = (IN_BOX_COLUMNS * i) + sMultiMove->minColumn; + for (j = sMultiMove->minColumn; j < columnCount; j++) { struct BoxPokemon *boxMon = GetBoxedMonPtr(boxId, boxPosition); // UB: possible null dereference #ifdef UBFIX if (boxMon != NULL) - sMoveMonsPtr->boxMons[monArrayId] = *boxMon; -#else - sMoveMonsPtr->boxMons[monArrayId] = *boxMon; #endif + sMultiMove->boxMons[monArrayId] = *boxMon; + monArrayId++; boxPosition++; } } } -static void sub_80D09A4(void) +// The Pokémon the player has picked up have been stored, now delete +// them from their original positions +static void MultiMove_RemoveMonsFromBox(void) { s32 i, j; - s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columnsTotal; - s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; + s32 columnCount = sMultiMove->minColumn + sMultiMove->columnsTotal; + s32 rowCount = sMultiMove->minRow + sMultiMove->rowsTotal; u8 boxId = StorageGetCurrentBox(); - for (i = sMoveMonsPtr->minRow; i < rowCount; i++) + for (i = sMultiMove->minRow; i < rowCount; i++) { - u8 boxPosition = (IN_BOX_COLUMNS * i) + sMoveMonsPtr->minColumn; - for (j = sMoveMonsPtr->minColumn; j < columnCount; j++) + u8 boxPosition = (IN_BOX_COLUMNS * i) + sMultiMove->minColumn; + for (j = sMultiMove->minColumn; j < columnCount; j++) { DestroyBoxMonIconAtPosition(boxPosition); ZeroBoxMonAt(boxId, boxPosition); @@ -8275,19 +8326,19 @@ static void sub_80D09A4(void) } } -static void sub_80D0A1C(void) +static void MultiMove_CreatePlacedMonIcons(void) { s32 i, j; - s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columnsTotal; - s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; + s32 columnCount = sMultiMove->minColumn + sMultiMove->columnsTotal; + s32 rowCount = sMultiMove->minRow + sMultiMove->rowsTotal; u8 monArrayId = 0; - for (i = sMoveMonsPtr->minRow; i < rowCount; i++) + for (i = sMultiMove->minRow; i < rowCount; i++) { - u8 boxPosition = (IN_BOX_COLUMNS * i) + sMoveMonsPtr->minColumn; - for (j = sMoveMonsPtr->minColumn; j < columnCount; j++) + u8 boxPosition = (IN_BOX_COLUMNS * i) + sMultiMove->minColumn; + for (j = sMultiMove->minColumn; j < columnCount; j++) { - if (GetBoxMonData(&sMoveMonsPtr->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES)) + if (GetBoxMonData(&sMultiMove->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES)) sub_80CB140(boxPosition); monArrayId++; boxPosition++; @@ -8295,28 +8346,28 @@ static void sub_80D0A1C(void) } } -static void sub_80D0AAC(void) +static void MultiMove_SetPlacedMonData(void) { s32 i, j; - s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columnsTotal; - s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; + s32 columnCount = sMultiMove->minColumn + sMultiMove->columnsTotal; + s32 rowCount = sMultiMove->minRow + sMultiMove->rowsTotal; u8 boxId = StorageGetCurrentBox(); u8 monArrayId = 0; - for (i = sMoveMonsPtr->minRow; i < rowCount; i++) + for (i = sMultiMove->minRow; i < rowCount; i++) { - u8 boxPosition = (IN_BOX_COLUMNS * i) + sMoveMonsPtr->minColumn; - for (j = sMoveMonsPtr->minColumn; j < columnCount; j++) + u8 boxPosition = (IN_BOX_COLUMNS * i) + sMultiMove->minColumn; + for (j = sMultiMove->minColumn; j < columnCount; j++) { - if (GetBoxMonData(&sMoveMonsPtr->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES)) - SetBoxMonAt(boxId, boxPosition, &sMoveMonsPtr->boxMons[monArrayId]); + if (GetBoxMonData(&sMultiMove->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES)) + SetBoxMonAt(boxId, boxPosition, &sMultiMove->boxMons[monArrayId]); boxPosition++; monArrayId++; } } } -static void sub_80D0B5C(void) +static void MultiMove_ResetBg(void) { ChangeBgX(0, 0, 0); ChangeBgY(0, 0, 0); @@ -8326,24 +8377,24 @@ static void sub_80D0B5C(void) CopyBgTilemapBufferToVram(0); } -static u8 sub_80D0BA4(void) +static u8 MultiMove_GetOrigin(void) { - return (IN_BOX_COLUMNS * sMoveMonsPtr->fromRow) + sMoveMonsPtr->fromColumn; + return (IN_BOX_COLUMNS * sMultiMove->fromRow) + sMultiMove->fromColumn; } -static bool8 sub_80D0BC0(void) +static bool8 MultiMove_CanPlaceSelection(void) { s32 i, j; - s32 columnCount = sMoveMonsPtr->minColumn + sMoveMonsPtr->columnsTotal; - s32 rowCount = sMoveMonsPtr->minRow + sMoveMonsPtr->rowsTotal; + s32 columnCount = sMultiMove->minColumn + sMultiMove->columnsTotal; + s32 rowCount = sMultiMove->minRow + sMultiMove->rowsTotal; u8 monArrayId = 0; - for (i = sMoveMonsPtr->minRow; i < rowCount; i++) + for (i = sMultiMove->minRow; i < rowCount; i++) { - u8 boxPosition = (IN_BOX_COLUMNS * i) + sMoveMonsPtr->minColumn; - for (j = sMoveMonsPtr->minColumn; j < columnCount; j++) + u8 boxPosition = (IN_BOX_COLUMNS * i) + sMultiMove->minColumn; + for (j = sMultiMove->minColumn; j < columnCount; j++) { - if (GetBoxMonData(&sMoveMonsPtr->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES) + if (GetBoxMonData(&sMultiMove->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES) && GetCurrentBoxMonData(boxPosition, MON_DATA_SANITY_HAS_SPECIES)) return FALSE; @@ -8351,7 +8402,6 @@ static bool8 sub_80D0BC0(void) boxPosition++; } } - return TRUE; } From cd2a99b7c44bb875135c2c97589ecc160dad71f0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 17 Apr 2021 00:49:51 -0400 Subject: [PATCH 50/63] Doc storage - misc cleanup, some item/cursor --- gflib/text.h | 2 +- .../display_menu.bin} | Bin .../display_menu.pal} | 0 .../party_menu.bin} | Bin include/graphics.h | 6 +- include/pokemon_storage_system.h | 2 +- src/battle_script_commands.c | 2 +- src/graphics.c | 6 +- src/pokemon_storage_system.c | 842 +++++++++--------- src/pokemon_summary_screen.c | 2 +- src/pokenav_conditions_1.c | 2 +- 11 files changed, 445 insertions(+), 419 deletions(-) rename graphics/{unknown/unknown_5722A0.bin => pokemon_storage/display_menu.bin} (100%) rename graphics/{unknown/unknown_572280.pal => pokemon_storage/display_menu.pal} (100%) rename graphics/{unknown/unknown_DD36C8.bin => pokemon_storage/party_menu.bin} (100%) diff --git a/gflib/text.h b/gflib/text.h index 5274ad8b5..3edd0fc62 100644 --- a/gflib/text.h +++ b/gflib/text.h @@ -71,7 +71,7 @@ // #define CHAR_i_ACUTE 0x6F // -#define CHAR_UNK_SPACER 0x77 +#define CHAR_GENDERLESS 0x77 // Empty space for lack of gender icon // #define CHAR_UP_ARROW 0x79 #define CHAR_DOWN_ARROW 0x7A diff --git a/graphics/unknown/unknown_5722A0.bin b/graphics/pokemon_storage/display_menu.bin similarity index 100% rename from graphics/unknown/unknown_5722A0.bin rename to graphics/pokemon_storage/display_menu.bin diff --git a/graphics/unknown/unknown_572280.pal b/graphics/pokemon_storage/display_menu.pal similarity index 100% rename from graphics/unknown/unknown_572280.pal rename to graphics/pokemon_storage/display_menu.pal diff --git a/graphics/unknown/unknown_DD36C8.bin b/graphics/pokemon_storage/party_menu.bin similarity index 100% rename from graphics/unknown/unknown_DD36C8.bin rename to graphics/pokemon_storage/party_menu.bin diff --git a/include/graphics.h b/include/graphics.h index cea8bbab1..ee5677f3c 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4875,12 +4875,12 @@ extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[]; extern const u16 gPokedexAreaScreenAreaUnknown_Pal[]; // Pokemon Storage System -extern const u32 gPSSMenu_Gfx[]; -extern const u16 gPSSMenu_Pal[]; +extern const u32 gStorageSystemMenu_Gfx[]; +extern const u16 gStorageSystemPartyMenu_Pal[]; +extern const u32 gStorageSystemPartyMenu_Tilemap[]; extern const u32 gWallpaperIcon_Plusle[]; extern const u32 gWallpaperIcon_Cross[]; extern const u32 gWallpaperIcon_Bolt[]; -extern const u32 gUnknown_08DD36C8[]; extern const u32 gWallpaperTiles_Ribbon[]; extern const u32 gWallpaperTilemap_Ribbon[]; extern const u16 gWallpaperPalettes_Ribbon[][16]; diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 24e92a449..73a7833ee 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -51,7 +51,7 @@ void ZeroBoxMonAt(u8 boxId, u8 boxPosition); void BoxMonAtToMon(u8 boxId, u8 boxPosition, struct Pokemon *dst); struct BoxPokemon *GetBoxedMonPtr(u8 boxId, u8 boxPosition); u8 *GetBoxNamePtr(u8 boxId); -s16 sub_80D214C(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3); +s16 AdvanceStorageMonIndex(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3); bool8 CheckFreePokemonStorageSpace(void); bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); u32 CountStorageNonEggMons(void); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 33c6ce0e5..0492caeb5 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6045,7 +6045,7 @@ static void PutLevelAndGenderOnLvlUpBox(void) var = (u32)(txtPtr); txtPtr = ConvertIntToDecimalStringN(txtPtr, monLevel, STR_CONV_MODE_LEFT_ALIGN, 3); var = (u32)(txtPtr) - var; - txtPtr = StringFill(txtPtr, CHAR_UNK_SPACER, 4 - var); + txtPtr = StringFill(txtPtr, CHAR_GENDERLESS, 4 - var); if (monGender != MON_GENDERLESS) { diff --git a/src/graphics.c b/src/graphics.c index 4eb58cc5a..4a96a0da1 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1411,9 +1411,9 @@ const u32 gKantoTrainerCardFrontLink_Tilemap[] = INCBIN_U32("graphics/trainer_ca // pokemon storage system -const u32 gPSSMenu_Gfx[] = INCBIN_U32("graphics/pokemon_storage/menu.4bpp.lz"); -const u16 gPSSMenu_Pal[] = INCBIN_U16("graphics/pokemon_storage/menu.gbapal"); -const u32 gUnknown_08DD36C8[] = INCBIN_U32("graphics/unknown/unknown_DD36C8.bin.lz"); +const u32 gStorageSystemMenu_Gfx[] = INCBIN_U32("graphics/pokemon_storage/menu.4bpp.lz"); +const u16 gStorageSystemPartyMenu_Pal[] = INCBIN_U16("graphics/pokemon_storage/menu.gbapal"); // Only used by party menu, but generated from all menu gfx +const u32 gStorageSystemPartyMenu_Tilemap[] = INCBIN_U32("graphics/pokemon_storage/party_menu.bin.lz"); // naming screen diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 5b16011fb..2db3e67cd 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -147,7 +147,7 @@ enum { // Return IDs for input handlers enum { INPUT_NONE, - INPUT_1, + INPUT_MOVE_CURSOR, INPUT_2, // Unused INPUT_3, // Unused INPUT_CLOSE_BOX, @@ -191,10 +191,10 @@ enum { enum { CURSOR_AREA_IN_BOX, CURSOR_AREA_IN_PARTY, - CURSOR_AREA_BOX, + CURSOR_AREA_BOX_TITLE, CURSOR_AREA_BUTTONS, // Party Pokemon and Close Box }; -#define CURSOR_AREA_IN_HAND CURSOR_AREA_BOX // Alt name for cursor area used by Move Items +#define CURSOR_AREA_IN_HAND CURSOR_AREA_BOX_TITLE // Alt name for cursor area used by Move Items enum { CURSOR_ANIM_BOUNCE, @@ -244,7 +244,7 @@ enum { GFXTAG_15, // Unused GFXTAG_MARKING_COMBO, GFXTAG_17, // Unused - GFXTAG_18, + GFXTAG_MON_ICON, }; // The maximum number of Pokémon icons that can appear on-screen. @@ -302,7 +302,7 @@ enum { // Given as arguments to MultiMove_SetFunction enum { MULTIMOVE_START, - MULTIMOVE_CANCEL, + MULTIMOVE_CANCEL, // If only 1 Pokémon is grabbed MULTIMOVE_CHANGE_SELECTION, MULTIMOVE_GRAB_SELECTION, MULTIMOVE_MOVE_MONS, @@ -316,12 +316,6 @@ struct Wallpaper const u16 *palettes; }; -struct PokemonStorageSystemFunc -{ - u8 (*func)(void); - s8 unk4; -}; - struct StorageMessage { const u8 *text; @@ -385,28 +379,28 @@ struct PokemonStorageSystemData u8 taskId; struct UnkStruct_2000020 unk_0020; struct UnkStruct_2000028 unk_0028[8]; - u16 field_B0[528 / 2]; - u16 field_2C0; - u16 field_2C2; + u16 partyMenuTilemapBuffer[0x108]; + u16 partyMenuUnused; // Never read + u16 partyMenuY; u8 field_2C4; // Unused - u8 field_2C5; + u8 partyMenuMoveTimer; u8 showPartyMenuState; - u8 unk_02C7; - u8 unk_02C8; - bool8 unk_02C9; + bool8 closeBoxFlashing; + u8 closeBoxFlashTimer; + bool8 closeBoxFlashState; s16 newCurrBoxId; u16 bg2_X; s16 scrollSpeed; - u16 field_2D0; + u16 scrollTimer; u8 wallpaperOffset; - u8 field_2D3; // Written to, but never read. - u8 scrollToBoxIdUnused; // Written to, but never read. - u16 field_2D6; // Written to, but never read. - s16 scrollDirectionUnused; // Written to, but never read. - u16 field_2DA; // Written to, but never read. - u16 field_2DC; // Written to, but never read. - u16 field_2DE; // Written to, but never read. - u16 field_2E0; // Written to, but never read. + u8 scrollUnused1; // Never read + u8 scrollToBoxIdUnused; // Never read + u16 scrollUnused2; // Never read + s16 scrollDirectionUnused; // Never read. + u16 scrollUnused3; // Never read + u16 scrollUnused4; // Never read + u16 scrollUnused5; // Never read + u16 scrollUnused6; // Never read u8 filler[22]; u8 boxTitleTiles[1024]; u8 boxTitleCycleId; @@ -421,7 +415,7 @@ struct PokemonStorageSystemData struct Sprite *arrowSprites[2]; u32 boxTitlePalBits; u8 field_73C[80]; // Unused - u16 field_78C; // Written to, but never read. + u16 field_78C; // Never read. s16 wallpaperSetId; s16 wallpaperId; u16 wallpaperTilemap[360]; @@ -449,34 +443,34 @@ struct PokemonStorageSystemData u8 field_C68; s8 field_C69; u8 field_C6A; - u8 field_C6B; // Written to, but never read. + u8 field_C6B; // Never read. struct WindowTemplate menuWindow; struct StorageMenu menuItems[7]; u8 menuItemsCount; u8 menuWidth; - u8 field_CAE; // Written to, but never read. + u8 menuUnusedField; // Never read. u16 menuWindowId; struct Sprite *cursorSprite; - struct Sprite *field_CB8; - s32 field_CBC; - s32 field_CC0; - u32 field_CC4; - u32 field_CC8; - s16 field_CCC; - s16 field_CCE; + struct Sprite *cursorShadowSprite; + s32 cursorNewX; + s32 cursorNewY; + u32 cursorSpeedX; + u32 cursorSpeedY; + s16 cursorTargetX; + s16 cursorTargetY; u16 cursorMoveSteps; - s8 field_CD2; - s8 field_CD3; - u8 field_CD4; - u8 field_CD5; - u8 field_CD6; - u8 field_CD7; + s8 cursorVerticalWrap; + s8 cursorHorizontalWrap; + u8 newCursorArea; + u8 newCursorPosition; + u8 cursorPrevHorizPos; + u8 cursorFlipTimer; u8 cursorPalNums[2]; const u32 *displayMonPalette; u32 displayMonPersonality; u16 displayMonSpecies; u16 displayMonItemId; - u16 field_CE8; + u16 displayUnusedVar; bool8 setMosaic; u8 displayMonMarkings; u8 displayMonLevel; @@ -505,15 +499,15 @@ struct PokemonStorageSystemData u16 releaseCheckState; u16 restrictedReleaseMonMoves; u16 restrictedMoveList[8]; - u8 field_2186; - u8 field_2187; + u8 summaryMaxPos; + u8 summaryStartPos; u8 summaryScreenMode; union { struct Pokemon *mon; struct BoxPokemon *box; - } field_218C; - u8 field_2190[40]; + } summaryMon; + u8 messageText[40]; u8 boxTitleText[40]; u8 releaseMonName[POKEMON_NAME_LENGTH + 1]; u8 itemName[20]; @@ -531,7 +525,7 @@ struct PokemonStorageSystemData u8 field_2AC4[0x1800]; // Unused u8 field_42C4[0x800]; u8 wallpaperBgTilemapBuffer[0x1000]; - u8 field_5AC4[0x800]; + u8 displayMenuTilemapBuffer[0x800]; }; struct UnkSubStruct_2039D84 @@ -571,7 +565,7 @@ EWRAM_DATA static u8 sDepositBoxId = 0; EWRAM_DATA static u8 sWhichToReshow = 0; EWRAM_DATA static u8 sLastUsedBox = 0; EWRAM_DATA static u16 sMovingItemId = 0; -EWRAM_DATA static struct Pokemon gUnknown_02039D14 = {0}; +EWRAM_DATA static struct Pokemon sSavedMovingMon = {0}; EWRAM_DATA static s8 sCursorArea = 0; EWRAM_DATA static s8 sCursorPosition = 0; EWRAM_DATA static bool8 sIsMonBeingMoved = 0; @@ -583,7 +577,7 @@ static void CreateMainMenu(u8, s16 *); static void Cb2_EnterPSS(u8); static u8 GetCurrentBoxOption(void); static u8 HandleInput(void); -static u8 sub_80CDC2C(void); +static u8 GetSavedCursorPos(void); static u8 sub_80CB9BC(void); static void LoadWallpaperGfx(u8, s8); static void CreateIncomingBoxTitle(u8, s8); @@ -597,17 +591,17 @@ static void ChooseBoxMenu_MoveLeft(void); static void ScrollBackground(void); static void ChooseBoxMenu_MoveRight(void); static void ChooseBoxMenu_PrintInfo(void); -static void sub_80CAA14(void); +static void UpdateCloseBoxButtonFlash(void); static void ToggleCursorAutoAction(void); -static void sub_80CE790(void); +static void LoadSavedMovingMon(void); static void sub_80CE8E4(void); static void GiveChosenBagItem(void); static void SetUpHidePartyMenu(void); static void DestroyAllPartyMonIcons(void); -static void sub_80D11CC(void); +static void MoveHeldItemWithPartyMenu(void); static void LoadPSSMenuGfx(void); static void LoadWaveformSpritePalette(void); -static void sub_80CDC18(void); +static void SaveCursorPos(void); static void sub_80CD36C(void); static void sub_80CD3EC(void); static void sub_80CAC1C(void); @@ -616,8 +610,8 @@ static void SetScrollingBackground(void); static void sub_80CABE0(void); static void sub_80CAEAC(void); static void CreateItemIconSprites(void); -static void sub_80CFEA8(void); -static void sub_80CDC0C(void); +static void TryHideItemAtCursor(void); +static void ClearSavedCursorPos(void); static void InitMonIconFields(void); static void sub_80CA0D8(void); static void AddMenu(void); @@ -633,26 +627,26 @@ static void TrySetCursorFistAnim(void); static void ClearBottomWindow(void); static void sub_80CA704(void); static void RemoveMenu(void); -static void sub_80CE00C(void); -static void sub_80D1194(void); +static void RefreshDisplayMon(void); +static void MoveItemFromCursorToBag(void); static void PrintDisplayMonInfo(void); static void UpdateWaveformAnimation(void); static void AddWallpaperSetsMenu(void); static void CreateBoxScrollArrows(void); static void InitMenu(void); static void StopBoxScrollArrowsSlide(void); -static void sub_80CFC14(void); -static void sub_80CEB40(void); +static void CreateCursorSprites(void); +static void TryRefreshDisplayMon(void); static void CycleBoxTitleSprites(void); static void InitItemInfoWindow(void); static void DrawItemInfoWindow(u32); static void sub_80CAA74(void); static void PrintItemDescription(void); -static void sub_80CE760(void); -static void sub_80CDBA0(void); -static void sub_80CE7E8(void); -static void sub_80CFECC(void); -static void sub_80CA9EC(void); +static void SaveMovingMon(void); +static void SetCursorInParty(void); +static void InitSummaryScreenData(void); +static void TryShowItemAtCursor(void); +static void StopFlashingCloseBoxButton(void); static void FreePSSData(void); static void AddBoxMenu(void); static void CycleBoxTitleColor(void); @@ -660,9 +654,9 @@ static void MoveMon(void); static void PlaceMon(void); static void sub_80CAB20(void); static void sub_80CE22C(void); -static void sub_80CDA68(void); +static void DoCursorNewPosUpdate(void); static void sub_80CB950(void); -static void sub_80CA9C0(void); +static void StartFlashingCloseBoxButton(void); static void SetUpDoShowPartyMenu(void); static void StartDisplayMonMosaicEffect(void); static void SpriteCB_ChooseBoxArrow(struct Sprite *); @@ -691,7 +685,7 @@ static bool8 IsMenuLoading(void); static bool8 IsRemovingLastPartyMon(void); static bool8 CanShiftMon(void); static bool8 IsCursorOnCloseBox(void); -static bool8 IsCursorOnBox(void); +static bool8 IsCursorOnBoxTitle(void); static bool8 IsCursorInBox(void); static bool8 IsMonBeingMoved(void); static bool8 TryStorePartyMonInBox(u8); @@ -732,7 +726,7 @@ static void SetMovingMonPriority(u8); static void InitMonPlaceChange(u8); static void SetMonMarkings(u8); static void ShowYesNoWindow(s8); -static void sub_80CDBF8(u8); +static void SetCursorBoxPosition(u8); static void AnimateBoxScrollArrows(bool8); static void sub_80CA984(bool8); static void CreatePartyMonsSprites(bool8); @@ -740,10 +734,10 @@ static void PrintMessage(u8 id); static s16 HandleMenuInput(void); static s8 RunCanReleaseMon(void); static u8 GetCursorPosition(void); -static void Item_FromMonToMoving(u8, u8); -static void Item_GiveMovingToMon(u8, u8); -static void Item_TakeMons(u8, u8); -static void Item_SwitchMonsWithMoving(u8, u8); +static void TakeItemFromMon(u8, u8); +static void GiveItemToMon(u8, u8); +static void MoveItemFromMonToBag(u8, u8); +static void SwapItemsWithMon(u8, u8); static struct Sprite *CreateChooseBoxArrows(u16, u16, u8, u8, u8); static void SetWallpaperForCurrentBox(u8); static void AddWallpapersMenu(u8); @@ -753,13 +747,13 @@ static void SpriteCB_DisplayMonMosaic(struct Sprite *); static void SpriteCB_OutgoingBoxTitle(struct Sprite *); static void sub_80CBA3C(struct Sprite *); static void SpriteCB_IncomingBoxTitle(struct Sprite *); -static void sub_80CBAF0(s16); +static void MovePartySprites(s16); static void sub_80CAAA8(u8, bool8); static const u8 *GetMovingItemName(void); static void SetMenuText(u8); -static void sub_80D0D8C(u8, u8); -static void sub_80D0E50(u8, u8); -static void sub_80D0F38(u16); +static void TryLoadItemIconAtPos(u8, u8); +static void TryHideItemIconAtPos(u8, u8); +static void InitItemIconInCursor(u16); static struct Sprite *CreateMonIconSprite(u16, u32, s16, s16, u8, u8); static void DestroyBoxMonIcon(struct Sprite *); static void SetBoxSpeciesAndPersonalities(u8); @@ -776,7 +770,7 @@ static bool8 sub_80CDEC4(void); static bool8 sub_80CDEB4(void); static void GetCursorCoordsByPos(u8, u8, u16 *, u16 *); static void SetShiftedMonData(u8, u8); -static void SetMovedMonData(u8, u8); +static void SetMovingMonData(u8, u8); static void SetPlacedMonData(u8, u8); static void PurgeMonOrBoxMon(u8, u8); static void SetDisplayMonData(void *, u8); @@ -833,6 +827,25 @@ static void MultiMove_SelectRow(u8, u8, u8); static void MultiMove_SelectColumn(u8, u8, u8); static void MultiMove_DeselectColumn(u8, u8, u8); +// Functions for Move Items mode +static bool32 IsItemIconAtPosition(u8, u8); +static const u32 *GetItemIconPic(u16); +static const u32 *GetItemIconPalette(u16); +static u8 GetNewItemIconIdx(void); +static void SetItemIconPosition(u8, u8, u8); +static void LoadItemIconGfx(u8, const u32 *, const u32 *); +static void SetItemIconAffineAnim(u8, u8); +static void SetItemIconActive(u8, bool8); +static u8 GetItemIconIdxByPosition(u8, u8); +static void SetItemIconCallback(u8, u8, u8, u8); +static void SpriteCB_ItemIcon_SetPosToCursor(struct Sprite *); +static void SpriteCB_ItemIcon_WaitAnim(struct Sprite *); +static void SpriteCB_ItemIcon_ToHand(struct Sprite *); +static void SpriteCB_ItemIcon_ToMon(struct Sprite *); +static void SpriteCB_ItemIcon_SwapToHand(struct Sprite *); +static void SpriteCB_ItemIcon_HideParty(struct Sprite *); +static void SpriteCB_ItemIcon_SwapToMon(struct Sprite *); + struct { const u8 *text; const u8 *desc; @@ -908,8 +921,8 @@ static const u8 sChooseBoxMenuCenter_Gfx[] = INCBIN_U8("graphics/pokemon_storage static const u8 sChooseBoxMenuSides_Gfx[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_sides.4bpp"); static const u32 sScrollingBg_Gfx[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.4bpp.lz"); static const u32 sScrollingBg_Tilemap[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.bin.lz"); -static const u32 gUnknown_08572280[] = INCBIN_U32("graphics/unknown/unknown_572280.gbapal"); -static const u32 gUnknown_085722A0[] = INCBIN_U32("graphics/unknown/unknown_5722A0.bin.lz"); +static const u16 sDisplayMenu_Pal[] = INCBIN_U16("graphics/pokemon_storage/display_menu.gbapal"); // Unused +static const u32 sDisplayMenu_Tilemap[] = INCBIN_U32("graphics/pokemon_storage/display_menu.bin.lz"); static const u16 gUnknown_0857239C[] = { @@ -974,7 +987,7 @@ static const struct WindowTemplate sWindowTemplates[] = DUMMY_WIN_TEMPLATE }; -static const struct BgTemplate gUnknown_08572734[] = +static const struct BgTemplate sBgTemplates[] = { { .bg = 0, @@ -1166,7 +1179,7 @@ static const struct SpriteTemplate sSpriteTemplate_Waveform = static const struct OamData sOamData_MonIcon; static const struct SpriteTemplate sSpriteTemplate_MonIcon = { - .tileTag = GFXTAG_18, + .tileTag = GFXTAG_MON_ICON, .paletteTag = PALTAG_MON_ICON_0, .oam = &sOamData_MonIcon, .anims = gDummySpriteAnimTable, @@ -1927,7 +1940,7 @@ static void Cb2_PSS(void) RunTasks(); DoScheduledBgTilemapCopiesToVram(); ScrollBackground(); - sub_80CAA14(); + UpdateCloseBoxButtonFlash(); AnimateSprites(); BuildOamBuffer(); } @@ -1997,12 +2010,12 @@ static void sub_80C7E98(void) sub_80D259C(3); sub_80D2644(0, 1, gUnknown_0857239C, 8, 4); sub_80D2770(0, 1, 0); - sPSSData->unk_02C7 = 0; + sPSSData->closeBoxFlashing = FALSE; } static void sub_80C7F1C(void) { - sub_80CDC0C(); + ClearSavedCursorPos(); sInPartyMenu = (sPSSData->boxOption == OPTION_DEPOSIT); sDepositBoxId = 0; } @@ -2035,13 +2048,16 @@ static void Cb_InitPSS(u8 taskId) { switch (sWhichToReshow) { - case 1: - sub_80CE790(); + case SCREEN_CHANGE_NAME_BOX - 1: + // Return from naming box + LoadSavedMovingMon(); break; - case 0: + case SCREEN_CHANGE_SUMMARY_SCREEN - 1: + // Return from summary screen sub_80CE8E4(); break; - case 2: + case SCREEN_CHANGE_ITEM_FROM_BAG - 1: + // Return from bag menu GiveChosenBagItem(); break; } @@ -2160,7 +2176,7 @@ static void Cb_ReshowPSS(u8 taskId) case 1: if (!UpdatePaletteFade()) { - if (sWhichToReshow == 2 && gSpecialVar_ItemId != 0) + if (sWhichToReshow == SCREEN_CHANGE_ITEM_FROM_BAG - 1 && gSpecialVar_ItemId != ITEM_NONE) { PrintMessage(MSG_ITEM_IS_HELD); sPSSData->state++; @@ -2188,7 +2204,7 @@ static void Cb_ReshowPSS(u8 taskId) // States for the outer switch in Cb_MainPSS enum { MSTATE_HANDLE_INPUT, - MSTATE_1, + MSTATE_MOVE_CURSOR, MSTATE_SCROLL_BOX, MSTATE_WAIT_MSG, MSTATE_ERROR_LAST_PARTY_MON, @@ -2208,9 +2224,9 @@ static void Cb_MainPSS(u8 taskId) case MSTATE_HANDLE_INPUT: switch (HandleInput()) { - case INPUT_1: + case INPUT_MOVE_CURSOR: PlaySE(SE_SELECT); - sPSSData->state = MSTATE_1; + sPSSData->state = MSTATE_MOVE_CURSOR; break; case INPUT_SHOW_PARTY: if (sPSSData->boxOption != OPTION_MOVE_MONS && sPSSData->boxOption != OPTION_MOVE_ITEMS) @@ -2220,7 +2236,7 @@ static void Cb_MainPSS(u8 taskId) } else { - sub_80CDC0C(); + ClearSavedCursorPos(); SetPSSCallback(Cb_ShowPartyPokemon); } break; @@ -2262,7 +2278,7 @@ static void Cb_MainPSS(u8 taskId) } else { - sub_80CFEA8(); + TryHideItemAtCursor(); sPSSData->state = MSTATE_SCROLL_BOX_ITEM; } break; @@ -2278,7 +2294,7 @@ static void Cb_MainPSS(u8 taskId) } else { - sub_80CFEA8(); + TryHideItemAtCursor(); sPSSData->state = MSTATE_SCROLL_BOX_ITEM; } break; @@ -2377,13 +2393,13 @@ static void Cb_MainPSS(u8 taskId) break; } break; - case MSTATE_1: + case MSTATE_MOVE_CURSOR: if (!UpdateCursorPos()) { if (IsCursorOnCloseBox()) - sub_80CA9C0(); + StartFlashingCloseBoxButton(); else - sub_80CA9EC(); + StopFlashingCloseBoxButton(); if (sPSSData->setMosaic) StartDisplayMonMosaicEffect(); @@ -2396,13 +2412,13 @@ static void Cb_MainPSS(u8 taskId) SetCurrentBox(sPSSData->newCurrBoxId); if (!sInPartyMenu && !IsMonBeingMoved()) { - sub_80CE00C(); + RefreshDisplayMon(); StartDisplayMonMosaicEffect(); } if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { - sub_80CFECC(); + TryShowItemAtCursor(); sPSSData->state = MSTATE_WAIT_ITEM_ANIM; } else @@ -2496,7 +2512,7 @@ static void Cb_HidePartyPokemon(u8 taskId) case 1: if (!HidePartyMenu()) { - sub_80CDBF8(sub_80CDC2C()); + SetCursorBoxPosition(GetSavedCursorPos()); sPSSData->state++; } break; @@ -2738,7 +2754,7 @@ static void Cb_WithdrawMon(u8 taskId) } else { - sub_80CDC18(); + SaveCursorPos(); InitMonPlaceChange(0); sPSSData->state = 2; } @@ -2920,7 +2936,7 @@ static void Cb_ReleaseMon(u8 taskId) case 6: if (!sub_80CB9BC()) { - sub_80CE00C(); + RefreshDisplayMon(); StartDisplayMonMosaicEffect(); sub_80CAB20(); sPSSData->state++; @@ -3014,7 +3030,7 @@ static void Cb_TakeItemForMoving(u8 taskId) break; case 1: StartCursorAnim(CURSOR_ANIM_OPEN); - Item_FromMonToMoving((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); + TakeItemFromMon(sInPartyMenu ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); sPSSData->state++; break; case 2: @@ -3022,7 +3038,7 @@ static void Cb_TakeItemForMoving(u8 taskId) { StartCursorAnim(CURSOR_ANIM_FIST); ClearBottomWindow(); - sub_80CE00C(); + RefreshDisplayMon(); PrintDisplayMonInfo(); sPSSData->state++; } @@ -3044,14 +3060,14 @@ static void Cb_GiveMovingItemToMon(u8 taskId) break; case 1: StartCursorAnim(CURSOR_ANIM_OPEN); - Item_GiveMovingToMon((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); + GiveItemToMon(sInPartyMenu ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); sPSSData->state++; break; case 2: if (!IsItemIconAnimActive()) { StartCursorAnim(CURSOR_ANIM_BOUNCE); - sub_80CE00C(); + RefreshDisplayMon(); PrintDisplayMonInfo(); PrintMessage(MSG_ITEM_IS_HELD); sPSSData->state++; @@ -3085,7 +3101,7 @@ static void Cb_ItemToBag(u8 taskId) else { PlaySE(SE_SELECT); - Item_TakeMons((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); + MoveItemFromMonToBag(sInPartyMenu ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); sPSSData->state = 1; } break; @@ -3100,7 +3116,7 @@ static void Cb_ItemToBag(u8 taskId) if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - sub_80CE00C(); + RefreshDisplayMon(); PrintDisplayMonInfo(); sPSSData->state = 4; } @@ -3136,14 +3152,14 @@ static void Cb_SwitchSelectedItem(u8 taskId) break; case 1: StartCursorAnim(CURSOR_ANIM_OPEN); - Item_SwitchMonsWithMoving((sInPartyMenu != FALSE) ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); + SwapItemsWithMon(sInPartyMenu ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); sPSSData->state++; break; case 2: if (!IsItemIconAnimActive()) { StartCursorAnim(CURSOR_ANIM_FIST); - sub_80CE00C(); + RefreshDisplayMon(); PrintDisplayMonInfo(); PrintMessage(MSG_CHANGED_TO_ITEM); sPSSData->state++; @@ -3246,7 +3262,7 @@ static void Cb_CloseBoxWhileHoldingItem(u8 taskId) } break; case 3: - sub_80D1194(); + MoveItemFromCursorToBag(); sPSSData->state = 4; break; case 4: @@ -3486,14 +3502,14 @@ static void Cb_NameBox(u8 taskId) switch (sPSSData->state) { case 0: - sub_80CE760(); + SaveMovingMon(); BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sPSSData->state++; break; case 1: if (!UpdatePaletteFade()) { - sWhichToReshow = 1; + sWhichToReshow = SCREEN_CHANGE_NAME_BOX - 1; sPSSData->screenChangeType = SCREEN_CHANGE_NAME_BOX; SetPSSCallback(Cb_ChangeScreen); } @@ -3506,14 +3522,14 @@ static void Cb_ShowMonSummary(u8 taskId) switch (sPSSData->state) { case 0: - sub_80CE7E8(); + InitSummaryScreenData(); BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sPSSData->state++; break; case 1: if (!UpdatePaletteFade()) { - sWhichToReshow = 0; + sWhichToReshow = SCREEN_CHANGE_SUMMARY_SCREEN - 1; sPSSData->screenChangeType = SCREEN_CHANGE_SUMMARY_SCREEN; SetPSSCallback(Cb_ChangeScreen); } @@ -3532,7 +3548,7 @@ static void Cb_GiveItemFromBag(u8 taskId) case 1: if (!UpdatePaletteFade()) { - sWhichToReshow = 2; + sWhichToReshow = SCREEN_CHANGE_ITEM_FROM_BAG - 1; sPSSData->screenChangeType = SCREEN_CHANGE_ITEM_FROM_BAG; SetPSSCallback(Cb_ChangeScreen); } @@ -3681,12 +3697,12 @@ static void Cb_ChangeScreen(u8 taskId) SetMainCallback2(Cb2_ExitPSS); break; case SCREEN_CHANGE_SUMMARY_SCREEN: - boxMons = sPSSData->field_218C.box; - monIndex = sPSSData->field_2187; - maxMonIndex = sPSSData->field_2186; + boxMons = sPSSData->summaryMon.box; + monIndex = sPSSData->summaryStartPos; + maxMonIndex = sPSSData->summaryMaxPos; mode = sPSSData->summaryScreenMode; FreePSSData(); - if (mode == SUMMARY_MODE_NORMAL && boxMons == &gUnknown_02039D14.box) + if (mode == SUMMARY_MODE_NORMAL && boxMons == &sSavedMovingMon.box) ShowPokemonSummaryScreenSet40EF(mode, boxMons, monIndex, maxMonIndex, Cb2_ReturnToPSS); else ShowPokemonSummaryScreen(mode, boxMons, monIndex, maxMonIndex, Cb2_ReturnToPSS); @@ -3743,10 +3759,10 @@ static void ScrollBackground(void) static void LoadPSSMenuGfx(void) { - InitBgsFromTemplates(0, gUnknown_08572734, ARRAY_COUNT(gUnknown_08572734)); - DecompressAndLoadBgGfxUsingHeap(1, gPSSMenu_Gfx, 0, 0, 0); - LZ77UnCompWram(gUnknown_085722A0, sPSSData->field_5AC4); - SetBgTilemapBuffer(1, sPSSData->field_5AC4); + InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); + DecompressAndLoadBgGfxUsingHeap(1, gStorageSystemMenu_Gfx, 0, 0, 0); + LZ77UnCompWram(sDisplayMenu_Tilemap, sPSSData->displayMenuTilemapBuffer); + SetBgTilemapBuffer(1, sPSSData->displayMenuTilemapBuffer); ShowBg(1); ScheduleBgCopyTilemapToVram(1); } @@ -3966,9 +3982,9 @@ static void UpdateWaveformAnimation(void) static void sub_80CA704(void) { - LZ77UnCompWram(gUnknown_08DD36C8, sPSSData->field_B0); - LoadPalette(gPSSMenu_Pal, 0x10, 0x20); - sub_80D2644(1, 1, sPSSData->field_B0, 12, 22); + LZ77UnCompWram(gStorageSystemPartyMenu_Tilemap, sPSSData->partyMenuTilemapBuffer); + LoadPalette(gStorageSystemPartyMenu_Pal, 0x10, 0x20); + sub_80D2644(1, 1, sPSSData->partyMenuTilemapBuffer, 12, 22); sub_80D2644(2, 1, gUnknown_0857245C, 9, 4); sub_80D2770(1, 10, 0); sub_80D2770(2, 21, 0); @@ -3989,29 +4005,29 @@ static void sub_80CA704(void) } ScheduleBgCopyTilemapToVram(1); - sPSSData->unk_02C7 = 0; + sPSSData->closeBoxFlashing = FALSE; } static void SetUpShowPartyMenu(void) { - sPSSData->field_2C0 = 20; - sPSSData->field_2C2 = 2; - sPSSData->field_2C5 = 0; + sPSSData->partyMenuUnused = 20; + sPSSData->partyMenuY = 2; + sPSSData->partyMenuMoveTimer = 0; CreatePartyMonsSprites(FALSE); } static bool8 ShowPartyMenu(void) { - if (sPSSData->field_2C5 == 20) + if (sPSSData->partyMenuMoveTimer == 20) return FALSE; - sPSSData->field_2C0--; - sPSSData->field_2C2++; + sPSSData->partyMenuUnused--; + sPSSData->partyMenuY++; sub_80D27F4(1, 3, 1); sub_80D2918(1); ScheduleBgCopyTilemapToVram(1); - sub_80CBAF0(8); - if (++sPSSData->field_2C5 == 20) + MovePartySprites(8); + if (++sPSSData->partyMenuMoveTimer == 20) { sInPartyMenu = TRUE; return FALSE; @@ -4024,24 +4040,24 @@ static bool8 ShowPartyMenu(void) static void SetUpHidePartyMenu(void) { - sPSSData->field_2C0 = 0; - sPSSData->field_2C2 = 22; - sPSSData->field_2C5 = 0; + sPSSData->partyMenuUnused = 0; + sPSSData->partyMenuY = 22; + sPSSData->partyMenuMoveTimer = 0; if (sPSSData->boxOption == OPTION_MOVE_ITEMS) - sub_80D11CC(); + MoveHeldItemWithPartyMenu(); } static bool8 HidePartyMenu(void) { - if (sPSSData->field_2C5 != 20) + if (sPSSData->partyMenuMoveTimer != 20) { - sPSSData->field_2C0++; - sPSSData->field_2C2--; + sPSSData->partyMenuUnused++; + sPSSData->partyMenuY--; sub_80D27F4(1, 3, -1); sub_80D2918(1); - FillBgTilemapBufferRect_Palette0(1, 0x100, 10, sPSSData->field_2C2, 12, 1); - sub_80CBAF0(-8); - if (++sPSSData->field_2C5 != 20) + FillBgTilemapBufferRect_Palette0(1, 0x100, 10, sPSSData->partyMenuY, 12, 1); + MovePartySprites(-8); + if (++sPSSData->partyMenuMoveTimer != 20) { ScheduleBgCopyTilemapToVram(1); return TRUE; @@ -4061,40 +4077,40 @@ static bool8 HidePartyMenu(void) return FALSE; } -static void sub_80CA984(bool8 arg0) +static void sub_80CA984(bool8 normal) { - if (arg0) + if (normal) sub_80D27AC(2, 0, 0, 9, 2); - else + else // flashing sub_80D27AC(2, 0, 2, 9, 2); sub_80D2918(2); ScheduleBgCopyTilemapToVram(1); } -static void sub_80CA9C0(void) +static void StartFlashingCloseBoxButton(void) { - sPSSData->unk_02C7 = 1; - sPSSData->unk_02C8 = 30; - sPSSData->unk_02C9 = TRUE; + sPSSData->closeBoxFlashing = TRUE; + sPSSData->closeBoxFlashTimer = 30; + sPSSData->closeBoxFlashState = TRUE; } -static void sub_80CA9EC(void) +static void StopFlashingCloseBoxButton(void) { - if (sPSSData->unk_02C7) + if (sPSSData->closeBoxFlashing) { - sPSSData->unk_02C7 = 0; + sPSSData->closeBoxFlashing = FALSE; sub_80CA984(TRUE); } } -static void sub_80CAA14(void) +static void UpdateCloseBoxButtonFlash(void) { - if (sPSSData->unk_02C7 && ++sPSSData->unk_02C8 > 30) + if (sPSSData->closeBoxFlashing && ++sPSSData->closeBoxFlashTimer > 30) { - sPSSData->unk_02C8 = 0; - sPSSData->unk_02C9 = (sPSSData->unk_02C9 == FALSE); - sub_80CA984(sPSSData->unk_02C9); + sPSSData->closeBoxFlashTimer = 0; + sPSSData->closeBoxFlashState = (sPSSData->closeBoxFlashState == FALSE); + sub_80CA984(sPSSData->closeBoxFlashState); } } @@ -4125,9 +4141,8 @@ static void sub_80CAAA8(u8 arg0, bool8 isPartyMon) for (i = 0; i < 3; i++) { for (j = 0; j < 4; j++) - { - sPSSData->field_B0[index + j] = data[j]; - } + sPSSData->partyMenuTilemapBuffer[index + j] = data[j]; + data += 4; index += 12; } @@ -4155,7 +4170,7 @@ static bool8 DoShowPartyMenu(void) case 0: if (!ShowPartyMenu()) { - sub_80CDBA0(); + SetCursorInParty(); sPSSData->showPartyMenuState++; } break; @@ -4223,9 +4238,9 @@ static void PrintMessage(u8 id) break; } - DynamicPlaceholderTextUtil_ExpandPlaceholders(sPSSData->field_2190, sMessages[id].text); + DynamicPlaceholderTextUtil_ExpandPlaceholders(sPSSData->messageText, sMessages[id].text); FillWindowPixelBuffer(1, PIXEL_FILL(1)); - AddTextPrinterParameterized(1, 1, sPSSData->field_2190, 0, 1, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(1, 1, sPSSData->messageText, 0, 1, TEXT_SPEED_FF, NULL); DrawTextBorderOuter(1, 2, 14); PutWindowTilemap(1); CopyWindowToVram(1, 2); @@ -4296,17 +4311,17 @@ static u8 GetCurrentBoxOption(void) static void sub_80CAEAC(void) { - if (!IsCursorOnBox()) + if (!IsCursorOnBoxTitle()) { if (sInPartyMenu) - sub_80D0D8C(CURSOR_AREA_IN_PARTY, GetCursorPosition()); + TryLoadItemIconAtPos(CURSOR_AREA_IN_PARTY, GetCursorPosition()); else - sub_80D0D8C(CURSOR_AREA_IN_BOX, GetCursorPosition()); + TryLoadItemIconAtPos(CURSOR_AREA_IN_BOX, GetCursorPosition()); } if (sMovingItemId != ITEM_NONE) { - sub_80D0F38(sMovingItemId); + InitItemIconInCursor(sMovingItemId); StartCursorAnim(CURSOR_ANIM_FIST); } } @@ -4742,7 +4757,7 @@ static void DestroyMovingMonIcon(void) } } -static void sub_80CBAF0(s16 yDelta) +static void MovePartySprites(s16 yDelta) { u16 i, posY; @@ -4792,7 +4807,7 @@ static void SetPartyMonIconObjMode(u8 partyId, u8 objMode) } } -static void sub_80CBC14(u8 mode, u8 id) +static void SetMovingMonSprite(u8 mode, u8 id) { if (mode == MODE_PARTY) { @@ -5104,16 +5119,16 @@ static void SetUpScrollToBox(u8 boxId) s8 direction = DetermineBoxScrollDirection(boxId); sPSSData->scrollSpeed = (direction > 0) ? 6 : -6; - sPSSData->field_2D3 = (direction > 0) ? 1 : 2; - sPSSData->field_2D0 = 32; + sPSSData->scrollUnused1 = (direction > 0) ? 1 : 2; + sPSSData->scrollTimer = 32; sPSSData->scrollToBoxIdUnused = boxId; - sPSSData->field_2D6 = (direction <= 0) ? 5 : 0; + sPSSData->scrollUnused2 = (direction <= 0) ? 5 : 0; sPSSData->scrollDirectionUnused = direction; - sPSSData->field_2DA = (direction > 0) ? 264 : 56; - sPSSData->field_2DC = (direction <= 0) ? 5 : 0; - sPSSData->field_2DE = 0; - sPSSData->field_2E0 = 2; + sPSSData->scrollUnused3 = (direction > 0) ? 264 : 56; + sPSSData->scrollUnused4 = (direction <= 0) ? 5 : 0; + sPSSData->scrollUnused5 = 0; + sPSSData->scrollUnused6 = 2; sPSSData->scrollToBoxId = boxId; sPSSData->scrollDirection = direction; sPSSData->scrollState = 0; @@ -5138,10 +5153,10 @@ static bool8 ScrollToBox(void) break; case 2: var = sub_80CB584(); - if (sPSSData->field_2D0 != 0) + if (sPSSData->scrollTimer != 0) { sPSSData->bg2_X += sPSSData->scrollSpeed; - if (--sPSSData->field_2D0 != 0) + if (--sPSSData->scrollTimer != 0) return TRUE; CycleBoxTitleSprites(); StopBoxScrollArrowsSlide(); @@ -5494,7 +5509,7 @@ static void CreateBoxScrollArrows(void) sPSSData->arrowSprites[i] = sprite; } } - if (IsCursorOnBox()) + if (IsCursorOnBoxTitle()) AnimateBoxScrollArrows(TRUE); } @@ -5632,22 +5647,22 @@ static void sub_80CD36C(void) sMovingMonOrigBoxId = 0; sMovingMonOrigBoxPos = 0; sAutoActionOn = FALSE; - sub_80CDC0C(); - sub_80CFC14(); - sPSSData->field_CD6 = 1; + ClearSavedCursorPos(); + CreateCursorSprites(); + sPSSData->cursorPrevHorizPos = 1; sPSSData->inBoxMovingMode = MOVE_MODE_NORMAL; - sub_80CEB40(); + TryRefreshDisplayMon(); } static void sub_80CD3EC(void) { - sub_80CFC14(); + CreateCursorSprites(); sub_80CEBDC(); - sPSSData->field_CD6 = 1; + sPSSData->cursorPrevHorizPos = 1; sPSSData->inBoxMovingMode = MOVE_MODE_NORMAL; if (sIsMonBeingMoved) { - sPSSData->movingMon = gUnknown_02039D14; + sPSSData->movingMon = sSavedMovingMon; CreateMovingMonIcon(); } } @@ -5677,7 +5692,7 @@ static void GetCursorCoordsByPos(u8 cursorArea, u8 cursorPosition, u16 *x, u16 * *y = (cursorPosition - 1) * 24 + 4; } break; - case CURSOR_AREA_BOX: + case CURSOR_AREA_BOX_TITLE: *x = 162; *y = 12; break; @@ -5718,104 +5733,116 @@ static bool8 UpdateCursorPos(void) } else if (--sPSSData->cursorMoveSteps != 0) { - sPSSData->field_CBC += sPSSData->field_CC4; - sPSSData->field_CC0 += sPSSData->field_CC8; - sPSSData->cursorSprite->pos1.x = sPSSData->field_CBC >> 8; - sPSSData->cursorSprite->pos1.y = sPSSData->field_CC0 >> 8; + // Update position toward target + sPSSData->cursorNewX += sPSSData->cursorSpeedX; + sPSSData->cursorNewY += sPSSData->cursorSpeedY; + sPSSData->cursorSprite->pos1.x = sPSSData->cursorNewX >> 8; + sPSSData->cursorSprite->pos1.y = sPSSData->cursorNewY >> 8; + + // Limit cursor on right if (sPSSData->cursorSprite->pos1.x > DISPLAY_WIDTH + 16) { tmp = sPSSData->cursorSprite->pos1.x - (DISPLAY_WIDTH + 16); sPSSData->cursorSprite->pos1.x = tmp + 64; } + + // Limit cursor on left if (sPSSData->cursorSprite->pos1.x < 64) { tmp = 64 - sPSSData->cursorSprite->pos1.x; sPSSData->cursorSprite->pos1.x = DISPLAY_WIDTH + 16 - tmp; } + + // Limit cursor on bottom if (sPSSData->cursorSprite->pos1.y > DISPLAY_HEIGHT + 16) { tmp = sPSSData->cursorSprite->pos1.y - (DISPLAY_HEIGHT + 16); sPSSData->cursorSprite->pos1.y = tmp - 16; } + + // Limit cursor on top if (sPSSData->cursorSprite->pos1.y < -16) { tmp = -16 - sPSSData->cursorSprite->pos1.y; sPSSData->cursorSprite->pos1.y = DISPLAY_HEIGHT + 16 - tmp; } - if (sPSSData->field_CD7 && --sPSSData->field_CD7 == 0) + + // Cursor flips vertically when moving on/off the top buttons + if (sPSSData->cursorFlipTimer && --sPSSData->cursorFlipTimer == 0) sPSSData->cursorSprite->vFlip = (sPSSData->cursorSprite->vFlip == FALSE); } else { - sPSSData->cursorSprite->pos1.x = sPSSData->field_CCC; - sPSSData->cursorSprite->pos1.y = sPSSData->field_CCE; - sub_80CDA68(); + // Time is up for cursor movement, make sure it's exactly at target + sPSSData->cursorSprite->pos1.x = sPSSData->cursorTargetX; + sPSSData->cursorSprite->pos1.y = sPSSData->cursorTargetY; + DoCursorNewPosUpdate(); } return TRUE; } -static void sub_80CD6AC(u8 newCursorArea, u8 newCursorPosition) +static void InitNewCursorPos(u8 newCursorArea, u8 newCursorPosition) { u16 x, y; GetCursorCoordsByPos(newCursorArea, newCursorPosition, &x, &y); - sPSSData->field_CD4 = newCursorArea; - sPSSData->field_CD5 = newCursorPosition; - sPSSData->field_CCC = x; - sPSSData->field_CCE = y; + sPSSData->newCursorArea = newCursorArea; + sPSSData->newCursorPosition = newCursorPosition; + sPSSData->cursorTargetX = x; + sPSSData->cursorTargetY = y; } -static void sub_80CD70C(void) +static void InitCursorMove(void) { - int r7, r0; + int yDistance, xDistance; - if (sPSSData->field_CD2 != 0 || sPSSData->field_CD3 != 0) + if (sPSSData->cursorVerticalWrap != 0 || sPSSData->cursorHorizontalWrap != 0) sPSSData->cursorMoveSteps = 12; else sPSSData->cursorMoveSteps = 6; - if (sPSSData->field_CD7) - sPSSData->field_CD7 = sPSSData->cursorMoveSteps >> 1; + if (sPSSData->cursorFlipTimer) + sPSSData->cursorFlipTimer = sPSSData->cursorMoveSteps >> 1; - switch (sPSSData->field_CD2) + switch (sPSSData->cursorVerticalWrap) { - default: - r7 = sPSSData->field_CCE - sPSSData->cursorSprite->pos1.y; + default: // No wrap + yDistance = sPSSData->cursorTargetY - sPSSData->cursorSprite->pos1.y; break; - case -1: - r7 = sPSSData->field_CCE - 0xc0 - sPSSData->cursorSprite->pos1.y; + case -1: // Wrap from top to bottom + yDistance = sPSSData->cursorTargetY - 192 - sPSSData->cursorSprite->pos1.y; break; - case 1: - r7 = sPSSData->field_CCE + 0xc0 - sPSSData->cursorSprite->pos1.y; + case 1: // Wrap from bottom to top + yDistance = sPSSData->cursorTargetY + 192 - sPSSData->cursorSprite->pos1.y; break; } - switch (sPSSData->field_CD3) + switch (sPSSData->cursorHorizontalWrap) { - default: - r0 = sPSSData->field_CCC - sPSSData->cursorSprite->pos1.x; + default: // No Wrap + xDistance = sPSSData->cursorTargetX - sPSSData->cursorSprite->pos1.x; break; - case -1: - r0 = sPSSData->field_CCC - 0xc0 - sPSSData->cursorSprite->pos1.x; + case -1: // Wrap from left to right + xDistance = sPSSData->cursorTargetX - 192 - sPSSData->cursorSprite->pos1.x; break; - case 1: - r0 = sPSSData->field_CCC + 0xc0 - sPSSData->cursorSprite->pos1.x; + case 1: // Wrap from right to left + xDistance = sPSSData->cursorTargetX + 192 - sPSSData->cursorSprite->pos1.x; break; } - r7 <<= 8; - r0 <<= 8; - sPSSData->field_CC4 = r0 / sPSSData->cursorMoveSteps; - sPSSData->field_CC8 = r7 / sPSSData->cursorMoveSteps; - sPSSData->field_CBC = sPSSData->cursorSprite->pos1.x << 8; - sPSSData->field_CC0 = sPSSData->cursorSprite->pos1.y << 8; + yDistance <<= 8; + xDistance <<= 8; + sPSSData->cursorSpeedX = xDistance / sPSSData->cursorMoveSteps; + sPSSData->cursorSpeedY = yDistance / sPSSData->cursorMoveSteps; + sPSSData->cursorNewX = sPSSData->cursorSprite->pos1.x << 8; + sPSSData->cursorNewY = sPSSData->cursorSprite->pos1.y << 8; } -static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) +static void SetCursorPosition(u8 newCursorArea, u8 newCursorPosition) { - sub_80CD6AC(newCursorArea, newCursorPosition); - sub_80CD70C(); + InitNewCursorPos(newCursorArea, newCursorPosition); + InitCursorMove(); if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { if (sPSSData->inBoxMovingMode == MOVE_MODE_NORMAL && !sIsMonBeingMoved) @@ -5830,36 +5857,36 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { if (sCursorArea == CURSOR_AREA_IN_BOX) - sub_80D0E50(CURSOR_AREA_IN_BOX, sCursorPosition); + TryHideItemIconAtPos(CURSOR_AREA_IN_BOX, sCursorPosition); else if (sCursorArea == CURSOR_AREA_IN_PARTY) - sub_80D0E50(CURSOR_AREA_IN_PARTY, sCursorPosition); + TryHideItemIconAtPos(CURSOR_AREA_IN_PARTY, sCursorPosition); if (newCursorArea == CURSOR_AREA_IN_BOX) - sub_80D0D8C(newCursorArea, newCursorPosition); + TryLoadItemIconAtPos(newCursorArea, newCursorPosition); else if (newCursorArea == CURSOR_AREA_IN_PARTY) - sub_80D0D8C(newCursorArea, newCursorPosition); + TryLoadItemIconAtPos(newCursorArea, newCursorPosition); } if (newCursorArea == CURSOR_AREA_IN_PARTY && sCursorArea != CURSOR_AREA_IN_PARTY) { - sPSSData->field_CD6 = newCursorArea; - sPSSData->field_CB8->invisible = TRUE; + sPSSData->cursorPrevHorizPos = 1; + sPSSData->cursorShadowSprite->invisible = TRUE; } switch (newCursorArea) { case CURSOR_AREA_IN_PARTY: - case CURSOR_AREA_BOX: + case CURSOR_AREA_BOX_TITLE: case CURSOR_AREA_BUTTONS: sPSSData->cursorSprite->oam.priority = 1; - sPSSData->field_CB8->invisible = TRUE; - sPSSData->field_CB8->oam.priority = 1; + sPSSData->cursorShadowSprite->invisible = TRUE; + sPSSData->cursorShadowSprite->oam.priority = 1; break; case CURSOR_AREA_IN_BOX: if (sPSSData->inBoxMovingMode != MOVE_MODE_NORMAL) { sPSSData->cursorSprite->oam.priority = 0; - sPSSData->field_CB8->invisible = TRUE; + sPSSData->cursorShadowSprite->invisible = TRUE; } else { @@ -5871,10 +5898,10 @@ static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) } } -static void sub_80CDA68(void) +static void DoCursorNewPosUpdate(void) { - sCursorArea = sPSSData->field_CD4; - sCursorPosition = sPSSData->field_CD5; + sCursorArea = sPSSData->newCursorArea; + sCursorPosition = sPSSData->newCursorPosition; if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { if (sPSSData->inBoxMovingMode == MOVE_MODE_NORMAL && !sIsMonBeingMoved) @@ -5886,33 +5913,33 @@ static void sub_80CDA68(void) StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); } - sub_80CEB40(); + TryRefreshDisplayMon(); switch (sCursorArea) { case CURSOR_AREA_BUTTONS: SetMovingMonPriority(1); break; - case CURSOR_AREA_BOX: + case CURSOR_AREA_BOX_TITLE: AnimateBoxScrollArrows(TRUE); break; case CURSOR_AREA_IN_PARTY: - sPSSData->field_CB8->subpriority = 13; + sPSSData->cursorShadowSprite->subpriority = 13; SetMovingMonPriority(1); break; case CURSOR_AREA_IN_BOX: if (sPSSData->inBoxMovingMode == MOVE_MODE_NORMAL) { sPSSData->cursorSprite->oam.priority = 1; - sPSSData->field_CB8->oam.priority = 2; - sPSSData->field_CB8->subpriority = 21; - sPSSData->field_CB8->invisible = FALSE; + sPSSData->cursorShadowSprite->oam.priority = 2; + sPSSData->cursorShadowSprite->subpriority = 21; + sPSSData->cursorShadowSprite->invisible = FALSE; SetMovingMonPriority(2); } break; } } -static void sub_80CDBA0(void) +static void SetCursorInParty(void) { u8 partyCount; @@ -5927,30 +5954,30 @@ static void sub_80CDBA0(void) partyCount = PARTY_SIZE - 1; } if (sPSSData->cursorSprite->vFlip) - sPSSData->field_CD7 = 1; - sub_80CD894(CURSOR_AREA_IN_PARTY, partyCount); + sPSSData->cursorFlipTimer = 1; + SetCursorPosition(CURSOR_AREA_IN_PARTY, partyCount); } -static void sub_80CDBF8(u8 cursorBoxPosition) +static void SetCursorBoxPosition(u8 cursorBoxPosition) { - sub_80CD894(CURSOR_AREA_IN_BOX, cursorBoxPosition); + SetCursorPosition(CURSOR_AREA_IN_BOX, cursorBoxPosition); } -EWRAM_DATA static u8 gUnknown_02039D7E = 0; +EWRAM_DATA static u8 sSavedCursorPosition = 0; -static void sub_80CDC0C(void) +static void ClearSavedCursorPos(void) { - gUnknown_02039D7E = 0; + sSavedCursorPosition = 0; } -static void sub_80CDC18(void) +static void SaveCursorPos(void) { - gUnknown_02039D7E = sCursorPosition; + sSavedCursorPosition = sCursorPosition; } -static u8 sub_80CDC2C(void) +static u8 GetSavedCursorPos(void) { - return gUnknown_02039D7E; + return sSavedCursorPosition; } static void InitMonPlaceChange(u8 a0) @@ -6117,14 +6144,14 @@ static void MoveMon(void) switch (sCursorArea) { case CURSOR_AREA_IN_PARTY: - SetMovedMonData(TOTAL_BOXES_COUNT, sCursorPosition); - sub_80CBC14(MODE_PARTY, sCursorPosition); + SetMovingMonData(TOTAL_BOXES_COUNT, sCursorPosition); + SetMovingMonSprite(MODE_PARTY, sCursorPosition); break; case CURSOR_AREA_IN_BOX: if (sPSSData->inBoxMovingMode == MOVE_MODE_NORMAL) { - SetMovedMonData(StorageGetCurrentBox(), sCursorPosition); - sub_80CBC14(MODE_BOX, sCursorPosition); + SetMovingMonData(StorageGetCurrentBox(), sCursorPosition); + SetMovingMonSprite(MODE_BOX, sCursorPosition); } break; default: @@ -6156,12 +6183,12 @@ static void PlaceMon(void) sIsMonBeingMoved = FALSE; } -static void sub_80CE00C(void) +static void RefreshDisplayMon(void) { - sub_80CEB40(); + TryRefreshDisplayMon(); } -static void SetMovedMonData(u8 boxId, u8 position) +static void SetMovingMonData(u8 boxId, u8 position) { if (boxId == TOTAL_BOXES_COUNT) sPSSData->movingMon = gPlayerParty[sCursorPosition]; @@ -6222,7 +6249,7 @@ static bool8 TryStorePartyMonInBox(u8 boxId) } else { - SetMovedMonData(TOTAL_BOXES_COUNT, sCursorPosition); + SetMovingMonData(TOTAL_BOXES_COUNT, sCursorPosition); SetPlacedMonData(boxId, boxPosition); DestroyPartyMonIcon(sCursorPosition); } @@ -6237,7 +6264,7 @@ static bool8 TryStorePartyMonInBox(u8 boxId) static void sub_80CE22C(void) { StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); - sub_80CEB40(); + TryRefreshDisplayMon(); } static void InitReleaseMon(void) @@ -6286,7 +6313,7 @@ static void ReleaseMon(void) PurgeMonOrBoxMon(boxId, sCursorPosition); } - sub_80CEB40(); + TryRefreshDisplayMon(); } static void TrySetCursorFistAnim(void) @@ -6489,45 +6516,45 @@ static s8 RunCanReleaseMon(void) return -1; } -static void sub_80CE760(void) +static void SaveMovingMon(void) { if (sIsMonBeingMoved) - gUnknown_02039D14 = sPSSData->movingMon; + sSavedMovingMon = sPSSData->movingMon; } -static void sub_80CE790(void) +static void LoadSavedMovingMon(void) { if (sIsMonBeingMoved) { if (sMovingMonOrigBoxId == TOTAL_BOXES_COUNT) - sPSSData->movingMon = gUnknown_02039D14; + sPSSData->movingMon = sSavedMovingMon; else - sPSSData->movingMon.box = gUnknown_02039D14.box; + sPSSData->movingMon.box = sSavedMovingMon.box; } } -static void sub_80CE7E8(void) +static void InitSummaryScreenData(void) { if (sIsMonBeingMoved) { - sub_80CE760(); - sPSSData->field_218C.mon = &gUnknown_02039D14; - sPSSData->field_2187 = 0; - sPSSData->field_2186 = 0; + SaveMovingMon(); + sPSSData->summaryMon.mon = &sSavedMovingMon; + sPSSData->summaryStartPos = 0; + sPSSData->summaryMaxPos = 0; sPSSData->summaryScreenMode = SUMMARY_MODE_NORMAL; } else if (sCursorArea == CURSOR_AREA_IN_PARTY) { - sPSSData->field_218C.mon = gPlayerParty; - sPSSData->field_2187 = sCursorPosition; - sPSSData->field_2186 = CountPartyMons() - 1; + sPSSData->summaryMon.mon = gPlayerParty; + sPSSData->summaryStartPos = sCursorPosition; + sPSSData->summaryMaxPos = CountPartyMons() - 1; sPSSData->summaryScreenMode = SUMMARY_MODE_NORMAL; } else { - sPSSData->field_218C.box = GetBoxedMonPtr(StorageGetCurrentBox(), 0); - sPSSData->field_2187 = sCursorPosition; - sPSSData->field_2186 = IN_BOX_COUNT - 1; + sPSSData->summaryMon.box = GetBoxedMonPtr(StorageGetCurrentBox(), 0); + sPSSData->summaryStartPos = sCursorPosition; + sPSSData->summaryMaxPos = IN_BOX_COUNT - 1; sPSSData->summaryScreenMode = SUMMARY_MODE_BOX; } } @@ -6535,7 +6562,7 @@ static void sub_80CE7E8(void) static void sub_80CE8E4(void) { if (sIsMonBeingMoved) - sub_80CE790(); + LoadSavedMovingMon(); else sCursorPosition = gLastViewedMonIndex; } @@ -6608,9 +6635,9 @@ static bool8 IsMonBeingMoved(void) return sIsMonBeingMoved; } -static bool8 IsCursorOnBox(void) +static bool8 IsCursorOnBoxTitle(void) { - return (sCursorArea == CURSOR_AREA_BOX); + return (sCursorArea == CURSOR_AREA_BOX_TITLE); } static bool8 IsCursorOnCloseBox(void) @@ -6623,11 +6650,15 @@ static bool8 IsCursorInBox(void) return (sCursorArea == CURSOR_AREA_IN_BOX); } -static void sub_80CEB40(void) +static void TryRefreshDisplayMon(void) { + // If a Pokémon is currently being moved, don't start + // mosaic or update display. Keep displaying the + // currently held Pokémon. sPSSData->setMosaic = (sIsMonBeingMoved == FALSE); if (!sIsMonBeingMoved) { + // Update display Pokémon switch (sCursorArea) { case CURSOR_AREA_IN_PARTY: @@ -6638,7 +6669,7 @@ static void sub_80CEB40(void) } // fallthrough case CURSOR_AREA_BUTTONS: - case CURSOR_AREA_BOX: + case CURSOR_AREA_BOX_TITLE: SetDisplayMonData(NULL, MODE_MOVE); break; case CURSOR_AREA_IN_BOX: @@ -6651,9 +6682,9 @@ static void sub_80CEB40(void) static void sub_80CEBDC(void) { if (sIsMonBeingMoved) - SetDisplayMonData(&gUnknown_02039D14, MODE_PARTY); + SetDisplayMonData(&sSavedMovingMon, MODE_PARTY); else - sub_80CEB40(); + TryRefreshDisplayMon(); } static void SetDisplayMonData(void *pokemon, u8 mode) @@ -6770,7 +6801,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode) *(txtPtr)++ = TEXT_COLOR_DARK_GRAY; *(txtPtr)++ = TEXT_COLOR_WHITE; *(txtPtr)++ = TEXT_COLOR_LIGHT_GRAY; - *(txtPtr)++ = CHAR_UNK_SPACER; + *(txtPtr)++ = CHAR_GENDERLESS; break; } @@ -6818,70 +6849,70 @@ static u8 InBoxInput_Normal(void) { cursorArea = sCursorArea; cursorPosition = sCursorPosition; - sPSSData->field_CD2 = 0; - sPSSData->field_CD3 = 0; - sPSSData->field_CD7 = 0; + sPSSData->cursorVerticalWrap = 0; + sPSSData->cursorHorizontalWrap = 0; + sPSSData->cursorFlipTimer = 0; if (JOY_REPEAT(DPAD_UP)) { - retVal = INPUT_1; + retVal = INPUT_MOVE_CURSOR; if (sCursorPosition >= IN_BOX_COLUMNS) { cursorPosition -= IN_BOX_COLUMNS; } else { - cursorArea = CURSOR_AREA_BOX; + cursorArea = CURSOR_AREA_BOX_TITLE; cursorPosition = 0; } break; } else if (JOY_REPEAT(DPAD_DOWN)) { - retVal = INPUT_1; + retVal = INPUT_MOVE_CURSOR; cursorPosition += IN_BOX_COLUMNS; if (cursorPosition >= IN_BOX_COUNT) { cursorArea = CURSOR_AREA_BUTTONS; cursorPosition -= IN_BOX_COUNT; cursorPosition /= 3; - sPSSData->field_CD2 = 1; - sPSSData->field_CD7 = 1; + sPSSData->cursorVerticalWrap = 1; + sPSSData->cursorFlipTimer = 1; } break; } else if (JOY_REPEAT(DPAD_LEFT)) { - retVal = INPUT_1; + retVal = INPUT_MOVE_CURSOR; if (sCursorPosition % IN_BOX_COLUMNS != 0) { cursorPosition--; } else { - sPSSData->field_CD3 = -1; + sPSSData->cursorHorizontalWrap = -1; cursorPosition += (IN_BOX_COLUMNS - 1); } break; } else if (JOY_REPEAT(DPAD_RIGHT)) { - retVal = INPUT_1; + retVal = INPUT_MOVE_CURSOR; if ((sCursorPosition + 1) % IN_BOX_COLUMNS != 0) { cursorPosition++; } else { - sPSSData->field_CD3 = 1; + sPSSData->cursorHorizontalWrap = 1; cursorPosition -= (IN_BOX_COLUMNS - 1); } break; } else if (JOY_NEW(START_BUTTON)) { - retVal = INPUT_1; - cursorArea = CURSOR_AREA_BOX; + retVal = INPUT_MOVE_CURSOR; + cursorArea = CURSOR_AREA_BOX_TITLE; cursorPosition = 0; break; } @@ -6942,7 +6973,7 @@ static u8 InBoxInput_Normal(void) } while (0); if (retVal) - sub_80CD894(cursorArea, cursorPosition); + SetCursorPosition(cursorArea, cursorPosition); return retVal; } @@ -6955,7 +6986,7 @@ static u8 InBoxInput_SelectingMultiple(void) { if (sCursorPosition / IN_BOX_COLUMNS != 0) { - sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition - IN_BOX_COLUMNS); + SetCursorPosition(CURSOR_AREA_IN_BOX, sCursorPosition - IN_BOX_COLUMNS); return INPUT_MULTIMOVE_CHANGE_SELECTION; } else @@ -6967,7 +6998,7 @@ static u8 InBoxInput_SelectingMultiple(void) { if (sCursorPosition + IN_BOX_COLUMNS < IN_BOX_COUNT) { - sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition + IN_BOX_COLUMNS); + SetCursorPosition(CURSOR_AREA_IN_BOX, sCursorPosition + IN_BOX_COLUMNS); return INPUT_MULTIMOVE_CHANGE_SELECTION; } else @@ -6979,7 +7010,7 @@ static u8 InBoxInput_SelectingMultiple(void) { if (sCursorPosition % IN_BOX_COLUMNS != 0) { - sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition - 1); + SetCursorPosition(CURSOR_AREA_IN_BOX, sCursorPosition - 1); return INPUT_MULTIMOVE_CHANGE_SELECTION; } else @@ -6991,7 +7022,7 @@ static u8 InBoxInput_SelectingMultiple(void) { if ((sCursorPosition + 1) % IN_BOX_COLUMNS != 0) { - sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition + 1); + SetCursorPosition(CURSOR_AREA_IN_BOX, sCursorPosition + 1); return INPUT_MULTIMOVE_CHANGE_SELECTION; } else @@ -7010,7 +7041,7 @@ static u8 InBoxInput_SelectingMultiple(void) { // Doing a multiple mon selection but only chose 1 mon sPSSData->inBoxMovingMode = MOVE_MODE_NORMAL; - sPSSData->field_CB8->invisible = FALSE; + sPSSData->cursorShadowSprite->invisible = FALSE; return INPUT_MULTIMOVE_SINGLE; } else @@ -7029,7 +7060,7 @@ static u8 InBoxInput_MovingMultiple(void) { if (MultiMove_TryMoveGroup(0)) { - sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition - IN_BOX_COLUMNS); + SetCursorPosition(CURSOR_AREA_IN_BOX, sCursorPosition - IN_BOX_COLUMNS); return INPUT_MULTIMOVE_MOVE_MONS; } else @@ -7041,7 +7072,7 @@ static u8 InBoxInput_MovingMultiple(void) { if (MultiMove_TryMoveGroup(1)) { - sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition + IN_BOX_COLUMNS); + SetCursorPosition(CURSOR_AREA_IN_BOX, sCursorPosition + IN_BOX_COLUMNS); return INPUT_MULTIMOVE_MOVE_MONS; } else @@ -7053,7 +7084,7 @@ static u8 InBoxInput_MovingMultiple(void) { if (MultiMove_TryMoveGroup(2)) { - sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition - 1); + SetCursorPosition(CURSOR_AREA_IN_BOX, sCursorPosition - 1); return INPUT_MULTIMOVE_MOVE_MONS; } else @@ -7065,7 +7096,7 @@ static u8 InBoxInput_MovingMultiple(void) { if (MultiMove_TryMoveGroup(3)) { - sub_80CD894(CURSOR_AREA_IN_BOX, sCursorPosition + 1); + SetCursorPosition(CURSOR_AREA_IN_BOX, sCursorPosition + 1); return INPUT_MULTIMOVE_MOVE_MONS; } else @@ -7115,9 +7146,9 @@ static u8 HandleInput_InParty(void) { cursorArea = sCursorArea; cursorPosition = sCursorPosition; - sPSSData->field_CD3 = 0; - sPSSData->field_CD2 = 0; - sPSSData->field_CD7 = 0; + sPSSData->cursorHorizontalWrap = 0; + sPSSData->cursorVerticalWrap = 0; + sPSSData->cursorFlipTimer = 0; gotoBox = FALSE; retVal = INPUT_NONE; @@ -7126,7 +7157,7 @@ static u8 HandleInput_InParty(void) if (--cursorPosition < 0) cursorPosition = PARTY_SIZE; if (cursorPosition != sCursorPosition) - retVal = INPUT_1; + retVal = INPUT_MOVE_CURSOR; break; } else if (JOY_REPEAT(DPAD_DOWN)) @@ -7134,13 +7165,13 @@ static u8 HandleInput_InParty(void) if (++cursorPosition > PARTY_SIZE) cursorPosition = 0; if (cursorPosition != sCursorPosition) - retVal = INPUT_1; + retVal = INPUT_MOVE_CURSOR; break; } else if (JOY_REPEAT(DPAD_LEFT) && sCursorPosition != 0) { - retVal = INPUT_1; - sPSSData->field_CD6 = sCursorPosition; + retVal = INPUT_MOVE_CURSOR; + sPSSData->cursorPrevHorizPos = sCursorPosition; cursorPosition = 0; break; } @@ -7148,8 +7179,8 @@ static u8 HandleInput_InParty(void) { if (sCursorPosition == 0) { - retVal = INPUT_1; - cursorPosition = sPSSData->field_CD6; + retVal = INPUT_MOVE_CURSOR; + cursorPosition = sPSSData->cursorPrevHorizPos; } else { @@ -7221,7 +7252,7 @@ static u8 HandleInput_InParty(void) if (retVal != INPUT_NONE) { if (retVal != INPUT_HIDE_PARTY) - sub_80CD894(cursorArea, cursorPosition); + SetCursorPosition(cursorArea, cursorPosition); } return retVal; @@ -7235,21 +7266,21 @@ static u8 HandleInput_OnBox(void) do { - sPSSData->field_CD3 = 0; - sPSSData->field_CD2 = 0; - sPSSData->field_CD7 = 0; + sPSSData->cursorHorizontalWrap = 0; + sPSSData->cursorVerticalWrap = 0; + sPSSData->cursorFlipTimer = 0; if (JOY_REPEAT(DPAD_UP)) { - retVal = INPUT_1; + retVal = INPUT_MOVE_CURSOR; cursorArea = CURSOR_AREA_BUTTONS; cursorPosition = 0; - sPSSData->field_CD7 = 1; + sPSSData->cursorFlipTimer = 1; break; } else if (JOY_REPEAT(DPAD_DOWN)) { - retVal = INPUT_1; + retVal = INPUT_MOVE_CURSOR; cursorArea = CURSOR_AREA_IN_BOX; cursorPosition = 2; break; @@ -7290,9 +7321,9 @@ static u8 HandleInput_OnBox(void) if (retVal != INPUT_NONE) { - if (cursorArea != CURSOR_AREA_BOX) + if (cursorArea != CURSOR_AREA_BOX_TITLE) AnimateBoxScrollArrows(FALSE); - sub_80CD894(cursorArea, cursorPosition); + SetCursorPosition(cursorArea, cursorPosition); } return retVal; @@ -7308,42 +7339,42 @@ static u8 HandleInput_OnButtons(void) { cursorArea = sCursorArea; cursorPosition = sCursorPosition; - sPSSData->field_CD3 = 0; - sPSSData->field_CD2 = 0; - sPSSData->field_CD7 = 0; + sPSSData->cursorHorizontalWrap = 0; + sPSSData->cursorVerticalWrap = 0; + sPSSData->cursorFlipTimer = 0; if (JOY_REPEAT(DPAD_UP)) { - retVal = INPUT_1; + retVal = INPUT_MOVE_CURSOR; cursorArea = CURSOR_AREA_IN_BOX; - sPSSData->field_CD2 = -1; + sPSSData->cursorVerticalWrap = -1; if (sCursorPosition == 0) cursorPosition = IN_BOX_COUNT - 1 - 5; else cursorPosition = IN_BOX_COUNT - 1; - sPSSData->field_CD7 = 1; + sPSSData->cursorFlipTimer = 1; break; } if (JOY_REPEAT(DPAD_DOWN | START_BUTTON)) { - retVal = INPUT_1; - cursorArea = CURSOR_AREA_BOX; + retVal = INPUT_MOVE_CURSOR; + cursorArea = CURSOR_AREA_BOX_TITLE; cursorPosition = 0; - sPSSData->field_CD7 = 1; + sPSSData->cursorFlipTimer = 1; break; } if (JOY_REPEAT(DPAD_LEFT)) { - retVal = INPUT_1; + retVal = INPUT_MOVE_CURSOR; if (--cursorPosition < 0) cursorPosition = 1; break; } else if (JOY_REPEAT(DPAD_RIGHT)) { - retVal = INPUT_1; + retVal = INPUT_MOVE_CURSOR; if (++cursorPosition > 1) cursorPosition = 0; break; @@ -7366,7 +7397,7 @@ static u8 HandleInput_OnButtons(void) } while (0); if (retVal != INPUT_NONE) - sub_80CD894(cursorArea, cursorPosition); + SetCursorPosition(cursorArea, cursorPosition); return retVal; } @@ -7381,7 +7412,7 @@ static u8 HandleInput(void) { {HandleInput_InBox, CURSOR_AREA_IN_BOX}, {HandleInput_InParty, CURSOR_AREA_IN_PARTY}, - {HandleInput_OnBox, CURSOR_AREA_BOX}, + {HandleInput_OnBox, CURSOR_AREA_BOX_TITLE}, {HandleInput_OnButtons, CURSOR_AREA_BUTTONS}, {}, }; @@ -7521,7 +7552,7 @@ static void SpriteCB_CursorShadow(struct Sprite *sprite) sprite->pos1.y = sPSSData->cursorSprite->pos1.y + 20; } -static void sub_80CFC14(void) +static void CreateCursorSprites(void) { u16 x, y; u8 spriteId; @@ -7638,14 +7669,14 @@ static void sub_80CFC14(void) spriteId = CreateSprite(&sSpriteTemplate_CursorShadow, 0, 0, subpriority); if (spriteId != MAX_SPRITES) { - sPSSData->field_CB8 = &gSprites[spriteId]; - sPSSData->field_CB8->oam.priority = priority; + sPSSData->cursorShadowSprite = &gSprites[spriteId]; + sPSSData->cursorShadowSprite->oam.priority = priority; if (sCursorArea) - sPSSData->field_CB8->invisible = 1; + sPSSData->cursorShadowSprite->invisible = TRUE; } else { - sPSSData->field_CB8 = NULL; + sPSSData->cursorShadowSprite = NULL; } } @@ -7689,16 +7720,16 @@ static void SetCursorPriorityTo1(void) sPSSData->cursorSprite->oam.priority = 1; } -static void sub_80CFEA8(void) +static void TryHideItemAtCursor(void) { if (sCursorArea == CURSOR_AREA_IN_BOX) - sub_80D0E50(CURSOR_AREA_IN_BOX, sCursorPosition); + TryHideItemIconAtPos(CURSOR_AREA_IN_BOX, sCursorPosition); } -static void sub_80CFECC(void) +static void TryShowItemAtCursor(void) { if (sCursorArea == CURSOR_AREA_IN_BOX) - sub_80D0D8C(CURSOR_AREA_IN_BOX, sCursorPosition); + TryLoadItemIconAtPos(CURSOR_AREA_IN_BOX, sCursorPosition); } static void InitMenu(void) @@ -7790,7 +7821,7 @@ static void AddMenu(void) PrintMenuTable(sPSSData->menuWindowId, sPSSData->menuItemsCount, (void*)sPSSData->menuItems); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sPSSData->menuWindowId, sPSSData->menuItemsCount, 0); ScheduleBgCopyTilemapToVram(0); - sPSSData->field_CAE = 0; + sPSSData->menuUnusedField = 0; } // Called after AddMenu to determine whether or not the handler callback should @@ -7847,7 +7878,7 @@ static void RemoveMenu(void) //------------------------------------------------------------------------------ -// MultiMove +// SECTION: MultiMove // // The functions below handle moving and selecting multiple Pokémon at once. // The icon sprites are moved to bg 0, and this bg is manipulated to move @@ -8405,24 +8436,13 @@ static bool8 MultiMove_CanPlaceSelection(void) return TRUE; } -// The functions below handle new features of MOVE_ITEMS box option. -static bool32 IsItemIconAtPosition(u8, u8); -static const u32 *GetItemIconPic(u16); -static const u32 *GetItemIconPalette(u16); -static u8 GetNewItemIconIdx(void); -static void SetItemIconPosition(u8, u8, u8); -static void LoadItemIconGfx(u8, const u32 *, const u32 *); -static void SetItemIconAffineAnim(u8, u8); -static void SetItemIconActive(u8, bool8); -static u8 GetItemIconIdxByPosition(u8, u8); -static void SetItemIconCallback(u8, u8, u8, u8); -static void SpriteCB_ItemIcon_SetPosToCursor(struct Sprite *); -static void SpriteCB_ItemIcon_WaitAnim(struct Sprite *); -static void SpriteCB_ItemIcon_ToHand(struct Sprite *); -static void SpriteCB_ItemIcon_ToMon(struct Sprite *); -static void SpriteCB_ItemIcon_SwapToHand(struct Sprite *); -static void SpriteCB_ItemIcon_HideParty(struct Sprite *); -static void SpriteCB_ItemIcon_SwapToMon(struct Sprite *); + +//------------------------------------------------------------------------------ +// SECTION: Item mode +// +// The functions below handle the Move Items mode +//------------------------------------------------------------------------------ + static const u32 sItemInfoFrame_Gfx[] = INCBIN_U32("graphics/pokemon_storage/item_info_frame.4bpp"); @@ -8546,7 +8566,7 @@ static void CreateItemIconSprites(void) sPSSData->movingItemId = ITEM_NONE; } -static void sub_80D0D8C(u8 cursorArea, u8 cursorPos) +static void TryLoadItemIconAtPos(u8 cursorArea, u8 cursorPos) { u16 heldItem; @@ -8586,7 +8606,7 @@ static void sub_80D0D8C(u8 cursorArea, u8 cursorPos) } } -static void sub_80D0E50(u8 cursorArea, u8 cursorPos) +static void TryHideItemIconAtPos(u8 cursorArea, u8 cursorPos) { u8 id; @@ -8598,7 +8618,7 @@ static void sub_80D0E50(u8 cursorArea, u8 cursorPos) SetItemIconCallback(id, ITEM_CB_WAIT_ANIM, cursorArea, cursorPos); } -static void Item_FromMonToMoving(u8 cursorArea, u8 cursorPos) +static void TakeItemFromMon(u8 cursorArea, u8 cursorPos) { u8 id; u16 itemId; @@ -8625,7 +8645,7 @@ static void Item_FromMonToMoving(u8 cursorArea, u8 cursorPos) sPSSData->movingItemId = sPSSData->displayMonItemId; } -static void sub_80D0F38(u16 itemId) +static void InitItemIconInCursor(u16 itemId) { const u32 *tiles = GetItemIconPic(itemId); const u32 *pal = GetItemIconPalette(itemId); @@ -8638,7 +8658,7 @@ static void sub_80D0F38(u16 itemId) sPSSData->movingItemId = itemId; } -static void Item_SwitchMonsWithMoving(u8 cursorArea, u8 cursorPos) +static void SwapItemsWithMon(u8 cursorArea, u8 cursorPos) { u8 id; u16 itemId; @@ -8667,7 +8687,7 @@ static void Item_SwitchMonsWithMoving(u8 cursorArea, u8 cursorPos) SetItemIconCallback(id, ITEM_CB_SWAP_TO_MON, cursorArea, cursorPos); } -static void Item_GiveMovingToMon(u8 cursorArea, u8 cursorPos) +static void GiveItemToMon(u8 cursorArea, u8 cursorPos) { u8 id; @@ -8689,31 +8709,31 @@ static void Item_GiveMovingToMon(u8 cursorArea, u8 cursorPos) } } -static void Item_TakeMons(u8 cursorArea, u8 cursorPos) +static void MoveItemFromMonToBag(u8 cursorArea, u8 cursorPos) { u8 id; - u16 item; + u16 itemId; if (sPSSData->boxOption != OPTION_MOVE_ITEMS) return; - item = 0; + itemId = ITEM_NONE; id = GetItemIconIdxByPosition(cursorArea, cursorPos); SetItemIconAffineAnim(id, ITEM_ANIM_DISAPPEAR); SetItemIconCallback(id, ITEM_CB_WAIT_ANIM, cursorArea, cursorPos); if (cursorArea == CURSOR_AREA_IN_BOX) { - SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &item); + SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &itemId); SetBoxMonIconObjMode(cursorPos, 1); } else { - SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &item); + SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &itemId); SetPartyMonIconObjMode(cursorPos, 1); } } -static void sub_80D1194(void) +static void MoveItemFromCursorToBag(void) { if (sPSSData->boxOption == OPTION_MOVE_ITEMS) { @@ -8723,7 +8743,10 @@ static void sub_80D1194(void) } } -static void sub_80D11CC(void) +// The party menu is being closed, if the cursor is on +// a Pokémon that has a held item make sure it slides +// up along with the closing menu. +static void MoveHeldItemWithPartyMenu(void) { s32 i; @@ -9171,14 +9194,16 @@ static void SpriteCB_ItemIcon_HideParty(struct Sprite *sprite) #undef sCursorArea #undef sCursorPos -static void ItemIconDummy_1(void) +// Unused, leftover from FRLG +static void BackupPokemonStorage(void/*struct PokemonStorage * dest*/) { - + //*dest = *gPokemonStoragePtr; } -static void ItemIconDummy_2(void) +// Unused, leftover from FRLG +static void RestorePokemonStorage(void/*struct PokemonStorage * src*/) { - + //*gPokemonStoragePtr = *src; } // Functions here are general utility functions. @@ -9320,17 +9345,18 @@ static void SetBoxWallpaper(u8 boxId, u8 wallpaperId) gPokemonStoragePtr->boxWallpapers[boxId] = wallpaperId; } -s16 sub_80D214C(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3) +// For moving to the next Pokémon while viewing the summary screen +s16 AdvanceStorageMonIndex(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 mode) { s16 i; - s16 adder = -1; + s16 direction = -1; - if (arg3 < 2) - adder = 1; + if (mode == 0 || mode == 1) + direction = 1; - if (arg3 == 1 || arg3 == 3) + if (mode == 1 || mode == 3) { - for (i = (s8)currIndex + adder; i >= 0 && i <= maxIndex; i += adder) + for (i = (s8)currIndex + direction; i >= 0 && i <= maxIndex; i += direction) { if (GetBoxMonData(&boxMons[i], MON_DATA_SPECIES) != SPECIES_NONE) return i; @@ -9338,7 +9364,7 @@ s16 sub_80D214C(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3) } else { - for (i = (s8)currIndex + adder; i >= 0 && i <= maxIndex; i += adder) + for (i = (s8)currIndex + direction; i >= 0 && i <= maxIndex; i += direction) { if (GetBoxMonData(&boxMons[i], MON_DATA_SPECIES) != SPECIES_NONE && !GetBoxMonData(&boxMons[i], MON_DATA_IS_EGG)) diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 92d2f5073..8f16321b2 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -1569,7 +1569,7 @@ static void ChangeSummaryPokemon(u8 taskId, s8 delta) else delta = 3; } - monId = sub_80D214C(sMonSummaryScreen->monList.boxMons, sMonSummaryScreen->curMonIndex, sMonSummaryScreen->maxMonIndex, delta); + monId = AdvanceStorageMonIndex(sMonSummaryScreen->monList.boxMons, sMonSummaryScreen->curMonIndex, sMonSummaryScreen->maxMonIndex, delta); } else if (IsMultiBattle() == TRUE) { diff --git a/src/pokenav_conditions_1.c b/src/pokenav_conditions_1.c index ebe870f80..61b289ae1 100644 --- a/src/pokenav_conditions_1.c +++ b/src/pokenav_conditions_1.c @@ -372,7 +372,7 @@ u8 *CopyMonConditionNameGender(u8 *str, u16 id, bool8 arg3) switch (gender) { default: - *(str_++) = CHAR_UNK_SPACER; + *(str_++) = CHAR_GENDERLESS; break; case MON_MALE: *(str_++) = EXT_CTRL_CODE_BEGIN; From 1c3e387d43e0e9afad23b2bc5d187524b5a45461 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 17 Apr 2021 14:33:00 -0400 Subject: [PATCH 51/63] Doc storage - party menu --- src/pokemon_storage_system.c | 120 ++++++++++++++++++++--------------- 1 file changed, 68 insertions(+), 52 deletions(-) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 2db3e67cd..8b07c17b5 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -435,7 +435,7 @@ struct PokemonStorageSystemData u32 boxPersonalities[IN_BOX_COUNT]; u8 field_C5C; u8 field_C5D; - u8 field_C5E; + u8 numPartyToCompact; u16 field_C60; s16 field_C62; s16 field_C64; @@ -578,7 +578,7 @@ static void Cb2_EnterPSS(u8); static u8 GetCurrentBoxOption(void); static u8 HandleInput(void); static u8 GetSavedCursorPos(void); -static u8 sub_80CB9BC(void); +static u8 GetNumPartySpritesCompacting(void); static void LoadWallpaperGfx(u8, s8); static void CreateIncomingBoxTitle(u8, s8); static void StartBoxScrollArrowsSlide(s8); @@ -640,7 +640,7 @@ static void TryRefreshDisplayMon(void); static void CycleBoxTitleSprites(void); static void InitItemInfoWindow(void); static void DrawItemInfoWindow(u32); -static void sub_80CAA74(void); +static void SetPartySlotTilemaps(void); static void PrintItemDescription(void); static void SaveMovingMon(void); static void SetCursorInParty(void); @@ -655,7 +655,7 @@ static void PlaceMon(void); static void sub_80CAB20(void); static void sub_80CE22C(void); static void DoCursorNewPosUpdate(void); -static void sub_80CB950(void); +static void CompactPartySprites(void); static void StartFlashingCloseBoxButton(void); static void SetUpDoShowPartyMenu(void); static void StartDisplayMonMosaicEffect(void); @@ -745,10 +745,10 @@ static u16 GetMovingItemId(void); static void LoadDisplayMonGfx(u16, u32); static void SpriteCB_DisplayMonMosaic(struct Sprite *); static void SpriteCB_OutgoingBoxTitle(struct Sprite *); -static void sub_80CBA3C(struct Sprite *); +static void SpriteCB_MovePartyMonToNextSlot(struct Sprite *); static void SpriteCB_IncomingBoxTitle(struct Sprite *); static void MovePartySprites(s16); -static void sub_80CAAA8(u8, bool8); +static void SetPartySlotTilemap(u8, bool8); static const u8 *GetMovingItemName(void); static void SetMenuText(u8); static void TryLoadItemIconAtPos(u8, u8); @@ -757,7 +757,7 @@ static void InitItemIconInCursor(u16); static struct Sprite *CreateMonIconSprite(u16, u32, s16, s16, u8, u8); static void DestroyBoxMonIcon(struct Sprite *); static void SetBoxSpeciesAndPersonalities(u8); -static void sub_80CB9D0(struct Sprite *, u16); +static void MovePartySpriteToNextSlot(struct Sprite *, u16); static void Task_InitBox(u8); static void InitBoxTitle(u8); static s8 DetermineBoxScrollDirection(u8); @@ -935,17 +935,17 @@ static const u16 gUnknown_085723FC[] = INCBIN_U16("graphics/unknown/unknown_5723 static const u16 gUnknown_0857241C[] = INCBIN_U16("graphics/unknown/unknown_57241C.gbapal"); static const u16 gUnknown_0857243C[] = INCBIN_U16("graphics/unknown/unknown_57243C.gbapal"); -static const u16 gUnknown_0857245C[] = +static const u16 sCloseBoxButton_Tilemap[] = { 0x014c, 0x014d, 0x014e, 0x014f, 0x0170, 0x0171, 0x0172, 0x0173, 0x0174, 0x015c, 0x015d, 0x015e, 0x015f, 0x0180, 0x0181, 0x0182, 0x0183, 0x0184, 0x0175, 0x0176, 0x0177, 0x0178, 0x0179, 0x017a, 0x017b, 0x017c, 0x017d, 0x0185, 0x0186, 0x0187, 0x0188, 0x0189, 0x018a, 0x018b, 0x018c, 0x018d }; -static const u16 gUnknown_085724A4[] = +static const u16 sPartySlotFilled_Tilemap[] = { 0x1140, 0x1141, 0x1141, 0x1142, 0x1150, 0x1151, 0x1151, 0x1152, 0x1160, 0x1161, 0x1161, 0x1162, }; -static const u16 gUnknown_085724BC[] = +static const u16 sPartySlotEmpty_Tilemap[] = { 0x1143, 0x1144, 0x1144, 0x1145, 0x1153, 0x1154, 0x1154, 0x1155, 0x1163, 0x1164, 0x1164, 0x1165, }; @@ -2837,11 +2837,11 @@ static void Cb_DepositMenu(u8 taskId) break; case 2: CompactPartySlots(); - sub_80CB950(); + CompactPartySprites(); sPSSData->state++; break; case 3: - if (!sub_80CB9BC()) + if (GetNumPartySpritesCompacting() == 0) { sub_80CE22C(); StartDisplayMonMosaicEffect(); @@ -2924,7 +2924,7 @@ static void Cb_ReleaseMon(u8 taskId) if (sInPartyMenu) { CompactPartySlots(); - sub_80CB950(); + CompactPartySprites(); sPSSData->state++; } else @@ -2934,7 +2934,7 @@ static void Cb_ReleaseMon(u8 taskId) } break; case 6: - if (!sub_80CB9BC()) + if (GetNumPartySpritesCompacting() == 0) { RefreshDisplayMon(); StartDisplayMonMosaicEffect(); @@ -3285,11 +3285,11 @@ static void Cb_HandleMovingMonFromParty(u8 taskId) { case 0: CompactPartySlots(); - sub_80CB950(); + CompactPartySprites(); sPSSData->state++; break; case 1: - if (!sub_80CB9BC()) + if (GetNumPartySpritesCompacting() == 0) { sub_80CAB20(); SetPSSCallback(Cb_MainPSS); @@ -3985,10 +3985,10 @@ static void sub_80CA704(void) LZ77UnCompWram(gStorageSystemPartyMenu_Tilemap, sPSSData->partyMenuTilemapBuffer); LoadPalette(gStorageSystemPartyMenu_Pal, 0x10, 0x20); sub_80D2644(1, 1, sPSSData->partyMenuTilemapBuffer, 12, 22); - sub_80D2644(2, 1, gUnknown_0857245C, 9, 4); + sub_80D2644(2, 1, sCloseBoxButton_Tilemap, 9, 4); sub_80D2770(1, 10, 0); sub_80D2770(2, 21, 0); - sub_80CAA74(); + SetPartySlotTilemaps(); if (sInPartyMenu) { sub_80CA984(TRUE); @@ -4114,28 +4114,30 @@ static void UpdateCloseBoxButtonFlash(void) } } -static void sub_80CAA74(void) +static void SetPartySlotTilemaps(void) { u8 i; + // Skips first party slot, it should always be drawn + // as if it has a Pokémon in it for (i = 1; i < PARTY_SIZE; i++) { s32 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES); - sub_80CAAA8(i, (species != SPECIES_NONE)); + SetPartySlotTilemap(i, species != SPECIES_NONE); } } -static void sub_80CAAA8(u8 arg0, bool8 isPartyMon) +static void SetPartySlotTilemap(u8 partyId, bool8 hasMon) { u16 i, j, index; const u16 *data; - if (isPartyMon) - data = gUnknown_085724A4; + if (hasMon) + data = sPartySlotFilled_Tilemap; else - data = gUnknown_085724BC; + data = sPartySlotEmpty_Tilemap; - index = 3 * (3 * (arg0 - 1) + 1); + index = 3 * (3 * (partyId - 1) + 1); index *= 4; index += 7; for (i = 0; i < 3; i++) @@ -4150,7 +4152,7 @@ static void sub_80CAAA8(u8 arg0, bool8 isPartyMon) static void sub_80CAB20(void) { - sub_80CAA74(); + SetPartySlotTilemaps(); sub_80D27AC(1, 0, 0, 12, 22); sub_80D2918(1); ScheduleBgCopyTilemapToVram(1); @@ -4677,62 +4679,69 @@ static void CreatePartyMonsSprites(bool8 arg0) } } -static void sub_80CB950(void) +static void CompactPartySprites(void) { - u16 i, count; + u16 i, targetSlot; - sPSSData->field_C5E = 0; - for (i = 0, count = 0; i < PARTY_SIZE; i++) + sPSSData->numPartyToCompact = 0; + for (i = 0, targetSlot = 0; i < PARTY_SIZE; i++) { if (sPSSData->partySprites[i] != NULL) { - if (i != count) + if (i != targetSlot) { - sub_80CB9D0(sPSSData->partySprites[i], count); + MovePartySpriteToNextSlot(sPSSData->partySprites[i], targetSlot); sPSSData->partySprites[i] = NULL; - sPSSData->field_C5E++; + sPSSData->numPartyToCompact++; } - count++; + targetSlot++; } } } -static u8 sub_80CB9BC(void) +static u8 GetNumPartySpritesCompacting(void) { - return sPSSData->field_C5E; + return sPSSData->numPartyToCompact; } -static void sub_80CB9D0(struct Sprite *sprite, u16 partyId) +#define sPartyId data[1] +#define sMonX data[2] +#define sMonY data[3] +#define sSpeedX data[4] +#define sSpeedY data[5] +#define sMoveSteps data[6] + +static void MovePartySpriteToNextSlot(struct Sprite *sprite, u16 partyId) { s16 x, y; - sprite->data[1] = partyId; + sprite->sPartyId = partyId; if (partyId == 0) x = 104, y = 64; else x = 152, y = 8 * (3 * (partyId - 1)) + 16; - sprite->data[2] = (u16)(sprite->pos1.x) * 8; - sprite->data[3] = (u16)(sprite->pos1.y) * 8; - sprite->data[4] = ((x * 8) - sprite->data[2]) / 8; - sprite->data[5] = ((y * 8) - sprite->data[3]) / 8; + sprite->sMonX = (u16)(sprite->pos1.x) * 8; + sprite->sMonY = (u16)(sprite->pos1.y) * 8; + sprite->sSpeedX = ((x * 8) - sprite->sMonX) / 8; + sprite->sSpeedY = ((y * 8) - sprite->sMonY) / 8; sprite->data[6] = 8; - sprite->callback = sub_80CBA3C; + sprite->callback = SpriteCB_MovePartyMonToNextSlot; } -static void sub_80CBA3C(struct Sprite *sprite) +static void SpriteCB_MovePartyMonToNextSlot(struct Sprite *sprite) { - if (sprite->data[6] != 0) + if (sprite->sMoveSteps != 0) { - s16 x = sprite->data[2] += sprite->data[4]; - s16 y = sprite->data[3] += sprite->data[5]; + s16 x = sprite->sMonX += sprite->sSpeedX; + s16 y = sprite->sMonY += sprite->sSpeedY; sprite->pos1.x = x / 8u; sprite->pos1.y = y / 8u; - sprite->data[6]--; + sprite->sMoveSteps--; } else { - if (sprite->data[1] == 0) + if (sprite->sPartyId == 0) { sprite->pos1.x = 104; sprite->pos1.y = 64; @@ -4740,14 +4749,21 @@ static void sub_80CBA3C(struct Sprite *sprite) else { sprite->pos1.x = 152; - sprite->pos1.y = 8 * (3 * (sprite->data[1] - 1)) + 16; + sprite->pos1.y = 8 * (3 * (sprite->sPartyId - 1)) + 16; } sprite->callback = SpriteCallbackDummy; - sPSSData->partySprites[sprite->data[1]] = sprite; - sPSSData->field_C5E--; + sPSSData->partySprites[sprite->sPartyId] = sprite; + sPSSData->numPartyToCompact--; } } +#undef sPartyId +#undef sMonX +#undef sMonY +#undef sSpeedX +#undef sSpeedY +#undef sMoveSteps + static void DestroyMovingMonIcon(void) { if (sPSSData->movingMonSprite != NULL) From c921994ce11952581dd423a1fa0cfa70f0fb240c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 17 Apr 2021 17:28:18 -0400 Subject: [PATCH 52/63] Doc storage - tilemap util, place change --- .../bg.pal} | 0 .../bg_move_items.pal} | 0 .../interface.pal} | 0 .../pkmn_data_gray.pal} | 0 src/pokemon_storage_system.c | 551 ++++++++++-------- 5 files changed, 300 insertions(+), 251 deletions(-) rename graphics/{unknown/unknown_57241C.pal => pokemon_storage/bg.pal} (100%) rename graphics/{unknown/unknown_57243C.pal => pokemon_storage/bg_move_items.pal} (100%) rename graphics/{unknown/unknown_5723DC.pal => pokemon_storage/interface.pal} (100%) rename graphics/{unknown/unknown_5723FC.pal => pokemon_storage/pkmn_data_gray.pal} (100%) diff --git a/graphics/unknown/unknown_57241C.pal b/graphics/pokemon_storage/bg.pal similarity index 100% rename from graphics/unknown/unknown_57241C.pal rename to graphics/pokemon_storage/bg.pal diff --git a/graphics/unknown/unknown_57243C.pal b/graphics/pokemon_storage/bg_move_items.pal similarity index 100% rename from graphics/unknown/unknown_57243C.pal rename to graphics/pokemon_storage/bg_move_items.pal diff --git a/graphics/unknown/unknown_5723DC.pal b/graphics/pokemon_storage/interface.pal similarity index 100% rename from graphics/unknown/unknown_5723DC.pal rename to graphics/pokemon_storage/interface.pal diff --git a/graphics/unknown/unknown_5723FC.pal b/graphics/pokemon_storage/pkmn_data_gray.pal similarity index 100% rename from graphics/unknown/unknown_5723FC.pal rename to graphics/pokemon_storage/pkmn_data_gray.pal diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 8b07c17b5..9a6ac1469 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -284,6 +284,13 @@ enum { RELEASE_ANIM_CAME_BACK, }; +// IDs for InitMonPlaceChange +enum { + CHANGE_GRAB, + CHANGE_PLACE, + CHANGE_SHIFT, +}; + // Modes for selecting and moving Pokémon in the box. // "MULTIPLE" mode allows up to an entire box to be // picked up at once by pressing Select then holding @@ -309,6 +316,13 @@ enum { MULTIMOVE_PLACE_MONS, }; +enum { + TILEMAPID_PKMN_DATA, // The "Pkmn Data" text at the top of the display + TILEMAPID_PARTY_MENU, + TILEMAPID_CLOSE_BUTTON, + TILEMAPID_COUNT +}; + struct Wallpaper { const u32 *tiles; @@ -528,32 +542,6 @@ struct PokemonStorageSystemData u8 displayMenuTilemapBuffer[0x800]; }; -struct UnkSubStruct_2039D84 -{ - s16 field_0; - s16 field_2; - u16 field_4; - u16 field_6; - s16 field_8; - s16 field_A; -}; - -struct UnkStruct_2039D84 -{ - struct UnkSubStruct_2039D84 field_0[2]; - const void *field_18; - const void *field_1C; - u16 field_20; - u16 field_22; - u16 field_24; - u16 field_26; - u16 field_28; - u8 field_2A; - u8 field_2B; - u8 field_2C; - u8 field_2D; -}; - static u32 sItemIconGfxBuffer[98]; EWRAM_DATA static u8 sPreviousBoxOption = 0; @@ -605,7 +593,7 @@ static void SaveCursorPos(void); static void sub_80CD36C(void); static void sub_80CD3EC(void); static void sub_80CAC1C(void); -static void sub_80CEBDC(void); +static void ReshowDisplayMon(void); static void SetScrollingBackground(void); static void sub_80CABE0(void); static void sub_80CAEAC(void); @@ -625,7 +613,7 @@ static void CreateWaveformSprites(void); static void ReshowReleaseMon(void); static void TrySetCursorFistAnim(void); static void ClearBottomWindow(void); -static void sub_80CA704(void); +static void InitSupplementalTilemaps(void); static void RemoveMenu(void); static void RefreshDisplayMon(void); static void MoveItemFromCursorToBag(void); @@ -652,7 +640,7 @@ static void AddBoxMenu(void); static void CycleBoxTitleColor(void); static void MoveMon(void); static void PlaceMon(void); -static void sub_80CAB20(void); +static void UpdatePartySlotColors(void); static void sub_80CE22C(void); static void DoCursorNewPosUpdate(void); static void CompactPartySprites(void); @@ -668,8 +656,8 @@ static bool8 InitPSSWindows(void); static bool8 ResetReleaseMonSpritePtr(void); static bool8 TryHideReleaseMon(void); static bool8 IsInitBoxActive(void); -static bool8 sub_80CDED4(void); -static bool8 sub_80CDF08(void); +static bool8 MonPlaceChange_CursorDown(void); +static bool8 MonPlaceChange_CursorUp(void); static bool8 UpdateItemInfoWindowSlideIn(void); static bool8 UpdateItemInfoWindowSlideOut(void); static bool8 DoShowPartyMenu(void); @@ -728,7 +716,7 @@ static void SetMonMarkings(u8); static void ShowYesNoWindow(s8); static void SetCursorBoxPosition(u8); static void AnimateBoxScrollArrows(bool8); -static void sub_80CA984(bool8); +static void UpdateCloseBoxButtonTilemap(bool8); static void CreatePartyMonsSprites(bool8); static void PrintMessage(u8 id); static s16 HandleMenuInput(void); @@ -764,10 +752,10 @@ static s8 DetermineBoxScrollDirection(u8); static void DrawWallpaper(const void *, s8, u8); static s16 GetBoxTitleBaseX(const u8 *); static bool8 MonPlaceChange_Shift(void); -static bool8 MonPlaceChange_Move(void); +static bool8 MonPlaceChange_Grab(void); static bool8 MonPlaceChange_Place(void); -static bool8 sub_80CDEC4(void); -static bool8 sub_80CDEB4(void); +static bool8 MultiMonPlaceChange_Up(void); +static bool8 MultiMonPlaceChange_Down(void); static void GetCursorCoordsByPos(u8, u8, u16 *, u16 *); static void SetShiftedMonData(u8, u8); static void SetMovingMonData(u8, u8); @@ -782,15 +770,6 @@ static s8 GetMenuItemTextId(u8); static u8 SetSelectionMenuTexts(void); static bool8 SetMenuTexts_Mon(void); static bool8 SetMenuTexts_Item(void); -static void sub_80D27AC(u8, u16, u16, u16, u16); -static void sub_80D27F4(u8, u8, s8); -static void sub_80D2644(u8, u8, const void *, u16, u16); -static void sub_80D2770(u8, u16, u16); -static void sub_80D259C(u8); -static void sub_80D25F0(void); -static void sub_80D2918(u8); -static void sub_80D2960(u8); -static void sub_80D29F8(u8); static void sub_80D2A90(struct UnkStruct_2000020 *, struct UnkStruct_2000028 *, u32); static void sub_80D2AA4(void); static void sub_80D2B88(struct UnkStruct_2000028 *); @@ -846,6 +825,17 @@ static void SpriteCB_ItemIcon_SwapToHand(struct Sprite *); static void SpriteCB_ItemIcon_HideParty(struct Sprite *); static void SpriteCB_ItemIcon_SwapToMon(struct Sprite *); +// Functions for the tilemap updating utility +static void TilemapUtil_SetRect(u8, u16, u16, u16, u16); +static void TilemapUtil_Move(u8, u8, s8); +static void TilemapUtil_SetMap(u8, u8, const void *, u16, u16); +static void TilemapUtil_SetPos(u8, u16, u16); +static void TilemapUtil_Init(u8); +static void TilemapUtil_Free(void); +static void TilemapUtil_Update(u8); +static void TilemapUtil_DrawPrev(u8); +static void TilemapUtil_Draw(u8); + struct { const u8 *text; const u8 *desc; @@ -916,24 +906,25 @@ static const union AffineAnimCmd *const sAffineAnims_ChooseBoxMenu[] = static const u8 sChooseBoxMenu_TextColors[] = {TEXT_COLOR_RED, TEXT_DYNAMIC_COLOR_6, TEXT_DYNAMIC_COLOR_5}; static const u8 sText_OutOf30[] = _("/30"); -static const u16 sChooseBoxMenu_Pal[] = INCBIN_U16("graphics/pokemon_storage/box_selection_popup.gbapal"); +static const u16 sChooseBoxMenu_Pal[] = INCBIN_U16("graphics/pokemon_storage/box_selection_popup.gbapal"); static const u8 sChooseBoxMenuCenter_Gfx[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_center.4bpp"); -static const u8 sChooseBoxMenuSides_Gfx[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_sides.4bpp"); -static const u32 sScrollingBg_Gfx[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.4bpp.lz"); -static const u32 sScrollingBg_Tilemap[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.bin.lz"); -static const u16 sDisplayMenu_Pal[] = INCBIN_U16("graphics/pokemon_storage/display_menu.gbapal"); // Unused -static const u32 sDisplayMenu_Tilemap[] = INCBIN_U32("graphics/pokemon_storage/display_menu.bin.lz"); +static const u8 sChooseBoxMenuSides_Gfx[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_sides.4bpp"); +static const u32 sScrollingBg_Gfx[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.4bpp.lz"); +static const u32 sScrollingBg_Tilemap[] = INCBIN_U32("graphics/pokemon_storage/scrolling_bg.bin.lz"); +static const u16 sDisplayMenu_Pal[] = INCBIN_U16("graphics/pokemon_storage/display_menu.gbapal"); // Unused +static const u32 sDisplayMenu_Tilemap[] = INCBIN_U32("graphics/pokemon_storage/display_menu.bin.lz"); -static const u16 gUnknown_0857239C[] = +static const u16 sPkmnData_Tilemap[] = { 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108, 0x0111, 0x0112, 0x0113, 0x0114, 0x0115, 0x0116, 0x0117, 0x0118, 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107, 0x2108, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117, 0x2118, }; -static const u16 gUnknown_085723DC[] = INCBIN_U16("graphics/unknown/unknown_5723DC.gbapal"); // Left-most part and Close Box. -static const u16 gUnknown_085723FC[] = INCBIN_U16("graphics/unknown/unknown_5723FC.gbapal"); -static const u16 gUnknown_0857241C[] = INCBIN_U16("graphics/unknown/unknown_57241C.gbapal"); -static const u16 gUnknown_0857243C[] = INCBIN_U16("graphics/unknown/unknown_57243C.gbapal"); +// sInterface_Pal - parts of the display frame, "PkmnData"'s normal color, Close Box +static const u16 sInterface_Pal[] = INCBIN_U16("graphics/pokemon_storage/interface.gbapal"); +static const u16 sPkmnDataGray_Pal[] = INCBIN_U16("graphics/pokemon_storage/pkmn_data_gray.gbapal"); +static const u16 sBg_Pal[] = INCBIN_U16("graphics/pokemon_storage/bg.gbapal"); +static const u16 sBgMoveItems_Pal[] = INCBIN_U16("graphics/pokemon_storage/bg_move_items.gbapal"); static const u16 sCloseBoxButton_Tilemap[] = { @@ -952,8 +943,8 @@ static const u16 sPartySlotEmpty_Tilemap[] = static const u16 sWaveform_Pal[] = INCBIN_U16("graphics/pokemon_storage/waveform.gbapal"); static const u32 sWaveform_Gfx[] = INCBIN_U32("graphics/pokemon_storage/waveform.4bpp"); -static const u32 gUnknown_085726B4[] = INCBIN_U32("graphics/unused/unknown_5726B4.gbapal"); -static const u32 gUnknown_085726F4[] = INCBIN_U32("graphics/unknown/unknown_5726F4.gbapal"); +static const u16 gUnknown_085726B4[] = INCBIN_U16("graphics/unused/unknown_5726B4.gbapal"); +static const u16 gUnknown_085726F4[] = INCBIN_U16("graphics/unknown/unknown_5726F4.gbapal"); static const struct WindowTemplate sWindowTemplates[] = { @@ -1353,9 +1344,9 @@ void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero } // Unused -void sub_80C6EAC(const u8 *string, void *dst, u16 arg2, u8 arg3, u8 clr2, u8 clr3) +static void UnusedDrawTextWindow(const u8 *string, void *dst, u16 offset, u8 bgColor, u8 fgColor, u8 shadowColor) { - u32 var; + u32 tileSize; u8 windowId; u8 txtColor[3]; u8 *tileData1, *tileData2; @@ -1363,17 +1354,17 @@ void sub_80C6EAC(const u8 *string, void *dst, u16 arg2, u8 arg3, u8 clr2, u8 clr winTemplate.width = StringLength_Multibyte(string); winTemplate.height = 2; - var = winTemplate.width * 32; + tileSize = winTemplate.width * 32; windowId = AddWindow(&winTemplate); - FillWindowPixelBuffer(windowId, PIXEL_FILL(arg3)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(bgColor)); tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA); tileData2 = (winTemplate.width * 32) + tileData1; - txtColor[0] = arg3; - txtColor[1] = clr2; - txtColor[2] = clr3; + txtColor[0] = bgColor; + txtColor[1] = fgColor; + txtColor[2] = shadowColor; AddTextPrinterParameterized4(windowId, 1, 0, 2, 0, 0, txtColor, -1, string); - CpuCopy16(tileData1, dst, var); - CpuCopy16(tileData2, dst + arg2, var); + CpuCopy16(tileData1, dst, tileSize); + CpuCopy16(tileData2, dst + offset, tileSize); RemoveWindow(windowId); } @@ -2007,9 +1998,9 @@ static void sub_80C7E98(void) sub_80D2A90(&sPSSData->unk_0020, sPSSData->unk_0028, 8); gKeyRepeatStartDelay = 20; ClearScheduledBgCopiesToVram(); - sub_80D259C(3); - sub_80D2644(0, 1, gUnknown_0857239C, 8, 4); - sub_80D2770(0, 1, 0); + TilemapUtil_Init(TILEMAPID_COUNT); + TilemapUtil_SetMap(TILEMAPID_PKMN_DATA, 1, sPkmnData_Tilemap, 8, 4); + TilemapUtil_SetPos(TILEMAPID_PKMN_DATA, 1, 0); sPSSData->closeBoxFlashing = FALSE; } @@ -2106,7 +2097,7 @@ static void Cb_InitPSS(u8 taskId) sub_80CA0D8(); break; case 7: - sub_80CA704(); + InitSupplementalTilemaps(); break; case 8: CreateInitBoxTask(StorageGetCurrentBox()); @@ -2689,7 +2680,7 @@ static void Cb_MoveMon(u8 taskId) switch (sPSSData->state) { case 0: - InitMonPlaceChange(0); + InitMonPlaceChange(CHANGE_GRAB); sPSSData->state++; break; case 1: @@ -2709,7 +2700,7 @@ static void Cb_PlaceMon(u8 taskId) switch (sPSSData->state) { case 0: - InitMonPlaceChange(1); + InitMonPlaceChange(CHANGE_PLACE); sPSSData->state++; break; case 1: @@ -2729,7 +2720,7 @@ static void Cb_ShiftMon(u8 taskId) switch (sPSSData->state) { case 0: - InitMonPlaceChange(2); + InitMonPlaceChange(CHANGE_SHIFT); sPSSData->state++; break; case 1: @@ -2755,7 +2746,7 @@ static void Cb_WithdrawMon(u8 taskId) else { SaveCursorPos(); - InitMonPlaceChange(0); + InitMonPlaceChange(CHANGE_GRAB); sPSSData->state = 2; } break; @@ -2777,14 +2768,14 @@ static void Cb_WithdrawMon(u8 taskId) case 3: if (!DoShowPartyMenu()) { - InitMonPlaceChange(1); + InitMonPlaceChange(CHANGE_PLACE); sPSSData->state++; } break; case 4: if (!DoMonPlaceChange()) { - sub_80CAB20(); + UpdatePartySlotColors(); sPSSData->state++; } break; @@ -2845,7 +2836,7 @@ static void Cb_DepositMenu(u8 taskId) { sub_80CE22C(); StartDisplayMonMosaicEffect(); - sub_80CAB20(); + UpdatePartySlotColors(); SetPSSCallback(Cb_MainPSS); } break; @@ -2938,7 +2929,7 @@ static void Cb_ReleaseMon(u8 taskId) { RefreshDisplayMon(); StartDisplayMonMosaicEffect(); - sub_80CAB20(); + UpdatePartySlotColors(); sPSSData->state++; } break; @@ -3291,7 +3282,7 @@ static void Cb_HandleMovingMonFromParty(u8 taskId) case 1: if (GetNumPartySpritesCompacting() == 0) { - sub_80CAB20(); + UpdatePartySlotColors(); SetPSSCallback(Cb_MainPSS); } break; @@ -3738,7 +3729,7 @@ static void GiveChosenBagItem(void) static void FreePSSData(void) { - sub_80D25F0(); + TilemapUtil_Free(); MultiMove_Free(); FREE_AND_SET_NULL(sPSSData); FreeAllWindowBuffers(); @@ -3787,13 +3778,13 @@ static void LoadWaveformSpritePalette(void) static void sub_80CA0D8(void) { - LoadPalette(gUnknown_085723DC, 0, 0x20); - LoadPalette(gUnknown_085723FC, 0x20, 0x20); - LoadPalette(gUnknown_085726F4, 0xF0, 0x20); + LoadPalette(sInterface_Pal, 0, sizeof(sInterface_Pal)); + LoadPalette(sPkmnDataGray_Pal, 0x20, sizeof(sPkmnDataGray_Pal)); + LoadPalette(gUnknown_085726F4, 0xF0, sizeof(gUnknown_085726F4)); if (sPSSData->boxOption != OPTION_MOVE_ITEMS) - LoadPalette(gUnknown_0857241C, 0x30, 0x20); + LoadPalette(sBg_Pal, 0x30, sizeof(sBg_Pal)); else - LoadPalette(gUnknown_0857243C, 0x30, 0x20); + LoadPalette(sBgMoveItems_Pal, 0x30, sizeof(sBgMoveItems_Pal)); SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) | BGCNT_CHARBASE(1) | BGCNT_16COLOR | BGCNT_SCREENBASE(30)); CreateDisplayMonSprite(); @@ -3963,45 +3954,45 @@ static void UpdateWaveformAnimation(void) if (sPSSData->displayMonSpecies != SPECIES_NONE) { - // Start animation - sub_80D27AC(0, 0, 0, 8, 2); + // Start waveform animation and color "Pkmn Data" + TilemapUtil_SetRect(TILEMAPID_PKMN_DATA, 0, 0, 8, 2); for (i = 0; i < ARRAY_COUNT(sPSSData->waveformSprites); i++) StartSpriteAnimIfDifferent(sPSSData->waveformSprites[i], i * 2 + 1); } else { - // Stop animation - sub_80D27AC(0, 0, 2, 8, 2); + // Stop waveform animation and gray out "Pkmn Data" + TilemapUtil_SetRect(TILEMAPID_PKMN_DATA, 0, 2, 8, 2); for (i = 0; i < ARRAY_COUNT(sPSSData->waveformSprites); i++) StartSpriteAnim(sPSSData->waveformSprites[i], i * 2); } - sub_80D2918(0); + TilemapUtil_Update(TILEMAPID_PKMN_DATA); ScheduleBgCopyTilemapToVram(1); } -static void sub_80CA704(void) +static void InitSupplementalTilemaps(void) { LZ77UnCompWram(gStorageSystemPartyMenu_Tilemap, sPSSData->partyMenuTilemapBuffer); LoadPalette(gStorageSystemPartyMenu_Pal, 0x10, 0x20); - sub_80D2644(1, 1, sPSSData->partyMenuTilemapBuffer, 12, 22); - sub_80D2644(2, 1, sCloseBoxButton_Tilemap, 9, 4); - sub_80D2770(1, 10, 0); - sub_80D2770(2, 21, 0); + TilemapUtil_SetMap(TILEMAPID_PARTY_MENU, 1, sPSSData->partyMenuTilemapBuffer, 12, 22); + TilemapUtil_SetMap(TILEMAPID_CLOSE_BUTTON, 1, sCloseBoxButton_Tilemap, 9, 4); + TilemapUtil_SetPos(TILEMAPID_PARTY_MENU, 10, 0); + TilemapUtil_SetPos(TILEMAPID_CLOSE_BUTTON, 21, 0); SetPartySlotTilemaps(); if (sInPartyMenu) { - sub_80CA984(TRUE); + UpdateCloseBoxButtonTilemap(TRUE); CreatePartyMonsSprites(TRUE); - sub_80D2918(2); - sub_80D2918(1); + TilemapUtil_Update(TILEMAPID_CLOSE_BUTTON); + TilemapUtil_Update(TILEMAPID_PARTY_MENU); } else { - sub_80D27AC(1, 0, 20, 12, 2); - sub_80CA984(TRUE); - sub_80D2918(1); - sub_80D2918(2); + TilemapUtil_SetRect(TILEMAPID_PARTY_MENU, 0, 20, 12, 2); + UpdateCloseBoxButtonTilemap(TRUE); + TilemapUtil_Update(TILEMAPID_PARTY_MENU); + TilemapUtil_Update(TILEMAPID_CLOSE_BUTTON); } ScheduleBgCopyTilemapToVram(1); @@ -4023,8 +4014,8 @@ static bool8 ShowPartyMenu(void) sPSSData->partyMenuUnused--; sPSSData->partyMenuY++; - sub_80D27F4(1, 3, 1); - sub_80D2918(1); + TilemapUtil_Move(TILEMAPID_PARTY_MENU, 3, 1); + TilemapUtil_Update(TILEMAPID_PARTY_MENU); ScheduleBgCopyTilemapToVram(1); MovePartySprites(8); if (++sPSSData->partyMenuMoveTimer == 20) @@ -4053,8 +4044,8 @@ static bool8 HidePartyMenu(void) { sPSSData->partyMenuUnused++; sPSSData->partyMenuY--; - sub_80D27F4(1, 3, -1); - sub_80D2918(1); + TilemapUtil_Move(TILEMAPID_PARTY_MENU, 3, -1); + TilemapUtil_Update(TILEMAPID_PARTY_MENU); FillBgTilemapBufferRect_Palette0(1, 0x100, 10, sPSSData->partyMenuY, 12, 1); MovePartySprites(-8); if (++sPSSData->partyMenuMoveTimer != 20) @@ -4067,8 +4058,11 @@ static bool8 HidePartyMenu(void) sInPartyMenu = FALSE; DestroyAllPartyMonIcons(); CompactPartySlots(); - sub_80D27AC(2, 0, 0, 9, 2); - sub_80D2918(2); + + // The close box button gets partially covered by + // the party menu, restore it + TilemapUtil_SetRect(TILEMAPID_CLOSE_BUTTON, 0, 0, 9, 2); + TilemapUtil_Update(TILEMAPID_CLOSE_BUTTON); ScheduleBgCopyTilemapToVram(1); return FALSE; } @@ -4077,14 +4071,14 @@ static bool8 HidePartyMenu(void) return FALSE; } -static void sub_80CA984(bool8 normal) +static void UpdateCloseBoxButtonTilemap(bool8 normal) { if (normal) - sub_80D27AC(2, 0, 0, 9, 2); + TilemapUtil_SetRect(TILEMAPID_CLOSE_BUTTON, 0, 0, 9, 2); else // flashing - sub_80D27AC(2, 0, 2, 9, 2); + TilemapUtil_SetRect(TILEMAPID_CLOSE_BUTTON, 0, 2, 9, 2); - sub_80D2918(2); + TilemapUtil_Update(TILEMAPID_CLOSE_BUTTON); ScheduleBgCopyTilemapToVram(1); } @@ -4100,7 +4094,7 @@ static void StopFlashingCloseBoxButton(void) if (sPSSData->closeBoxFlashing) { sPSSData->closeBoxFlashing = FALSE; - sub_80CA984(TRUE); + UpdateCloseBoxButtonTilemap(TRUE); } } @@ -4110,7 +4104,7 @@ static void UpdateCloseBoxButtonFlash(void) { sPSSData->closeBoxFlashTimer = 0; sPSSData->closeBoxFlashState = (sPSSData->closeBoxFlashState == FALSE); - sub_80CA984(sPSSData->closeBoxFlashState); + UpdateCloseBoxButtonTilemap(sPSSData->closeBoxFlashState); } } @@ -4150,11 +4144,11 @@ static void SetPartySlotTilemap(u8 partyId, bool8 hasMon) } } -static void sub_80CAB20(void) +static void UpdatePartySlotColors(void) { SetPartySlotTilemaps(); - sub_80D27AC(1, 0, 0, 12, 22); - sub_80D2918(1); + TilemapUtil_SetRect(TILEMAPID_PARTY_MENU, 0, 0, 12, 22); + TilemapUtil_Update(TILEMAPID_PARTY_MENU); ScheduleBgCopyTilemapToVram(1); } @@ -4637,7 +4631,7 @@ static void SetBoxMonIconObjMode(u8 boxPosition, u8 objMode) } } -static void CreatePartyMonsSprites(bool8 arg0) +static void CreatePartyMonsSprites(bool8 visible) { u16 i, count; u16 species = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES2); @@ -4660,7 +4654,7 @@ static void CreatePartyMonsSprites(bool8 arg0) } } - if (!arg0) + if (!visible) { for (i = 0; i < count; i++) { @@ -5426,7 +5420,7 @@ static void CreateIncomingBoxTitle(u8 boxId, s8 direction) StringCopyPadded(sPSSData->boxTitleText, GetBoxNamePtr(boxId), 0, 8); DrawTextWindowAndBufferTiles(sPSSData->boxTitleText, sPSSData->boxTitleTiles, 0, 0, 2); LoadSpriteSheet(&spriteSheet); - LoadPalette(sBoxTitleColors[GetBoxWallpaper(boxId)], palOffset, 4); + LoadPalette(sBoxTitleColors[GetBoxWallpaper(boxId)], palOffset, sizeof(sBoxTitleColors[0])); x = GetBoxTitleBaseX(GetBoxNamePtr(boxId)); adjustedX = x; adjustedX += direction * 192; @@ -5673,7 +5667,7 @@ static void sub_80CD36C(void) static void sub_80CD3EC(void) { CreateCursorSprites(); - sub_80CEBDC(); + ReshowDisplayMon(); sPSSData->cursorPrevHorizPos = 1; sPSSData->inBoxMovingMode = MOVE_MODE_NORMAL; if (sIsMonBeingMoved) @@ -5996,25 +5990,27 @@ static u8 GetSavedCursorPos(void) return sSavedCursorPosition; } -static void InitMonPlaceChange(u8 a0) +static void InitMonPlaceChange(u8 type) { static bool8 (*const placeChangeFuncs[])(void) = { - MonPlaceChange_Move, - MonPlaceChange_Place, - MonPlaceChange_Shift, + [CHANGE_GRAB] = MonPlaceChange_Grab, + [CHANGE_PLACE] = MonPlaceChange_Place, + [CHANGE_SHIFT] = MonPlaceChange_Shift, }; - sPSSData->monPlaceChangeFunc = placeChangeFuncs[a0]; + sPSSData->monPlaceChangeFunc = placeChangeFuncs[type]; sPSSData->monPlaceChangeState = 0; } -static void sub_80CDC64(bool8 arg0) +// No Shift while moving multiple Pokémon, only grab and place +// For both grab/place, the cursor moves down, then up +static void InitMultiMonPlaceChange(bool8 up) { - if (!arg0) - sPSSData->monPlaceChangeFunc = sub_80CDEB4; + if (!up) + sPSSData->monPlaceChangeFunc = MultiMonPlaceChange_Down; else - sPSSData->monPlaceChangeFunc = sub_80CDEC4; + sPSSData->monPlaceChangeFunc = MultiMonPlaceChange_Up; sPSSData->monPlaceChangeState = 0; } @@ -6024,7 +6020,7 @@ static bool8 DoMonPlaceChange(void) return sPSSData->monPlaceChangeFunc(); } -static bool8 MonPlaceChange_Move(void) +static bool8 MonPlaceChange_Grab(void) { switch (sPSSData->monPlaceChangeState) { @@ -6035,7 +6031,7 @@ static bool8 MonPlaceChange_Move(void) sPSSData->monPlaceChangeState++; break; case 1: - if (!sub_80CDED4()) + if (!MonPlaceChange_CursorDown()) { StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_FIST); MoveMon(); @@ -6043,7 +6039,7 @@ static bool8 MonPlaceChange_Move(void) } break; case 2: - if (!sub_80CDF08()) + if (!MonPlaceChange_CursorUp()) sPSSData->monPlaceChangeState++; break; case 3: @@ -6058,7 +6054,7 @@ static bool8 MonPlaceChange_Place(void) switch (sPSSData->monPlaceChangeState) { case 0: - if (!sub_80CDED4()) + if (!MonPlaceChange_CursorDown()) { StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_OPEN); PlaceMon(); @@ -6066,7 +6062,7 @@ static bool8 MonPlaceChange_Place(void) } break; case 1: - if (!sub_80CDF08()) + if (!MonPlaceChange_CursorUp()) { StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); sPSSData->monPlaceChangeState++; @@ -6114,17 +6110,17 @@ static bool8 MonPlaceChange_Shift(void) return TRUE; } -static bool8 sub_80CDEB4(void) +static bool8 MultiMonPlaceChange_Down(void) { - return sub_80CDED4(); + return MonPlaceChange_CursorDown(); } -static bool8 sub_80CDEC4(void) +static bool8 MultiMonPlaceChange_Up(void) { - return sub_80CDF08(); + return MonPlaceChange_CursorUp(); } -static bool8 sub_80CDED4(void) +static bool8 MonPlaceChange_CursorDown(void) { switch (sPSSData->cursorSprite->pos2.y) { @@ -6134,18 +6130,18 @@ static bool8 sub_80CDED4(void) case 0: sPSSData->cursorSprite->pos2.y++; break; - case 8: + case 8: // Cursor has reached bottom return FALSE; } return TRUE; } -static bool8 sub_80CDF08(void) +static bool8 MonPlaceChange_CursorUp(void) { switch (sPSSData->cursorSprite->pos2.y) { - case 0: + case 0: // Cursor has reached top return FALSE; default: sPSSData->cursorSprite->pos2.y--; @@ -6542,6 +6538,8 @@ static void LoadSavedMovingMon(void) { if (sIsMonBeingMoved) { + // If it came from the party load a struct Pokemon, + // otherwise load a BoxPokemon if (sMovingMonOrigBoxId == TOTAL_BOXES_COUNT) sPSSData->movingMon = sSavedMovingMon; else @@ -6695,7 +6693,7 @@ static void TryRefreshDisplayMon(void) } } -static void sub_80CEBDC(void) +static void ReshowDisplayMon(void) { if (sIsMonBeingMoved) SetDisplayMonData(&sSavedMovingMon, MODE_PARTY); @@ -7726,7 +7724,8 @@ static void StartCursorAnim(u8 animNum) StartSpriteAnim(sPSSData->cursorSprite, animNum); } -static u8 sub_80CFE78(void) +// Unused +static u8 GetMovingMonOriginalBoxId(void) { return sMovingMonOrigBoxId; } @@ -8078,7 +8077,7 @@ static bool8 MultiMove_GrabSelection(void) case 0: MultiMove_GetMonsFromSelection(); MultiMove_RemoveMonsFromBox(); - sub_80CDC64(FALSE); + InitMultiMonPlaceChange(FALSE); sMultiMove->state++; break; case 1: @@ -8086,7 +8085,7 @@ static bool8 MultiMove_GrabSelection(void) { StartCursorAnim(CURSOR_ANIM_FIST); MultiMove_InitMove(0, 256, 8); - sub_80CDC64(TRUE); + InitMultiMonPlaceChange(TRUE); sMultiMove->state++; } break; @@ -8119,7 +8118,7 @@ static bool8 MultiMove_PlaceMons(void) case 0: MultiMove_SetPlacedMonData(); MultiMove_InitMove(0, -256, 8); - sub_80CDC64(FALSE); + InitMultiMonPlaceChange(FALSE); sMultiMove->state++; break; case 1: @@ -8127,7 +8126,7 @@ static bool8 MultiMove_PlaceMons(void) { MultiMove_CreatePlacedMonIcons(); StartCursorAnim(CURSOR_ANIM_OPEN); - sub_80CDC64(TRUE); + InitMultiMonPlaceChange(TRUE); HideBg(0); sMultiMove->state++; } @@ -9210,6 +9209,12 @@ static void SpriteCB_ItemIcon_HideParty(struct Sprite *sprite) #undef sCursorArea #undef sCursorPos + +//------------------------------------------------------------------------------ +// SECTION: General utility +//------------------------------------------------------------------------------ + + // Unused, leftover from FRLG static void BackupPokemonStorage(void/*struct PokemonStorage * dest*/) { @@ -9474,6 +9479,12 @@ bool32 AnyStorageMonWithMove(u16 moveId) return FALSE; } + +//------------------------------------------------------------------------------ +// SECTION: Walda +//------------------------------------------------------------------------------ + + void ResetWaldaWallpaper(void) { gSaveBlock1Ptr->waldaPhrase.iconId = 0; @@ -9542,205 +9553,243 @@ bool32 IsWaldaPhraseEmpty(void) return (gSaveBlock1Ptr->waldaPhrase.text[0] == EOS); } -// Not sure what the purpose of these functions is. -// They seem to only be called while PSS is initialized. -EWRAM_DATA static struct UnkStruct_2039D84 *gUnknown_02039D84 = NULL; -EWRAM_DATA static u16 gUnknown_02039D88 = 0; +//------------------------------------------------------------------------------ +// SECTION: TilemapUtil +// +// Handles 3 particular tilemaps in a somewhat unusual way. +// For example, while the cursor is on the Close Box button it flashes between +// two states alternately. Both these states are their own part of the same +// tilemap that's always present. The utility shifts the tilemap up and down +// to show/hide the states, and limits the view with a rectangle that only +// reveals one at a time. +// Each tilemap is tracked with a TILEMAPID that can be used to reference it. +//------------------------------------------------------------------------------ -static void sub_80D259C(u8 count) + +struct TilemapUtil_RectData +{ + s16 x; + s16 y; + u16 width; + u16 height; + s16 destX; + s16 destY; +}; + +struct TilemapUtil +{ + struct TilemapUtil_RectData prev; // Only read in unused function + struct TilemapUtil_RectData cur; + const void *savedTilemap; // Only written in unused function + const void *tilemap; + u16 altWidth; + u16 altHeight; // Never read + u16 width; + u16 height; // Never read + u16 rowSize; // Never read + u8 tileSize; + u8 bg; + bool8 active; +}; + +EWRAM_DATA static struct TilemapUtil *sTilemapUtil = NULL; +EWRAM_DATA static u16 sNumTilemapUtilIds = 0; + +static void TilemapUtil_Init(u8 count) { u16 i; - gUnknown_02039D84 = Alloc(sizeof(*gUnknown_02039D84) * count); - gUnknown_02039D88 = (gUnknown_02039D84 == NULL) ? 0 : count; - for (i = 0; i < gUnknown_02039D88; i++) + sTilemapUtil = Alloc(sizeof(*sTilemapUtil) * count); + sNumTilemapUtilIds = (sTilemapUtil == NULL) ? 0 : count; + for (i = 0; i < sNumTilemapUtilIds; i++) { - gUnknown_02039D84[i].field_18 = NULL; - gUnknown_02039D84[i].field_2C = 0; + sTilemapUtil[i].savedTilemap = NULL; + sTilemapUtil[i].active = FALSE; } } -static void sub_80D25F0(void) +static void TilemapUtil_Free(void) { - Free(gUnknown_02039D84); + Free(sTilemapUtil); } -static void sub_80D2604(void) +// Unused +static void TilemapUtil_UpdateAll(void) { s32 i; - for (i = 0; i < gUnknown_02039D88; i++) + for (i = 0; i < sNumTilemapUtilIds; i++) { - if (gUnknown_02039D84[i].field_2C == 1) - sub_80D2918(i); + if (sTilemapUtil[i].active == TRUE) + TilemapUtil_Update(i); } } struct { - u16 a; - u16 b; -} -static const sUnkVars[][4] = + u16 width; + u16 height; +} static const sTilemapDimensions[][4] = { { - {0x0100, 0x0100}, - {0x0200, 0x0100}, - {0x0100, 0x0200}, - {0x0200, 0x0200}, + { 256, 256}, + { 512, 256}, + { 256, 512}, + { 512, 512}, }, { - {0x0080, 0x0080}, - {0x0100, 0x0100}, - {0x0200, 0x0200}, - {0x0400, 0x0400}, + { 128, 128}, + { 256, 256}, + { 512, 512}, + {1024, 1024}, }, }; -static void sub_80D2644(u8 id, u8 bg, const void *arg2, u16 arg3, u16 arg4) +static void TilemapUtil_SetMap(u8 id, u8 bg, const void *tilemap, u16 width, u16 height) { u16 bgScreenSize, bgType; - if (id >= gUnknown_02039D88) + if (id >= sNumTilemapUtilIds) return; - gUnknown_02039D84[id].field_18 = NULL; - gUnknown_02039D84[id].field_1C = arg2; - gUnknown_02039D84[id].field_2B = bg; - gUnknown_02039D84[id].field_24 = arg3; - gUnknown_02039D84[id].field_26 = arg4; + sTilemapUtil[id].savedTilemap = NULL; + sTilemapUtil[id].tilemap = tilemap; + sTilemapUtil[id].bg = bg; + sTilemapUtil[id].width = width; + sTilemapUtil[id].height = height; bgScreenSize = GetBgAttribute(bg, BG_ATTR_SCREENSIZE); bgType = GetBgAttribute(bg, BG_ATTR_TYPE); - gUnknown_02039D84[id].field_20 = sUnkVars[bgType][bgScreenSize].a; - gUnknown_02039D84[id].field_22 = sUnkVars[bgType][bgScreenSize].b; + sTilemapUtil[id].altWidth = sTilemapDimensions[bgType][bgScreenSize].width; + sTilemapUtil[id].altHeight = sTilemapDimensions[bgType][bgScreenSize].height; if (bgType != 0) - gUnknown_02039D84[id].field_2A = 1; + sTilemapUtil[id].tileSize = 1; else - gUnknown_02039D84[id].field_2A = 2; + sTilemapUtil[id].tileSize = 2; - gUnknown_02039D84[id].field_28 = gUnknown_02039D84[id].field_2A * arg3; - gUnknown_02039D84[id].field_0[1].field_4 = arg3; - gUnknown_02039D84[id].field_0[1].field_6 = arg4; - gUnknown_02039D84[id].field_0[1].field_0 = 0; - gUnknown_02039D84[id].field_0[1].field_2 = 0; - gUnknown_02039D84[id].field_0[1].field_8 = 0; - gUnknown_02039D84[id].field_0[1].field_A = 0; - gUnknown_02039D84[id].field_0[0] = gUnknown_02039D84[id].field_0[1]; - gUnknown_02039D84[id].field_2C = 1; + sTilemapUtil[id].rowSize = sTilemapUtil[id].tileSize * width; + sTilemapUtil[id].cur.width = width; + sTilemapUtil[id].cur.height = height; + sTilemapUtil[id].cur.x = 0; + sTilemapUtil[id].cur.y = 0; + sTilemapUtil[id].cur.destX = 0; + sTilemapUtil[id].cur.destY = 0; + sTilemapUtil[id].prev = sTilemapUtil[id].cur; + sTilemapUtil[id].active = TRUE; } -static void sub_80D2740(u8 id, const void *arg1) +// Unused +static void TilemapUtil_SetSavedMap(u8 id, const void *tilemap) { - if (id >= gUnknown_02039D88) + if (id >= sNumTilemapUtilIds) return; - gUnknown_02039D84[id].field_18 = arg1; - gUnknown_02039D84[id].field_2C = 1; + sTilemapUtil[id].savedTilemap = tilemap; + sTilemapUtil[id].active = TRUE; } -static void sub_80D2770(u8 id, u16 arg1, u16 arg2) +static void TilemapUtil_SetPos(u8 id, u16 x, u16 y) { - if (id >= gUnknown_02039D88) + if (id >= sNumTilemapUtilIds) return; - gUnknown_02039D84[id].field_0[1].field_8 = arg1; - gUnknown_02039D84[id].field_0[1].field_A = arg2; - gUnknown_02039D84[id].field_2C = 1; + sTilemapUtil[id].cur.destX = x; + sTilemapUtil[id].cur.destY = y; + sTilemapUtil[id].active = TRUE; } -static void sub_80D27AC(u8 id, u16 arg1, u16 arg2, u16 arg3, u16 arg4) +static void TilemapUtil_SetRect(u8 id, u16 x, u16 y, u16 width, u16 height) { - if (id >= gUnknown_02039D88) + if (id >= sNumTilemapUtilIds) return; - gUnknown_02039D84[id].field_0[1].field_0 = arg1; - gUnknown_02039D84[id].field_0[1].field_2 = arg2; - gUnknown_02039D84[id].field_0[1].field_4 = arg3; - gUnknown_02039D84[id].field_0[1].field_6 = arg4; - gUnknown_02039D84[id].field_2C = 1; + sTilemapUtil[id].cur.x = x; + sTilemapUtil[id].cur.y = y; + sTilemapUtil[id].cur.width = width; + sTilemapUtil[id].cur.height = height; + sTilemapUtil[id].active = TRUE; } -static void sub_80D27F4(u8 id, u8 arg1, s8 arg2) +static void TilemapUtil_Move(u8 id, u8 mode, s8 val) { - if (id >= gUnknown_02039D88) + if (id >= sNumTilemapUtilIds) return; - switch (arg1) + switch (mode) { case 0: - gUnknown_02039D84[id].field_0[1].field_8 += arg2; - gUnknown_02039D84[id].field_0[1].field_4 -= arg2; + sTilemapUtil[id].cur.destX += val; + sTilemapUtil[id].cur.width -= val; break; case 1: - gUnknown_02039D84[id].field_0[1].field_0 += arg2; - gUnknown_02039D84[id].field_0[1].field_4 += arg2; + sTilemapUtil[id].cur.x += val; + sTilemapUtil[id].cur.width += val; break; case 2: - gUnknown_02039D84[id].field_0[1].field_A += arg2; - gUnknown_02039D84[id].field_0[1].field_6 -= arg2; + sTilemapUtil[id].cur.destY += val; + sTilemapUtil[id].cur.height -= val; break; case 3: - gUnknown_02039D84[id].field_0[1].field_2 -= arg2; - gUnknown_02039D84[id].field_0[1].field_6 += arg2; + sTilemapUtil[id].cur.y -= val; + sTilemapUtil[id].cur.height += val; break; case 4: - gUnknown_02039D84[id].field_0[1].field_8 += arg2; + sTilemapUtil[id].cur.destX += val; break; case 5: - gUnknown_02039D84[id].field_0[1].field_A += arg2; + sTilemapUtil[id].cur.destY += val; break; } - gUnknown_02039D84[id].field_2C = 1; + sTilemapUtil[id].active = TRUE; } -static void sub_80D2918(u8 id) +static void TilemapUtil_Update(u8 id) { - if (id >= gUnknown_02039D88) + if (id >= sNumTilemapUtilIds) return; - if (gUnknown_02039D84[id].field_18 != NULL) - sub_80D2960(id); + if (sTilemapUtil[id].savedTilemap != NULL) + TilemapUtil_DrawPrev(id); // Never called, above always FALSE - sub_80D29F8(id); - gUnknown_02039D84[id].field_0[0] = gUnknown_02039D84[id].field_0[1]; + TilemapUtil_Draw(id); + sTilemapUtil[id].prev = sTilemapUtil[id].cur; } -static void sub_80D2960(u8 id) +static void TilemapUtil_DrawPrev(u8 id) { s32 i; - u32 adder = gUnknown_02039D84[id].field_2A * gUnknown_02039D84[id].field_20; - const void *tiles = (gUnknown_02039D84[id].field_18 + (adder * gUnknown_02039D84[id].field_0[0].field_A)) - + (gUnknown_02039D84[id].field_2A * gUnknown_02039D84[id].field_0[0].field_8); + u32 adder = sTilemapUtil[id].tileSize * sTilemapUtil[id].altWidth; + const void *tiles = (sTilemapUtil[id].savedTilemap + (adder * sTilemapUtil[id].prev.destY)) + + (sTilemapUtil[id].tileSize * sTilemapUtil[id].prev.destX); - for (i = 0; i < gUnknown_02039D84[id].field_0[0].field_6; i++) + for (i = 0; i < sTilemapUtil[id].prev.height; i++) { - CopyToBgTilemapBufferRect(gUnknown_02039D84[id].field_2B, + CopyToBgTilemapBufferRect(sTilemapUtil[id].bg, tiles, - gUnknown_02039D84[id].field_0[0].field_8, - gUnknown_02039D84[id].field_0[0].field_A + i, - gUnknown_02039D84[id].field_0[0].field_4, + sTilemapUtil[id].prev.destX, + sTilemapUtil[id].prev.destY + i, + sTilemapUtil[id].prev.width, 1); tiles += adder; } } -static void sub_80D29F8(u8 id) +static void TilemapUtil_Draw(u8 id) { s32 i; - u32 adder = gUnknown_02039D84[id].field_2A * gUnknown_02039D84[id].field_24; - const void *tiles = (gUnknown_02039D84[id].field_1C + (adder * gUnknown_02039D84[id].field_0[1].field_2)) - + (gUnknown_02039D84[id].field_2A * gUnknown_02039D84[id].field_0[1].field_0); + u32 adder = sTilemapUtil[id].tileSize * sTilemapUtil[id].width; + const void *tiles = (sTilemapUtil[id].tilemap + (adder * sTilemapUtil[id].cur.y)) + + (sTilemapUtil[id].tileSize * sTilemapUtil[id].cur.x); - for (i = 0; i < gUnknown_02039D84[id].field_0[1].field_6; i++) + for (i = 0; i < sTilemapUtil[id].cur.height; i++) { - CopyToBgTilemapBufferRect(gUnknown_02039D84[id].field_2B, + CopyToBgTilemapBufferRect(sTilemapUtil[id].bg, tiles, - gUnknown_02039D84[id].field_0[1].field_8, - gUnknown_02039D84[id].field_0[1].field_A + i, - gUnknown_02039D84[id].field_0[1].field_4, + sTilemapUtil[id].cur.destX, + sTilemapUtil[id].cur.destY + i, + sTilemapUtil[id].cur.width, 1); tiles += adder; } From 7bf89d64466040f958903d0d4fc8a77c7c6c2737 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 17 Apr 2021 19:28:31 -0400 Subject: [PATCH 53/63] Doc storage - icon scroll --- src/pokemon_storage_system.c | 198 ++++++++++++++++++++--------------- 1 file changed, 112 insertions(+), 86 deletions(-) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 9a6ac1469..82d33227d 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -450,14 +450,14 @@ struct PokemonStorageSystemData u8 field_C5C; u8 field_C5D; u8 numPartyToCompact; - u16 field_C60; - s16 field_C62; - s16 field_C64; - u16 field_C66; - u8 field_C68; - s8 field_C69; - u8 field_C6A; - u8 field_C6B; // Never read. + u16 iconScrollDistance; + s16 iconScrollPos; + s16 iconScrollSpeed; + u16 iconScrollNumIncoming; + u8 iconScrollCurColumn; + s8 iconScrollDirection; // Unnecessary duplicate of scrollDirection + u8 iconScrollState; + u8 iconScrollToBoxId; // Unnecessary duplicate of scrollToBoxId struct WindowTemplate menuWindow; struct StorageMenu menuItems[7]; u8 menuItemsCount; @@ -582,7 +582,7 @@ static void ChooseBoxMenu_PrintInfo(void); static void UpdateCloseBoxButtonFlash(void); static void ToggleCursorAutoAction(void); static void LoadSavedMovingMon(void); -static void sub_80CE8E4(void); +static void SetSelectionAfterSummaryScreen(void); static void GiveChosenBagItem(void); static void SetUpHidePartyMenu(void); static void DestroyAllPartyMonIcons(void); @@ -649,7 +649,7 @@ static void SetUpDoShowPartyMenu(void); static void StartDisplayMonMosaicEffect(void); static void SpriteCB_ChooseBoxArrow(struct Sprite *); static void SpriteCB_HeldMon(struct Sprite *); -static void sub_80CB278(struct Sprite *); +static void SpriteCB_BoxMonIconScrollOut(struct Sprite *); static void SpriteCB_Arrow(struct Sprite *); static bool32 WaitForWallpaperGfxLoad(void); static bool8 InitPSSWindows(void); @@ -2045,7 +2045,7 @@ static void Cb_InitPSS(u8 taskId) break; case SCREEN_CHANGE_SUMMARY_SCREEN - 1: // Return from summary screen - sub_80CE8E4(); + SetSelectionAfterSummaryScreen(); break; case SCREEN_CHANGE_ITEM_FROM_BAG - 1: // Return from bag menu @@ -4396,7 +4396,7 @@ static void InitBoxMonSprites(u8 boxId) } } -static void sub_80CB140(u8 boxPosition) +static void CreateBoxMonIconAtPos(u8 boxPosition) { u16 species = GetCurrentBoxMonData(boxPosition, MON_DATA_SPECIES2); @@ -4412,7 +4412,13 @@ static void sub_80CB140(u8 boxPosition) } } -static void sub_80CB1F0(s16 arg0) +#define sDistance data[1] +#define sSpeed data[2] +#define sScrollInDestX data[3] +#define sDelay data[4] +#define sScrollOutX data[5] + +static void StartBoxMonIconsScrollOut(s16 speed) { u16 i; @@ -4420,44 +4426,51 @@ static void sub_80CB1F0(s16 arg0) { if (sPSSData->boxMonsSprites[i] != NULL) { - sPSSData->boxMonsSprites[i]->data[2] = arg0; - sPSSData->boxMonsSprites[i]->data[4] = 1; - sPSSData->boxMonsSprites[i]->callback = sub_80CB278; + sPSSData->boxMonsSprites[i]->sSpeed = speed; + sPSSData->boxMonsSprites[i]->sDelay = 1; + sPSSData->boxMonsSprites[i]->callback = SpriteCB_BoxMonIconScrollOut; } } } -static void sub_80CB234(struct Sprite *sprite) +static void SpriteCB_BoxMonIconScrollIn(struct Sprite *sprite) { - if (sprite->data[1] != 0) + if (sprite->sDistance != 0) { - sprite->data[1]--; - sprite->pos1.x += sprite->data[2]; + // Icon moving + sprite->sDistance--; + sprite->pos1.x += sprite->sSpeed; } else { - sPSSData->field_C66--; - sprite->pos1.x = sprite->data[3]; + // Icon arrived + sPSSData->iconScrollNumIncoming--; + sprite->pos1.x = sprite->sScrollInDestX; sprite->callback = SpriteCallbackDummy; } } -static void sub_80CB278(struct Sprite *sprite) +static void SpriteCB_BoxMonIconScrollOut(struct Sprite *sprite) { - if (sprite->data[4] != 0) + if (sprite->sDelay != 0) { - sprite->data[4]--; + sprite->sDelay--; } else { - sprite->pos1.x += sprite->data[2]; - sprite->data[5] = sprite->pos1.x + sprite->pos2.x; - if (sprite->data[5] <= 68 || sprite->data[5] >= 252) + // Icon moving + sprite->pos1.x += sprite->sSpeed; + sprite->sScrollOutX = sprite->pos1.x + sprite->pos2.x; + + // Check if icon offscreen + if (sprite->sScrollOutX <= 68 || sprite->sScrollOutX >= 252) sprite->callback = SpriteCallbackDummy; } } -static void DestroyAllIconsInColumn(u8 column) +// Sprites for Pokémon icons are destroyed during +// the box scroll once they've gone offscreen +static void DestroyBoxMonIconsInColumn(u8 column) { u16 row; u8 boxPosition = column; @@ -4473,15 +4486,16 @@ static void DestroyAllIconsInColumn(u8 column) } } -static u8 sub_80CB2F8(u8 row, u16 times, s16 xDelta) +// Create the appearing icons for the incoming scrolling box +static u8 CreateBoxMonIconsInColumn(u8 column, u16 distance, s16 speed) { s32 i; u16 y = 44; - s16 xDest = 8 * (3 * row) + 100; - u16 x = xDest - ((times + 1) * xDelta); - u8 subpriority = 19 - row; - u8 count = 0; - u8 boxPosition = row; + s16 xDest = 8 * (3 * column) + 100; + u16 x = xDest - ((distance + 1) * speed); + u8 subpriority = 19 - column; + u8 iconsCreated = 0; + u8 boxPosition = column; if (sPSSData->boxOption != OPTION_MOVE_ITEMS) { @@ -4494,11 +4508,11 @@ static u8 sub_80CB2F8(u8 row, u16 times, s16 xDelta) x, y, 2, subpriority); if (sPSSData->boxMonsSprites[boxPosition] != NULL) { - sPSSData->boxMonsSprites[boxPosition]->data[1] = times; - sPSSData->boxMonsSprites[boxPosition]->data[2] = xDelta; - sPSSData->boxMonsSprites[boxPosition]->data[3] = xDest; - sPSSData->boxMonsSprites[boxPosition]->callback = sub_80CB234; - count++; + sPSSData->boxMonsSprites[boxPosition]->sDistance = distance; + sPSSData->boxMonsSprites[boxPosition]->sSpeed = speed; + sPSSData->boxMonsSprites[boxPosition]->sScrollInDestX = xDest; + sPSSData->boxMonsSprites[boxPosition]->callback = SpriteCB_BoxMonIconScrollIn; + iconsCreated++; } } boxPosition += IN_BOX_COLUMNS; @@ -4507,6 +4521,8 @@ static u8 sub_80CB2F8(u8 row, u16 times, s16 xDelta) } else { + // Separate case for Move Items mode is used + // to create the icons with the proper blend for (i = 0; i < IN_BOX_ROWS; i++) { if (sPSSData->boxSpecies[boxPosition] != SPECIES_NONE) @@ -4516,13 +4532,13 @@ static u8 sub_80CB2F8(u8 row, u16 times, s16 xDelta) x, y, 2, subpriority); if (sPSSData->boxMonsSprites[boxPosition] != NULL) { - sPSSData->boxMonsSprites[boxPosition]->data[1] = times; - sPSSData->boxMonsSprites[boxPosition]->data[2] = xDelta; - sPSSData->boxMonsSprites[boxPosition]->data[3] = xDest; - sPSSData->boxMonsSprites[boxPosition]->callback = sub_80CB234; - if (GetBoxMonDataAt(sPSSData->field_C5C, boxPosition, MON_DATA_HELD_ITEM) == 0) + sPSSData->boxMonsSprites[boxPosition]->sDistance = distance; + sPSSData->boxMonsSprites[boxPosition]->sSpeed = speed; + sPSSData->boxMonsSprites[boxPosition]->sScrollInDestX = xDest; + sPSSData->boxMonsSprites[boxPosition]->callback = SpriteCB_BoxMonIconScrollIn; + if (GetBoxMonDataAt(sPSSData->field_C5C, boxPosition, MON_DATA_HELD_ITEM) == ITEM_NONE) sPSSData->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; - count++; + iconsCreated++; } } boxPosition += IN_BOX_COLUMNS; @@ -4530,61 +4546,73 @@ static u8 sub_80CB2F8(u8 row, u16 times, s16 xDelta) } } - return count; + return iconsCreated; } -static void sub_80CB4CC(u8 boxId, s8 direction) +#undef sDistance +#undef sSpeed +#undef sScrollInDestX +#undef sDelay +#undef sScrollOutX + +static void InitBoxMonIconScroll(u8 boxId, s8 direction) { - sPSSData->field_C6A = 0; - sPSSData->field_C6B = boxId; - sPSSData->field_C69 = direction; - sPSSData->field_C60 = 32; - sPSSData->field_C64 = -(6 * direction); - sPSSData->field_C66 = 0; + sPSSData->iconScrollState = 0; + sPSSData->iconScrollToBoxId = boxId; + sPSSData->iconScrollDirection = direction; + sPSSData->iconScrollDistance = 32; + sPSSData->iconScrollSpeed = -(6 * direction); + sPSSData->iconScrollNumIncoming = 0; SetBoxSpeciesAndPersonalities(boxId); if (direction > 0) - sPSSData->field_C68 = 0; + sPSSData->iconScrollCurColumn = 0; else - sPSSData->field_C68 = IN_BOX_COLUMNS - 1; + sPSSData->iconScrollCurColumn = IN_BOX_COLUMNS - 1; - sPSSData->field_C62 = (24 * sPSSData->field_C68) + 100; - sub_80CB1F0(sPSSData->field_C64); + sPSSData->iconScrollPos = (24 * sPSSData->iconScrollCurColumn) + 100; + StartBoxMonIconsScrollOut(sPSSData->iconScrollSpeed); } -static bool8 sub_80CB584(void) +static bool8 UpdateBoxMonIconScroll(void) { - if (sPSSData->field_C60 != 0) - sPSSData->field_C60--; + if (sPSSData->iconScrollDistance != 0) + sPSSData->iconScrollDistance--; - switch (sPSSData->field_C6A) + switch (sPSSData->iconScrollState) { case 0: - sPSSData->field_C62 += sPSSData->field_C64; - if (sPSSData->field_C62 <= 64 || sPSSData->field_C62 >= 252) + sPSSData->iconScrollPos += sPSSData->iconScrollSpeed; + if (sPSSData->iconScrollPos <= 64 || sPSSData->iconScrollPos >= 252) { - DestroyAllIconsInColumn(sPSSData->field_C68); - sPSSData->field_C62 += sPSSData->field_C69 * 24; - sPSSData->field_C6A++; + // A column of icons has gone offscreen, destroy them + DestroyBoxMonIconsInColumn(sPSSData->iconScrollCurColumn); + sPSSData->iconScrollPos += sPSSData->iconScrollDirection * 24; + sPSSData->iconScrollState++; } break; case 1: - sPSSData->field_C62 += sPSSData->field_C64; - sPSSData->field_C66 += sub_80CB2F8(sPSSData->field_C68, sPSSData->field_C60, sPSSData->field_C64); - if ((sPSSData->field_C69 > 0 && sPSSData->field_C68 == IN_BOX_COLUMNS - 1) - || (sPSSData->field_C69 < 0 && sPSSData->field_C68 == 0)) + // Create the new incoming column of icons + sPSSData->iconScrollPos += sPSSData->iconScrollSpeed; + sPSSData->iconScrollNumIncoming += CreateBoxMonIconsInColumn(sPSSData->iconScrollCurColumn, sPSSData->iconScrollDistance, sPSSData->iconScrollSpeed); + + if ((sPSSData->iconScrollDirection > 0 && sPSSData->iconScrollCurColumn == IN_BOX_COLUMNS - 1) + || (sPSSData->iconScrollDirection < 0 && sPSSData->iconScrollCurColumn == 0)) { - sPSSData->field_C6A++; + // Scroll has reached final column + sPSSData->iconScrollState++; } else { - sPSSData->field_C68 += sPSSData->field_C69; - sPSSData->field_C6A = 0; + // Continue scrolling + sPSSData->iconScrollCurColumn += sPSSData->iconScrollDirection; + sPSSData->iconScrollState = 0; } break; case 2: - if (sPSSData->field_C66 == 0) + // Wait to make sure all icons have arrived + if (sPSSData->iconScrollNumIncoming == 0) { - sPSSData->field_C60++; + sPSSData->iconScrollDistance++; return FALSE; } break; @@ -4626,9 +4654,7 @@ static void DestroyBoxMonIconAtPosition(u8 boxPosition) static void SetBoxMonIconObjMode(u8 boxPosition, u8 objMode) { if (sPSSData->boxMonsSprites[boxPosition] != NULL) - { sPSSData->boxMonsSprites[boxPosition]->oam.objMode = objMode; - } } static void CreatePartyMonsSprites(bool8 visible) @@ -4667,7 +4693,7 @@ static void CreatePartyMonsSprites(bool8 visible) { for (i = 0; i < PARTY_SIZE; i++) { - if (sPSSData->partySprites[i] != NULL && GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) == 0) + if (sPSSData->partySprites[i] != NULL && GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) == ITEM_NONE) sPSSData->partySprites[i]->oam.objMode = ST_OAM_OBJ_BLEND; } } @@ -5146,7 +5172,7 @@ static void SetUpScrollToBox(u8 boxId) static bool8 ScrollToBox(void) { - bool8 var; + bool8 iconsScrolling; switch (sPSSData->scrollState) { @@ -5157,12 +5183,12 @@ static bool8 ScrollToBox(void) if (!WaitForWallpaperGfxLoad()) return TRUE; - sub_80CB4CC(sPSSData->scrollToBoxId, sPSSData->scrollDirection); + InitBoxMonIconScroll(sPSSData->scrollToBoxId, sPSSData->scrollDirection); CreateIncomingBoxTitle(sPSSData->scrollToBoxId, sPSSData->scrollDirection); StartBoxScrollArrowsSlide(sPSSData->scrollDirection); break; case 2: - var = sub_80CB584(); + iconsScrolling = UpdateBoxMonIconScroll(); if (sPSSData->scrollTimer != 0) { sPSSData->bg2_X += sPSSData->scrollSpeed; @@ -5171,7 +5197,7 @@ static bool8 ScrollToBox(void) CycleBoxTitleSprites(); StopBoxScrollArrowsSlide(); } - return var; + return iconsScrolling; } sPSSData->scrollState++; @@ -6267,7 +6293,7 @@ static bool8 TryStorePartyMonInBox(u8 boxId) } if (boxId == StorageGetCurrentBox()) - sub_80CB140(boxPosition); + CreateBoxMonIconAtPos(boxPosition); StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_STILL); return TRUE; @@ -6573,7 +6599,7 @@ static void InitSummaryScreenData(void) } } -static void sub_80CE8E4(void) +static void SetSelectionAfterSummaryScreen(void) { if (sIsMonBeingMoved) LoadSavedMovingMon(); @@ -8385,7 +8411,7 @@ static void MultiMove_CreatePlacedMonIcons(void) for (j = sMultiMove->minColumn; j < columnCount; j++) { if (GetBoxMonData(&sMultiMove->boxMons[monArrayId], MON_DATA_SANITY_HAS_SPECIES)) - sub_80CB140(boxPosition); + CreateBoxMonIconAtPos(boxPosition); monArrayId++; boxPosition++; } From 33c68255de5db6a936929faade6a635ba97d33d0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 17 Apr 2021 23:31:29 -0400 Subject: [PATCH 54/63] Doc storage - unk utility --- src/pokemon_storage_system.c | 135 +++++++++++++++++++---------------- 1 file changed, 75 insertions(+), 60 deletions(-) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 82d33227d..6c25dcfce 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -342,21 +342,21 @@ struct StorageMenu int textId; }; -struct UnkStruct_2000028 +struct UnkUtilData { - const u8 *unk_00; - u8 *unk_04; - u16 unk_08; - u16 unk_0a; - u16 newField; - void (*unk_0c)(struct UnkStruct_2000028 *data); + const u8 *src; + u8 *dest; + u16 size; + u16 unk; + u16 height; + void (*func)(struct UnkUtilData *data); }; -struct UnkStruct_2000020 +struct UnkUtil { - struct UnkStruct_2000028 *unk_00; - u8 unk_04; - u8 unk_05; + struct UnkUtilData *data; + u8 numActive; + u8 max; }; struct ChooseBoxMenu @@ -391,8 +391,8 @@ struct PokemonStorageSystemData u8 screenChangeType; bool8 isReshowingPSS; u8 taskId; - struct UnkStruct_2000020 unk_0020; - struct UnkStruct_2000028 unk_0028[8]; + struct UnkUtil unkUtil; + struct UnkUtilData unkUtilData[8]; u16 partyMenuTilemapBuffer[0x108]; u16 partyMenuUnused; // Never read u16 partyMenuY; @@ -770,10 +770,6 @@ static s8 GetMenuItemTextId(u8); static u8 SetSelectionMenuTexts(void); static bool8 SetMenuTexts_Mon(void); static bool8 SetMenuTexts_Item(void); -static void sub_80D2A90(struct UnkStruct_2000020 *, struct UnkStruct_2000028 *, u32); -static void sub_80D2AA4(void); -static void sub_80D2B88(struct UnkStruct_2000028 *); -static void sub_80D2C1C(struct UnkStruct_2000028 *); static u8 GetBoxWallpaper(u8); static void SetBoxWallpaper(u8, u8); @@ -836,6 +832,12 @@ static void TilemapUtil_Update(u8); static void TilemapUtil_DrawPrev(u8); static void TilemapUtil_Draw(u8); +// Functions for unknown utility +static void UnkUtil_Init(struct UnkUtil *, struct UnkUtilData *, u32); +static void UnkUtil_Run(void); +static void UnkUtil_CpuRun(struct UnkUtilData *); +static void UnkUtil_DmaRun(struct UnkUtilData *); + struct { const u8 *text; const u8 *desc; @@ -1921,7 +1923,7 @@ static void VblankCb_PSS(void) { LoadOam(); ProcessSpriteCopyRequests(); - sub_80D2AA4(); + UnkUtil_Run(); TransferPlttBuffer(); SetGpuReg(REG_OFFSET_BG2HOFS, sPSSData->bg2_X); } @@ -1995,7 +1997,7 @@ static void sub_80C7E98(void) FreeAllSpritePalettes(); ClearDma3Requests(); gReservedSpriteTileCount = 0x280; - sub_80D2A90(&sPSSData->unk_0020, sPSSData->unk_0028, 8); + UnkUtil_Init(&sPSSData->unkUtil, sPSSData->unkUtilData, ARRAY_COUNT(sPSSData->unkUtilData)); gKeyRepeatStartDelay = 20; ClearScheduledBgCopiesToVram(); TilemapUtil_Init(TILEMAPID_COUNT); @@ -9821,83 +9823,96 @@ static void TilemapUtil_Draw(u8 id) } } -EWRAM_DATA static struct UnkStruct_2000020 *gUnknown_02039D8C = NULL; -static void sub_80D2A90(struct UnkStruct_2000020 *arg0, struct UnkStruct_2000028 *arg1, u32 arg2) +//------------------------------------------------------------------------------ +// SECTION: UnkUtil +// +// Some data transfer utility that goes functionally unused. +// It gets initialized with UnkUtil_Init, and run every vblank in Pokémon +// Storage with UnkUtil_Run, but neither of the Add functions are ever used, +// so UnkUtil_Run performs no actions. +//------------------------------------------------------------------------------ + + +EWRAM_DATA static struct UnkUtil *sUnkUtil = NULL; + +static void UnkUtil_Init(struct UnkUtil *util, struct UnkUtilData *data, u32 max) { - gUnknown_02039D8C = arg0; - arg0->unk_00 = arg1; - arg0->unk_05 = arg2; - arg0->unk_04 = 0; + sUnkUtil = util; + util->data = data; + util->max = max; + util->numActive = 0; } -static void sub_80D2AA4(void) +static void UnkUtil_Run(void) { u16 i; - - if (gUnknown_02039D8C->unk_04) + if (sUnkUtil->numActive) { - for (i = 0; i < gUnknown_02039D8C->unk_04; i++) + for (i = 0; i < sUnkUtil->numActive; i++) { - struct UnkStruct_2000028 *unkStruct = &gUnknown_02039D8C->unk_00[i]; - unkStruct->unk_0c(unkStruct); + struct UnkUtilData *data = &sUnkUtil->data[i]; + data->func(data); } - - gUnknown_02039D8C->unk_04 = 0; + sUnkUtil->numActive = 0; } } -static bool8 sub_80D2AEC(u8 *dest, u16 dLeft, u16 dTop, const u8 *src, u16 sLeft, u16 sTop, u16 width, u16 height, u16 unkArg) +// Unused +static bool8 UnkUtil_CpuAdd(u8 *dest, u16 dLeft, u16 dTop, const u8 *src, u16 sLeft, u16 sTop, u16 width, u16 height, u16 unkArg) { - struct UnkStruct_2000028 *unkStruct; + struct UnkUtilData *data; - if (gUnknown_02039D8C->unk_04 >= gUnknown_02039D8C->unk_05) + if (sUnkUtil->numActive >= sUnkUtil->max) return FALSE; - unkStruct = &gUnknown_02039D8C->unk_00[gUnknown_02039D8C->unk_04++]; - unkStruct->unk_08 = width * 2; - unkStruct->unk_04 = dest + 2 * (dTop * 32 + dLeft); - unkStruct->unk_00 = src + 2 * (sTop * unkArg + sLeft); - unkStruct->newField = height; - unkStruct->unk_0a = unkArg; - unkStruct->unk_0c = sub_80D2B88; + data = &sUnkUtil->data[sUnkUtil->numActive++]; + data->size = width * 2; + data->dest = dest + 2 * (dTop * 32 + dLeft); + data->src = src + 2 * (sTop * unkArg + sLeft); + data->height = height; + data->unk = unkArg; + data->func = UnkUtil_CpuRun; return TRUE; } -static void sub_80D2B88(struct UnkStruct_2000028 *unkStruct) +// Functionally unused +static void UnkUtil_CpuRun(struct UnkUtilData *data) { u16 i; - for (i = 0; i < unkStruct->newField; i++) + for (i = 0; i < data->height; i++) { - CpuSet(unkStruct->unk_00, unkStruct->unk_04, (unkStruct->unk_08 / 2)); - unkStruct->unk_04 += 64; - unkStruct->unk_00 += (unkStruct->unk_0a * 2); + CpuSet(data->src, data->dest, data->size / 2); + data->dest += 64; + data->src += data->unk * 2; } } -static bool8 sub_80D2BC0(void *dest, u16 dLeft, u16 dTop, u16 width, u16 height) +// Unused +static bool8 UnkUtil_DmaAdd(void *dest, u16 dLeft, u16 dTop, u16 width, u16 height) { - struct UnkStruct_2000028 *unkStruct; + struct UnkUtilData *data; - if (gUnknown_02039D8C->unk_04 >= gUnknown_02039D8C->unk_05) + if (sUnkUtil->numActive >= sUnkUtil->max) return FALSE; - unkStruct = &gUnknown_02039D8C->unk_00[gUnknown_02039D8C->unk_04++]; - unkStruct->unk_08 = width * 2; - unkStruct->unk_04 = dest + ((dTop * 32) + dLeft) * 2; - unkStruct->newField = height; - unkStruct->unk_0c = sub_80D2C1C; + data = &sUnkUtil->data[sUnkUtil->numActive++]; + data->size = width * 2; + data->dest = dest + (dTop * 32 + dLeft) * 2; + data->height = height; + data->func = UnkUtil_DmaRun; return TRUE; } -static void sub_80D2C1C(struct UnkStruct_2000028 *unkStruct) +// Functionally unused +static void UnkUtil_DmaRun(struct UnkUtilData *data) { u16 i; - for (i = 0; i < unkStruct->newField; i++) + for (i = 0; i < data->height; i++) { - Dma3FillLarge_(0, unkStruct->unk_04, unkStruct->unk_08, 16); - unkStruct->unk_04 += 64; + Dma3FillLarge16_(0, data->dest, data->size); + data->dest += 64; } } From 6f967ff6ad90e4a8438fe802c18dbc29cedda1ee Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 17 Apr 2021 23:40:27 -0400 Subject: [PATCH 55/63] Doc storage - standardize names, drop PSS --- src/pokemon_storage_system.c | 2504 +++++++++++++++++----------------- 1 file changed, 1252 insertions(+), 1252 deletions(-) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 6c25dcfce..c4b3c6f60 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -389,7 +389,7 @@ struct PokemonStorageSystemData u8 state; u8 boxOption; u8 screenChangeType; - bool8 isReshowingPSS; + bool8 isReopening; u8 taskId; struct UnkUtil unkUtil; struct UnkUtilData unkUtilData[8]; @@ -546,7 +546,7 @@ static u32 sItemIconGfxBuffer[98]; EWRAM_DATA static u8 sPreviousBoxOption = 0; EWRAM_DATA static struct ChooseBoxMenu *sChooseBoxMenu = NULL; -EWRAM_DATA static struct PokemonStorageSystemData *sPSSData = NULL; +EWRAM_DATA static struct PokemonStorageSystemData *sStorage = NULL; EWRAM_DATA static bool8 sInPartyMenu = 0; EWRAM_DATA static u8 sCurrentBoxOption = 0; EWRAM_DATA static u8 sDepositBoxId = 0; @@ -562,7 +562,7 @@ EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0; EWRAM_DATA static bool8 sAutoActionOn = 0; static void CreateMainMenu(u8, s16 *); -static void Cb2_EnterPSS(u8); +static void EnterPokeStorage(u8); static u8 GetCurrentBoxOption(void); static u8 HandleInput(void); static u8 GetSavedCursorPos(void); @@ -587,7 +587,7 @@ static void GiveChosenBagItem(void); static void SetUpHidePartyMenu(void); static void DestroyAllPartyMonIcons(void); static void MoveHeldItemWithPartyMenu(void); -static void LoadPSSMenuGfx(void); +static void LoadPokeStorageMenuGfx(void); static void LoadWaveformSpritePalette(void); static void SaveCursorPos(void); static void sub_80CD36C(void); @@ -635,7 +635,7 @@ static void SetCursorInParty(void); static void InitSummaryScreenData(void); static void TryShowItemAtCursor(void); static void StopFlashingCloseBoxButton(void); -static void FreePSSData(void); +static void FreePokeStorageData(void); static void AddBoxMenu(void); static void CycleBoxTitleColor(void); static void MoveMon(void); @@ -652,7 +652,7 @@ static void SpriteCB_HeldMon(struct Sprite *); static void SpriteCB_BoxMonIconScrollOut(struct Sprite *); static void SpriteCB_Arrow(struct Sprite *); static bool32 WaitForWallpaperGfxLoad(void); -static bool8 InitPSSWindows(void); +static bool8 InitPokeStorageWindows(void); static bool8 ResetReleaseMonSpritePtr(void); static bool8 TryHideReleaseMon(void); static bool8 IsInitBoxActive(void); @@ -677,37 +677,37 @@ static bool8 IsCursorOnBoxTitle(void); static bool8 IsCursorInBox(void); static bool8 IsMonBeingMoved(void); static bool8 TryStorePartyMonInBox(u8); -static void Cb_InitPSS(u8); -static void Cb_PlaceMon(u8); -static void Cb_ChangeScreen(u8); -static void Cb_ShowPSS(u8); -static void Cb_OnBPressed(u8); -static void Cb_HandleBoxOptions(u8); -static void Cb_OnSelectedMon(u8); -static void Cb_OnCloseBoxPressed(u8); -static void Cb_HidePartyPokemon(u8); -static void Cb_DepositMenu(u8); -static void Cb_MoveMon(u8); -static void Cb_GiveMovingItemToMon(u8); -static void Cb_SwitchSelectedItem(u8); -static void Cb_TakeItemForMoving(u8); -static void Cb_WithdrawMon(u8); -static void Cb_ShiftMon(u8); -static void Cb_ShowPartyPokemon(u8); -static void Cb_ShowItemInfo(u8); -static void Cb_GiveItemFromBag(u8); -static void Cb_ItemToBag(u8); -static void Cb_TakeItemForMoving(u8); -static void Cb_ShowMarkMenu(u8); -static void Cb_ShowMonSummary(u8); -static void Cb_ReleaseMon(u8); -static void Cb_ReshowPSS(u8); -static void Cb_MainPSS(u8); -static void Cb_JumpBox(u8); -static void Cb_HandleWallpapers(u8); -static void Cb_NameBox(u8); -static void Cb_PrintCantStoreMail(u8); -static void Cb_HandleMovingMonFromParty(u8); +static void Task_InitPokeStorage(u8); +static void Task_PlaceMon(u8); +static void Task_ChangeScreen(u8); +static void Task_ShowPokeStorage(u8); +static void Task_OnBPressed(u8); +static void Task_HandleBoxOptions(u8); +static void Task_OnSelectedMon(u8); +static void Task_OnCloseBoxPressed(u8); +static void Task_HidePartyPokemon(u8); +static void Task_DepositMenu(u8); +static void Task_MoveMon(u8); +static void Task_GiveMovingItemToMon(u8); +static void Task_SwitchSelectedItem(u8); +static void Task_TakeItemForMoving(u8); +static void Task_WithdrawMon(u8); +static void Task_ShiftMon(u8); +static void Task_ShowPartyPokemon(u8); +static void Task_ShowItemInfo(u8); +static void Task_GiveItemFromBag(u8); +static void Task_ItemToBag(u8); +static void Task_TakeItemForMoving(u8); +static void Task_ShowMarkMenu(u8); +static void Task_ShowMonSummary(u8); +static void Task_ReleaseMon(u8); +static void Task_ReshowPokeStorage(u8); +static void Task_PokeStorageMain(u8); +static void Task_JumpBox(u8); +static void Task_HandleWallpapers(u8); +static void Task_NameBox(u8); +static void Task_PrintCantStoreMail(u8); +static void Task_HandleMovingMonFromParty(u8); static void SetUpScrollToBox(u8); static void StartCursorAnim(u8); static void SetMovingMonPriority(u8); @@ -1604,7 +1604,7 @@ static void Task_PCMainMenu(u8 taskId) if (!gPaletteFade.active) { CleanupOverworldWindowsAndTilemaps(); - Cb2_EnterPSS(task->tInput); + EnterPokeStorage(task->tInput); RemoveWindow(task->tWindowId); DestroyTask(taskId); } @@ -1620,7 +1620,7 @@ void ShowPokemonStorageSystemPC(void) ScriptContext2_Enable(); } -static void FieldCb_ReturnToPcMenu(void) +static void FieldTask_ReturnToPcMenu(void) { u8 taskId; MainCallback vblankCb = gMain.vblankCallback; @@ -1653,10 +1653,10 @@ static void CreateMainMenu(u8 whichMenu, s16 *windowIdPtr) *windowIdPtr = windowId; } -static void Cb2_ExitPSS(void) +static void CB2_ExitPokeStorage(void) { sPreviousBoxOption = GetCurrentBoxOption(); - gFieldCallback = FieldCb_ReturnToPcMenu; + gFieldCallback = FieldTask_ReturnToPcMenu; SetMainCallback2(CB2_ReturnToField); } @@ -1919,16 +1919,16 @@ static void SpriteCB_ChooseBoxArrow(struct Sprite *sprite) } } -static void VblankCb_PSS(void) +static void VBlankCB_PokeStorage(void) { LoadOam(); ProcessSpriteCopyRequests(); UnkUtil_Run(); TransferPlttBuffer(); - SetGpuReg(REG_OFFSET_BG2HOFS, sPSSData->bg2_X); + SetGpuReg(REG_OFFSET_BG2HOFS, sStorage->bg2_X); } -static void Cb2_PSS(void) +static void CB2_PokeStorage(void) { RunTasks(); DoScheduledBgTilemapCopiesToVram(); @@ -1938,42 +1938,42 @@ static void Cb2_PSS(void) BuildOamBuffer(); } -static void Cb2_EnterPSS(u8 boxOption) +static void EnterPokeStorage(u8 boxOption) { ResetTasks(); sCurrentBoxOption = boxOption; - sPSSData = Alloc(sizeof(*sPSSData)); - if (sPSSData == NULL) + sStorage = Alloc(sizeof(*sStorage)); + if (sStorage == NULL) { - SetMainCallback2(Cb2_ExitPSS); + SetMainCallback2(CB2_ExitPokeStorage); } else { - sPSSData->boxOption = boxOption; - sPSSData->isReshowingPSS = FALSE; + sStorage->boxOption = boxOption; + sStorage->isReopening = FALSE; sMovingItemId = ITEM_NONE; - sPSSData->state = 0; - sPSSData->taskId = CreateTask(Cb_InitPSS, 3); + sStorage->state = 0; + sStorage->taskId = CreateTask(Task_InitPokeStorage, 3); sLastUsedBox = StorageGetCurrentBox(); - SetMainCallback2(Cb2_PSS); + SetMainCallback2(CB2_PokeStorage); } } -static void Cb2_ReturnToPSS(void) +static void CB2_ReturnToPokeStorage(void) { ResetTasks(); - sPSSData = Alloc(sizeof(*sPSSData)); - if (sPSSData == NULL) + sStorage = Alloc(sizeof(*sStorage)); + if (sStorage == NULL) { - SetMainCallback2(Cb2_ExitPSS); + SetMainCallback2(CB2_ExitPokeStorage); } else { - sPSSData->boxOption = sCurrentBoxOption; - sPSSData->isReshowingPSS = TRUE; - sPSSData->state = 0; - sPSSData->taskId = CreateTask(Cb_InitPSS, 3); - SetMainCallback2(Cb2_PSS); + sStorage->boxOption = sCurrentBoxOption; + sStorage->isReopening = TRUE; + sStorage->state = 0; + sStorage->taskId = CreateTask(Task_InitPokeStorage, 3); + SetMainCallback2(CB2_PokeStorage); } } @@ -1997,25 +1997,25 @@ static void sub_80C7E98(void) FreeAllSpritePalettes(); ClearDma3Requests(); gReservedSpriteTileCount = 0x280; - UnkUtil_Init(&sPSSData->unkUtil, sPSSData->unkUtilData, ARRAY_COUNT(sPSSData->unkUtilData)); + UnkUtil_Init(&sStorage->unkUtil, sStorage->unkUtilData, ARRAY_COUNT(sStorage->unkUtilData)); gKeyRepeatStartDelay = 20; ClearScheduledBgCopiesToVram(); TilemapUtil_Init(TILEMAPID_COUNT); TilemapUtil_SetMap(TILEMAPID_PKMN_DATA, 1, sPkmnData_Tilemap, 8, 4); TilemapUtil_SetPos(TILEMAPID_PKMN_DATA, 1, 0); - sPSSData->closeBoxFlashing = FALSE; + sStorage->closeBoxFlashing = FALSE; } static void sub_80C7F1C(void) { ClearSavedCursorPos(); - sInPartyMenu = (sPSSData->boxOption == OPTION_DEPOSIT); + sInPartyMenu = (sStorage->boxOption == OPTION_DEPOSIT); sDepositBoxId = 0; } static void SetMonIconTransparency(void) { - if (sPSSData->boxOption == OPTION_MOVE_ITEMS) + if (sStorage->boxOption == OPTION_MOVE_ITEMS) { SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(7, 11)); @@ -2023,21 +2023,21 @@ static void SetMonIconTransparency(void) SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_1D_MAP); } -static void SetPSSCallback(TaskFunc newFunc) +static void SetPokeStorageTask(TaskFunc newFunc) { - gTasks[sPSSData->taskId].func = newFunc; - sPSSData->state = 0; + gTasks[sStorage->taskId].func = newFunc; + sStorage->state = 0; } -static void Cb_InitPSS(u8 taskId) +static void Task_InitPokeStorage(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: SetVBlankCallback(NULL); SetGpuReg(REG_OFFSET_DISPCNT, 0); sub_80C7E98(); - if (sPSSData->isReshowingPSS) + if (sStorage->isReopening) { switch (sWhichToReshow) { @@ -2055,13 +2055,13 @@ static void Cb_InitPSS(u8 taskId) break; } } - LoadPSSMenuGfx(); + LoadPokeStorageMenuGfx(); LoadWaveformSpritePalette(); break; case 1: - if (!InitPSSWindows()) + if (!InitPokeStorageWindows()) { - SetPSSCallback(Cb_ChangeScreen); + SetPokeStorageTask(Task_ChangeScreen); return; } break; @@ -2073,12 +2073,12 @@ static void Cb_InitPSS(u8 taskId) break; case 3: ResetAllBgCoords(); - if (!sPSSData->isReshowingPSS) + if (!sStorage->isReopening) sub_80C7F1C(); break; case 4: InitMonIconFields(); - if (!sPSSData->isReshowingPSS) + if (!sStorage->isReopening) sub_80CD36C(); else sub_80CD3EC(); @@ -2086,7 +2086,7 @@ static void Cb_InitPSS(u8 taskId) case 5: if (!MultiMove_Init()) { - SetPSSCallback(Cb_ChangeScreen); + SetPokeStorageTask(Task_ChangeScreen); return; } else @@ -2108,11 +2108,11 @@ static void Cb_InitPSS(u8 taskId) if (IsInitBoxActive()) return; - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) { - sPSSData->markMenu.baseTileTag = GFXTAG_MARKING_MENU; - sPSSData->markMenu.basePaletteTag = PALTAG_MARKING_MENU; - InitMonMarkingsMenu(&sPSSData->markMenu); + sStorage->markMenu.baseTileTag = GFXTAG_MARKING_MENU; + sStorage->markMenu.basePaletteTag = PALTAG_MARKING_MENU; + InitMonMarkingsMenu(&sStorage->markMenu); BufferMonMarkingsMenuTiles(); } else @@ -2123,48 +2123,48 @@ static void Cb_InitPSS(u8 taskId) break; case 10: SetMonIconTransparency(); - if (!sPSSData->isReshowingPSS) + if (!sStorage->isReopening) { BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); - SetPSSCallback(Cb_ShowPSS); + SetPokeStorageTask(Task_ShowPokeStorage); } else { BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); - SetPSSCallback(Cb_ReshowPSS); + SetPokeStorageTask(Task_ReshowPokeStorage); } - SetVBlankCallback(VblankCb_PSS); + SetVBlankCallback(VBlankCB_PokeStorage); return; default: return; } - sPSSData->state++; + sStorage->state++; } -static void Cb_ShowPSS(u8 taskId) +static void Task_ShowPokeStorage(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: PlaySE(SE_PC_LOGIN); ComputerScreenOpenEffect(20, 0, 1); - sPSSData->state++; + sStorage->state++; break; case 1: if (!IsComputerScreenOpenEffectActive()) - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; } } -static void Cb_ReshowPSS(u8 taskId) +static void Task_ReshowPokeStorage(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: BeginNormalPaletteFade(PALETTES_ALL, -1, 0x10, 0, RGB_BLACK); - sPSSData->state++; + sStorage->state++; break; case 1: if (!UpdatePaletteFade()) @@ -2172,11 +2172,11 @@ static void Cb_ReshowPSS(u8 taskId) if (sWhichToReshow == SCREEN_CHANGE_ITEM_FROM_BAG - 1 && gSpecialVar_ItemId != ITEM_NONE) { PrintMessage(MSG_ITEM_IS_HELD); - sPSSData->state++; + sStorage->state++; } else { - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } } break; @@ -2184,17 +2184,17 @@ static void Cb_ReshowPSS(u8 taskId) if (!IsDma3ManagerBusyWithBgCopy() && JOY_NEW(A_BUTTON | B_BUTTON)) { ClearBottomWindow(); - sPSSData->state++; + sStorage->state++; } break; case 3: if (!IsDma3ManagerBusyWithBgCopy()) - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; } } -// States for the outer switch in Cb_MainPSS +// States for the outer switch in Task_PokeStorageMain enum { MSTATE_HANDLE_INPUT, MSTATE_MOVE_CURSOR, @@ -2210,174 +2210,174 @@ enum { MSTATE_WAIT_ITEM_ANIM, }; -static void Cb_MainPSS(u8 taskId) +static void Task_PokeStorageMain(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case MSTATE_HANDLE_INPUT: switch (HandleInput()) { case INPUT_MOVE_CURSOR: PlaySE(SE_SELECT); - sPSSData->state = MSTATE_MOVE_CURSOR; + sStorage->state = MSTATE_MOVE_CURSOR; break; case INPUT_SHOW_PARTY: - if (sPSSData->boxOption != OPTION_MOVE_MONS && sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_MONS && sStorage->boxOption != OPTION_MOVE_ITEMS) { PrintMessage(MSG_WHICH_ONE_WILL_TAKE); - sPSSData->state = MSTATE_WAIT_MSG; + sStorage->state = MSTATE_WAIT_MSG; } else { ClearSavedCursorPos(); - SetPSSCallback(Cb_ShowPartyPokemon); + SetPokeStorageTask(Task_ShowPartyPokemon); } break; case INPUT_HIDE_PARTY: - if (sPSSData->boxOption == OPTION_MOVE_MONS) + if (sStorage->boxOption == OPTION_MOVE_MONS) { - if (IsMonBeingMoved() && ItemIsMail(sPSSData->displayMonItemId)) - sPSSData->state = MSTATE_ERROR_HAS_MAIL; + if (IsMonBeingMoved() && ItemIsMail(sStorage->displayMonItemId)) + sStorage->state = MSTATE_ERROR_HAS_MAIL; else - SetPSSCallback(Cb_HidePartyPokemon); + SetPokeStorageTask(Task_HidePartyPokemon); } - else if (sPSSData->boxOption == OPTION_MOVE_ITEMS) + else if (sStorage->boxOption == OPTION_MOVE_ITEMS) { - SetPSSCallback(Cb_HidePartyPokemon); + SetPokeStorageTask(Task_HidePartyPokemon); } break; case INPUT_CLOSE_BOX: - SetPSSCallback(Cb_OnCloseBoxPressed); + SetPokeStorageTask(Task_OnCloseBoxPressed); break; case INPUT_PRESSED_B: - SetPSSCallback(Cb_OnBPressed); + SetPokeStorageTask(Task_OnBPressed); break; case INPUT_BOX_OPTIONS: PlaySE(SE_SELECT); - SetPSSCallback(Cb_HandleBoxOptions); + SetPokeStorageTask(Task_HandleBoxOptions); break; case INPUT_IN_MENU: - SetPSSCallback(Cb_OnSelectedMon); + SetPokeStorageTask(Task_OnSelectedMon); break; case INPUT_SCROLL_RIGHT: PlaySE(SE_SELECT); - sPSSData->newCurrBoxId = StorageGetCurrentBox() + 1; - if (sPSSData->newCurrBoxId >= TOTAL_BOXES_COUNT) - sPSSData->newCurrBoxId = 0; - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + sStorage->newCurrBoxId = StorageGetCurrentBox() + 1; + if (sStorage->newCurrBoxId >= TOTAL_BOXES_COUNT) + sStorage->newCurrBoxId = 0; + if (sStorage->boxOption != OPTION_MOVE_ITEMS) { - SetUpScrollToBox(sPSSData->newCurrBoxId); - sPSSData->state = MSTATE_SCROLL_BOX; + SetUpScrollToBox(sStorage->newCurrBoxId); + sStorage->state = MSTATE_SCROLL_BOX; } else { TryHideItemAtCursor(); - sPSSData->state = MSTATE_SCROLL_BOX_ITEM; + sStorage->state = MSTATE_SCROLL_BOX_ITEM; } break; case INPUT_SCROLL_LEFT: PlaySE(SE_SELECT); - sPSSData->newCurrBoxId = StorageGetCurrentBox() - 1; - if (sPSSData->newCurrBoxId < 0) - sPSSData->newCurrBoxId = TOTAL_BOXES_COUNT - 1; - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + sStorage->newCurrBoxId = StorageGetCurrentBox() - 1; + if (sStorage->newCurrBoxId < 0) + sStorage->newCurrBoxId = TOTAL_BOXES_COUNT - 1; + if (sStorage->boxOption != OPTION_MOVE_ITEMS) { - SetUpScrollToBox(sPSSData->newCurrBoxId); - sPSSData->state = MSTATE_SCROLL_BOX; + SetUpScrollToBox(sStorage->newCurrBoxId); + sStorage->state = MSTATE_SCROLL_BOX; } else { TryHideItemAtCursor(); - sPSSData->state = MSTATE_SCROLL_BOX_ITEM; + sStorage->state = MSTATE_SCROLL_BOX_ITEM; } break; case INPUT_DEPOSIT: if (!IsRemovingLastPartyMon()) { - if (ItemIsMail(sPSSData->displayMonItemId)) + if (ItemIsMail(sStorage->displayMonItemId)) { - sPSSData->state = MSTATE_ERROR_HAS_MAIL; + sStorage->state = MSTATE_ERROR_HAS_MAIL; } else { PlaySE(SE_SELECT); - SetPSSCallback(Cb_DepositMenu); + SetPokeStorageTask(Task_DepositMenu); } } else { - sPSSData->state = MSTATE_ERROR_LAST_PARTY_MON; + sStorage->state = MSTATE_ERROR_LAST_PARTY_MON; } break; case INPUT_MOVE_MON: if (IsRemovingLastPartyMon()) { - sPSSData->state = MSTATE_ERROR_LAST_PARTY_MON; + sStorage->state = MSTATE_ERROR_LAST_PARTY_MON; } else { PlaySE(SE_SELECT); - SetPSSCallback(Cb_MoveMon); + SetPokeStorageTask(Task_MoveMon); } break; case INPUT_SHIFT_MON: if (!CanShiftMon()) { - sPSSData->state = MSTATE_ERROR_LAST_PARTY_MON; + sStorage->state = MSTATE_ERROR_LAST_PARTY_MON; } else { PlaySE(SE_SELECT); - SetPSSCallback(Cb_ShiftMon); + SetPokeStorageTask(Task_ShiftMon); } break; case INPUT_WITHDRAW: PlaySE(SE_SELECT); - SetPSSCallback(Cb_WithdrawMon); + SetPokeStorageTask(Task_WithdrawMon); break; case INPUT_PLACE_MON: PlaySE(SE_SELECT); - SetPSSCallback(Cb_PlaceMon); + SetPokeStorageTask(Task_PlaceMon); break; case INPUT_TAKE_ITEM: PlaySE(SE_SELECT); - SetPSSCallback(Cb_TakeItemForMoving); + SetPokeStorageTask(Task_TakeItemForMoving); break; case INPUT_GIVE_ITEM: PlaySE(SE_SELECT); - SetPSSCallback(Cb_GiveMovingItemToMon); + SetPokeStorageTask(Task_GiveMovingItemToMon); break; case INPUT_SWITCH_ITEMS: PlaySE(SE_SELECT); - SetPSSCallback(Cb_SwitchSelectedItem); + SetPokeStorageTask(Task_SwitchSelectedItem); break; case INPUT_MULTIMOVE_START: PlaySE(SE_SELECT); MultiMove_SetFunction(MULTIMOVE_START); - sPSSData->state = MSTATE_MULTIMOVE_RUN; + sStorage->state = MSTATE_MULTIMOVE_RUN; break; case INPUT_MULTIMOVE_SINGLE: MultiMove_SetFunction(MULTIMOVE_CANCEL); - sPSSData->state = MSTATE_MULTIMOVE_RUN_CANCEL; + sStorage->state = MSTATE_MULTIMOVE_RUN_CANCEL; break; case INPUT_MULTIMOVE_CHANGE_SELECTION: PlaySE(SE_SELECT); MultiMove_SetFunction(MULTIMOVE_CHANGE_SELECTION); - sPSSData->state = MSTATE_MULTIMOVE_RUN_MOVED; + sStorage->state = MSTATE_MULTIMOVE_RUN_MOVED; break; case INPUT_MULTIMOVE_GRAB_SELECTION: MultiMove_SetFunction(MULTIMOVE_GRAB_SELECTION); - sPSSData->state = MSTATE_MULTIMOVE_RUN; + sStorage->state = MSTATE_MULTIMOVE_RUN; break; case INPUT_MULTIMOVE_MOVE_MONS: PlaySE(SE_SELECT); MultiMove_SetFunction(MULTIMOVE_MOVE_MONS); - sPSSData->state = MSTATE_MULTIMOVE_RUN_MOVED; + sStorage->state = MSTATE_MULTIMOVE_RUN_MOVED; break; case INPUT_MULTIMOVE_PLACE_MONS: PlaySE(SE_SELECT); MultiMove_SetFunction(MULTIMOVE_PLACE_MONS); - sPSSData->state = MSTATE_MULTIMOVE_RUN; + sStorage->state = MSTATE_MULTIMOVE_RUN; break; case INPUT_MULTIMOVE_UNABLE: // When selecting/moving multiple Pokémon the @@ -2394,29 +2394,29 @@ static void Cb_MainPSS(u8 taskId) else StopFlashingCloseBoxButton(); - if (sPSSData->setMosaic) + if (sStorage->setMosaic) StartDisplayMonMosaicEffect(); - sPSSData->state = MSTATE_HANDLE_INPUT; + sStorage->state = MSTATE_HANDLE_INPUT; } break; case MSTATE_SCROLL_BOX: if (!ScrollToBox()) { - SetCurrentBox(sPSSData->newCurrBoxId); + SetCurrentBox(sStorage->newCurrBoxId); if (!sInPartyMenu && !IsMonBeingMoved()) { RefreshDisplayMon(); StartDisplayMonMosaicEffect(); } - if (sPSSData->boxOption == OPTION_MOVE_ITEMS) + if (sStorage->boxOption == OPTION_MOVE_ITEMS) { TryShowItemAtCursor(); - sPSSData->state = MSTATE_WAIT_ITEM_ANIM; + sStorage->state = MSTATE_WAIT_ITEM_ANIM; } else { - sPSSData->state = MSTATE_HANDLE_INPUT; + sStorage->state = MSTATE_HANDLE_INPUT; } } break; @@ -2424,29 +2424,29 @@ static void Cb_MainPSS(u8 taskId) if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - sPSSData->state = MSTATE_HANDLE_INPUT; + sStorage->state = MSTATE_HANDLE_INPUT; } break; case MSTATE_ERROR_LAST_PARTY_MON: PlaySE(SE_FAILURE); PrintMessage(MSG_LAST_POKE); - sPSSData->state = MSTATE_WAIT_ERROR_MSG; + sStorage->state = MSTATE_WAIT_ERROR_MSG; break; case MSTATE_ERROR_HAS_MAIL: PlaySE(SE_FAILURE); PrintMessage(MSG_PLEASE_REMOVE_MAIL); - sPSSData->state = MSTATE_WAIT_ERROR_MSG; + sStorage->state = MSTATE_WAIT_ERROR_MSG; break; case MSTATE_WAIT_ERROR_MSG: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; case MSTATE_MULTIMOVE_RUN: if (!MultiMove_RunFunction()) - sPSSData->state = MSTATE_HANDLE_INPUT; + sStorage->state = MSTATE_HANDLE_INPUT; break; case MSTATE_MULTIMOVE_RUN_CANCEL: // Began a multiple Pokémon selection but @@ -2454,94 +2454,94 @@ static void Cb_MainPSS(u8 taskId) // Wait for multi move to cancel, then // do a normal move. if (!MultiMove_RunFunction()) - SetPSSCallback(Cb_MoveMon); + SetPokeStorageTask(Task_MoveMon); break; case MSTATE_MULTIMOVE_RUN_MOVED: if (!MultiMove_RunFunction()) { - if (sPSSData->setMosaic) + if (sStorage->setMosaic) StartDisplayMonMosaicEffect(); - sPSSData->state = MSTATE_HANDLE_INPUT; + sStorage->state = MSTATE_HANDLE_INPUT; } break; case MSTATE_SCROLL_BOX_ITEM: if (!IsItemIconAnimActive()) { - SetUpScrollToBox(sPSSData->newCurrBoxId); - sPSSData->state = MSTATE_SCROLL_BOX; + SetUpScrollToBox(sStorage->newCurrBoxId); + sStorage->state = MSTATE_SCROLL_BOX; } break; case MSTATE_WAIT_ITEM_ANIM: if (!IsItemIconAnimActive()) - sPSSData->state = MSTATE_HANDLE_INPUT; + sStorage->state = MSTATE_HANDLE_INPUT; break; } } -static void Cb_ShowPartyPokemon(u8 taskId) +static void Task_ShowPartyPokemon(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: SetUpDoShowPartyMenu(); - sPSSData->state++; + sStorage->state++; break; case 1: if (!DoShowPartyMenu()) - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; } } -static void Cb_HidePartyPokemon(u8 taskId) +static void Task_HidePartyPokemon(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: PlaySE(SE_SELECT); SetUpHidePartyMenu(); - sPSSData->state++; + sStorage->state++; break; case 1: if (!HidePartyMenu()) { SetCursorBoxPosition(GetSavedCursorPos()); - sPSSData->state++; + sStorage->state++; } break; case 2: if (!UpdateCursorPos()) { - if (sPSSData->setMosaic) + if (sStorage->setMosaic) StartDisplayMonMosaicEffect(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; } } -static void Cb_OnSelectedMon(u8 taskId) +static void Task_OnSelectedMon(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: if (!IsDisplayMosaicActive()) { PlaySE(SE_SELECT); - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) PrintMessage(MSG_IS_SELECTED); - else if (IsMovingItem() || sPSSData->displayMonItemId != ITEM_NONE) + else if (IsMovingItem() || sStorage->displayMonItemId != ITEM_NONE) PrintMessage(MSG_IS_SELECTED2); else PrintMessage(MSG_GIVE_TO_MON); AddMenu(); - sPSSData->state = 1; + sStorage->state = 1; } break; case 1: if (!IsMenuLoading()) - sPSSData->state = 2; + sStorage->state = 2; break; case 2: switch (HandleMenuInput()) @@ -2549,214 +2549,214 @@ static void Cb_OnSelectedMon(u8 taskId) case MENU_B_PRESSED: case MENU_CANCEL: ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; case MENU_MOVE: if (IsRemovingLastPartyMon()) { - sPSSData->state = 3; + sStorage->state = 3; } else { PlaySE(SE_SELECT); ClearBottomWindow(); - SetPSSCallback(Cb_MoveMon); + SetPokeStorageTask(Task_MoveMon); } break; case MENU_PLACE: PlaySE(SE_SELECT); ClearBottomWindow(); - SetPSSCallback(Cb_PlaceMon); + SetPokeStorageTask(Task_PlaceMon); break; case MENU_SHIFT: if (!CanShiftMon()) { - sPSSData->state = 3; + sStorage->state = 3; } else { PlaySE(SE_SELECT); ClearBottomWindow(); - SetPSSCallback(Cb_ShiftMon); + SetPokeStorageTask(Task_ShiftMon); } break; case MENU_WITHDRAW: PlaySE(SE_SELECT); ClearBottomWindow(); - SetPSSCallback(Cb_WithdrawMon); + SetPokeStorageTask(Task_WithdrawMon); break; case MENU_STORE: if (IsRemovingLastPartyMon()) { - sPSSData->state = 3; + sStorage->state = 3; } - else if (ItemIsMail(sPSSData->displayMonItemId)) + else if (ItemIsMail(sStorage->displayMonItemId)) { - sPSSData->state = 4; + sStorage->state = 4; } else { PlaySE(SE_SELECT); ClearBottomWindow(); - SetPSSCallback(Cb_DepositMenu); + SetPokeStorageTask(Task_DepositMenu); } break; case MENU_RELEASE: if (IsRemovingLastPartyMon()) { - sPSSData->state = 3; + sStorage->state = 3; } - else if (sPSSData->displayMonIsEgg) + else if (sStorage->displayMonIsEgg) { - sPSSData->state = 5; // Cannot release an Egg. + sStorage->state = 5; // Cannot release an Egg. } - else if (ItemIsMail(sPSSData->displayMonItemId)) + else if (ItemIsMail(sStorage->displayMonItemId)) { - sPSSData->state = 4; + sStorage->state = 4; } else { PlaySE(SE_SELECT); - SetPSSCallback(Cb_ReleaseMon); + SetPokeStorageTask(Task_ReleaseMon); } break; case MENU_SUMMARY: PlaySE(SE_SELECT); - SetPSSCallback(Cb_ShowMonSummary); + SetPokeStorageTask(Task_ShowMonSummary); break; case MENU_MARK: PlaySE(SE_SELECT); - SetPSSCallback(Cb_ShowMarkMenu); + SetPokeStorageTask(Task_ShowMarkMenu); break; case MENU_TAKE: PlaySE(SE_SELECT); - SetPSSCallback(Cb_TakeItemForMoving); + SetPokeStorageTask(Task_TakeItemForMoving); break; case MENU_GIVE: PlaySE(SE_SELECT); - SetPSSCallback(Cb_GiveMovingItemToMon); + SetPokeStorageTask(Task_GiveMovingItemToMon); break; case MENU_BAG: - SetPSSCallback(Cb_ItemToBag); + SetPokeStorageTask(Task_ItemToBag); break; case MENU_SWITCH: PlaySE(SE_SELECT); - SetPSSCallback(Cb_SwitchSelectedItem); + SetPokeStorageTask(Task_SwitchSelectedItem); break; case MENU_GIVE_2: PlaySE(SE_SELECT); - SetPSSCallback(Cb_GiveItemFromBag); + SetPokeStorageTask(Task_GiveItemFromBag); break; case MENU_INFO: - SetPSSCallback(Cb_ShowItemInfo); + SetPokeStorageTask(Task_ShowItemInfo); break; } break; case 3: PlaySE(SE_FAILURE); PrintMessage(MSG_LAST_POKE); - sPSSData->state = 6; + sStorage->state = 6; break; case 5: PlaySE(SE_FAILURE); PrintMessage(MSG_CANT_RELEASE_EGG); - sPSSData->state = 6; + sStorage->state = 6; break; case 4: PlaySE(SE_FAILURE); PrintMessage(MSG_PLEASE_REMOVE_MAIL); - sPSSData->state = 6; + sStorage->state = 6; break; case 6: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; } } -static void Cb_MoveMon(u8 taskId) +static void Task_MoveMon(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: InitMonPlaceChange(CHANGE_GRAB); - sPSSData->state++; + sStorage->state++; break; case 1: if (!DoMonPlaceChange()) { if (sInPartyMenu) - SetPSSCallback(Cb_HandleMovingMonFromParty); + SetPokeStorageTask(Task_HandleMovingMonFromParty); else - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; } } -static void Cb_PlaceMon(u8 taskId) +static void Task_PlaceMon(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: InitMonPlaceChange(CHANGE_PLACE); - sPSSData->state++; + sStorage->state++; break; case 1: if (!DoMonPlaceChange()) { if (sInPartyMenu) - SetPSSCallback(Cb_HandleMovingMonFromParty); + SetPokeStorageTask(Task_HandleMovingMonFromParty); else - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; } } -static void Cb_ShiftMon(u8 taskId) +static void Task_ShiftMon(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: InitMonPlaceChange(CHANGE_SHIFT); - sPSSData->state++; + sStorage->state++; break; case 1: if (!DoMonPlaceChange()) { StartDisplayMonMosaicEffect(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; } } -static void Cb_WithdrawMon(u8 taskId) +static void Task_WithdrawMon(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: if (CalculatePlayerPartyCount() == PARTY_SIZE) { PrintMessage(MSG_PARTY_FULL); - sPSSData->state = 1; + sStorage->state = 1; } else { SaveCursorPos(); InitMonPlaceChange(CHANGE_GRAB); - sPSSData->state = 2; + sStorage->state = 2; } break; case 1: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; case 2: @@ -2764,40 +2764,40 @@ static void Cb_WithdrawMon(u8 taskId) { SetMovingMonPriority(1); SetUpDoShowPartyMenu(); - sPSSData->state++; + sStorage->state++; } break; case 3: if (!DoShowPartyMenu()) { InitMonPlaceChange(CHANGE_PLACE); - sPSSData->state++; + sStorage->state++; } break; case 4: if (!DoMonPlaceChange()) { UpdatePartySlotColors(); - sPSSData->state++; + sStorage->state++; } break; case 5: - SetPSSCallback(Cb_HidePartyPokemon); + SetPokeStorageTask(Task_HidePartyPokemon); break; } } -static void Cb_DepositMenu(u8 taskId) +static void Task_DepositMenu(u8 taskId) { u8 boxId; - switch (sPSSData->state) + switch (sStorage->state) { case 0: PrintMessage(MSG_DEPOSIT_IN_WHICH_BOX); - LoadChooseBoxMenuGfx(&sPSSData->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, PALTAG_7, 3, FALSE); + LoadChooseBoxMenuGfx(&sStorage->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, PALTAG_7, 3, FALSE); CreateChooseBoxMenuSprites(sDepositBoxId); - sPSSData->state++; + sStorage->state++; break; case 1: boxId = HandleChooseBoxMenuInput(); @@ -2809,7 +2809,7 @@ static void Cb_DepositMenu(u8 taskId) ClearBottomWindow(); DestroyChooseBoxMenuSprites(); FreeChooseBoxMenu(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; default: if (TryStorePartyMonInBox(boxId)) @@ -2818,12 +2818,12 @@ static void Cb_DepositMenu(u8 taskId) ClearBottomWindow(); DestroyChooseBoxMenuSprites(); FreeChooseBoxMenu(); - sPSSData->state = 2; + sStorage->state = 2; } else { PrintMessage(MSG_BOX_IS_FULL); - sPSSData->state = 4; + sStorage->state = 4; } break; } @@ -2831,7 +2831,7 @@ static void Cb_DepositMenu(u8 taskId) case 2: CompactPartySlots(); CompactPartySprites(); - sPSSData->state++; + sStorage->state++; break; case 3: if (GetNumPartySpritesCompacting() == 0) @@ -2839,27 +2839,27 @@ static void Cb_DepositMenu(u8 taskId) sub_80CE22C(); StartDisplayMonMosaicEffect(); UpdatePartySlotColors(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; case 4: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { PrintMessage(MSG_DEPOSIT_IN_WHICH_BOX); - sPSSData->state = 1; + sStorage->state = 1; } break; } } -static void Cb_ReleaseMon(u8 taskId) +static void Task_ReleaseMon(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: PrintMessage(MSG_RELEASE_POKE); ShowYesNoWindow(1); - sPSSData->state++; + sStorage->state++; // fallthrough case 1: switch (Menu_ProcessInputNoWrapClearOnChoose()) @@ -2867,13 +2867,13 @@ static void Cb_ReleaseMon(u8 taskId) case MENU_B_PRESSED: case 1: // No ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; case 0: // Yes ClearBottomWindow(); InitCanReleaseMonVars(); InitReleaseMon(); - sPSSData->state++; + sStorage->state++; break; } break; @@ -2886,12 +2886,12 @@ static void Cb_ReleaseMon(u8 taskId) s8 canRelease = RunCanReleaseMon(); if (canRelease == TRUE) { - sPSSData->state++; + sStorage->state++; break; } else if (!canRelease) { - sPSSData->state = 8; + sStorage->state = 8; break; } } @@ -2901,13 +2901,13 @@ static void Cb_ReleaseMon(u8 taskId) ReleaseMon(); RefreshDisplayMonData(); PrintMessage(MSG_WAS_RELEASED); - sPSSData->state++; + sStorage->state++; break; case 4: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { PrintMessage(MSG_BYE_BYE); - sPSSData->state++; + sStorage->state++; } break; case 5: @@ -2918,11 +2918,11 @@ static void Cb_ReleaseMon(u8 taskId) { CompactPartySlots(); CompactPartySprites(); - sPSSData->state++; + sStorage->state++; } else { - sPSSData->state = 7; + sStorage->state = 7; } } break; @@ -2932,22 +2932,22 @@ static void Cb_ReleaseMon(u8 taskId) RefreshDisplayMon(); StartDisplayMonMosaicEffect(); UpdatePartySlotColors(); - sPSSData->state++; + sStorage->state++; } break; case 7: - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; case 8: // Start "can't release" sequence PrintMessage(MSG_WAS_RELEASED); - sPSSData->state++; + sStorage->state++; break; case 9: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { PrintMessage(MSG_SURPRISE); - sPSSData->state++; + sStorage->state++; } break; case 10: @@ -2955,7 +2955,7 @@ static void Cb_ReleaseMon(u8 taskId) { ClearBottomWindow(); ReshowReleaseMon(); - sPSSData->state++; + sStorage->state++; } break; case 11: @@ -2963,68 +2963,68 @@ static void Cb_ReleaseMon(u8 taskId) { TrySetCursorFistAnim(); PrintMessage(MSG_CAME_BACK); - sPSSData->state++; + sStorage->state++; } break; case 12: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { PrintMessage(MSG_WORRIED); - sPSSData->state++; + sStorage->state++; } break; case 13: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; } } -static void Cb_ShowMarkMenu(u8 taskId) +static void Task_ShowMarkMenu(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: PrintMessage(MSG_MARK_POKE); - sPSSData->markMenu.markings = sPSSData->displayMonMarkings; - OpenMonMarkingsMenu(sPSSData->displayMonMarkings, 0xb0, 0x10); - sPSSData->state++; + sStorage->markMenu.markings = sStorage->displayMonMarkings; + OpenMonMarkingsMenu(sStorage->displayMonMarkings, 0xb0, 0x10); + sStorage->state++; break; case 1: if (!HandleMonMarkingsMenuInput()) { FreeMonMarkingsMenu(); ClearBottomWindow(); - SetMonMarkings(sPSSData->markMenu.markings); + SetMonMarkings(sStorage->markMenu.markings); RefreshDisplayMonData(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; } } -static void Cb_TakeItemForMoving(u8 taskId) +static void Task_TakeItemForMoving(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: - if (!ItemIsMail(sPSSData->displayMonItemId)) + if (!ItemIsMail(sStorage->displayMonItemId)) { ClearBottomWindow(); - sPSSData->state++; + sStorage->state++; } else { - SetPSSCallback(Cb_PrintCantStoreMail); + SetPokeStorageTask(Task_PrintCantStoreMail); } break; case 1: StartCursorAnim(CURSOR_ANIM_OPEN); TakeItemFromMon(sInPartyMenu ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); - sPSSData->state++; + sStorage->state++; break; case 2: if (!IsItemIconAnimActive()) @@ -3033,28 +3033,28 @@ static void Cb_TakeItemForMoving(u8 taskId) ClearBottomWindow(); RefreshDisplayMon(); PrintDisplayMonInfo(); - sPSSData->state++; + sStorage->state++; } break; case 3: if (!IsDma3ManagerBusyWithBgCopy()) - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; } } -static void Cb_GiveMovingItemToMon(u8 taskId) +static void Task_GiveMovingItemToMon(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: ClearBottomWindow(); - sPSSData->state++; + sStorage->state++; break; case 1: StartCursorAnim(CURSOR_ANIM_OPEN); GiveItemToMon(sInPartyMenu ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); - sPSSData->state++; + sStorage->state++; break; case 2: if (!IsItemIconAnimActive()) @@ -3063,46 +3063,46 @@ static void Cb_GiveMovingItemToMon(u8 taskId) RefreshDisplayMon(); PrintDisplayMonInfo(); PrintMessage(MSG_ITEM_IS_HELD); - sPSSData->state++; + sStorage->state++; } break; case 3: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - sPSSData->state++; + sStorage->state++; } break; case 4: if (!IsDma3ManagerBusyWithBgCopy()) - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; } } -static void Cb_ItemToBag(u8 taskId) +static void Task_ItemToBag(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: - if (!AddBagItem(sPSSData->displayMonItemId, 1)) + if (!AddBagItem(sStorage->displayMonItemId, 1)) { PlaySE(SE_FAILURE); PrintMessage(MSG_BAG_FULL); - sPSSData->state = 3; + sStorage->state = 3; } else { PlaySE(SE_SELECT); MoveItemFromMonToBag(sInPartyMenu ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); - sPSSData->state = 1; + sStorage->state = 1; } break; case 1: if (!IsItemIconAnimActive()) { PrintMessage(MSG_PLACED_IN_BAG); - sPSSData->state = 2; + sStorage->state = 2; } break; case 2: @@ -3111,42 +3111,42 @@ static void Cb_ItemToBag(u8 taskId) ClearBottomWindow(); RefreshDisplayMon(); PrintDisplayMonInfo(); - sPSSData->state = 4; + sStorage->state = 4; } break; case 4: if (!IsDma3ManagerBusyWithBgCopy()) - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; case 3: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; } } -static void Cb_SwitchSelectedItem(u8 taskId) +static void Task_SwitchSelectedItem(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: - if (!ItemIsMail(sPSSData->displayMonItemId)) + if (!ItemIsMail(sStorage->displayMonItemId)) { ClearBottomWindow(); - sPSSData->state++; + sStorage->state++; } else { - SetPSSCallback(Cb_PrintCantStoreMail); + SetPokeStorageTask(Task_PrintCantStoreMail); } break; case 1: StartCursorAnim(CURSOR_ANIM_OPEN); SwapItemsWithMon(sInPartyMenu ? CURSOR_AREA_IN_PARTY : CURSOR_AREA_IN_BOX, GetCursorPosition()); - sPSSData->state++; + sStorage->state++; break; case 2: if (!IsItemIconAnimActive()) @@ -3155,30 +3155,30 @@ static void Cb_SwitchSelectedItem(u8 taskId) RefreshDisplayMon(); PrintDisplayMonInfo(); PrintMessage(MSG_CHANGED_TO_ITEM); - sPSSData->state++; + sStorage->state++; } break; case 3: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - sPSSData->state++; + sStorage->state++; } break; case 4: if (!IsDma3ManagerBusyWithBgCopy()) - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; } } -static void Cb_ShowItemInfo(u8 taskId) +static void Task_ShowItemInfo(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: ClearBottomWindow(); - sPSSData->state++; + sStorage->state++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) @@ -3186,44 +3186,44 @@ static void Cb_ShowItemInfo(u8 taskId) PlaySE(SE_WIN_OPEN); PrintItemDescription(); InitItemInfoWindow(); - sPSSData->state++; + sStorage->state++; } break; case 2: if (!UpdateItemInfoWindowSlideIn()) - sPSSData->state++; + sStorage->state++; break; case 3: if (!IsDma3ManagerBusyWithBgCopy()) - sPSSData->state++; + sStorage->state++; break; case 4: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { PlaySE(SE_WIN_OPEN); - sPSSData->state++; + sStorage->state++; } break; case 5: if (!UpdateItemInfoWindowSlideOut()) - sPSSData->state++; + sStorage->state++; break; case 6: if (!IsDma3ManagerBusyWithBgCopy()) - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; } } -static void Cb_CloseBoxWhileHoldingItem(u8 taskId) +static void Task_CloseBoxWhileHoldingItem(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: PlaySE(SE_SELECT); PrintMessage(MSG_PUT_IN_BAG); ShowYesNoWindow(0); - sPSSData->state = 1; + sStorage->state = 1; break; case 1: switch (Menu_ProcessInputNoWrapClearOnChoose()) @@ -3231,18 +3231,18 @@ static void Cb_CloseBoxWhileHoldingItem(u8 taskId) case MENU_B_PRESSED: case 1: // No ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; case 0:// Yes - if (AddBagItem(sPSSData->movingItemId, 1) == TRUE) + if (AddBagItem(sStorage->movingItemId, 1) == TRUE) { ClearBottomWindow(); - sPSSData->state = 3; + sStorage->state = 3; } else { PrintMessage(MSG_BAG_FULL); - sPSSData->state = 2; + sStorage->state = 2; } break; } @@ -3251,86 +3251,86 @@ static void Cb_CloseBoxWhileHoldingItem(u8 taskId) if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - sPSSData->state = 5; + sStorage->state = 5; } break; case 3: MoveItemFromCursorToBag(); - sPSSData->state = 4; + sStorage->state = 4; break; case 4: if (!IsItemIconAnimActive()) { StartCursorAnim(CURSOR_ANIM_BOUNCE); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; case 5: if (!IsDma3ManagerBusyWithBgCopy()) - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; } } -static void Cb_HandleMovingMonFromParty(u8 taskId) +static void Task_HandleMovingMonFromParty(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: CompactPartySlots(); CompactPartySprites(); - sPSSData->state++; + sStorage->state++; break; case 1: if (GetNumPartySpritesCompacting() == 0) { UpdatePartySlotColors(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; } } -static void Cb_PrintCantStoreMail(u8 taskId) +static void Task_PrintCantStoreMail(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: PrintMessage(MSG_CANT_STORE_MAIL); - sPSSData->state++; + sStorage->state++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) - sPSSData->state++; + sStorage->state++; break; case 2: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - sPSSData->state++; + sStorage->state++; } break; case 3: if (!IsDma3ManagerBusyWithBgCopy()) - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; } } // Handle options menu that shows when the box title bar is selected -static void Cb_HandleBoxOptions(u8 taskId) +static void Task_HandleBoxOptions(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: PrintMessage(MSG_WHAT_YOU_DO); AddMenu(); - sPSSData->state++; + sStorage->state++; break; case 1: if (IsMenuLoading()) return; - sPSSData->state++; + sStorage->state++; case 2: switch (HandleMenuInput()) { @@ -3338,48 +3338,48 @@ static void Cb_HandleBoxOptions(u8 taskId) case MENU_CANCEL: AnimateBoxScrollArrows(TRUE); ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; case MENU_NAME: PlaySE(SE_SELECT); - SetPSSCallback(Cb_NameBox); + SetPokeStorageTask(Task_NameBox); break; case MENU_WALLPAPER: PlaySE(SE_SELECT); ClearBottomWindow(); - SetPSSCallback(Cb_HandleWallpapers); + SetPokeStorageTask(Task_HandleWallpapers); break; case MENU_JUMP: PlaySE(SE_SELECT); ClearBottomWindow(); - SetPSSCallback(Cb_JumpBox); + SetPokeStorageTask(Task_JumpBox); break; } break; } } -static void Cb_HandleWallpapers(u8 taskId) +static void Task_HandleWallpapers(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: AddWallpaperSetsMenu(); PrintMessage(MSG_PICK_A_THEME); - sPSSData->state++; + sStorage->state++; break; case 1: if (!IsMenuLoading()) - sPSSData->state++; + sStorage->state++; break; case 2: - sPSSData->wallpaperSetId = HandleMenuInput(); - switch (sPSSData->wallpaperSetId) + sStorage->wallpaperSetId = HandleMenuInput(); + switch (sStorage->wallpaperSetId) { case MENU_B_PRESSED: AnimateBoxScrollArrows(TRUE); ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; case MENU_SCENERY_1: case MENU_SCENERY_2: @@ -3387,43 +3387,43 @@ static void Cb_HandleWallpapers(u8 taskId) case MENU_ETCETERA: PlaySE(SE_SELECT); RemoveMenu(); - sPSSData->wallpaperSetId -= MENU_WALLPAPER_SETS_START; - sPSSData->state++; + sStorage->wallpaperSetId -= MENU_WALLPAPER_SETS_START; + sStorage->state++; break; case MENU_FRIENDS: // New wallpaper from Walda. PlaySE(SE_SELECT); - sPSSData->wallpaperId = WALLPAPER_FRIENDS; + sStorage->wallpaperId = WALLPAPER_FRIENDS; RemoveMenu(); ClearBottomWindow(); - sPSSData->state = 6; + sStorage->state = 6; break; } break; case 3: if (!IsDma3ManagerBusyWithBgCopy()) { - AddWallpapersMenu(sPSSData->wallpaperSetId); + AddWallpapersMenu(sStorage->wallpaperSetId); PrintMessage(MSG_PICK_A_WALLPAPER); - sPSSData->state++; + sStorage->state++; } break; case 4: - sPSSData->wallpaperId = HandleMenuInput(); - switch (sPSSData->wallpaperId) + sStorage->wallpaperId = HandleMenuInput(); + switch (sStorage->wallpaperId) { case MENU_NOTHING_CHOSEN: break; case MENU_B_PRESSED: ClearBottomWindow(); - sPSSData->state = 0; + sStorage->state = 0; break; default: PlaySE(SE_SELECT); ClearBottomWindow(); - sPSSData->wallpaperId -= MENU_WALLPAPERS_START; - SetWallpaperForCurrentBox(sPSSData->wallpaperId); - sPSSData->state++; + sStorage->wallpaperId -= MENU_WALLPAPERS_START; + SetWallpaperForCurrentBox(sStorage->wallpaperId); + sStorage->state++; break; } break; @@ -3431,32 +3431,32 @@ static void Cb_HandleWallpapers(u8 taskId) if (!DoWallpaperGfxChange()) { AnimateBoxScrollArrows(TRUE); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; case 6: if (!IsDma3ManagerBusyWithBgCopy()) { - SetWallpaperForCurrentBox(sPSSData->wallpaperId); - sPSSData->state = 5; + SetWallpaperForCurrentBox(sStorage->wallpaperId); + sStorage->state = 5; } break; } } -static void Cb_JumpBox(u8 taskId) +static void Task_JumpBox(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: PrintMessage(MSG_JUMP_TO_WHICH_BOX); - LoadChooseBoxMenuGfx(&sPSSData->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, PALTAG_7, 3, FALSE); + LoadChooseBoxMenuGfx(&sStorage->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, PALTAG_7, 3, FALSE); CreateChooseBoxMenuSprites(StorageGetCurrentBox()); - sPSSData->state++; + sStorage->state++; break; case 1: - sPSSData->newCurrBoxId = HandleChooseBoxMenuInput(); - switch (sPSSData->newCurrBoxId) + sStorage->newCurrBoxId = HandleChooseBoxMenuInput(); + switch (sStorage->newCurrBoxId) { case BOXID_NONE_CHOSEN: break; @@ -3464,119 +3464,119 @@ static void Cb_JumpBox(u8 taskId) ClearBottomWindow(); DestroyChooseBoxMenuSprites(); FreeChooseBoxMenu(); - if (sPSSData->newCurrBoxId == BOXID_CANCELED || sPSSData->newCurrBoxId == StorageGetCurrentBox()) + if (sStorage->newCurrBoxId == BOXID_CANCELED || sStorage->newCurrBoxId == StorageGetCurrentBox()) { AnimateBoxScrollArrows(TRUE); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } else { - sPSSData->state++; + sStorage->state++; } break; } break; case 2: - SetUpScrollToBox(sPSSData->newCurrBoxId); - sPSSData->state++; + SetUpScrollToBox(sStorage->newCurrBoxId); + sStorage->state++; break; case 3: if (!ScrollToBox()) { - SetCurrentBox(sPSSData->newCurrBoxId); - SetPSSCallback(Cb_MainPSS); + SetCurrentBox(sStorage->newCurrBoxId); + SetPokeStorageTask(Task_PokeStorageMain); } break; } } -static void Cb_NameBox(u8 taskId) +static void Task_NameBox(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: SaveMovingMon(); BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sPSSData->state++; + sStorage->state++; break; case 1: if (!UpdatePaletteFade()) { sWhichToReshow = SCREEN_CHANGE_NAME_BOX - 1; - sPSSData->screenChangeType = SCREEN_CHANGE_NAME_BOX; - SetPSSCallback(Cb_ChangeScreen); + sStorage->screenChangeType = SCREEN_CHANGE_NAME_BOX; + SetPokeStorageTask(Task_ChangeScreen); } break; } } -static void Cb_ShowMonSummary(u8 taskId) +static void Task_ShowMonSummary(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: InitSummaryScreenData(); BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sPSSData->state++; + sStorage->state++; break; case 1: if (!UpdatePaletteFade()) { sWhichToReshow = SCREEN_CHANGE_SUMMARY_SCREEN - 1; - sPSSData->screenChangeType = SCREEN_CHANGE_SUMMARY_SCREEN; - SetPSSCallback(Cb_ChangeScreen); + sStorage->screenChangeType = SCREEN_CHANGE_SUMMARY_SCREEN; + SetPokeStorageTask(Task_ChangeScreen); } break; } } -static void Cb_GiveItemFromBag(u8 taskId) +static void Task_GiveItemFromBag(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); - sPSSData->state++; + sStorage->state++; break; case 1: if (!UpdatePaletteFade()) { sWhichToReshow = SCREEN_CHANGE_ITEM_FROM_BAG - 1; - sPSSData->screenChangeType = SCREEN_CHANGE_ITEM_FROM_BAG; - SetPSSCallback(Cb_ChangeScreen); + sStorage->screenChangeType = SCREEN_CHANGE_ITEM_FROM_BAG; + SetPokeStorageTask(Task_ChangeScreen); } break; } } -static void Cb_OnCloseBoxPressed(u8 taskId) +static void Task_OnCloseBoxPressed(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: if (IsMonBeingMoved()) { PlaySE(SE_FAILURE); PrintMessage(MSG_HOLDING_POKE); - sPSSData->state = 1; + sStorage->state = 1; } else if (IsMovingItem()) { - SetPSSCallback(Cb_CloseBoxWhileHoldingItem); + SetPokeStorageTask(Task_CloseBoxWhileHoldingItem); } else { PlaySE(SE_SELECT); PrintMessage(MSG_EXIT_BOX); ShowYesNoWindow(0); - sPSSData->state = 2; + sStorage->state = 2; } break; case 1: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; case 2: @@ -3585,59 +3585,59 @@ static void Cb_OnCloseBoxPressed(u8 taskId) case MENU_B_PRESSED: case 1: ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; case 0: PlaySE(SE_PC_OFF); ClearBottomWindow(); - sPSSData->state++; + sStorage->state++; break; } break; case 3: ComputerScreenCloseEffect(20, 0, 1); - sPSSData->state++; + sStorage->state++; break; case 4: if (!IsComputerScreenCloseEffectActive()) { sub_80CABE0(); gPlayerPartyCount = CalculatePlayerPartyCount(); - sPSSData->screenChangeType = SCREEN_CHANGE_EXIT_BOX; - SetPSSCallback(Cb_ChangeScreen); + sStorage->screenChangeType = SCREEN_CHANGE_EXIT_BOX; + SetPokeStorageTask(Task_ChangeScreen); } break; } } -static void Cb_OnBPressed(u8 taskId) +static void Task_OnBPressed(u8 taskId) { - switch (sPSSData->state) + switch (sStorage->state) { case 0: if (IsMonBeingMoved()) { PlaySE(SE_FAILURE); PrintMessage(MSG_HOLDING_POKE); - sPSSData->state = 1; + sStorage->state = 1; } else if (IsMovingItem()) { - SetPSSCallback(Cb_CloseBoxWhileHoldingItem); + SetPokeStorageTask(Task_CloseBoxWhileHoldingItem); } else { PlaySE(SE_SELECT); PrintMessage(MSG_CONTINUE_BOX); ShowYesNoWindow(0); - sPSSData->state = 2; + sStorage->state = 2; } break; case 1: if (JOY_NEW(A_BUTTON | B_BUTTON | DPAD_ANY)) { ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); } break; case 2: @@ -3645,39 +3645,39 @@ static void Cb_OnBPressed(u8 taskId) { case 0: ClearBottomWindow(); - SetPSSCallback(Cb_MainPSS); + SetPokeStorageTask(Task_PokeStorageMain); break; case 1: case MENU_B_PRESSED: PlaySE(SE_PC_OFF); ClearBottomWindow(); - sPSSData->state++; + sStorage->state++; break; } break; case 3: ComputerScreenCloseEffect(20, 0, 0); - sPSSData->state++; + sStorage->state++; break; case 4: if (!IsComputerScreenCloseEffectActive()) { sub_80CABE0(); gPlayerPartyCount = CalculatePlayerPartyCount(); - sPSSData->screenChangeType = SCREEN_CHANGE_EXIT_BOX; - SetPSSCallback(Cb_ChangeScreen); + sStorage->screenChangeType = SCREEN_CHANGE_EXIT_BOX; + SetPokeStorageTask(Task_ChangeScreen); } break; } } -static void Cb_ChangeScreen(u8 taskId) +static void Task_ChangeScreen(u8 taskId) { struct BoxPokemon *boxMons; u8 mode, monIndex, maxMonIndex; - u8 screenChangeType = sPSSData->screenChangeType; + u8 screenChangeType = sStorage->screenChangeType; - if (sPSSData->boxOption == OPTION_MOVE_ITEMS && IsMovingItem() == TRUE) + if (sStorage->boxOption == OPTION_MOVE_ITEMS && IsMovingItem() == TRUE) sMovingItemId = GetMovingItemId(); else sMovingItemId = ITEM_NONE; @@ -3686,27 +3686,27 @@ static void Cb_ChangeScreen(u8 taskId) { case SCREEN_CHANGE_EXIT_BOX: default: - FreePSSData(); - SetMainCallback2(Cb2_ExitPSS); + FreePokeStorageData(); + SetMainCallback2(CB2_ExitPokeStorage); break; case SCREEN_CHANGE_SUMMARY_SCREEN: - boxMons = sPSSData->summaryMon.box; - monIndex = sPSSData->summaryStartPos; - maxMonIndex = sPSSData->summaryMaxPos; - mode = sPSSData->summaryScreenMode; - FreePSSData(); + boxMons = sStorage->summaryMon.box; + monIndex = sStorage->summaryStartPos; + maxMonIndex = sStorage->summaryMaxPos; + mode = sStorage->summaryScreenMode; + FreePokeStorageData(); if (mode == SUMMARY_MODE_NORMAL && boxMons == &sSavedMovingMon.box) - ShowPokemonSummaryScreenSet40EF(mode, boxMons, monIndex, maxMonIndex, Cb2_ReturnToPSS); + ShowPokemonSummaryScreenSet40EF(mode, boxMons, monIndex, maxMonIndex, CB2_ReturnToPokeStorage); else - ShowPokemonSummaryScreen(mode, boxMons, monIndex, maxMonIndex, Cb2_ReturnToPSS); + ShowPokemonSummaryScreen(mode, boxMons, monIndex, maxMonIndex, CB2_ReturnToPokeStorage); break; case SCREEN_CHANGE_NAME_BOX: - FreePSSData(); - DoNamingScreen(NAMING_SCREEN_BOX, GetBoxNamePtr(StorageGetCurrentBox()), 0, 0, 0, Cb2_ReturnToPSS); + FreePokeStorageData(); + DoNamingScreen(NAMING_SCREEN_BOX, GetBoxNamePtr(StorageGetCurrentBox()), 0, 0, 0, CB2_ReturnToPokeStorage); break; case SCREEN_CHANGE_ITEM_FROM_BAG: - FreePSSData(); - GoToBagMenu(ITEMMENULOCATION_PCBOX, 0, Cb2_ReturnToPSS); + FreePokeStorageData(); + GoToBagMenu(ITEMMENULOCATION_PCBOX, 0, CB2_ReturnToPokeStorage); break; } @@ -3729,11 +3729,11 @@ static void GiveChosenBagItem(void) } } -static void FreePSSData(void) +static void FreePokeStorageData(void) { TilemapUtil_Free(); MultiMove_Free(); - FREE_AND_SET_NULL(sPSSData); + FREE_AND_SET_NULL(sStorage); FreeAllWindowBuffers(); } @@ -3750,17 +3750,17 @@ static void ScrollBackground(void) ChangeBgY(3, 128, 2); } -static void LoadPSSMenuGfx(void) +static void LoadPokeStorageMenuGfx(void) { InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); DecompressAndLoadBgGfxUsingHeap(1, gStorageSystemMenu_Gfx, 0, 0, 0); - LZ77UnCompWram(sDisplayMenu_Tilemap, sPSSData->displayMenuTilemapBuffer); - SetBgTilemapBuffer(1, sPSSData->displayMenuTilemapBuffer); + LZ77UnCompWram(sDisplayMenu_Tilemap, sStorage->displayMenuTilemapBuffer); + SetBgTilemapBuffer(1, sStorage->displayMenuTilemapBuffer); ShowBg(1); ScheduleBgCopyTilemapToVram(1); } -static bool8 InitPSSWindows(void) +static bool8 InitPokeStorageWindows(void) { if (!InitWindows(sWindowTemplates)) { @@ -3783,7 +3783,7 @@ static void sub_80CA0D8(void) LoadPalette(sInterface_Pal, 0, sizeof(sInterface_Pal)); LoadPalette(sPkmnDataGray_Pal, 0x20, sizeof(sPkmnDataGray_Pal)); LoadPalette(gUnknown_085726F4, 0xF0, sizeof(gUnknown_085726F4)); - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) LoadPalette(sBg_Pal, 0x30, sizeof(sBg_Pal)); else LoadPalette(sBgMoveItems_Pal, 0x30, sizeof(sBgMoveItems_Pal)); @@ -3797,12 +3797,12 @@ static void sub_80CA0D8(void) static void CreateMarkingComboSprite(void) { - sPSSData->markingComboSprite = CreateMonMarkingComboSprite(GFXTAG_MARKING_COMBO, PALTAG_MARKING_COMBO, NULL); - sPSSData->markingComboSprite->oam.priority = 1; - sPSSData->markingComboSprite->subpriority = 1; - sPSSData->markingComboSprite->pos1.x = 40; - sPSSData->markingComboSprite->pos1.y = 150; - sPSSData->markingComboTilesPtr = (void*) OBJ_VRAM0 + 32 * GetSpriteTileStartByTag(GFXTAG_MARKING_COMBO); + sStorage->markingComboSprite = CreateMonMarkingComboSprite(GFXTAG_MARKING_COMBO, PALTAG_MARKING_COMBO, NULL); + sStorage->markingComboSprite->oam.priority = 1; + sStorage->markingComboSprite->subpriority = 1; + sStorage->markingComboSprite->pos1.x = 40; + sStorage->markingComboSprite->pos1.y = 150; + sStorage->markingComboTilesPtr = (void*) OBJ_VRAM0 + 32 * GetSpriteTileStartByTag(GFXTAG_MARKING_COMBO); } static void CreateWaveformSprites(void) @@ -3811,16 +3811,16 @@ static void CreateWaveformSprites(void) struct SpriteSheet sheet = sSpriteSheet_Waveform; LoadSpriteSheet(&sheet); - for (i = 0; i < ARRAY_COUNT(sPSSData->waveformSprites); i++) + for (i = 0; i < ARRAY_COUNT(sStorage->waveformSprites); i++) { u8 spriteId = CreateSprite(&sSpriteTemplate_Waveform, i * 63 + 8, 9, 2); - sPSSData->waveformSprites[i] = &gSprites[spriteId]; + sStorage->waveformSprites[i] = &gSprites[spriteId]; } } static void RefreshDisplayMonData(void) { - LoadDisplayMonGfx(sPSSData->displayMonSpecies, sPSSData->displayMonPersonality); + LoadDisplayMonGfx(sStorage->displayMonSpecies, sStorage->displayMonPersonality); PrintDisplayMonInfo(); UpdateWaveformAnimation(); ScheduleBgCopyTilemapToVram(0); @@ -3829,19 +3829,19 @@ static void RefreshDisplayMonData(void) static void StartDisplayMonMosaicEffect(void) { RefreshDisplayMonData(); - if (sPSSData->displayMonSprite) + if (sStorage->displayMonSprite) { - sPSSData->displayMonSprite->oam.mosaic = TRUE; - sPSSData->displayMonSprite->data[0] = 10; - sPSSData->displayMonSprite->data[1] = 1; - sPSSData->displayMonSprite->callback = SpriteCB_DisplayMonMosaic; - SetGpuReg(REG_OFFSET_MOSAIC, (sPSSData->displayMonSprite->data[0] << 12) | (sPSSData->displayMonSprite->data[0] << 8)); + sStorage->displayMonSprite->oam.mosaic = TRUE; + sStorage->displayMonSprite->data[0] = 10; + sStorage->displayMonSprite->data[1] = 1; + sStorage->displayMonSprite->callback = SpriteCB_DisplayMonMosaic; + SetGpuReg(REG_OFFSET_MOSAIC, (sStorage->displayMonSprite->data[0] << 12) | (sStorage->displayMonSprite->data[0] << 8)); } } static u8 IsDisplayMosaicActive(void) { - return sPSSData->displayMonSprite->oam.mosaic; + return sStorage->displayMonSprite->oam.mosaic; } static void SpriteCB_DisplayMonMosaic(struct Sprite *sprite) @@ -3863,16 +3863,16 @@ static void CreateDisplayMonSprite(void) u16 tileStart; u8 palSlot; u8 spriteId; - struct SpriteSheet sheet = {sPSSData->tileBuffer, MON_PIC_SIZE, GFXTAG_DISPLAY_MON}; - struct SpritePalette palette = {sPSSData->displayMonPalBuffer, PALTAG_DISPLAY_MON}; + struct SpriteSheet sheet = {sStorage->tileBuffer, MON_PIC_SIZE, GFXTAG_DISPLAY_MON}; + struct SpritePalette palette = {sStorage->displayMonPalBuffer, PALTAG_DISPLAY_MON}; struct SpriteTemplate template = sSpriteTemplate_DisplayMon; for (i = 0; i < MON_PIC_SIZE; i++) - sPSSData->tileBuffer[i] = 0; + sStorage->tileBuffer[i] = 0; for (i = 0; i < 16; i++) - sPSSData->displayMonPalBuffer[i] = 0; + sStorage->displayMonPalBuffer[i] = 0; - sPSSData->displayMonSprite = NULL; + sStorage->displayMonSprite = NULL; do { @@ -3888,12 +3888,12 @@ static void CreateDisplayMonSprite(void) if (spriteId == MAX_SPRITES) break; - sPSSData->displayMonSprite = &gSprites[spriteId]; - sPSSData->displayMonPalOffset = palSlot * 16 + 0x100; - sPSSData->displayMonTilePtr = (void*) OBJ_VRAM0 + tileStart * 32; + sStorage->displayMonSprite = &gSprites[spriteId]; + sStorage->displayMonPalOffset = palSlot * 16 + 0x100; + sStorage->displayMonTilePtr = (void*) OBJ_VRAM0 + tileStart * 32; } while (0); - if (sPSSData->displayMonSprite == NULL) + if (sStorage->displayMonSprite == NULL) { FreeSpriteTilesByTag(GFXTAG_DISPLAY_MON); FreeSpritePaletteByTag(PALTAG_DISPLAY_MON); @@ -3902,50 +3902,50 @@ static void CreateDisplayMonSprite(void) static void LoadDisplayMonGfx(u16 species, u32 pid) { - if (sPSSData->displayMonSprite == NULL) + if (sStorage->displayMonSprite == NULL) return; if (species != SPECIES_NONE) { - LoadSpecialPokePic(&gMonFrontPicTable[species], sPSSData->tileBuffer, species, pid, TRUE); - LZ77UnCompWram(sPSSData->displayMonPalette, sPSSData->displayMonPalBuffer); - CpuCopy32(sPSSData->tileBuffer, sPSSData->displayMonTilePtr, MON_PIC_SIZE); - LoadPalette(sPSSData->displayMonPalBuffer, sPSSData->displayMonPalOffset, 0x20); - sPSSData->displayMonSprite->invisible = FALSE; + LoadSpecialPokePic(&gMonFrontPicTable[species], sStorage->tileBuffer, species, pid, TRUE); + LZ77UnCompWram(sStorage->displayMonPalette, sStorage->displayMonPalBuffer); + CpuCopy32(sStorage->tileBuffer, sStorage->displayMonTilePtr, MON_PIC_SIZE); + LoadPalette(sStorage->displayMonPalBuffer, sStorage->displayMonPalOffset, 0x20); + sStorage->displayMonSprite->invisible = FALSE; } else { - sPSSData->displayMonSprite->invisible = TRUE; + sStorage->displayMonSprite->invisible = TRUE; } } static void PrintDisplayMonInfo(void) { FillWindowPixelBuffer(0, PIXEL_FILL(1)); - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) { - AddTextPrinterParameterized(0, 1, sPSSData->displayMonNameText, 6, 0, TEXT_SPEED_FF, NULL); - AddTextPrinterParameterized(0, 2, sPSSData->displayMonSpeciesName, 6, 15, TEXT_SPEED_FF, NULL); - AddTextPrinterParameterized(0, 2, sPSSData->displayMonGenderLvlText, 10, 29, TEXT_SPEED_FF, NULL); - AddTextPrinterParameterized(0, 0, sPSSData->displayMonItemName, 6, 43, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 1, sStorage->displayMonNameText, 6, 0, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 2, sStorage->displayMonSpeciesName, 6, 15, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 2, sStorage->displayMonGenderLvlText, 10, 29, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 0, sStorage->displayMonItemName, 6, 43, TEXT_SPEED_FF, NULL); } else { - AddTextPrinterParameterized(0, 0, sPSSData->displayMonItemName, 6, 0, TEXT_SPEED_FF, NULL); - AddTextPrinterParameterized(0, 1, sPSSData->displayMonNameText, 6, 13, TEXT_SPEED_FF, NULL); - AddTextPrinterParameterized(0, 2, sPSSData->displayMonSpeciesName, 6, 28, TEXT_SPEED_FF, NULL); - AddTextPrinterParameterized(0, 2, sPSSData->displayMonGenderLvlText, 10, 42, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 0, sStorage->displayMonItemName, 6, 0, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 1, sStorage->displayMonNameText, 6, 13, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 2, sStorage->displayMonSpeciesName, 6, 28, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(0, 2, sStorage->displayMonGenderLvlText, 10, 42, TEXT_SPEED_FF, NULL); } CopyWindowToVram(0, 2); - if (sPSSData->displayMonSpecies != SPECIES_NONE) + if (sStorage->displayMonSpecies != SPECIES_NONE) { - UpdateMonMarkingTiles(sPSSData->displayMonMarkings, sPSSData->markingComboTilesPtr); - sPSSData->markingComboSprite->invisible = FALSE; + UpdateMonMarkingTiles(sStorage->displayMonMarkings, sStorage->markingComboTilesPtr); + sStorage->markingComboSprite->invisible = FALSE; } else { - sPSSData->markingComboSprite->invisible = TRUE; + sStorage->markingComboSprite->invisible = TRUE; } } @@ -3954,19 +3954,19 @@ static void UpdateWaveformAnimation(void) { u16 i; - if (sPSSData->displayMonSpecies != SPECIES_NONE) + if (sStorage->displayMonSpecies != SPECIES_NONE) { // Start waveform animation and color "Pkmn Data" TilemapUtil_SetRect(TILEMAPID_PKMN_DATA, 0, 0, 8, 2); - for (i = 0; i < ARRAY_COUNT(sPSSData->waveformSprites); i++) - StartSpriteAnimIfDifferent(sPSSData->waveformSprites[i], i * 2 + 1); + for (i = 0; i < ARRAY_COUNT(sStorage->waveformSprites); i++) + StartSpriteAnimIfDifferent(sStorage->waveformSprites[i], i * 2 + 1); } else { // Stop waveform animation and gray out "Pkmn Data" TilemapUtil_SetRect(TILEMAPID_PKMN_DATA, 0, 2, 8, 2); - for (i = 0; i < ARRAY_COUNT(sPSSData->waveformSprites); i++) - StartSpriteAnim(sPSSData->waveformSprites[i], i * 2); + for (i = 0; i < ARRAY_COUNT(sStorage->waveformSprites); i++) + StartSpriteAnim(sStorage->waveformSprites[i], i * 2); } TilemapUtil_Update(TILEMAPID_PKMN_DATA); @@ -3975,9 +3975,9 @@ static void UpdateWaveformAnimation(void) static void InitSupplementalTilemaps(void) { - LZ77UnCompWram(gStorageSystemPartyMenu_Tilemap, sPSSData->partyMenuTilemapBuffer); + LZ77UnCompWram(gStorageSystemPartyMenu_Tilemap, sStorage->partyMenuTilemapBuffer); LoadPalette(gStorageSystemPartyMenu_Pal, 0x10, 0x20); - TilemapUtil_SetMap(TILEMAPID_PARTY_MENU, 1, sPSSData->partyMenuTilemapBuffer, 12, 22); + TilemapUtil_SetMap(TILEMAPID_PARTY_MENU, 1, sStorage->partyMenuTilemapBuffer, 12, 22); TilemapUtil_SetMap(TILEMAPID_CLOSE_BUTTON, 1, sCloseBoxButton_Tilemap, 9, 4); TilemapUtil_SetPos(TILEMAPID_PARTY_MENU, 10, 0); TilemapUtil_SetPos(TILEMAPID_CLOSE_BUTTON, 21, 0); @@ -3998,29 +3998,29 @@ static void InitSupplementalTilemaps(void) } ScheduleBgCopyTilemapToVram(1); - sPSSData->closeBoxFlashing = FALSE; + sStorage->closeBoxFlashing = FALSE; } static void SetUpShowPartyMenu(void) { - sPSSData->partyMenuUnused = 20; - sPSSData->partyMenuY = 2; - sPSSData->partyMenuMoveTimer = 0; + sStorage->partyMenuUnused = 20; + sStorage->partyMenuY = 2; + sStorage->partyMenuMoveTimer = 0; CreatePartyMonsSprites(FALSE); } static bool8 ShowPartyMenu(void) { - if (sPSSData->partyMenuMoveTimer == 20) + if (sStorage->partyMenuMoveTimer == 20) return FALSE; - sPSSData->partyMenuUnused--; - sPSSData->partyMenuY++; + sStorage->partyMenuUnused--; + sStorage->partyMenuY++; TilemapUtil_Move(TILEMAPID_PARTY_MENU, 3, 1); TilemapUtil_Update(TILEMAPID_PARTY_MENU); ScheduleBgCopyTilemapToVram(1); MovePartySprites(8); - if (++sPSSData->partyMenuMoveTimer == 20) + if (++sStorage->partyMenuMoveTimer == 20) { sInPartyMenu = TRUE; return FALSE; @@ -4033,24 +4033,24 @@ static bool8 ShowPartyMenu(void) static void SetUpHidePartyMenu(void) { - sPSSData->partyMenuUnused = 0; - sPSSData->partyMenuY = 22; - sPSSData->partyMenuMoveTimer = 0; - if (sPSSData->boxOption == OPTION_MOVE_ITEMS) + sStorage->partyMenuUnused = 0; + sStorage->partyMenuY = 22; + sStorage->partyMenuMoveTimer = 0; + if (sStorage->boxOption == OPTION_MOVE_ITEMS) MoveHeldItemWithPartyMenu(); } static bool8 HidePartyMenu(void) { - if (sPSSData->partyMenuMoveTimer != 20) + if (sStorage->partyMenuMoveTimer != 20) { - sPSSData->partyMenuUnused++; - sPSSData->partyMenuY--; + sStorage->partyMenuUnused++; + sStorage->partyMenuY--; TilemapUtil_Move(TILEMAPID_PARTY_MENU, 3, -1); TilemapUtil_Update(TILEMAPID_PARTY_MENU); - FillBgTilemapBufferRect_Palette0(1, 0x100, 10, sPSSData->partyMenuY, 12, 1); + FillBgTilemapBufferRect_Palette0(1, 0x100, 10, sStorage->partyMenuY, 12, 1); MovePartySprites(-8); - if (++sPSSData->partyMenuMoveTimer != 20) + if (++sStorage->partyMenuMoveTimer != 20) { ScheduleBgCopyTilemapToVram(1); return TRUE; @@ -4086,27 +4086,27 @@ static void UpdateCloseBoxButtonTilemap(bool8 normal) static void StartFlashingCloseBoxButton(void) { - sPSSData->closeBoxFlashing = TRUE; - sPSSData->closeBoxFlashTimer = 30; - sPSSData->closeBoxFlashState = TRUE; + sStorage->closeBoxFlashing = TRUE; + sStorage->closeBoxFlashTimer = 30; + sStorage->closeBoxFlashState = TRUE; } static void StopFlashingCloseBoxButton(void) { - if (sPSSData->closeBoxFlashing) + if (sStorage->closeBoxFlashing) { - sPSSData->closeBoxFlashing = FALSE; + sStorage->closeBoxFlashing = FALSE; UpdateCloseBoxButtonTilemap(TRUE); } } static void UpdateCloseBoxButtonFlash(void) { - if (sPSSData->closeBoxFlashing && ++sPSSData->closeBoxFlashTimer > 30) + if (sStorage->closeBoxFlashing && ++sStorage->closeBoxFlashTimer > 30) { - sPSSData->closeBoxFlashTimer = 0; - sPSSData->closeBoxFlashState = (sPSSData->closeBoxFlashState == FALSE); - UpdateCloseBoxButtonTilemap(sPSSData->closeBoxFlashState); + sStorage->closeBoxFlashTimer = 0; + sStorage->closeBoxFlashState = (sStorage->closeBoxFlashState == FALSE); + UpdateCloseBoxButtonTilemap(sStorage->closeBoxFlashState); } } @@ -4139,7 +4139,7 @@ static void SetPartySlotTilemap(u8 partyId, bool8 hasMon) for (i = 0; i < 3; i++) { for (j = 0; j < 4; j++) - sPSSData->partyMenuTilemapBuffer[index + j] = data[j]; + sStorage->partyMenuTilemapBuffer[index + j] = data[j]; data += 4; index += 12; @@ -4156,28 +4156,28 @@ static void UpdatePartySlotColors(void) static void SetUpDoShowPartyMenu(void) { - sPSSData->showPartyMenuState = 0; + sStorage->showPartyMenuState = 0; PlaySE(SE_WIN_OPEN); SetUpShowPartyMenu(); } static bool8 DoShowPartyMenu(void) { - switch (sPSSData->showPartyMenuState) + switch (sStorage->showPartyMenuState) { case 0: if (!ShowPartyMenu()) { SetCursorInParty(); - sPSSData->showPartyMenuState++; + sStorage->showPartyMenuState++; } break; case 1: if (!UpdateCursorPos()) { - if (sPSSData->setMosaic) + if (sStorage->setMosaic) StartDisplayMonMosaicEffect(); - sPSSData->showPartyMenuState++; + sStorage->showPartyMenuState++; } break; case 2: @@ -4215,30 +4215,30 @@ static void PrintMessage(u8 id) case MSG_VAR_MON_NAME_1: case MSG_VAR_MON_NAME_2: case MSG_VAR_MON_NAME_3: - DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->displayMonName); + DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sStorage->displayMonName); break; case MSG_VAR_RELEASE_MON_1: case MSG_VAR_RELEASE_MON_2: case MSG_VAR_RELEASE_MON_3: - DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->releaseMonName); + DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sStorage->releaseMonName); break; case MSG_VAR_ITEM_NAME: if (IsMovingItem()) - txtPtr = StringCopy(sPSSData->itemName, GetMovingItemName()); + txtPtr = StringCopy(sStorage->itemName, GetMovingItemName()); else - txtPtr = StringCopy(sPSSData->itemName, sPSSData->displayMonItemName); + txtPtr = StringCopy(sStorage->itemName, sStorage->displayMonItemName); while (*(txtPtr - 1) == CHAR_SPACE) txtPtr--; *txtPtr = EOS; - DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sPSSData->itemName); + DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, sStorage->itemName); break; } - DynamicPlaceholderTextUtil_ExpandPlaceholders(sPSSData->messageText, sMessages[id].text); + DynamicPlaceholderTextUtil_ExpandPlaceholders(sStorage->messageText, sMessages[id].text); FillWindowPixelBuffer(1, PIXEL_FILL(1)); - AddTextPrinterParameterized(1, 1, sPSSData->messageText, 0, 1, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(1, 1, sStorage->messageText, 0, 1, TEXT_SPEED_FF, NULL); DrawTextBorderOuter(1, 2, 14); PutWindowTilemap(1); CopyWindowToVram(1, 2); @@ -4330,16 +4330,16 @@ static void InitMonIconFields(void) LoadMonIconPalettes(); for (i = 0; i < MAX_MON_ICONS; i++) - sPSSData->numIconsPerSpecies[i] = 0; + sStorage->numIconsPerSpecies[i] = 0; for (i = 0; i < MAX_MON_ICONS; i++) - sPSSData->iconSpeciesList[i] = SPECIES_NONE; + sStorage->iconSpeciesList[i] = SPECIES_NONE; for (i = 0; i < PARTY_SIZE; i++) - sPSSData->partySprites[i] = NULL; + sStorage->partySprites[i] = NULL; for (i = 0; i < IN_BOX_COUNT; i++) - sPSSData->boxMonsSprites[i] = NULL; + sStorage->boxMonsSprites[i] = NULL; - sPSSData->movingMonSprite = NULL; - sPSSData->field_78C = 0; + sStorage->movingMonSprite = NULL; + sStorage->field_78C = 0; } static u8 GetMonIconPriorityByCursorPos(void) @@ -4349,12 +4349,12 @@ static u8 GetMonIconPriorityByCursorPos(void) static void CreateMovingMonIcon(void) { - u32 personality = GetMonData(&sPSSData->movingMon, MON_DATA_PERSONALITY); - u16 species = GetMonData(&sPSSData->movingMon, MON_DATA_SPECIES2); + u32 personality = GetMonData(&sStorage->movingMon, MON_DATA_PERSONALITY); + u16 species = GetMonData(&sStorage->movingMon, MON_DATA_SPECIES2); u8 priority = GetMonIconPriorityByCursorPos(); - sPSSData->movingMonSprite = CreateMonIconSprite(species, personality, 0, 0, priority, 7); - sPSSData->movingMonSprite->callback = SpriteCB_HeldMon; + sStorage->movingMonSprite = CreateMonIconSprite(species, personality, 0, 0, priority, 7); + sStorage->movingMonSprite->callback = SpriteCB_HeldMon; } static void InitBoxMonSprites(u8 boxId) @@ -4376,11 +4376,11 @@ static void InitBoxMonSprites(u8 boxId) if (species != SPECIES_NONE) { personality = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_PERSONALITY); - sPSSData->boxMonsSprites[count] = CreateMonIconSprite(species, personality, 8 * (3 * j) + 100, 8 * (3 * i) + 44, 2, 19 - j); + sStorage->boxMonsSprites[count] = CreateMonIconSprite(species, personality, 8 * (3 * j) + 100, 8 * (3 * i) + 44, 2, 19 - j); } else { - sPSSData->boxMonsSprites[count] = NULL; + sStorage->boxMonsSprites[count] = NULL; } boxPosition++; count++; @@ -4388,12 +4388,12 @@ static void InitBoxMonSprites(u8 boxId) } // If in item mode, set all Pokémon icons with no item to be transparent - if (sPSSData->boxOption == OPTION_MOVE_ITEMS) + if (sStorage->boxOption == OPTION_MOVE_ITEMS) { for (boxPosition = 0; boxPosition < IN_BOX_COUNT; boxPosition++) { if (GetBoxMonDataAt(boxId, boxPosition, MON_DATA_HELD_ITEM) == ITEM_NONE) - sPSSData->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; + sStorage->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; } } } @@ -4408,9 +4408,9 @@ static void CreateBoxMonIconAtPos(u8 boxPosition) s16 y = 8 * (3 * (boxPosition / IN_BOX_COLUMNS)) + 44; u32 personality = GetCurrentBoxMonData(boxPosition, MON_DATA_PERSONALITY); - sPSSData->boxMonsSprites[boxPosition] = CreateMonIconSprite(species, personality, x, y, 2, 19 - (boxPosition % IN_BOX_COLUMNS)); - if (sPSSData->boxOption == OPTION_MOVE_ITEMS) - sPSSData->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; + sStorage->boxMonsSprites[boxPosition] = CreateMonIconSprite(species, personality, x, y, 2, 19 - (boxPosition % IN_BOX_COLUMNS)); + if (sStorage->boxOption == OPTION_MOVE_ITEMS) + sStorage->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; } } @@ -4426,11 +4426,11 @@ static void StartBoxMonIconsScrollOut(s16 speed) for (i = 0; i < IN_BOX_COUNT; i++) { - if (sPSSData->boxMonsSprites[i] != NULL) + if (sStorage->boxMonsSprites[i] != NULL) { - sPSSData->boxMonsSprites[i]->sSpeed = speed; - sPSSData->boxMonsSprites[i]->sDelay = 1; - sPSSData->boxMonsSprites[i]->callback = SpriteCB_BoxMonIconScrollOut; + sStorage->boxMonsSprites[i]->sSpeed = speed; + sStorage->boxMonsSprites[i]->sDelay = 1; + sStorage->boxMonsSprites[i]->callback = SpriteCB_BoxMonIconScrollOut; } } } @@ -4446,7 +4446,7 @@ static void SpriteCB_BoxMonIconScrollIn(struct Sprite *sprite) else { // Icon arrived - sPSSData->iconScrollNumIncoming--; + sStorage->iconScrollNumIncoming--; sprite->pos1.x = sprite->sScrollInDestX; sprite->callback = SpriteCallbackDummy; } @@ -4479,10 +4479,10 @@ static void DestroyBoxMonIconsInColumn(u8 column) for (row = 0; row < IN_BOX_ROWS; row++) { - if (sPSSData->boxMonsSprites[boxPosition] != NULL) + if (sStorage->boxMonsSprites[boxPosition] != NULL) { - DestroyBoxMonIcon(sPSSData->boxMonsSprites[boxPosition]); - sPSSData->boxMonsSprites[boxPosition] = NULL; + DestroyBoxMonIcon(sStorage->boxMonsSprites[boxPosition]); + sStorage->boxMonsSprites[boxPosition] = NULL; } boxPosition += IN_BOX_COLUMNS; } @@ -4499,21 +4499,21 @@ static u8 CreateBoxMonIconsInColumn(u8 column, u16 distance, s16 speed) u8 iconsCreated = 0; u8 boxPosition = column; - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) { for (i = 0; i < IN_BOX_ROWS; i++) { - if (sPSSData->boxSpecies[boxPosition] != SPECIES_NONE) + if (sStorage->boxSpecies[boxPosition] != SPECIES_NONE) { - sPSSData->boxMonsSprites[boxPosition] = CreateMonIconSprite(sPSSData->boxSpecies[boxPosition], - sPSSData->boxPersonalities[boxPosition], + sStorage->boxMonsSprites[boxPosition] = CreateMonIconSprite(sStorage->boxSpecies[boxPosition], + sStorage->boxPersonalities[boxPosition], x, y, 2, subpriority); - if (sPSSData->boxMonsSprites[boxPosition] != NULL) + if (sStorage->boxMonsSprites[boxPosition] != NULL) { - sPSSData->boxMonsSprites[boxPosition]->sDistance = distance; - sPSSData->boxMonsSprites[boxPosition]->sSpeed = speed; - sPSSData->boxMonsSprites[boxPosition]->sScrollInDestX = xDest; - sPSSData->boxMonsSprites[boxPosition]->callback = SpriteCB_BoxMonIconScrollIn; + sStorage->boxMonsSprites[boxPosition]->sDistance = distance; + sStorage->boxMonsSprites[boxPosition]->sSpeed = speed; + sStorage->boxMonsSprites[boxPosition]->sScrollInDestX = xDest; + sStorage->boxMonsSprites[boxPosition]->callback = SpriteCB_BoxMonIconScrollIn; iconsCreated++; } } @@ -4527,19 +4527,19 @@ static u8 CreateBoxMonIconsInColumn(u8 column, u16 distance, s16 speed) // to create the icons with the proper blend for (i = 0; i < IN_BOX_ROWS; i++) { - if (sPSSData->boxSpecies[boxPosition] != SPECIES_NONE) + if (sStorage->boxSpecies[boxPosition] != SPECIES_NONE) { - sPSSData->boxMonsSprites[boxPosition] = CreateMonIconSprite(sPSSData->boxSpecies[boxPosition], - sPSSData->boxPersonalities[boxPosition], + sStorage->boxMonsSprites[boxPosition] = CreateMonIconSprite(sStorage->boxSpecies[boxPosition], + sStorage->boxPersonalities[boxPosition], x, y, 2, subpriority); - if (sPSSData->boxMonsSprites[boxPosition] != NULL) + if (sStorage->boxMonsSprites[boxPosition] != NULL) { - sPSSData->boxMonsSprites[boxPosition]->sDistance = distance; - sPSSData->boxMonsSprites[boxPosition]->sSpeed = speed; - sPSSData->boxMonsSprites[boxPosition]->sScrollInDestX = xDest; - sPSSData->boxMonsSprites[boxPosition]->callback = SpriteCB_BoxMonIconScrollIn; - if (GetBoxMonDataAt(sPSSData->field_C5C, boxPosition, MON_DATA_HELD_ITEM) == ITEM_NONE) - sPSSData->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; + sStorage->boxMonsSprites[boxPosition]->sDistance = distance; + sStorage->boxMonsSprites[boxPosition]->sSpeed = speed; + sStorage->boxMonsSprites[boxPosition]->sScrollInDestX = xDest; + sStorage->boxMonsSprites[boxPosition]->callback = SpriteCB_BoxMonIconScrollIn; + if (GetBoxMonDataAt(sStorage->field_C5C, boxPosition, MON_DATA_HELD_ITEM) == ITEM_NONE) + sStorage->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; iconsCreated++; } } @@ -4559,62 +4559,62 @@ static u8 CreateBoxMonIconsInColumn(u8 column, u16 distance, s16 speed) static void InitBoxMonIconScroll(u8 boxId, s8 direction) { - sPSSData->iconScrollState = 0; - sPSSData->iconScrollToBoxId = boxId; - sPSSData->iconScrollDirection = direction; - sPSSData->iconScrollDistance = 32; - sPSSData->iconScrollSpeed = -(6 * direction); - sPSSData->iconScrollNumIncoming = 0; + sStorage->iconScrollState = 0; + sStorage->iconScrollToBoxId = boxId; + sStorage->iconScrollDirection = direction; + sStorage->iconScrollDistance = 32; + sStorage->iconScrollSpeed = -(6 * direction); + sStorage->iconScrollNumIncoming = 0; SetBoxSpeciesAndPersonalities(boxId); if (direction > 0) - sPSSData->iconScrollCurColumn = 0; + sStorage->iconScrollCurColumn = 0; else - sPSSData->iconScrollCurColumn = IN_BOX_COLUMNS - 1; + sStorage->iconScrollCurColumn = IN_BOX_COLUMNS - 1; - sPSSData->iconScrollPos = (24 * sPSSData->iconScrollCurColumn) + 100; - StartBoxMonIconsScrollOut(sPSSData->iconScrollSpeed); + sStorage->iconScrollPos = (24 * sStorage->iconScrollCurColumn) + 100; + StartBoxMonIconsScrollOut(sStorage->iconScrollSpeed); } static bool8 UpdateBoxMonIconScroll(void) { - if (sPSSData->iconScrollDistance != 0) - sPSSData->iconScrollDistance--; + if (sStorage->iconScrollDistance != 0) + sStorage->iconScrollDistance--; - switch (sPSSData->iconScrollState) + switch (sStorage->iconScrollState) { case 0: - sPSSData->iconScrollPos += sPSSData->iconScrollSpeed; - if (sPSSData->iconScrollPos <= 64 || sPSSData->iconScrollPos >= 252) + sStorage->iconScrollPos += sStorage->iconScrollSpeed; + if (sStorage->iconScrollPos <= 64 || sStorage->iconScrollPos >= 252) { // A column of icons has gone offscreen, destroy them - DestroyBoxMonIconsInColumn(sPSSData->iconScrollCurColumn); - sPSSData->iconScrollPos += sPSSData->iconScrollDirection * 24; - sPSSData->iconScrollState++; + DestroyBoxMonIconsInColumn(sStorage->iconScrollCurColumn); + sStorage->iconScrollPos += sStorage->iconScrollDirection * 24; + sStorage->iconScrollState++; } break; case 1: // Create the new incoming column of icons - sPSSData->iconScrollPos += sPSSData->iconScrollSpeed; - sPSSData->iconScrollNumIncoming += CreateBoxMonIconsInColumn(sPSSData->iconScrollCurColumn, sPSSData->iconScrollDistance, sPSSData->iconScrollSpeed); + sStorage->iconScrollPos += sStorage->iconScrollSpeed; + sStorage->iconScrollNumIncoming += CreateBoxMonIconsInColumn(sStorage->iconScrollCurColumn, sStorage->iconScrollDistance, sStorage->iconScrollSpeed); - if ((sPSSData->iconScrollDirection > 0 && sPSSData->iconScrollCurColumn == IN_BOX_COLUMNS - 1) - || (sPSSData->iconScrollDirection < 0 && sPSSData->iconScrollCurColumn == 0)) + if ((sStorage->iconScrollDirection > 0 && sStorage->iconScrollCurColumn == IN_BOX_COLUMNS - 1) + || (sStorage->iconScrollDirection < 0 && sStorage->iconScrollCurColumn == 0)) { // Scroll has reached final column - sPSSData->iconScrollState++; + sStorage->iconScrollState++; } else { // Continue scrolling - sPSSData->iconScrollCurColumn += sPSSData->iconScrollDirection; - sPSSData->iconScrollState = 0; + sStorage->iconScrollCurColumn += sStorage->iconScrollDirection; + sStorage->iconScrollState = 0; } break; case 2: // Wait to make sure all icons have arrived - if (sPSSData->iconScrollNumIncoming == 0) + if (sStorage->iconScrollNumIncoming == 0) { - sPSSData->iconScrollDistance++; + sStorage->iconScrollDistance++; return FALSE; } break; @@ -4634,29 +4634,29 @@ static void SetBoxSpeciesAndPersonalities(u8 boxId) { for (j = 0; j < IN_BOX_COLUMNS; j++) { - sPSSData->boxSpecies[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES2); - if (sPSSData->boxSpecies[boxPosition] != SPECIES_NONE) - sPSSData->boxPersonalities[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_PERSONALITY); + sStorage->boxSpecies[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_SPECIES2); + if (sStorage->boxSpecies[boxPosition] != SPECIES_NONE) + sStorage->boxPersonalities[boxPosition] = GetBoxMonDataAt(boxId, boxPosition, MON_DATA_PERSONALITY); boxPosition++; } } - sPSSData->field_C5C = boxId; + sStorage->field_C5C = boxId; } static void DestroyBoxMonIconAtPosition(u8 boxPosition) { - if (sPSSData->boxMonsSprites[boxPosition] != NULL) + if (sStorage->boxMonsSprites[boxPosition] != NULL) { - DestroyBoxMonIcon(sPSSData->boxMonsSprites[boxPosition]); - sPSSData->boxMonsSprites[boxPosition] = NULL; + DestroyBoxMonIcon(sStorage->boxMonsSprites[boxPosition]); + sStorage->boxMonsSprites[boxPosition] = NULL; } } static void SetBoxMonIconObjMode(u8 boxPosition, u8 objMode) { - if (sPSSData->boxMonsSprites[boxPosition] != NULL) - sPSSData->boxMonsSprites[boxPosition]->oam.objMode = objMode; + if (sStorage->boxMonsSprites[boxPosition] != NULL) + sStorage->boxMonsSprites[boxPosition]->oam.objMode = objMode; } static void CreatePartyMonsSprites(bool8 visible) @@ -4665,7 +4665,7 @@ static void CreatePartyMonsSprites(bool8 visible) u16 species = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES2); u32 personality = GetMonData(&gPlayerParty[0], MON_DATA_PERSONALITY); - sPSSData->partySprites[0] = CreateMonIconSprite(species, personality, 104, 64, 1, 12); + sStorage->partySprites[0] = CreateMonIconSprite(species, personality, 104, 64, 1, 12); count = 1; for (i = 1; i < PARTY_SIZE; i++) { @@ -4673,12 +4673,12 @@ static void CreatePartyMonsSprites(bool8 visible) if (species != SPECIES_NONE) { personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY); - sPSSData->partySprites[i] = CreateMonIconSprite(species, personality, 152, 8 * (3 * (i - 1)) + 16, 1, 12); + sStorage->partySprites[i] = CreateMonIconSprite(species, personality, 152, 8 * (3 * (i - 1)) + 16, 1, 12); count++; } else { - sPSSData->partySprites[i] = NULL; + sStorage->partySprites[i] = NULL; } } @@ -4686,17 +4686,17 @@ static void CreatePartyMonsSprites(bool8 visible) { for (i = 0; i < count; i++) { - sPSSData->partySprites[i]->pos1.y -= 160; - sPSSData->partySprites[i]->invisible = TRUE; + sStorage->partySprites[i]->pos1.y -= 160; + sStorage->partySprites[i]->invisible = TRUE; } } - if (sPSSData->boxOption == OPTION_MOVE_ITEMS) + if (sStorage->boxOption == OPTION_MOVE_ITEMS) { for (i = 0; i < PARTY_SIZE; i++) { - if (sPSSData->partySprites[i] != NULL && GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) == ITEM_NONE) - sPSSData->partySprites[i]->oam.objMode = ST_OAM_OBJ_BLEND; + if (sStorage->partySprites[i] != NULL && GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) == ITEM_NONE) + sStorage->partySprites[i]->oam.objMode = ST_OAM_OBJ_BLEND; } } } @@ -4705,16 +4705,16 @@ static void CompactPartySprites(void) { u16 i, targetSlot; - sPSSData->numPartyToCompact = 0; + sStorage->numPartyToCompact = 0; for (i = 0, targetSlot = 0; i < PARTY_SIZE; i++) { - if (sPSSData->partySprites[i] != NULL) + if (sStorage->partySprites[i] != NULL) { if (i != targetSlot) { - MovePartySpriteToNextSlot(sPSSData->partySprites[i], targetSlot); - sPSSData->partySprites[i] = NULL; - sPSSData->numPartyToCompact++; + MovePartySpriteToNextSlot(sStorage->partySprites[i], targetSlot); + sStorage->partySprites[i] = NULL; + sStorage->numPartyToCompact++; } targetSlot++; } @@ -4723,7 +4723,7 @@ static void CompactPartySprites(void) static u8 GetNumPartySpritesCompacting(void) { - return sPSSData->numPartyToCompact; + return sStorage->numPartyToCompact; } #define sPartyId data[1] @@ -4774,8 +4774,8 @@ static void SpriteCB_MovePartyMonToNextSlot(struct Sprite *sprite) sprite->pos1.y = 8 * (3 * (sprite->sPartyId - 1)) + 16; } sprite->callback = SpriteCallbackDummy; - sPSSData->partySprites[sprite->sPartyId] = sprite; - sPSSData->numPartyToCompact--; + sStorage->partySprites[sprite->sPartyId] = sprite; + sStorage->numPartyToCompact--; } } @@ -4788,10 +4788,10 @@ static void SpriteCB_MovePartyMonToNextSlot(struct Sprite *sprite) static void DestroyMovingMonIcon(void) { - if (sPSSData->movingMonSprite != NULL) + if (sStorage->movingMonSprite != NULL) { - DestroyBoxMonIcon(sPSSData->movingMonSprite); - sPSSData->movingMonSprite = NULL; + DestroyBoxMonIcon(sStorage->movingMonSprite); + sStorage->movingMonSprite = NULL; } } @@ -4801,25 +4801,25 @@ static void MovePartySprites(s16 yDelta) for (i = 0; i < PARTY_SIZE; i++) { - if (sPSSData->partySprites[i] != NULL) + if (sStorage->partySprites[i] != NULL) { - sPSSData->partySprites[i]->pos1.y += yDelta; - posY = sPSSData->partySprites[i]->pos1.y + sPSSData->partySprites[i]->pos2.y + sPSSData->partySprites[i]->centerToCornerVecY; + sStorage->partySprites[i]->pos1.y += yDelta; + posY = sStorage->partySprites[i]->pos1.y + sStorage->partySprites[i]->pos2.y + sStorage->partySprites[i]->centerToCornerVecY; posY += 16; if (posY > 192) - sPSSData->partySprites[i]->invisible = TRUE; + sStorage->partySprites[i]->invisible = TRUE; else - sPSSData->partySprites[i]->invisible = FALSE; + sStorage->partySprites[i]->invisible = FALSE; } } } static void DestroyPartyMonIcon(u8 partyId) { - if (sPSSData->partySprites[partyId] != NULL) + if (sStorage->partySprites[partyId] != NULL) { - DestroyBoxMonIcon(sPSSData->partySprites[partyId]); - sPSSData->partySprites[partyId] = NULL; + DestroyBoxMonIcon(sStorage->partySprites[partyId]); + sStorage->partySprites[partyId] = NULL; } } @@ -4829,19 +4829,19 @@ static void DestroyAllPartyMonIcons(void) for (i = 0; i < PARTY_SIZE; i++) { - if (sPSSData->partySprites[i] != NULL) + if (sStorage->partySprites[i] != NULL) { - DestroyBoxMonIcon(sPSSData->partySprites[i]); - sPSSData->partySprites[i] = NULL; + DestroyBoxMonIcon(sStorage->partySprites[i]); + sStorage->partySprites[i] = NULL; } } } static void SetPartyMonIconObjMode(u8 partyId, u8 objMode) { - if (sPSSData->partySprites[partyId] != NULL) + if (sStorage->partySprites[partyId] != NULL) { - sPSSData->partySprites[partyId]->oam.objMode = objMode; + sStorage->partySprites[partyId]->oam.objMode = objMode; } } @@ -4849,83 +4849,83 @@ static void SetMovingMonSprite(u8 mode, u8 id) { if (mode == MODE_PARTY) { - sPSSData->movingMonSprite = sPSSData->partySprites[id]; - sPSSData->partySprites[id] = NULL; + sStorage->movingMonSprite = sStorage->partySprites[id]; + sStorage->partySprites[id] = NULL; } else if (mode == MODE_BOX) { - sPSSData->movingMonSprite = sPSSData->boxMonsSprites[id]; - sPSSData->boxMonsSprites[id] = NULL; + sStorage->movingMonSprite = sStorage->boxMonsSprites[id]; + sStorage->boxMonsSprites[id] = NULL; } else { return; } - sPSSData->movingMonSprite->callback = SpriteCB_HeldMon; - sPSSData->movingMonSprite->oam.priority = GetMonIconPriorityByCursorPos(); - sPSSData->movingMonSprite->subpriority = 7; + sStorage->movingMonSprite->callback = SpriteCB_HeldMon; + sStorage->movingMonSprite->oam.priority = GetMonIconPriorityByCursorPos(); + sStorage->movingMonSprite->subpriority = 7; } static void sub_80CBCAC(u8 boxId, u8 position) { if (boxId == TOTAL_BOXES_COUNT) // party mon { - sPSSData->partySprites[position] = sPSSData->movingMonSprite; - sPSSData->partySprites[position]->oam.priority = 1; - sPSSData->partySprites[position]->subpriority = 12; + sStorage->partySprites[position] = sStorage->movingMonSprite; + sStorage->partySprites[position]->oam.priority = 1; + sStorage->partySprites[position]->subpriority = 12; } else { - sPSSData->boxMonsSprites[position] = sPSSData->movingMonSprite; - sPSSData->boxMonsSprites[position]->oam.priority = 2; - sPSSData->boxMonsSprites[position]->subpriority = 19 - (position % IN_BOX_COLUMNS); + sStorage->boxMonsSprites[position] = sStorage->movingMonSprite; + sStorage->boxMonsSprites[position]->oam.priority = 2; + sStorage->boxMonsSprites[position]->subpriority = 19 - (position % IN_BOX_COLUMNS); } - sPSSData->movingMonSprite->callback = SpriteCallbackDummy; - sPSSData->movingMonSprite = NULL; + sStorage->movingMonSprite->callback = SpriteCallbackDummy; + sStorage->movingMonSprite = NULL; } static void sub_80CBD5C(u8 boxId, u8 position) { if (boxId == TOTAL_BOXES_COUNT) // party mon - sPSSData->field_B00 = &sPSSData->partySprites[position]; + sStorage->field_B00 = &sStorage->partySprites[position]; else - sPSSData->field_B00 = &sPSSData->boxMonsSprites[position]; + sStorage->field_B00 = &sStorage->boxMonsSprites[position]; - sPSSData->movingMonSprite->callback = SpriteCallbackDummy; - sPSSData->field_C5D = 0; + sStorage->movingMonSprite->callback = SpriteCallbackDummy; + sStorage->field_C5D = 0; } static bool8 sub_80CBDC4(void) { - if (sPSSData->field_C5D == 16) + if (sStorage->field_C5D == 16) return FALSE; - sPSSData->field_C5D++; - if (sPSSData->field_C5D & 1) + sStorage->field_C5D++; + if (sStorage->field_C5D & 1) { - (*sPSSData->field_B00)->pos1.y--; - sPSSData->movingMonSprite->pos1.y++; + (*sStorage->field_B00)->pos1.y--; + sStorage->movingMonSprite->pos1.y++; } - (*sPSSData->field_B00)->pos2.x = gSineTable[sPSSData->field_C5D * 8] / 16; - sPSSData->movingMonSprite->pos2.x = -(gSineTable[sPSSData->field_C5D * 8] / 16); - if (sPSSData->field_C5D == 8) + (*sStorage->field_B00)->pos2.x = gSineTable[sStorage->field_C5D * 8] / 16; + sStorage->movingMonSprite->pos2.x = -(gSineTable[sStorage->field_C5D * 8] / 16); + if (sStorage->field_C5D == 8) { - sPSSData->movingMonSprite->oam.priority = (*sPSSData->field_B00)->oam.priority; - sPSSData->movingMonSprite->subpriority = (*sPSSData->field_B00)->subpriority; - (*sPSSData->field_B00)->oam.priority = GetMonIconPriorityByCursorPos(); - (*sPSSData->field_B00)->subpriority = 7; + sStorage->movingMonSprite->oam.priority = (*sStorage->field_B00)->oam.priority; + sStorage->movingMonSprite->subpriority = (*sStorage->field_B00)->subpriority; + (*sStorage->field_B00)->oam.priority = GetMonIconPriorityByCursorPos(); + (*sStorage->field_B00)->subpriority = 7; } - if (sPSSData->field_C5D == 16) + if (sStorage->field_C5D == 16) { - struct Sprite *sprite = sPSSData->movingMonSprite; - sPSSData->movingMonSprite = (*sPSSData->field_B00); - *sPSSData->field_B00 = sprite; + struct Sprite *sprite = sStorage->movingMonSprite; + sStorage->movingMonSprite = (*sStorage->field_B00); + *sStorage->field_B00 = sprite; - sPSSData->movingMonSprite->callback = SpriteCB_HeldMon; - (*sPSSData->field_B00)->callback = SpriteCallbackDummy; + sStorage->movingMonSprite->callback = SpriteCB_HeldMon; + (*sStorage->field_B00)->callback = SpriteCallbackDummy; } return TRUE; @@ -4936,78 +4936,78 @@ static void SetReleaseMon(u8 mode, u8 position) switch (mode) { case MODE_PARTY: - sPSSData->releaseMonSpritePtr = &sPSSData->partySprites[position]; + sStorage->releaseMonSpritePtr = &sStorage->partySprites[position]; break; case MODE_BOX: - sPSSData->releaseMonSpritePtr = &sPSSData->boxMonsSprites[position]; + sStorage->releaseMonSpritePtr = &sStorage->boxMonsSprites[position]; break; case MODE_MOVE: - sPSSData->releaseMonSpritePtr = &sPSSData->movingMonSprite; + sStorage->releaseMonSpritePtr = &sStorage->movingMonSprite; break; default: return; } - if (*sPSSData->releaseMonSpritePtr != NULL) + if (*sStorage->releaseMonSpritePtr != NULL) { - InitSpriteAffineAnim(*sPSSData->releaseMonSpritePtr); - (*sPSSData->releaseMonSpritePtr)->oam.affineMode = ST_OAM_AFFINE_NORMAL; - (*sPSSData->releaseMonSpritePtr)->affineAnims = sAffineAnims_ReleaseMon; - StartSpriteAffineAnim(*sPSSData->releaseMonSpritePtr, RELEASE_ANIM_RELEASE); + InitSpriteAffineAnim(*sStorage->releaseMonSpritePtr); + (*sStorage->releaseMonSpritePtr)->oam.affineMode = ST_OAM_AFFINE_NORMAL; + (*sStorage->releaseMonSpritePtr)->affineAnims = sAffineAnims_ReleaseMon; + StartSpriteAffineAnim(*sStorage->releaseMonSpritePtr, RELEASE_ANIM_RELEASE); } } static bool8 TryHideReleaseMonSprite(void) { - if (*sPSSData->releaseMonSpritePtr == NULL - || (*sPSSData->releaseMonSpritePtr)->invisible) + if (*sStorage->releaseMonSpritePtr == NULL + || (*sStorage->releaseMonSpritePtr)->invisible) return FALSE; - if ((*sPSSData->releaseMonSpritePtr)->affineAnimEnded) - (*sPSSData->releaseMonSpritePtr)->invisible = TRUE; + if ((*sStorage->releaseMonSpritePtr)->affineAnimEnded) + (*sStorage->releaseMonSpritePtr)->invisible = TRUE; return TRUE; } static void DestroyReleaseMonIcon(void) { - if (*sPSSData->releaseMonSpritePtr != NULL) + if (*sStorage->releaseMonSpritePtr != NULL) { - FreeOamMatrix((*sPSSData->releaseMonSpritePtr)->oam.matrixNum); - DestroyBoxMonIcon(*sPSSData->releaseMonSpritePtr); - *sPSSData->releaseMonSpritePtr = NULL; + FreeOamMatrix((*sStorage->releaseMonSpritePtr)->oam.matrixNum); + DestroyBoxMonIcon(*sStorage->releaseMonSpritePtr); + *sStorage->releaseMonSpritePtr = NULL; } } static void ReshowReleaseMon(void) { - if (*sPSSData->releaseMonSpritePtr != NULL) + if (*sStorage->releaseMonSpritePtr != NULL) { - (*sPSSData->releaseMonSpritePtr)->invisible = FALSE; - StartSpriteAffineAnim(*sPSSData->releaseMonSpritePtr, RELEASE_ANIM_CAME_BACK); + (*sStorage->releaseMonSpritePtr)->invisible = FALSE; + StartSpriteAffineAnim(*sStorage->releaseMonSpritePtr, RELEASE_ANIM_CAME_BACK); } } static bool8 ResetReleaseMonSpritePtr(void) { - if (sPSSData->releaseMonSpritePtr == NULL) + if (sStorage->releaseMonSpritePtr == NULL) return FALSE; - if ((*sPSSData->releaseMonSpritePtr)->affineAnimEnded) - sPSSData->releaseMonSpritePtr = NULL; + if ((*sStorage->releaseMonSpritePtr)->affineAnimEnded) + sStorage->releaseMonSpritePtr = NULL; return TRUE; } static void SetMovingMonPriority(u8 priority) { - sPSSData->movingMonSprite->oam.priority = priority; + sStorage->movingMonSprite->oam.priority = priority; } static void SpriteCB_HeldMon(struct Sprite *sprite) { - sprite->pos1.x = sPSSData->cursorSprite->pos1.x; - sprite->pos1.y = sPSSData->cursorSprite->pos1.y + sPSSData->cursorSprite->pos2.y + 4; + sprite->pos1.x = sStorage->cursorSprite->pos1.x; + sprite->pos1.y = sStorage->cursorSprite->pos1.y + sStorage->cursorSprite->pos2.y + 4; } static u16 TryLoadMonIconTiles(u16 species) @@ -5017,7 +5017,7 @@ static u16 TryLoadMonIconTiles(u16 species) // Search icon list for this species for (i = 0; i < MAX_MON_ICONS; i++) { - if (sPSSData->iconSpeciesList[i] == species) + if (sStorage->iconSpeciesList[i] == species) break; } @@ -5027,7 +5027,7 @@ static u16 TryLoadMonIconTiles(u16 species) // Find first empty spot in the list to put it for (i = 0; i < MAX_MON_ICONS; i++) { - if (sPSSData->iconSpeciesList[i] == 0) + if (sStorage->iconSpeciesList[i] == 0) break; } @@ -5037,8 +5037,8 @@ static u16 TryLoadMonIconTiles(u16 species) } // Add species to icon list and load tiles - sPSSData->iconSpeciesList[i] = species; - sPSSData->numIconsPerSpecies[i]++; + sStorage->iconSpeciesList[i] = species; + sStorage->numIconsPerSpecies[i]++; offset = 16 * i; CpuCopy32(GetMonIconTiles(species, TRUE), (void*)(OBJ_VRAM0) + offset * 32, 0x200); @@ -5051,10 +5051,10 @@ static void RemoveSpeciesFromIconList(u16 species) for (i = 0; i < MAX_MON_ICONS; i++) { - if (sPSSData->iconSpeciesList[i] == species) + if (sStorage->iconSpeciesList[i] == species) { - if (--sPSSData->numIconsPerSpecies[i] == 0) - sPSSData->iconSpeciesList[i] = SPECIES_NONE; + if (--sStorage->numIconsPerSpecies[i] == 0) + sStorage->iconSpeciesList[i] = SPECIES_NONE; break; } } @@ -5114,15 +5114,15 @@ static void Task_InitBox(u8 taskId) switch (task->tState) { case 0: - sPSSData->wallpaperOffset = 0; - sPSSData->bg2_X = 0; - task->tDmaIdx = RequestDma3Fill(0, sPSSData->wallpaperBgTilemapBuffer, sizeof(sPSSData->wallpaperBgTilemapBuffer), 1); + sStorage->wallpaperOffset = 0; + sStorage->bg2_X = 0; + task->tDmaIdx = RequestDma3Fill(0, sStorage->wallpaperBgTilemapBuffer, sizeof(sStorage->wallpaperBgTilemapBuffer), 1); break; case 1: if (CheckForSpaceForDma3Request(task->tDmaIdx) == -1) return; - SetBgTilemapBuffer(2, sPSSData->wallpaperBgTilemapBuffer); + SetBgTilemapBuffer(2, sStorage->wallpaperBgTilemapBuffer); ShowBg(2); break; case 2: @@ -5156,45 +5156,45 @@ static void SetUpScrollToBox(u8 boxId) { s8 direction = DetermineBoxScrollDirection(boxId); - sPSSData->scrollSpeed = (direction > 0) ? 6 : -6; - sPSSData->scrollUnused1 = (direction > 0) ? 1 : 2; - sPSSData->scrollTimer = 32; - sPSSData->scrollToBoxIdUnused = boxId; - sPSSData->scrollUnused2 = (direction <= 0) ? 5 : 0; - sPSSData->scrollDirectionUnused = direction; + sStorage->scrollSpeed = (direction > 0) ? 6 : -6; + sStorage->scrollUnused1 = (direction > 0) ? 1 : 2; + sStorage->scrollTimer = 32; + sStorage->scrollToBoxIdUnused = boxId; + sStorage->scrollUnused2 = (direction <= 0) ? 5 : 0; + sStorage->scrollDirectionUnused = direction; - sPSSData->scrollUnused3 = (direction > 0) ? 264 : 56; - sPSSData->scrollUnused4 = (direction <= 0) ? 5 : 0; - sPSSData->scrollUnused5 = 0; - sPSSData->scrollUnused6 = 2; - sPSSData->scrollToBoxId = boxId; - sPSSData->scrollDirection = direction; - sPSSData->scrollState = 0; + sStorage->scrollUnused3 = (direction > 0) ? 264 : 56; + sStorage->scrollUnused4 = (direction <= 0) ? 5 : 0; + sStorage->scrollUnused5 = 0; + sStorage->scrollUnused6 = 2; + sStorage->scrollToBoxId = boxId; + sStorage->scrollDirection = direction; + sStorage->scrollState = 0; } static bool8 ScrollToBox(void) { bool8 iconsScrolling; - switch (sPSSData->scrollState) + switch (sStorage->scrollState) { case 0: - LoadWallpaperGfx(sPSSData->scrollToBoxId, sPSSData->scrollDirection); - sPSSData->scrollState++; + LoadWallpaperGfx(sStorage->scrollToBoxId, sStorage->scrollDirection); + sStorage->scrollState++; case 1: if (!WaitForWallpaperGfxLoad()) return TRUE; - InitBoxMonIconScroll(sPSSData->scrollToBoxId, sPSSData->scrollDirection); - CreateIncomingBoxTitle(sPSSData->scrollToBoxId, sPSSData->scrollDirection); - StartBoxScrollArrowsSlide(sPSSData->scrollDirection); + InitBoxMonIconScroll(sStorage->scrollToBoxId, sStorage->scrollDirection); + CreateIncomingBoxTitle(sStorage->scrollToBoxId, sStorage->scrollDirection); + StartBoxScrollArrowsSlide(sStorage->scrollDirection); break; case 2: iconsScrolling = UpdateBoxMonIconScroll(); - if (sPSSData->scrollTimer != 0) + if (sStorage->scrollTimer != 0) { - sPSSData->bg2_X += sPSSData->scrollSpeed; - if (--sPSSData->scrollTimer != 0) + sStorage->bg2_X += sStorage->scrollSpeed; + if (--sStorage->scrollTimer != 0) return TRUE; CycleBoxTitleSprites(); StopBoxScrollArrowsSlide(); @@ -5202,7 +5202,7 @@ static bool8 ScrollToBox(void) return iconsScrolling; } - sPSSData->scrollState++; + sStorage->scrollState++; return TRUE; } @@ -5225,36 +5225,36 @@ static void SetWallpaperForCurrentBox(u8 wallpaperId) { u8 boxId = StorageGetCurrentBox(); SetBoxWallpaper(boxId, wallpaperId); - sPSSData->wallpaperChangeState = 0; + sStorage->wallpaperChangeState = 0; } static bool8 DoWallpaperGfxChange(void) { - switch (sPSSData->wallpaperChangeState) + switch (sStorage->wallpaperChangeState) { case 0: - BeginNormalPaletteFade(sPSSData->boxTitlePalBits, 1, 0, 16, RGB_WHITEALPHA); - sPSSData->wallpaperChangeState++; + BeginNormalPaletteFade(sStorage->boxTitlePalBits, 1, 0, 16, RGB_WHITEALPHA); + sStorage->wallpaperChangeState++; break; case 1: if (!UpdatePaletteFade()) { u8 curBox = StorageGetCurrentBox(); LoadWallpaperGfx(curBox, 0); - sPSSData->wallpaperChangeState++; + sStorage->wallpaperChangeState++; } break; case 2: if (WaitForWallpaperGfxLoad() == TRUE) { CycleBoxTitleColor(); - BeginNormalPaletteFade(sPSSData->boxTitlePalBits, 1, 16, 0, RGB_WHITEALPHA); - sPSSData->wallpaperChangeState++; + BeginNormalPaletteFade(sStorage->boxTitlePalBits, 1, 16, 0, RGB_WHITEALPHA); + sStorage->wallpaperChangeState++; } break; case 3: if (!UpdatePaletteFade()) - sPSSData->wallpaperChangeState++; + sStorage->wallpaperChangeState++; break; case 4: return FALSE; @@ -5270,50 +5270,50 @@ static void LoadWallpaperGfx(u8 boxId, s8 direction) void *iconGfx; u32 tilesSize, iconSize; - sPSSData->wallpaperLoadState = 0; - sPSSData->wallpaperLoadBoxId = boxId; - sPSSData->wallpaperLoadDir = direction; - if (sPSSData->wallpaperLoadDir != 0) + sStorage->wallpaperLoadState = 0; + sStorage->wallpaperLoadBoxId = boxId; + sStorage->wallpaperLoadDir = direction; + if (sStorage->wallpaperLoadDir != 0) { - sPSSData->wallpaperOffset = (sPSSData->wallpaperOffset == 0); - TrimOldWallpaper(sPSSData->wallpaperBgTilemapBuffer); + sStorage->wallpaperOffset = (sStorage->wallpaperOffset == 0); + TrimOldWallpaper(sStorage->wallpaperBgTilemapBuffer); } - wallpaperId = GetBoxWallpaper(sPSSData->wallpaperLoadBoxId); + wallpaperId = GetBoxWallpaper(sStorage->wallpaperLoadBoxId); if (wallpaperId != WALLPAPER_FRIENDS) { wallpaper = &sWallpapers[wallpaperId]; - LZ77UnCompWram(wallpaper->tilemap, sPSSData->wallpaperTilemap); - DrawWallpaper(sPSSData->wallpaperTilemap, sPSSData->wallpaperLoadDir, sPSSData->wallpaperOffset); + LZ77UnCompWram(wallpaper->tilemap, sStorage->wallpaperTilemap); + DrawWallpaper(sStorage->wallpaperTilemap, sStorage->wallpaperLoadDir, sStorage->wallpaperOffset); - if (sPSSData->wallpaperLoadDir != 0) - LoadPalette(wallpaper->palettes, (sPSSData->wallpaperOffset * 32) + 0x40, 0x40); + if (sStorage->wallpaperLoadDir != 0) + LoadPalette(wallpaper->palettes, (sStorage->wallpaperOffset * 32) + 0x40, 0x40); else - CpuCopy16(wallpaper->palettes, &gPlttBufferUnfaded[(sPSSData->wallpaperOffset * 32) + 0x40], 0x40); + CpuCopy16(wallpaper->palettes, &gPlttBufferUnfaded[(sStorage->wallpaperOffset * 32) + 0x40], 0x40); - sPSSData->wallpaperTiles = malloc_and_decompress(wallpaper->tiles, &tilesSize); - LoadBgTiles(2, sPSSData->wallpaperTiles, tilesSize, sPSSData->wallpaperOffset << 8); + sStorage->wallpaperTiles = malloc_and_decompress(wallpaper->tiles, &tilesSize); + LoadBgTiles(2, sStorage->wallpaperTiles, tilesSize, sStorage->wallpaperOffset << 8); } else { wallpaper = &sWaldaWallpapers[GetWaldaWallpaperPatternId()]; - LZ77UnCompWram(wallpaper->tilemap, sPSSData->wallpaperTilemap); - DrawWallpaper(sPSSData->wallpaperTilemap, sPSSData->wallpaperLoadDir, sPSSData->wallpaperOffset); + LZ77UnCompWram(wallpaper->tilemap, sStorage->wallpaperTilemap); + DrawWallpaper(sStorage->wallpaperTilemap, sStorage->wallpaperLoadDir, sStorage->wallpaperOffset); - CpuCopy16(wallpaper->palettes, sPSSData->wallpaperTilemap, 0x40); - CpuCopy16(GetWaldaWallpaperColorsPtr(), &sPSSData->wallpaperTilemap[1], 4); - CpuCopy16(GetWaldaWallpaperColorsPtr(), &sPSSData->wallpaperTilemap[17], 4); + CpuCopy16(wallpaper->palettes, sStorage->wallpaperTilemap, 0x40); + CpuCopy16(GetWaldaWallpaperColorsPtr(), &sStorage->wallpaperTilemap[1], 4); + CpuCopy16(GetWaldaWallpaperColorsPtr(), &sStorage->wallpaperTilemap[17], 4); - if (sPSSData->wallpaperLoadDir != 0) - LoadPalette(sPSSData->wallpaperTilemap, (sPSSData->wallpaperOffset * 32) + 0x40, 0x40); + if (sStorage->wallpaperLoadDir != 0) + LoadPalette(sStorage->wallpaperTilemap, (sStorage->wallpaperOffset * 32) + 0x40, 0x40); else - CpuCopy16(sPSSData->wallpaperTilemap, &gPlttBufferUnfaded[(sPSSData->wallpaperOffset * 32) + 0x40], 0x40); + CpuCopy16(sStorage->wallpaperTilemap, &gPlttBufferUnfaded[(sStorage->wallpaperOffset * 32) + 0x40], 0x40); - sPSSData->wallpaperTiles = malloc_and_decompress(wallpaper->tiles, &tilesSize); + sStorage->wallpaperTiles = malloc_and_decompress(wallpaper->tiles, &tilesSize); iconGfx = malloc_and_decompress(sWaldaWallpaperIcons[GetWaldaWallpaperIconId()], &iconSize); - CpuCopy32(iconGfx, sPSSData->wallpaperTiles + 0x800, iconSize); + CpuCopy32(iconGfx, sStorage->wallpaperTiles + 0x800, iconSize); Free(iconGfx); - LoadBgTiles(2, sPSSData->wallpaperTiles, tilesSize, sPSSData->wallpaperOffset << 8); + LoadBgTiles(2, sStorage->wallpaperTiles, tilesSize, sStorage->wallpaperOffset << 8); } CopyBgTilemapBufferToVram(2); @@ -5324,8 +5324,8 @@ static bool32 WaitForWallpaperGfxLoad(void) if (IsDma3ManagerBusyWithBgCopy()) return FALSE; - if (sPSSData->wallpaperTiles != NULL) - FREE_AND_SET_NULL(sPSSData->wallpaperTiles); + if (sStorage->wallpaperTiles != NULL) + FREE_AND_SET_NULL(sStorage->wallpaperTiles); return TRUE; } @@ -5333,7 +5333,7 @@ static bool32 WaitForWallpaperGfxLoad(void) static void DrawWallpaper(const void *tilemap, s8 direction, u8 offset) { s16 var = (offset * 2) + 3; - s16 x = ((sPSSData->bg2_X / 8 + 10) + (direction * 24)) & 0x3F; + s16 x = ((sStorage->bg2_X / 8 + 10) + (direction * 24)) & 0x3F; CopyRectToBgTilemapBufferRect(2, tilemap, 0, 0, 0x14, 0x12, x, 2, 0x14, 0x12, 0x11, offset << 8, var); @@ -5351,7 +5351,7 @@ static void TrimOldWallpaper(void *tilemap) { u16 i; u16 *dest = tilemap; - s16 r3 = ((sPSSData->bg2_X / 8) + 30) & 0x3F; + s16 r3 = ((sStorage->bg2_X / 8) + 30) & 0x3F; if (r3 <= 31) dest += r3 + 0x260; @@ -5375,33 +5375,33 @@ static void InitBoxTitle(u8 boxId) s16 x; u16 i; - struct SpriteSheet spriteSheet = {sPSSData->boxTitleTiles, 0x200, GFXTAG_BOX_TITLE}; + struct SpriteSheet spriteSheet = {sStorage->boxTitleTiles, 0x200, GFXTAG_BOX_TITLE}; struct SpritePalette palettes[] = { - {sPSSData->boxTitlePal, PALTAG_BOX_TITLE}, + {sStorage->boxTitlePal, PALTAG_BOX_TITLE}, {} }; u16 wallpaperId = GetBoxWallpaper(boxId); - sPSSData->boxTitlePal[14] = sBoxTitleColors[wallpaperId][0]; // Shadow color - sPSSData->boxTitlePal[15] = sBoxTitleColors[wallpaperId][1]; // Text Color + sStorage->boxTitlePal[14] = sBoxTitleColors[wallpaperId][0]; // Shadow color + sStorage->boxTitlePal[15] = sBoxTitleColors[wallpaperId][1]; // Text Color LoadSpritePalettes(palettes); - sPSSData->boxTitlePalBits = 0x3f0; + sStorage->boxTitlePalBits = 0x3f0; tagIndex = IndexOfSpritePaletteTag(PALTAG_BOX_TITLE); - sPSSData->boxTitlePalOffset = 0x10e + 16 * tagIndex; - sPSSData->boxTitlePalBits |= 0x10000 << tagIndex; + sStorage->boxTitlePalOffset = 0x10e + 16 * tagIndex; + sStorage->boxTitlePalBits |= 0x10000 << tagIndex; // The below seems intended to have separately tracked // the incoming wallpaper title's palette, but as they now // share a palette tag, all colors (and fields in some cases) // this is redundant along with the use of boxTitleAltPalOffset tagIndex = IndexOfSpritePaletteTag(PALTAG_BOX_TITLE); - sPSSData->boxTitleAltPalOffset = 0x10e + 16 * tagIndex; - sPSSData->boxTitlePalBits |= 0x10000 << tagIndex; + sStorage->boxTitleAltPalOffset = 0x10e + 16 * tagIndex; + sStorage->boxTitlePalBits |= 0x10000 << tagIndex; - StringCopyPadded(sPSSData->boxTitleText, GetBoxNamePtr(boxId), 0, 8); - DrawTextWindowAndBufferTiles(sPSSData->boxTitleText, sPSSData->boxTitleTiles, 0, 0, 2); + StringCopyPadded(sStorage->boxTitleText, GetBoxNamePtr(boxId), 0, 8); + DrawTextWindowAndBufferTiles(sStorage->boxTitleText, sStorage->boxTitleTiles, 0, 0, 2); LoadSpriteSheet(&spriteSheet); x = GetBoxTitleBaseX(GetBoxNamePtr(boxId)); @@ -5409,10 +5409,10 @@ static void InitBoxTitle(u8 boxId) for (i = 0; i < 2; i++) { u8 spriteId = CreateSprite(&sSpriteTemplate_BoxTitle, x + i * 32, 28, 24); - sPSSData->curBoxTitleSprites[i] = &gSprites[spriteId]; - StartSpriteAnim(sPSSData->curBoxTitleSprites[i], i); + sStorage->curBoxTitleSprites[i] = &gSprites[spriteId]; + StartSpriteAnim(sStorage->curBoxTitleSprites[i], i); } - sPSSData->boxTitleCycleId = 0; + sStorage->boxTitleCycleId = 0; } // Sprite data for moving title text @@ -5428,25 +5428,25 @@ static void CreateIncomingBoxTitle(u8 boxId, s8 direction) u16 palOffset; s16 x, adjustedX; u16 i; - struct SpriteSheet spriteSheet = {sPSSData->boxTitleTiles, 0x200, GFXTAG_BOX_TITLE}; + struct SpriteSheet spriteSheet = {sStorage->boxTitleTiles, 0x200, GFXTAG_BOX_TITLE}; struct SpriteTemplate template = sSpriteTemplate_BoxTitle; - sPSSData->boxTitleCycleId = (sPSSData->boxTitleCycleId == 0); - if (sPSSData->boxTitleCycleId == 0) + sStorage->boxTitleCycleId = (sStorage->boxTitleCycleId == 0); + if (sStorage->boxTitleCycleId == 0) { spriteSheet.tag = GFXTAG_BOX_TITLE; - palOffset = sPSSData->boxTitlePalOffset; + palOffset = sStorage->boxTitlePalOffset; } else { spriteSheet.tag = GFXTAG_BOX_TITLE_ALT; - palOffset = sPSSData->boxTitlePalOffset; + palOffset = sStorage->boxTitlePalOffset; template.tileTag = GFXTAG_BOX_TITLE_ALT; template.paletteTag = PALTAG_BOX_TITLE; } - StringCopyPadded(sPSSData->boxTitleText, GetBoxNamePtr(boxId), 0, 8); - DrawTextWindowAndBufferTiles(sPSSData->boxTitleText, sPSSData->boxTitleTiles, 0, 0, 2); + StringCopyPadded(sStorage->boxTitleText, GetBoxNamePtr(boxId), 0, 8); + DrawTextWindowAndBufferTiles(sStorage->boxTitleText, sStorage->boxTitleTiles, 0, 0, 2); LoadSpriteSheet(&spriteSheet); LoadPalette(sBoxTitleColors[GetBoxWallpaper(boxId)], palOffset, sizeof(sBoxTitleColors[0])); x = GetBoxTitleBaseX(GetBoxNamePtr(boxId)); @@ -5458,28 +5458,28 @@ static void CreateIncomingBoxTitle(u8 boxId, s8 direction) { u8 spriteId = CreateSprite(&template, i * 32 + adjustedX, 28, 24); - sPSSData->nextBoxTitleSprites[i] = &gSprites[spriteId]; - sPSSData->nextBoxTitleSprites[i]->sSpeed = (-direction) * 6; - sPSSData->nextBoxTitleSprites[i]->sIncomingX = i * 32 + x; - sPSSData->nextBoxTitleSprites[i]->sIncomingDelay = 0; - sPSSData->nextBoxTitleSprites[i]->callback = SpriteCB_IncomingBoxTitle; - StartSpriteAnim(sPSSData->nextBoxTitleSprites[i], i); + sStorage->nextBoxTitleSprites[i] = &gSprites[spriteId]; + sStorage->nextBoxTitleSprites[i]->sSpeed = (-direction) * 6; + sStorage->nextBoxTitleSprites[i]->sIncomingX = i * 32 + x; + sStorage->nextBoxTitleSprites[i]->sIncomingDelay = 0; + sStorage->nextBoxTitleSprites[i]->callback = SpriteCB_IncomingBoxTitle; + StartSpriteAnim(sStorage->nextBoxTitleSprites[i], i); - sPSSData->curBoxTitleSprites[i]->sSpeed = (-direction) * 6; - sPSSData->curBoxTitleSprites[i]->sOutgoingDelay = 1; - sPSSData->curBoxTitleSprites[i]->callback = SpriteCB_OutgoingBoxTitle; + sStorage->curBoxTitleSprites[i]->sSpeed = (-direction) * 6; + sStorage->curBoxTitleSprites[i]->sOutgoingDelay = 1; + sStorage->curBoxTitleSprites[i]->callback = SpriteCB_OutgoingBoxTitle; } } static void CycleBoxTitleSprites(void) { - if (sPSSData->boxTitleCycleId == 0) + if (sStorage->boxTitleCycleId == 0) FreeSpriteTilesByTag(GFXTAG_BOX_TITLE_ALT); else FreeSpriteTilesByTag(GFXTAG_BOX_TITLE); - sPSSData->curBoxTitleSprites[0] = sPSSData->nextBoxTitleSprites[0]; - sPSSData->curBoxTitleSprites[1] = sPSSData->nextBoxTitleSprites[1]; + sStorage->curBoxTitleSprites[0] = sStorage->nextBoxTitleSprites[0]; + sStorage->curBoxTitleSprites[1] = sStorage->nextBoxTitleSprites[1]; } static void SpriteCB_IncomingBoxTitle(struct Sprite *sprite) @@ -5515,10 +5515,10 @@ static void CycleBoxTitleColor(void) { u8 boxId = StorageGetCurrentBox(); u8 wallpaperId = GetBoxWallpaper(boxId); - if (sPSSData->boxTitleCycleId == 0) - CpuCopy16(sBoxTitleColors[wallpaperId], gPlttBufferUnfaded + sPSSData->boxTitlePalOffset, 4); + if (sStorage->boxTitleCycleId == 0) + CpuCopy16(sBoxTitleColors[wallpaperId], gPlttBufferUnfaded + sStorage->boxTitlePalOffset, 4); else - CpuCopy16(sBoxTitleColors[wallpaperId], gPlttBufferUnfaded + sPSSData->boxTitleAltPalOffset, 4); + CpuCopy16(sBoxTitleColors[wallpaperId], gPlttBufferUnfaded + sStorage->boxTitleAltPalOffset, 4); } static s16 GetBoxTitleBaseX(const u8 *string) @@ -5544,7 +5544,7 @@ static void CreateBoxScrollArrows(void) struct Sprite *sprite = &gSprites[spriteId]; StartSpriteAnim(sprite, i); sprite->sSpeed = (i == 0) ? -1 : 1; - sPSSData->arrowSprites[i] = sprite; + sStorage->arrowSprites[i] = sprite; } } if (IsCursorOnBoxTitle()) @@ -5558,25 +5558,25 @@ static void StartBoxScrollArrowsSlide(s8 direction) for (i = 0; i < 2; i++) { - sPSSData->arrowSprites[i]->pos2.x = 0; - sPSSData->arrowSprites[i]->sState = 2; + sStorage->arrowSprites[i]->pos2.x = 0; + sStorage->arrowSprites[i]->sState = 2; } if (direction < 0) { - sPSSData->arrowSprites[0]->sTimer = 29; - sPSSData->arrowSprites[1]->sTimer = 5; - sPSSData->arrowSprites[0]->data[2] = 72; - sPSSData->arrowSprites[1]->data[2] = 72; + sStorage->arrowSprites[0]->sTimer = 29; + sStorage->arrowSprites[1]->sTimer = 5; + sStorage->arrowSprites[0]->data[2] = 72; + sStorage->arrowSprites[1]->data[2] = 72; } else { - sPSSData->arrowSprites[0]->sTimer = 5; - sPSSData->arrowSprites[1]->sTimer = 29; - sPSSData->arrowSprites[0]->data[2] = DISPLAY_WIDTH + 8; - sPSSData->arrowSprites[1]->data[2] = DISPLAY_WIDTH + 8; + sStorage->arrowSprites[0]->sTimer = 5; + sStorage->arrowSprites[1]->sTimer = 29; + sStorage->arrowSprites[0]->data[2] = DISPLAY_WIDTH + 8; + sStorage->arrowSprites[1]->data[2] = DISPLAY_WIDTH + 8; } - sPSSData->arrowSprites[0]->data[7] = 0; - sPSSData->arrowSprites[1]->data[7] = 1; + sStorage->arrowSprites[0]->data[7] = 0; + sStorage->arrowSprites[1]->data[7] = 1; } // New box's scroll arrows have entered, stop sliding and set their position @@ -5586,9 +5586,9 @@ static void StopBoxScrollArrowsSlide(void) for (i = 0; i < 2; i++) { - sPSSData->arrowSprites[i]->pos1.x = 136 * i + 92; - sPSSData->arrowSprites[i]->pos2.x = 0; - sPSSData->arrowSprites[i]->invisible = FALSE; + sStorage->arrowSprites[i]->pos1.x = 136 * i + 92; + sStorage->arrowSprites[i]->pos2.x = 0; + sStorage->arrowSprites[i]->invisible = FALSE; } AnimateBoxScrollArrows(TRUE); } @@ -5603,17 +5603,17 @@ static void AnimateBoxScrollArrows(bool8 animate) // Start arrows moving for (i = 0; i < 2; i++) { - sPSSData->arrowSprites[i]->sState = 1; - sPSSData->arrowSprites[i]->sTimer = 0; - sPSSData->arrowSprites[i]->data[2] = 0; - sPSSData->arrowSprites[i]->data[4] = 0; + sStorage->arrowSprites[i]->sState = 1; + sStorage->arrowSprites[i]->sTimer = 0; + sStorage->arrowSprites[i]->data[2] = 0; + sStorage->arrowSprites[i]->data[4] = 0; } } else { // Stop arrows moving for (i = 0; i < 2; i++) - sPSSData->arrowSprites[i]->sState = 0; + sStorage->arrowSprites[i]->sState = 0; } } @@ -5640,7 +5640,7 @@ static void SpriteCB_Arrow(struct Sprite *sprite) sprite->sState = 3; break; case 3: - sprite->pos1.x -= sPSSData->scrollSpeed; + sprite->pos1.x -= sStorage->scrollSpeed; if (sprite->pos1.x <= 72 || sprite->pos1.x >= DISPLAY_WIDTH + 8) sprite->invisible = TRUE; if (--sprite->sTimer == 0) @@ -5651,7 +5651,7 @@ static void SpriteCB_Arrow(struct Sprite *sprite) } break; case 4: - sprite->pos1.x -= sPSSData->scrollSpeed; + sprite->pos1.x -= sStorage->scrollSpeed; break; } } @@ -5675,7 +5675,7 @@ static struct Sprite *CreateChooseBoxArrows(u16 x, u16 y, u8 animId, u8 priority static void sub_80CD36C(void) { - if (sPSSData->boxOption != OPTION_DEPOSIT) + if (sStorage->boxOption != OPTION_DEPOSIT) sCursorArea = CURSOR_AREA_IN_BOX; else sCursorArea = CURSOR_AREA_IN_PARTY; @@ -5687,8 +5687,8 @@ static void sub_80CD36C(void) sAutoActionOn = FALSE; ClearSavedCursorPos(); CreateCursorSprites(); - sPSSData->cursorPrevHorizPos = 1; - sPSSData->inBoxMovingMode = MOVE_MODE_NORMAL; + sStorage->cursorPrevHorizPos = 1; + sStorage->inBoxMovingMode = MOVE_MODE_NORMAL; TryRefreshDisplayMon(); } @@ -5696,11 +5696,11 @@ static void sub_80CD3EC(void) { CreateCursorSprites(); ReshowDisplayMon(); - sPSSData->cursorPrevHorizPos = 1; - sPSSData->inBoxMovingMode = MOVE_MODE_NORMAL; + sStorage->cursorPrevHorizPos = 1; + sStorage->inBoxMovingMode = MOVE_MODE_NORMAL; if (sIsMonBeingMoved) { - sPSSData->movingMon = sSavedMovingMon; + sStorage->movingMon = sSavedMovingMon; CreateMovingMonIcon(); } } @@ -5762,58 +5762,58 @@ static bool8 UpdateCursorPos(void) { s16 tmp; - if (sPSSData->cursorMoveSteps == 0) + if (sStorage->cursorMoveSteps == 0) { - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) return FALSE; else return IsItemIconAnimActive(); } - else if (--sPSSData->cursorMoveSteps != 0) + else if (--sStorage->cursorMoveSteps != 0) { // Update position toward target - sPSSData->cursorNewX += sPSSData->cursorSpeedX; - sPSSData->cursorNewY += sPSSData->cursorSpeedY; - sPSSData->cursorSprite->pos1.x = sPSSData->cursorNewX >> 8; - sPSSData->cursorSprite->pos1.y = sPSSData->cursorNewY >> 8; + sStorage->cursorNewX += sStorage->cursorSpeedX; + sStorage->cursorNewY += sStorage->cursorSpeedY; + sStorage->cursorSprite->pos1.x = sStorage->cursorNewX >> 8; + sStorage->cursorSprite->pos1.y = sStorage->cursorNewY >> 8; // Limit cursor on right - if (sPSSData->cursorSprite->pos1.x > DISPLAY_WIDTH + 16) + if (sStorage->cursorSprite->pos1.x > DISPLAY_WIDTH + 16) { - tmp = sPSSData->cursorSprite->pos1.x - (DISPLAY_WIDTH + 16); - sPSSData->cursorSprite->pos1.x = tmp + 64; + tmp = sStorage->cursorSprite->pos1.x - (DISPLAY_WIDTH + 16); + sStorage->cursorSprite->pos1.x = tmp + 64; } // Limit cursor on left - if (sPSSData->cursorSprite->pos1.x < 64) + if (sStorage->cursorSprite->pos1.x < 64) { - tmp = 64 - sPSSData->cursorSprite->pos1.x; - sPSSData->cursorSprite->pos1.x = DISPLAY_WIDTH + 16 - tmp; + tmp = 64 - sStorage->cursorSprite->pos1.x; + sStorage->cursorSprite->pos1.x = DISPLAY_WIDTH + 16 - tmp; } // Limit cursor on bottom - if (sPSSData->cursorSprite->pos1.y > DISPLAY_HEIGHT + 16) + if (sStorage->cursorSprite->pos1.y > DISPLAY_HEIGHT + 16) { - tmp = sPSSData->cursorSprite->pos1.y - (DISPLAY_HEIGHT + 16); - sPSSData->cursorSprite->pos1.y = tmp - 16; + tmp = sStorage->cursorSprite->pos1.y - (DISPLAY_HEIGHT + 16); + sStorage->cursorSprite->pos1.y = tmp - 16; } // Limit cursor on top - if (sPSSData->cursorSprite->pos1.y < -16) + if (sStorage->cursorSprite->pos1.y < -16) { - tmp = -16 - sPSSData->cursorSprite->pos1.y; - sPSSData->cursorSprite->pos1.y = DISPLAY_HEIGHT + 16 - tmp; + tmp = -16 - sStorage->cursorSprite->pos1.y; + sStorage->cursorSprite->pos1.y = DISPLAY_HEIGHT + 16 - tmp; } // Cursor flips vertically when moving on/off the top buttons - if (sPSSData->cursorFlipTimer && --sPSSData->cursorFlipTimer == 0) - sPSSData->cursorSprite->vFlip = (sPSSData->cursorSprite->vFlip == FALSE); + if (sStorage->cursorFlipTimer && --sStorage->cursorFlipTimer == 0) + sStorage->cursorSprite->vFlip = (sStorage->cursorSprite->vFlip == FALSE); } else { // Time is up for cursor movement, make sure it's exactly at target - sPSSData->cursorSprite->pos1.x = sPSSData->cursorTargetX; - sPSSData->cursorSprite->pos1.y = sPSSData->cursorTargetY; + sStorage->cursorSprite->pos1.x = sStorage->cursorTargetX; + sStorage->cursorSprite->pos1.y = sStorage->cursorTargetY; DoCursorNewPosUpdate(); } @@ -5825,74 +5825,74 @@ static void InitNewCursorPos(u8 newCursorArea, u8 newCursorPosition) u16 x, y; GetCursorCoordsByPos(newCursorArea, newCursorPosition, &x, &y); - sPSSData->newCursorArea = newCursorArea; - sPSSData->newCursorPosition = newCursorPosition; - sPSSData->cursorTargetX = x; - sPSSData->cursorTargetY = y; + sStorage->newCursorArea = newCursorArea; + sStorage->newCursorPosition = newCursorPosition; + sStorage->cursorTargetX = x; + sStorage->cursorTargetY = y; } static void InitCursorMove(void) { int yDistance, xDistance; - if (sPSSData->cursorVerticalWrap != 0 || sPSSData->cursorHorizontalWrap != 0) - sPSSData->cursorMoveSteps = 12; + if (sStorage->cursorVerticalWrap != 0 || sStorage->cursorHorizontalWrap != 0) + sStorage->cursorMoveSteps = 12; else - sPSSData->cursorMoveSteps = 6; + sStorage->cursorMoveSteps = 6; - if (sPSSData->cursorFlipTimer) - sPSSData->cursorFlipTimer = sPSSData->cursorMoveSteps >> 1; + if (sStorage->cursorFlipTimer) + sStorage->cursorFlipTimer = sStorage->cursorMoveSteps >> 1; - switch (sPSSData->cursorVerticalWrap) + switch (sStorage->cursorVerticalWrap) { default: // No wrap - yDistance = sPSSData->cursorTargetY - sPSSData->cursorSprite->pos1.y; + yDistance = sStorage->cursorTargetY - sStorage->cursorSprite->pos1.y; break; case -1: // Wrap from top to bottom - yDistance = sPSSData->cursorTargetY - 192 - sPSSData->cursorSprite->pos1.y; + yDistance = sStorage->cursorTargetY - 192 - sStorage->cursorSprite->pos1.y; break; case 1: // Wrap from bottom to top - yDistance = sPSSData->cursorTargetY + 192 - sPSSData->cursorSprite->pos1.y; + yDistance = sStorage->cursorTargetY + 192 - sStorage->cursorSprite->pos1.y; break; } - switch (sPSSData->cursorHorizontalWrap) + switch (sStorage->cursorHorizontalWrap) { default: // No Wrap - xDistance = sPSSData->cursorTargetX - sPSSData->cursorSprite->pos1.x; + xDistance = sStorage->cursorTargetX - sStorage->cursorSprite->pos1.x; break; case -1: // Wrap from left to right - xDistance = sPSSData->cursorTargetX - 192 - sPSSData->cursorSprite->pos1.x; + xDistance = sStorage->cursorTargetX - 192 - sStorage->cursorSprite->pos1.x; break; case 1: // Wrap from right to left - xDistance = sPSSData->cursorTargetX + 192 - sPSSData->cursorSprite->pos1.x; + xDistance = sStorage->cursorTargetX + 192 - sStorage->cursorSprite->pos1.x; break; } yDistance <<= 8; xDistance <<= 8; - sPSSData->cursorSpeedX = xDistance / sPSSData->cursorMoveSteps; - sPSSData->cursorSpeedY = yDistance / sPSSData->cursorMoveSteps; - sPSSData->cursorNewX = sPSSData->cursorSprite->pos1.x << 8; - sPSSData->cursorNewY = sPSSData->cursorSprite->pos1.y << 8; + sStorage->cursorSpeedX = xDistance / sStorage->cursorMoveSteps; + sStorage->cursorSpeedY = yDistance / sStorage->cursorMoveSteps; + sStorage->cursorNewX = sStorage->cursorSprite->pos1.x << 8; + sStorage->cursorNewY = sStorage->cursorSprite->pos1.y << 8; } static void SetCursorPosition(u8 newCursorArea, u8 newCursorPosition) { InitNewCursorPos(newCursorArea, newCursorPosition); InitCursorMove(); - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) { - if (sPSSData->inBoxMovingMode == MOVE_MODE_NORMAL && !sIsMonBeingMoved) - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_STILL); + if (sStorage->inBoxMovingMode == MOVE_MODE_NORMAL && !sIsMonBeingMoved) + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_STILL); } else { if (!IsMovingItem()) - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_STILL); + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_STILL); } - if (sPSSData->boxOption == OPTION_MOVE_ITEMS) + if (sStorage->boxOption == OPTION_MOVE_ITEMS) { if (sCursorArea == CURSOR_AREA_IN_BOX) TryHideItemIconAtPos(CURSOR_AREA_IN_BOX, sCursorPosition); @@ -5907,8 +5907,8 @@ static void SetCursorPosition(u8 newCursorArea, u8 newCursorPosition) if (newCursorArea == CURSOR_AREA_IN_PARTY && sCursorArea != CURSOR_AREA_IN_PARTY) { - sPSSData->cursorPrevHorizPos = 1; - sPSSData->cursorShadowSprite->invisible = TRUE; + sStorage->cursorPrevHorizPos = 1; + sStorage->cursorShadowSprite->invisible = TRUE; } switch (newCursorArea) @@ -5916,19 +5916,19 @@ static void SetCursorPosition(u8 newCursorArea, u8 newCursorPosition) case CURSOR_AREA_IN_PARTY: case CURSOR_AREA_BOX_TITLE: case CURSOR_AREA_BUTTONS: - sPSSData->cursorSprite->oam.priority = 1; - sPSSData->cursorShadowSprite->invisible = TRUE; - sPSSData->cursorShadowSprite->oam.priority = 1; + sStorage->cursorSprite->oam.priority = 1; + sStorage->cursorShadowSprite->invisible = TRUE; + sStorage->cursorShadowSprite->oam.priority = 1; break; case CURSOR_AREA_IN_BOX: - if (sPSSData->inBoxMovingMode != MOVE_MODE_NORMAL) + if (sStorage->inBoxMovingMode != MOVE_MODE_NORMAL) { - sPSSData->cursorSprite->oam.priority = 0; - sPSSData->cursorShadowSprite->invisible = TRUE; + sStorage->cursorSprite->oam.priority = 0; + sStorage->cursorShadowSprite->invisible = TRUE; } else { - sPSSData->cursorSprite->oam.priority = 2; + sStorage->cursorSprite->oam.priority = 2; if (sCursorArea == CURSOR_AREA_IN_BOX && sIsMonBeingMoved) SetMovingMonPriority(2); } @@ -5938,17 +5938,17 @@ static void SetCursorPosition(u8 newCursorArea, u8 newCursorPosition) static void DoCursorNewPosUpdate(void) { - sCursorArea = sPSSData->newCursorArea; - sCursorPosition = sPSSData->newCursorPosition; - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + sCursorArea = sStorage->newCursorArea; + sCursorPosition = sStorage->newCursorPosition; + if (sStorage->boxOption != OPTION_MOVE_ITEMS) { - if (sPSSData->inBoxMovingMode == MOVE_MODE_NORMAL && !sIsMonBeingMoved) - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); + if (sStorage->inBoxMovingMode == MOVE_MODE_NORMAL && !sIsMonBeingMoved) + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_BOUNCE); } else { if (!IsMovingItem()) - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_BOUNCE); } TryRefreshDisplayMon(); @@ -5961,16 +5961,16 @@ static void DoCursorNewPosUpdate(void) AnimateBoxScrollArrows(TRUE); break; case CURSOR_AREA_IN_PARTY: - sPSSData->cursorShadowSprite->subpriority = 13; + sStorage->cursorShadowSprite->subpriority = 13; SetMovingMonPriority(1); break; case CURSOR_AREA_IN_BOX: - if (sPSSData->inBoxMovingMode == MOVE_MODE_NORMAL) + if (sStorage->inBoxMovingMode == MOVE_MODE_NORMAL) { - sPSSData->cursorSprite->oam.priority = 1; - sPSSData->cursorShadowSprite->oam.priority = 2; - sPSSData->cursorShadowSprite->subpriority = 21; - sPSSData->cursorShadowSprite->invisible = FALSE; + sStorage->cursorSprite->oam.priority = 1; + sStorage->cursorShadowSprite->oam.priority = 2; + sStorage->cursorShadowSprite->subpriority = 21; + sStorage->cursorShadowSprite->invisible = FALSE; SetMovingMonPriority(2); } break; @@ -5991,8 +5991,8 @@ static void SetCursorInParty(void) if (partyCount >= PARTY_SIZE) partyCount = PARTY_SIZE - 1; } - if (sPSSData->cursorSprite->vFlip) - sPSSData->cursorFlipTimer = 1; + if (sStorage->cursorSprite->vFlip) + sStorage->cursorFlipTimer = 1; SetCursorPosition(CURSOR_AREA_IN_PARTY, partyCount); } @@ -6027,8 +6027,8 @@ static void InitMonPlaceChange(u8 type) [CHANGE_SHIFT] = MonPlaceChange_Shift, }; - sPSSData->monPlaceChangeFunc = placeChangeFuncs[type]; - sPSSData->monPlaceChangeState = 0; + sStorage->monPlaceChangeFunc = placeChangeFuncs[type]; + sStorage->monPlaceChangeState = 0; } // No Shift while moving multiple Pokémon, only grab and place @@ -6036,39 +6036,39 @@ static void InitMonPlaceChange(u8 type) static void InitMultiMonPlaceChange(bool8 up) { if (!up) - sPSSData->monPlaceChangeFunc = MultiMonPlaceChange_Down; + sStorage->monPlaceChangeFunc = MultiMonPlaceChange_Down; else - sPSSData->monPlaceChangeFunc = MultiMonPlaceChange_Up; + sStorage->monPlaceChangeFunc = MultiMonPlaceChange_Up; - sPSSData->monPlaceChangeState = 0; + sStorage->monPlaceChangeState = 0; } static bool8 DoMonPlaceChange(void) { - return sPSSData->monPlaceChangeFunc(); + return sStorage->monPlaceChangeFunc(); } static bool8 MonPlaceChange_Grab(void) { - switch (sPSSData->monPlaceChangeState) + switch (sStorage->monPlaceChangeState) { case 0: if (sIsMonBeingMoved) return FALSE; - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_OPEN); - sPSSData->monPlaceChangeState++; + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_OPEN); + sStorage->monPlaceChangeState++; break; case 1: if (!MonPlaceChange_CursorDown()) { - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_FIST); + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_FIST); MoveMon(); - sPSSData->monPlaceChangeState++; + sStorage->monPlaceChangeState++; } break; case 2: if (!MonPlaceChange_CursorUp()) - sPSSData->monPlaceChangeState++; + sStorage->monPlaceChangeState++; break; case 3: return FALSE; @@ -6079,21 +6079,21 @@ static bool8 MonPlaceChange_Grab(void) static bool8 MonPlaceChange_Place(void) { - switch (sPSSData->monPlaceChangeState) + switch (sStorage->monPlaceChangeState) { case 0: if (!MonPlaceChange_CursorDown()) { - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_OPEN); + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_OPEN); PlaceMon(); - sPSSData->monPlaceChangeState++; + sStorage->monPlaceChangeState++; } break; case 1: if (!MonPlaceChange_CursorUp()) { - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); - sPSSData->monPlaceChangeState++; + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_BOUNCE); + sStorage->monPlaceChangeState++; } break; case 2: @@ -6105,30 +6105,30 @@ static bool8 MonPlaceChange_Place(void) static bool8 MonPlaceChange_Shift(void) { - switch (sPSSData->monPlaceChangeState) + switch (sStorage->monPlaceChangeState) { case 0: switch (sCursorArea) { case CURSOR_AREA_IN_PARTY: - sPSSData->field_D91 = TOTAL_BOXES_COUNT; + sStorage->field_D91 = TOTAL_BOXES_COUNT; break; case CURSOR_AREA_IN_BOX: - sPSSData->field_D91 = StorageGetCurrentBox(); + sStorage->field_D91 = StorageGetCurrentBox(); break; default: return FALSE; } - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_OPEN); - sub_80CBD5C(sPSSData->field_D91, sCursorPosition); - sPSSData->monPlaceChangeState++; + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_OPEN); + sub_80CBD5C(sStorage->field_D91, sCursorPosition); + sStorage->monPlaceChangeState++; break; case 1: if (!sub_80CBDC4()) { - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_FIST); - SetShiftedMonData(sPSSData->field_D91, sCursorPosition); - sPSSData->monPlaceChangeState++; + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_FIST); + SetShiftedMonData(sStorage->field_D91, sCursorPosition); + sStorage->monPlaceChangeState++; } break; case 2: @@ -6150,13 +6150,13 @@ static bool8 MultiMonPlaceChange_Up(void) static bool8 MonPlaceChange_CursorDown(void) { - switch (sPSSData->cursorSprite->pos2.y) + switch (sStorage->cursorSprite->pos2.y) { default: - sPSSData->cursorSprite->pos2.y++; + sStorage->cursorSprite->pos2.y++; break; case 0: - sPSSData->cursorSprite->pos2.y++; + sStorage->cursorSprite->pos2.y++; break; case 8: // Cursor has reached bottom return FALSE; @@ -6167,12 +6167,12 @@ static bool8 MonPlaceChange_CursorDown(void) static bool8 MonPlaceChange_CursorUp(void) { - switch (sPSSData->cursorSprite->pos2.y) + switch (sStorage->cursorSprite->pos2.y) { case 0: // Cursor has reached top return FALSE; default: - sPSSData->cursorSprite->pos2.y--; + sStorage->cursorSprite->pos2.y--; break; } @@ -6188,7 +6188,7 @@ static void MoveMon(void) SetMovingMonSprite(MODE_PARTY, sCursorPosition); break; case CURSOR_AREA_IN_BOX: - if (sPSSData->inBoxMovingMode == MOVE_MODE_NORMAL) + if (sStorage->inBoxMovingMode == MOVE_MODE_NORMAL) { SetMovingMonData(StorageGetCurrentBox(), sCursorPosition); SetMovingMonSprite(MODE_BOX, sCursorPosition); @@ -6231,9 +6231,9 @@ static void RefreshDisplayMon(void) static void SetMovingMonData(u8 boxId, u8 position) { if (boxId == TOTAL_BOXES_COUNT) - sPSSData->movingMon = gPlayerParty[sCursorPosition]; + sStorage->movingMon = gPlayerParty[sCursorPosition]; else - BoxMonAtToMon(boxId, position, &sPSSData->movingMon); + BoxMonAtToMon(boxId, position, &sStorage->movingMon); PurgeMonOrBoxMon(boxId, position); sMovingMonOrigBoxId = boxId; @@ -6244,12 +6244,12 @@ static void SetPlacedMonData(u8 boxId, u8 position) { if (boxId == TOTAL_BOXES_COUNT) { - gPlayerParty[position] = sPSSData->movingMon; + gPlayerParty[position] = sStorage->movingMon; } else { - BoxMonRestorePP(&sPSSData->movingMon.box); - SetBoxMonAt(boxId, position, &sPSSData->movingMon.box); + BoxMonRestorePP(&sStorage->movingMon.box); + SetBoxMonAt(boxId, position, &sStorage->movingMon.box); } } @@ -6264,13 +6264,13 @@ static void PurgeMonOrBoxMon(u8 boxId, u8 position) static void SetShiftedMonData(u8 boxId, u8 position) { if (boxId == TOTAL_BOXES_COUNT) - sPSSData->tempMon = gPlayerParty[position]; + sStorage->tempMon = gPlayerParty[position]; else - BoxMonAtToMon(boxId, position, &sPSSData->tempMon); + BoxMonAtToMon(boxId, position, &sStorage->tempMon); SetPlacedMonData(boxId, position); - sPSSData->movingMon = sPSSData->tempMon; - SetDisplayMonData(&sPSSData->movingMon, MODE_PARTY); + sStorage->movingMon = sStorage->tempMon; + SetDisplayMonData(&sStorage->movingMon, MODE_PARTY); sMovingMonOrigBoxId = boxId; sMovingMonOrigBoxPos = position; } @@ -6297,13 +6297,13 @@ static bool8 TryStorePartyMonInBox(u8 boxId) if (boxId == StorageGetCurrentBox()) CreateBoxMonIconAtPos(boxPosition); - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_STILL); + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_STILL); return TRUE; } static void sub_80CE22C(void) { - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_BOUNCE); TryRefreshDisplayMon(); } @@ -6319,14 +6319,14 @@ static void InitReleaseMon(void) mode = MODE_BOX; SetReleaseMon(mode, sCursorPosition); - StringCopy(sPSSData->releaseMonName, sPSSData->displayMonName); + StringCopy(sStorage->releaseMonName, sStorage->displayMonName); } static bool8 TryHideReleaseMon(void) { if (!TryHideReleaseMonSprite()) { - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_BOUNCE); + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_BOUNCE); return FALSE; } else @@ -6359,7 +6359,7 @@ static void ReleaseMon(void) static void TrySetCursorFistAnim(void) { if (sIsMonBeingMoved) - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_FIST); + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_FIST); } // If the player is on the listed map (or any map, if none is specified), @@ -6404,48 +6404,48 @@ static void InitCanReleaseMonVars(void) { // The player only has 1 or 2 usable // Pokémon, this one can't be released - sPSSData->releaseStatusResolved = TRUE; - sPSSData->canReleaseMon = FALSE; + sStorage->releaseStatusResolved = TRUE; + sStorage->canReleaseMon = FALSE; return; } if (sIsMonBeingMoved) { - sPSSData->tempMon = sPSSData->movingMon; - sPSSData->releaseBoxId = -1; - sPSSData->releaseBoxPos = -1; + sStorage->tempMon = sStorage->movingMon; + sStorage->releaseBoxId = -1; + sStorage->releaseBoxPos = -1; } else { if (sCursorArea == CURSOR_AREA_IN_PARTY) { - sPSSData->tempMon = gPlayerParty[sCursorPosition]; - sPSSData->releaseBoxId = TOTAL_BOXES_COUNT; + sStorage->tempMon = gPlayerParty[sCursorPosition]; + sStorage->releaseBoxId = TOTAL_BOXES_COUNT; } else { - BoxMonAtToMon(StorageGetCurrentBox(), sCursorPosition, &sPSSData->tempMon); - sPSSData->releaseBoxId = StorageGetCurrentBox(); + BoxMonAtToMon(StorageGetCurrentBox(), sCursorPosition, &sStorage->tempMon); + sStorage->releaseBoxId = StorageGetCurrentBox(); } - sPSSData->releaseBoxPos = sCursorPosition; + sStorage->releaseBoxPos = sCursorPosition; } - GetRestrictedReleaseMoves(sPSSData->restrictedMoveList); - sPSSData->restrictedReleaseMonMoves = GetMonData(&sPSSData->tempMon, MON_DATA_KNOWN_MOVES, (u8*)sPSSData->restrictedMoveList); - if (sPSSData->restrictedReleaseMonMoves != 0) + GetRestrictedReleaseMoves(sStorage->restrictedMoveList); + sStorage->restrictedReleaseMonMoves = GetMonData(&sStorage->tempMon, MON_DATA_KNOWN_MOVES, (u8*)sStorage->restrictedMoveList); + if (sStorage->restrictedReleaseMonMoves != 0) { // Pokémon knows at least one restricted release move // Need to check if another Pokémon has this move first - sPSSData->releaseStatusResolved = FALSE; + sStorage->releaseStatusResolved = FALSE; } else { // Pokémon knows no restricted moves, can be released - sPSSData->releaseStatusResolved = TRUE; - sPSSData->canReleaseMon = TRUE; + sStorage->releaseStatusResolved = TRUE; + sStorage->canReleaseMon = TRUE; } - sPSSData->releaseCheckState = 0; + sStorage->releaseCheckState = 0; } static bool32 AtLeastThreeUsableMons(void) @@ -6484,10 +6484,10 @@ static s8 RunCanReleaseMon(void) u16 i; u16 knownMoves; - if (sPSSData->releaseStatusResolved) - return sPSSData->canReleaseMon; + if (sStorage->releaseStatusResolved) + return sStorage->canReleaseMon; - switch (sPSSData->releaseCheckState) + switch (sStorage->releaseCheckState) { case 0: // Check party for other Pokémon that know any restricted @@ -6495,26 +6495,26 @@ static s8 RunCanReleaseMon(void) for (i = 0; i < PARTY_SIZE; i++) { // Make sure party Pokémon isn't the one we're releasing first - if (sPSSData->releaseBoxId != TOTAL_BOXES_COUNT || sPSSData->releaseBoxPos != i) + if (sStorage->releaseBoxId != TOTAL_BOXES_COUNT || sStorage->releaseBoxPos != i) { - knownMoves = GetMonData(&gPlayerParty[i], MON_DATA_KNOWN_MOVES, (u8*)sPSSData->restrictedMoveList); - sPSSData->restrictedReleaseMonMoves &= ~(knownMoves); + knownMoves = GetMonData(&gPlayerParty[i], MON_DATA_KNOWN_MOVES, (u8*)sStorage->restrictedMoveList); + sStorage->restrictedReleaseMonMoves &= ~(knownMoves); } } - if (sPSSData->restrictedReleaseMonMoves == 0) + if (sStorage->restrictedReleaseMonMoves == 0) { // No restricted moves on release Pokémon that // aren't resolved by the party, it can be released. - sPSSData->releaseStatusResolved = TRUE; - sPSSData->canReleaseMon = TRUE; + sStorage->releaseStatusResolved = TRUE; + sStorage->canReleaseMon = TRUE; } else { // Release Pokémon has restricted moves not resolved by the party. // Continue and check the PC next - sPSSData->releaseCheckBoxId = 0; - sPSSData->releaseCheckBoxPos = 0; - sPSSData->releaseCheckState++; + sStorage->releaseCheckBoxId = 0; + sStorage->releaseCheckBoxPos = 0; + sStorage->releaseCheckState++; } break; case 1: @@ -6522,31 +6522,31 @@ static s8 RunCanReleaseMon(void) // moves the release Pokémon knows for (i = 0; i < IN_BOX_COUNT; i++) { - knownMoves = GetAndCopyBoxMonDataAt(sPSSData->releaseCheckBoxId, sPSSData->releaseCheckBoxPos, MON_DATA_KNOWN_MOVES, (u8*)sPSSData->restrictedMoveList); - if (knownMoves != 0 && !(sPSSData->releaseBoxId == sPSSData->releaseCheckBoxId - && sPSSData->releaseBoxPos == sPSSData->releaseCheckBoxPos)) + knownMoves = GetAndCopyBoxMonDataAt(sStorage->releaseCheckBoxId, sStorage->releaseCheckBoxPos, MON_DATA_KNOWN_MOVES, (u8*)sStorage->restrictedMoveList); + if (knownMoves != 0 && !(sStorage->releaseBoxId == sStorage->releaseCheckBoxId + && sStorage->releaseBoxPos == sStorage->releaseCheckBoxPos)) { // Found PC Pokémon with restricted move, clear move from list - sPSSData->restrictedReleaseMonMoves &= ~(knownMoves); - if (sPSSData->restrictedReleaseMonMoves == 0) + sStorage->restrictedReleaseMonMoves &= ~(knownMoves); + if (sStorage->restrictedReleaseMonMoves == 0) { // No restricted moves on release Pokémon that // aren't resolved, it can be released. - sPSSData->releaseStatusResolved = TRUE; - sPSSData->canReleaseMon = TRUE; + sStorage->releaseStatusResolved = TRUE; + sStorage->canReleaseMon = TRUE; break; } } - if (++sPSSData->releaseCheckBoxPos >= IN_BOX_COUNT) + if (++sStorage->releaseCheckBoxPos >= IN_BOX_COUNT) { - sPSSData->releaseCheckBoxPos = 0; - if (++sPSSData->releaseCheckBoxId >= TOTAL_BOXES_COUNT) + sStorage->releaseCheckBoxPos = 0; + if (++sStorage->releaseCheckBoxId >= TOTAL_BOXES_COUNT) { // Checked every Pokémon in the PC, release Pokémon is // the sole owner of at least one restricted move. // It cannot be released. - sPSSData->releaseStatusResolved = TRUE; - sPSSData->canReleaseMon = FALSE; + sStorage->releaseStatusResolved = TRUE; + sStorage->canReleaseMon = FALSE; } } } @@ -6559,7 +6559,7 @@ static s8 RunCanReleaseMon(void) static void SaveMovingMon(void) { if (sIsMonBeingMoved) - sSavedMovingMon = sPSSData->movingMon; + sSavedMovingMon = sStorage->movingMon; } static void LoadSavedMovingMon(void) @@ -6569,9 +6569,9 @@ static void LoadSavedMovingMon(void) // If it came from the party load a struct Pokemon, // otherwise load a BoxPokemon if (sMovingMonOrigBoxId == TOTAL_BOXES_COUNT) - sPSSData->movingMon = sSavedMovingMon; + sStorage->movingMon = sSavedMovingMon; else - sPSSData->movingMon.box = sSavedMovingMon.box; + sStorage->movingMon.box = sSavedMovingMon.box; } } @@ -6580,24 +6580,24 @@ static void InitSummaryScreenData(void) if (sIsMonBeingMoved) { SaveMovingMon(); - sPSSData->summaryMon.mon = &sSavedMovingMon; - sPSSData->summaryStartPos = 0; - sPSSData->summaryMaxPos = 0; - sPSSData->summaryScreenMode = SUMMARY_MODE_NORMAL; + sStorage->summaryMon.mon = &sSavedMovingMon; + sStorage->summaryStartPos = 0; + sStorage->summaryMaxPos = 0; + sStorage->summaryScreenMode = SUMMARY_MODE_NORMAL; } else if (sCursorArea == CURSOR_AREA_IN_PARTY) { - sPSSData->summaryMon.mon = gPlayerParty; - sPSSData->summaryStartPos = sCursorPosition; - sPSSData->summaryMaxPos = CountPartyMons() - 1; - sPSSData->summaryScreenMode = SUMMARY_MODE_NORMAL; + sStorage->summaryMon.mon = gPlayerParty; + sStorage->summaryStartPos = sCursorPosition; + sStorage->summaryMaxPos = CountPartyMons() - 1; + sStorage->summaryScreenMode = SUMMARY_MODE_NORMAL; } else { - sPSSData->summaryMon.box = GetBoxedMonPtr(StorageGetCurrentBox(), 0); - sPSSData->summaryStartPos = sCursorPosition; - sPSSData->summaryMaxPos = IN_BOX_COUNT - 1; - sPSSData->summaryScreenMode = SUMMARY_MODE_BOX; + sStorage->summaryMon.box = GetBoxedMonPtr(StorageGetCurrentBox(), 0); + sStorage->summaryStartPos = sCursorPosition; + sStorage->summaryMaxPos = IN_BOX_COUNT - 1; + sStorage->summaryScreenMode = SUMMARY_MODE_BOX; } } @@ -6636,10 +6636,10 @@ s16 CompactPartySlots(void) static void SetMonMarkings(u8 markings) { - sPSSData->displayMonMarkings = markings; + sStorage->displayMonMarkings = markings; if (sIsMonBeingMoved) { - SetMonData(&sPSSData->movingMon, MON_DATA_MARKINGS, &markings); + SetMonData(&sStorage->movingMon, MON_DATA_MARKINGS, &markings); } else { @@ -6664,7 +6664,7 @@ static bool8 CanShiftMon(void) { if (sCursorArea == CURSOR_AREA_IN_PARTY && CountPartyAliveNonEggMonsExcept(sCursorPosition) == 0) { - if (sPSSData->displayMonIsEgg || GetMonData(&sPSSData->movingMon, MON_DATA_HP) == 0) + if (sStorage->displayMonIsEgg || GetMonData(&sStorage->movingMon, MON_DATA_HP) == 0) return FALSE; } return TRUE; @@ -6697,7 +6697,7 @@ static void TryRefreshDisplayMon(void) // If a Pokémon is currently being moved, don't start // mosaic or update display. Keep displaying the // currently held Pokémon. - sPSSData->setMosaic = (sIsMonBeingMoved == FALSE); + sStorage->setMosaic = (sIsMonBeingMoved == FALSE); if (!sIsMonBeingMoved) { // Update display Pokémon @@ -6735,94 +6735,94 @@ static void SetDisplayMonData(void *pokemon, u8 mode) u16 gender; bool8 sanityIsBadEgg; - sPSSData->displayMonItemId = ITEM_NONE; + sStorage->displayMonItemId = ITEM_NONE; gender = MON_MALE; sanityIsBadEgg = FALSE; if (mode == MODE_PARTY) { struct Pokemon *mon = (struct Pokemon *)pokemon; - sPSSData->displayMonSpecies = GetMonData(mon, MON_DATA_SPECIES2); - if (sPSSData->displayMonSpecies != SPECIES_NONE) + sStorage->displayMonSpecies = GetMonData(mon, MON_DATA_SPECIES2); + if (sStorage->displayMonSpecies != SPECIES_NONE) { sanityIsBadEgg = GetMonData(mon, MON_DATA_SANITY_IS_BAD_EGG); if (sanityIsBadEgg) - sPSSData->displayMonIsEgg = TRUE; + sStorage->displayMonIsEgg = TRUE; else - sPSSData->displayMonIsEgg = GetMonData(mon, MON_DATA_IS_EGG); + sStorage->displayMonIsEgg = GetMonData(mon, MON_DATA_IS_EGG); - GetMonData(mon, MON_DATA_NICKNAME, sPSSData->displayMonName); - StringGetEnd10(sPSSData->displayMonName); - sPSSData->displayMonLevel = GetMonData(mon, MON_DATA_LEVEL); - sPSSData->displayMonMarkings = GetMonData(mon, MON_DATA_MARKINGS); - sPSSData->displayMonPersonality = GetMonData(mon, MON_DATA_PERSONALITY); - sPSSData->displayMonPalette = GetMonFrontSpritePal(mon); + GetMonData(mon, MON_DATA_NICKNAME, sStorage->displayMonName); + StringGetEnd10(sStorage->displayMonName); + sStorage->displayMonLevel = GetMonData(mon, MON_DATA_LEVEL); + sStorage->displayMonMarkings = GetMonData(mon, MON_DATA_MARKINGS); + sStorage->displayMonPersonality = GetMonData(mon, MON_DATA_PERSONALITY); + sStorage->displayMonPalette = GetMonFrontSpritePal(mon); gender = GetMonGender(mon); - sPSSData->displayMonItemId = GetMonData(mon, MON_DATA_HELD_ITEM); + sStorage->displayMonItemId = GetMonData(mon, MON_DATA_HELD_ITEM); } } else if (mode == MODE_BOX) { struct BoxPokemon *boxMon = (struct BoxPokemon *)pokemon; - sPSSData->displayMonSpecies = GetBoxMonData(pokemon, MON_DATA_SPECIES2); - if (sPSSData->displayMonSpecies != SPECIES_NONE) + sStorage->displayMonSpecies = GetBoxMonData(pokemon, MON_DATA_SPECIES2); + if (sStorage->displayMonSpecies != SPECIES_NONE) { u32 otId = GetBoxMonData(boxMon, MON_DATA_OT_ID); sanityIsBadEgg = GetBoxMonData(boxMon, MON_DATA_SANITY_IS_BAD_EGG); if (sanityIsBadEgg) - sPSSData->displayMonIsEgg = TRUE; + sStorage->displayMonIsEgg = TRUE; else - sPSSData->displayMonIsEgg = GetBoxMonData(boxMon, MON_DATA_IS_EGG); + sStorage->displayMonIsEgg = GetBoxMonData(boxMon, MON_DATA_IS_EGG); - GetBoxMonData(boxMon, MON_DATA_NICKNAME, sPSSData->displayMonName); - StringGetEnd10(sPSSData->displayMonName); - sPSSData->displayMonLevel = GetLevelFromBoxMonExp(boxMon); - sPSSData->displayMonMarkings = GetBoxMonData(boxMon, MON_DATA_MARKINGS); - sPSSData->displayMonPersonality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY); - sPSSData->displayMonPalette = GetMonSpritePalFromSpeciesAndPersonality(sPSSData->displayMonSpecies, otId, sPSSData->displayMonPersonality); - gender = GetGenderFromSpeciesAndPersonality(sPSSData->displayMonSpecies, sPSSData->displayMonPersonality); - sPSSData->displayMonItemId = GetBoxMonData(boxMon, MON_DATA_HELD_ITEM); + GetBoxMonData(boxMon, MON_DATA_NICKNAME, sStorage->displayMonName); + StringGetEnd10(sStorage->displayMonName); + sStorage->displayMonLevel = GetLevelFromBoxMonExp(boxMon); + sStorage->displayMonMarkings = GetBoxMonData(boxMon, MON_DATA_MARKINGS); + sStorage->displayMonPersonality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY); + sStorage->displayMonPalette = GetMonSpritePalFromSpeciesAndPersonality(sStorage->displayMonSpecies, otId, sStorage->displayMonPersonality); + gender = GetGenderFromSpeciesAndPersonality(sStorage->displayMonSpecies, sStorage->displayMonPersonality); + sStorage->displayMonItemId = GetBoxMonData(boxMon, MON_DATA_HELD_ITEM); } } else { - sPSSData->displayMonSpecies = SPECIES_NONE; - sPSSData->displayMonItemId = ITEM_NONE; + sStorage->displayMonSpecies = SPECIES_NONE; + sStorage->displayMonItemId = ITEM_NONE; } - if (sPSSData->displayMonSpecies == SPECIES_NONE) + if (sStorage->displayMonSpecies == SPECIES_NONE) { - StringFill(sPSSData->displayMonName, CHAR_SPACE, 5); - StringFill(sPSSData->displayMonNameText, CHAR_SPACE, 8); - StringFill(sPSSData->displayMonSpeciesName, CHAR_SPACE, 8); - StringFill(sPSSData->displayMonGenderLvlText, CHAR_SPACE, 8); - StringFill(sPSSData->displayMonItemName, CHAR_SPACE, 8); + StringFill(sStorage->displayMonName, CHAR_SPACE, 5); + StringFill(sStorage->displayMonNameText, CHAR_SPACE, 8); + StringFill(sStorage->displayMonSpeciesName, CHAR_SPACE, 8); + StringFill(sStorage->displayMonGenderLvlText, CHAR_SPACE, 8); + StringFill(sStorage->displayMonItemName, CHAR_SPACE, 8); } - else if (sPSSData->displayMonIsEgg) + else if (sStorage->displayMonIsEgg) { if (sanityIsBadEgg) - StringCopyPadded(sPSSData->displayMonNameText, sPSSData->displayMonName, CHAR_SPACE, 5); + StringCopyPadded(sStorage->displayMonNameText, sStorage->displayMonName, CHAR_SPACE, 5); else - StringCopyPadded(sPSSData->displayMonNameText, gText_EggNickname, CHAR_SPACE, 8); + StringCopyPadded(sStorage->displayMonNameText, gText_EggNickname, CHAR_SPACE, 8); - StringFill(sPSSData->displayMonSpeciesName, CHAR_SPACE, 8); - StringFill(sPSSData->displayMonGenderLvlText, CHAR_SPACE, 8); - StringFill(sPSSData->displayMonItemName, CHAR_SPACE, 8); + StringFill(sStorage->displayMonSpeciesName, CHAR_SPACE, 8); + StringFill(sStorage->displayMonGenderLvlText, CHAR_SPACE, 8); + StringFill(sStorage->displayMonItemName, CHAR_SPACE, 8); } else { - if (sPSSData->displayMonSpecies == SPECIES_NIDORAN_F || sPSSData->displayMonSpecies == SPECIES_NIDORAN_M) + if (sStorage->displayMonSpecies == SPECIES_NIDORAN_F || sStorage->displayMonSpecies == SPECIES_NIDORAN_M) gender = MON_GENDERLESS; - StringCopyPadded(sPSSData->displayMonNameText, sPSSData->displayMonName, CHAR_SPACE, 5); + StringCopyPadded(sStorage->displayMonNameText, sStorage->displayMonName, CHAR_SPACE, 5); - txtPtr = sPSSData->displayMonSpeciesName; + txtPtr = sStorage->displayMonSpeciesName; *(txtPtr)++ = CHAR_SLASH; - StringCopyPadded(txtPtr, gSpeciesNames[sPSSData->displayMonSpecies], CHAR_SPACE, 5); + StringCopyPadded(txtPtr, gSpeciesNames[sStorage->displayMonSpecies], CHAR_SPACE, 5); - txtPtr = sPSSData->displayMonGenderLvlText; + txtPtr = sStorage->displayMonGenderLvlText; *(txtPtr)++ = EXT_CTRL_CODE_BEGIN; *(txtPtr)++ = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW; switch (gender) @@ -6856,20 +6856,20 @@ static void SetDisplayMonData(void *pokemon, u8 mode) *(txtPtr++) = CHAR_EXTRA_SYMBOL; *(txtPtr++) = CHAR_LV_2; - txtPtr = ConvertIntToDecimalStringN(txtPtr, sPSSData->displayMonLevel, STR_CONV_MODE_LEFT_ALIGN, 3); + txtPtr = ConvertIntToDecimalStringN(txtPtr, sStorage->displayMonLevel, STR_CONV_MODE_LEFT_ALIGN, 3); txtPtr[0] = CHAR_SPACE; txtPtr[1] = EOS; - if (sPSSData->displayMonItemId != ITEM_NONE) - StringCopyPadded(sPSSData->displayMonItemName, ItemId_GetName(sPSSData->displayMonItemId), CHAR_SPACE, 8); + if (sStorage->displayMonItemId != ITEM_NONE) + StringCopyPadded(sStorage->displayMonItemName, ItemId_GetName(sStorage->displayMonItemId), CHAR_SPACE, 8); else - StringFill(sPSSData->displayMonItemName, CHAR_SPACE, 8); + StringFill(sStorage->displayMonItemName, CHAR_SPACE, 8); } } static u8 HandleInput_InBox(void) { - switch (sPSSData->inBoxMovingMode) + switch (sStorage->inBoxMovingMode) { case MOVE_MODE_NORMAL: default: @@ -6891,9 +6891,9 @@ static u8 InBoxInput_Normal(void) { cursorArea = sCursorArea; cursorPosition = sCursorPosition; - sPSSData->cursorVerticalWrap = 0; - sPSSData->cursorHorizontalWrap = 0; - sPSSData->cursorFlipTimer = 0; + sStorage->cursorVerticalWrap = 0; + sStorage->cursorHorizontalWrap = 0; + sStorage->cursorFlipTimer = 0; if (JOY_REPEAT(DPAD_UP)) { @@ -6918,8 +6918,8 @@ static u8 InBoxInput_Normal(void) cursorArea = CURSOR_AREA_BUTTONS; cursorPosition -= IN_BOX_COUNT; cursorPosition /= 3; - sPSSData->cursorVerticalWrap = 1; - sPSSData->cursorFlipTimer = 1; + sStorage->cursorVerticalWrap = 1; + sStorage->cursorFlipTimer = 1; } break; } @@ -6932,7 +6932,7 @@ static u8 InBoxInput_Normal(void) } else { - sPSSData->cursorHorizontalWrap = -1; + sStorage->cursorHorizontalWrap = -1; cursorPosition += (IN_BOX_COLUMNS - 1); } break; @@ -6946,7 +6946,7 @@ static u8 InBoxInput_Normal(void) } else { - sPSSData->cursorHorizontalWrap = 1; + sStorage->cursorHorizontalWrap = 1; cursorPosition -= (IN_BOX_COLUMNS - 1); } break; @@ -6964,7 +6964,7 @@ static u8 InBoxInput_Normal(void) if (!sAutoActionOn) return INPUT_IN_MENU; - if (sPSSData->boxOption != OPTION_MOVE_MONS || sIsMonBeingMoved == TRUE) + if (sStorage->boxOption != OPTION_MOVE_MONS || sIsMonBeingMoved == TRUE) { switch (GetMenuItemTextId(0)) { @@ -6988,7 +6988,7 @@ static u8 InBoxInput_Normal(void) } else { - sPSSData->inBoxMovingMode = MOVE_MODE_MULTIPLE_SELECTING; + sStorage->inBoxMovingMode = MOVE_MODE_MULTIPLE_SELECTING; return INPUT_MULTIMOVE_START; } } @@ -7082,14 +7082,14 @@ static u8 InBoxInput_SelectingMultiple(void) if (MultiMove_GetOrigin() == sCursorPosition) { // Doing a multiple mon selection but only chose 1 mon - sPSSData->inBoxMovingMode = MOVE_MODE_NORMAL; - sPSSData->cursorShadowSprite->invisible = FALSE; + sStorage->inBoxMovingMode = MOVE_MODE_NORMAL; + sStorage->cursorShadowSprite->invisible = FALSE; return INPUT_MULTIMOVE_SINGLE; } else { - sIsMonBeingMoved = (sPSSData->displayMonSpecies != SPECIES_NONE); - sPSSData->inBoxMovingMode = MOVE_MODE_MULTIPLE_MOVING; + sIsMonBeingMoved = (sStorage->displayMonSpecies != SPECIES_NONE); + sStorage->inBoxMovingMode = MOVE_MODE_MULTIPLE_MOVING; sMovingMonOrigBoxId = StorageGetCurrentBox(); return INPUT_MULTIMOVE_GRAB_SELECTION; } @@ -7151,7 +7151,7 @@ static u8 InBoxInput_MovingMultiple(void) if (MultiMove_CanPlaceSelection()) { sIsMonBeingMoved = FALSE; - sPSSData->inBoxMovingMode = MOVE_MODE_NORMAL; + sStorage->inBoxMovingMode = MOVE_MODE_NORMAL; return INPUT_MULTIMOVE_PLACE_MONS; } else @@ -7188,9 +7188,9 @@ static u8 HandleInput_InParty(void) { cursorArea = sCursorArea; cursorPosition = sCursorPosition; - sPSSData->cursorHorizontalWrap = 0; - sPSSData->cursorVerticalWrap = 0; - sPSSData->cursorFlipTimer = 0; + sStorage->cursorHorizontalWrap = 0; + sStorage->cursorVerticalWrap = 0; + sStorage->cursorFlipTimer = 0; gotoBox = FALSE; retVal = INPUT_NONE; @@ -7213,7 +7213,7 @@ static u8 HandleInput_InParty(void) else if (JOY_REPEAT(DPAD_LEFT) && sCursorPosition != 0) { retVal = INPUT_MOVE_CURSOR; - sPSSData->cursorPrevHorizPos = sCursorPosition; + sStorage->cursorPrevHorizPos = sCursorPosition; cursorPosition = 0; break; } @@ -7222,7 +7222,7 @@ static u8 HandleInput_InParty(void) if (sCursorPosition == 0) { retVal = INPUT_MOVE_CURSOR; - cursorPosition = sPSSData->cursorPrevHorizPos; + cursorPosition = sStorage->cursorPrevHorizPos; } else { @@ -7237,7 +7237,7 @@ static u8 HandleInput_InParty(void) { if (sCursorPosition == PARTY_SIZE) { - if (sPSSData->boxOption == OPTION_DEPOSIT) + if (sStorage->boxOption == OPTION_DEPOSIT) return INPUT_CLOSE_BOX; gotoBox = TRUE; @@ -7271,7 +7271,7 @@ static u8 HandleInput_InParty(void) if (JOY_NEW(B_BUTTON)) { - if (sPSSData->boxOption == OPTION_DEPOSIT) + if (sStorage->boxOption == OPTION_DEPOSIT) return INPUT_PRESSED_B; gotoBox = TRUE; @@ -7308,16 +7308,16 @@ static u8 HandleInput_OnBox(void) do { - sPSSData->cursorHorizontalWrap = 0; - sPSSData->cursorVerticalWrap = 0; - sPSSData->cursorFlipTimer = 0; + sStorage->cursorHorizontalWrap = 0; + sStorage->cursorVerticalWrap = 0; + sStorage->cursorFlipTimer = 0; if (JOY_REPEAT(DPAD_UP)) { retVal = INPUT_MOVE_CURSOR; cursorArea = CURSOR_AREA_BUTTONS; cursorPosition = 0; - sPSSData->cursorFlipTimer = 1; + sStorage->cursorFlipTimer = 1; break; } else if (JOY_REPEAT(DPAD_DOWN)) @@ -7381,20 +7381,20 @@ static u8 HandleInput_OnButtons(void) { cursorArea = sCursorArea; cursorPosition = sCursorPosition; - sPSSData->cursorHorizontalWrap = 0; - sPSSData->cursorVerticalWrap = 0; - sPSSData->cursorFlipTimer = 0; + sStorage->cursorHorizontalWrap = 0; + sStorage->cursorVerticalWrap = 0; + sStorage->cursorFlipTimer = 0; if (JOY_REPEAT(DPAD_UP)) { retVal = INPUT_MOVE_CURSOR; cursorArea = CURSOR_AREA_IN_BOX; - sPSSData->cursorVerticalWrap = -1; + sStorage->cursorVerticalWrap = -1; if (sCursorPosition == 0) cursorPosition = IN_BOX_COUNT - 1 - 5; else cursorPosition = IN_BOX_COUNT - 1; - sPSSData->cursorFlipTimer = 1; + sStorage->cursorFlipTimer = 1; break; } @@ -7403,7 +7403,7 @@ static u8 HandleInput_OnButtons(void) retVal = INPUT_MOVE_CURSOR; cursorArea = CURSOR_AREA_BOX_TITLE; cursorPosition = 0; - sPSSData->cursorFlipTimer = 1; + sStorage->cursorFlipTimer = 1; break; } @@ -7482,7 +7482,7 @@ static void AddBoxMenu(void) static u8 SetSelectionMenuTexts(void) { InitMenu(); - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) return SetMenuTexts_Mon(); else return SetMenuTexts_Item(); @@ -7492,7 +7492,7 @@ static bool8 SetMenuTexts_Mon(void) { u16 species = GetSpeciesAtCursorPosition(); - switch (sPSSData->boxOption) + switch (sStorage->boxOption) { case OPTION_DEPOSIT: if (species != SPECIES_NONE) @@ -7528,7 +7528,7 @@ static bool8 SetMenuTexts_Mon(void) } SetMenuText(MENU_SUMMARY); - if (sPSSData->boxOption == OPTION_MOVE_MONS) + if (sStorage->boxOption == OPTION_MOVE_MONS) { if (sCursorArea == CURSOR_AREA_IN_BOX) SetMenuText(MENU_WITHDRAW); @@ -7544,21 +7544,21 @@ static bool8 SetMenuTexts_Mon(void) static bool8 SetMenuTexts_Item(void) { - if (sPSSData->displayMonSpecies == SPECIES_EGG) + if (sStorage->displayMonSpecies == SPECIES_EGG) return FALSE; if (!IsMovingItem()) { - if (sPSSData->displayMonItemId == ITEM_NONE) + if (sStorage->displayMonItemId == ITEM_NONE) { - if (sPSSData->displayMonSpecies == SPECIES_NONE) + if (sStorage->displayMonSpecies == SPECIES_NONE) return FALSE; SetMenuText(MENU_GIVE_2); } else { - if (!ItemIsMail(sPSSData->displayMonItemId)) + if (!ItemIsMail(sStorage->displayMonItemId)) { SetMenuText(MENU_TAKE); SetMenuText(MENU_BAG); @@ -7568,16 +7568,16 @@ static bool8 SetMenuTexts_Item(void) } else { - if (sPSSData->displayMonItemId == ITEM_NONE) + if (sStorage->displayMonItemId == ITEM_NONE) { - if (sPSSData->displayMonSpecies == SPECIES_NONE) + if (sStorage->displayMonSpecies == SPECIES_NONE) return FALSE; SetMenuText(MENU_GIVE); } else { - if (ItemIsMail(sPSSData->displayMonItemId) == TRUE) + if (ItemIsMail(sStorage->displayMonItemId) == TRUE) return FALSE; SetMenuText(MENU_SWITCH); @@ -7590,8 +7590,8 @@ static bool8 SetMenuTexts_Item(void) static void SpriteCB_CursorShadow(struct Sprite *sprite) { - sprite->pos1.x = sPSSData->cursorSprite->pos1.x; - sprite->pos1.y = sPSSData->cursorSprite->pos1.y + 20; + sprite->pos1.x = sStorage->cursorSprite->pos1.x; + sprite->pos1.y = sStorage->cursorSprite->pos1.y + 20; } static void CreateCursorSprites(void) @@ -7679,22 +7679,22 @@ static void CreateCursorSprites(void) LoadSpriteSheets(spriteSheets); LoadSpritePalettes(spritePalettes); - sPSSData->cursorPalNums[0] = IndexOfSpritePaletteTag(PALTAG_10); // White hand, normal - sPSSData->cursorPalNums[1] = IndexOfSpritePaletteTag(PALTAG_7); // Yellow hand, when auto-action is on + sStorage->cursorPalNums[0] = IndexOfSpritePaletteTag(PALTAG_10); // White hand, normal + sStorage->cursorPalNums[1] = IndexOfSpritePaletteTag(PALTAG_7); // Yellow hand, when auto-action is on GetCursorCoordsByPos(sCursorArea, sCursorPosition, &x, &y); spriteId = CreateSprite(&sSpriteTemplate_Cursor, x, y, 6); if (spriteId != MAX_SPRITES) { - sPSSData->cursorSprite = &gSprites[spriteId]; - sPSSData->cursorSprite->oam.paletteNum = sPSSData->cursorPalNums[sAutoActionOn]; - sPSSData->cursorSprite->oam.priority = 1; + sStorage->cursorSprite = &gSprites[spriteId]; + sStorage->cursorSprite->oam.paletteNum = sStorage->cursorPalNums[sAutoActionOn]; + sStorage->cursorSprite->oam.priority = 1; if (sIsMonBeingMoved) - StartSpriteAnim(sPSSData->cursorSprite, CURSOR_ANIM_FIST); + StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_FIST); } else { - sPSSData->cursorSprite = NULL; + sStorage->cursorSprite = NULL; } if (sCursorArea == CURSOR_AREA_IN_PARTY) @@ -7711,21 +7711,21 @@ static void CreateCursorSprites(void) spriteId = CreateSprite(&sSpriteTemplate_CursorShadow, 0, 0, subpriority); if (spriteId != MAX_SPRITES) { - sPSSData->cursorShadowSprite = &gSprites[spriteId]; - sPSSData->cursorShadowSprite->oam.priority = priority; + sStorage->cursorShadowSprite = &gSprites[spriteId]; + sStorage->cursorShadowSprite->oam.priority = priority; if (sCursorArea) - sPSSData->cursorShadowSprite->invisible = TRUE; + sStorage->cursorShadowSprite->invisible = TRUE; } else { - sPSSData->cursorShadowSprite = NULL; + sStorage->cursorShadowSprite = NULL; } } static void ToggleCursorAutoAction(void) { sAutoActionOn = !sAutoActionOn; - sPSSData->cursorSprite->oam.paletteNum = sPSSData->cursorPalNums[sAutoActionOn]; + sStorage->cursorSprite->oam.paletteNum = sStorage->cursorPalNums[sAutoActionOn]; } static u8 GetCursorPosition(void) @@ -7749,7 +7749,7 @@ static void GetCursorBoxColumnAndRow(u8 *column, u8 *row) static void StartCursorAnim(u8 animNum) { - StartSpriteAnim(sPSSData->cursorSprite, animNum); + StartSpriteAnim(sStorage->cursorSprite, animNum); } // Unused @@ -7760,7 +7760,7 @@ static u8 GetMovingMonOriginalBoxId(void) static void SetCursorPriorityTo1(void) { - sPSSData->cursorSprite->oam.priority = 1; + sStorage->cursorSprite->oam.priority = 1; } static void TryHideItemAtCursor(void) @@ -7777,11 +7777,11 @@ static void TryShowItemAtCursor(void) static void InitMenu(void) { - sPSSData->menuItemsCount = 0; - sPSSData->menuWidth = 0; - sPSSData->menuWindow.bg = 0; - sPSSData->menuWindow.paletteNum = 15; - sPSSData->menuWindow.baseBlock = 92; + sStorage->menuItemsCount = 0; + sStorage->menuWidth = 0; + sStorage->menuWindow.bg = 0; + sStorage->menuWindow.paletteNum = 15; + sStorage->menuWindow.baseBlock = 92; } static const u8 *const sMenuTexts[] = @@ -7829,42 +7829,42 @@ static const u8 *const sMenuTexts[] = static void SetMenuText(u8 textId) { - if (sPSSData->menuItemsCount < ARRAY_COUNT(sPSSData->menuItems)) + if (sStorage->menuItemsCount < ARRAY_COUNT(sStorage->menuItems)) { u8 len; - struct StorageMenu *menu = &sPSSData->menuItems[sPSSData->menuItemsCount]; + struct StorageMenu *menu = &sStorage->menuItems[sStorage->menuItemsCount]; menu->text = sMenuTexts[textId]; menu->textId = textId; len = StringLength(menu->text); - if (len > sPSSData->menuWidth) - sPSSData->menuWidth = len; + if (len > sStorage->menuWidth) + sStorage->menuWidth = len; - sPSSData->menuItemsCount++; + sStorage->menuItemsCount++; } } static s8 GetMenuItemTextId(u8 menuIdx) { - if (menuIdx >= sPSSData->menuItemsCount) + if (menuIdx >= sStorage->menuItemsCount) return -1; else - return sPSSData->menuItems[menuIdx].textId; + return sStorage->menuItems[menuIdx].textId; } static void AddMenu(void) { - sPSSData->menuWindow.width = sPSSData->menuWidth + 2; - sPSSData->menuWindow.height = 2 * sPSSData->menuItemsCount; - sPSSData->menuWindow.tilemapLeft = 29 - sPSSData->menuWindow.width; - sPSSData->menuWindow.tilemapTop = 15 - sPSSData->menuWindow.height; - sPSSData->menuWindowId = AddWindow(&sPSSData->menuWindow); - ClearWindowTilemap(sPSSData->menuWindowId); - DrawStdFrameWithCustomTileAndPalette(sPSSData->menuWindowId, FALSE, 11, 14); - PrintMenuTable(sPSSData->menuWindowId, sPSSData->menuItemsCount, (void*)sPSSData->menuItems); - InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sPSSData->menuWindowId, sPSSData->menuItemsCount, 0); + sStorage->menuWindow.width = sStorage->menuWidth + 2; + sStorage->menuWindow.height = 2 * sStorage->menuItemsCount; + sStorage->menuWindow.tilemapLeft = 29 - sStorage->menuWindow.width; + sStorage->menuWindow.tilemapTop = 15 - sStorage->menuWindow.height; + sStorage->menuWindowId = AddWindow(&sStorage->menuWindow); + ClearWindowTilemap(sStorage->menuWindowId); + DrawStdFrameWithCustomTileAndPalette(sStorage->menuWindowId, FALSE, 11, 14); + PrintMenuTable(sStorage->menuWindowId, sStorage->menuItemsCount, (void*)sStorage->menuItems); + InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sStorage->menuWindowId, sStorage->menuItemsCount, 0); ScheduleBgCopyTilemapToVram(0); - sPSSData->menuUnusedField = 0; + sStorage->menuUnusedField = 0; } // Called after AddMenu to determine whether or not the handler callback should @@ -7908,15 +7908,15 @@ static s16 HandleMenuInput(void) RemoveMenu(); if (input >= 0) - input = sPSSData->menuItems[input].textId; + input = sStorage->menuItems[input].textId; return input; } static void RemoveMenu(void) { - ClearStdWindowAndFrameToTransparent(sPSSData->menuWindowId, TRUE); - RemoveWindow(sPSSData->menuWindowId); + ClearStdWindowAndFrameToTransparent(sStorage->menuWindowId, TRUE); + RemoveWindow(sStorage->menuWindowId); } @@ -7965,10 +7965,10 @@ static bool8 MultiMove_Init(void) sMultiMove = Alloc(sizeof(*sMultiMove)); if (sMultiMove != NULL) { - sPSSData->multiMoveWindowId = AddWindow8Bit(&sWindowTemplate_MultiMove); - if (sPSSData->multiMoveWindowId != WINDOW_NONE) + sStorage->multiMoveWindowId = AddWindow8Bit(&sWindowTemplate_MultiMove); + if (sStorage->multiMoveWindowId != WINDOW_NONE) { - FillWindowPixelBuffer(sPSSData->multiMoveWindowId, PIXEL_FILL(0)); + FillWindowPixelBuffer(sStorage->multiMoveWindowId, PIXEL_FILL(0)); return TRUE; } } @@ -8025,11 +8025,11 @@ static bool8 MultiMove_Start(void) ChangeBgX(0, -1024, 0); ChangeBgY(0, -1024, 0); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); - FillWindowPixelBuffer8Bit(sPSSData->multiMoveWindowId, PIXEL_FILL(0)); + FillWindowPixelBuffer8Bit(sStorage->multiMoveWindowId, PIXEL_FILL(0)); MultiMove_SetIconToBg(sMultiMove->fromColumn, sMultiMove->fromRow); SetBgAttribute(0, BG_ATTR_PALETTEMODE, 1); - PutWindowTilemap(sPSSData->multiMoveWindowId); - CopyWindowToVram8Bit(sPSSData->multiMoveWindowId, 3); + PutWindowTilemap(sStorage->multiMoveWindowId); + CopyWindowToVram8Bit(sStorage->multiMoveWindowId, 3); BlendPalettes(0x3F00, 8, RGB_WHITE); StartCursorAnim(CURSOR_ANIM_OPEN); SetGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR); @@ -8085,7 +8085,7 @@ static bool8 MultiMove_ChangeSelection(void) MultiMove_UpdateSelectedIcons(); sMultiMove->toColumn = sMultiMove->cursorColumn; sMultiMove->toRow = sMultiMove->cursorRow; - CopyWindowToVram8Bit(sPSSData->multiMoveWindowId, 2); + CopyWindowToVram8Bit(sStorage->multiMoveWindowId, 2); sMultiMove->state++; } break; @@ -8296,7 +8296,7 @@ static void MultiMove_SetIconToBg(u8 x, u8 y) const u8 *iconGfx = GetMonIconPtr(species, personality, 1); u8 index = GetValidMonIconPalIndex(species) + 8; - BlitBitmapRectToWindow4BitTo8Bit(sPSSData->multiMoveWindowId, + BlitBitmapRectToWindow4BitTo8Bit(sStorage->multiMoveWindowId, iconGfx, 0, 0, @@ -8317,7 +8317,7 @@ static void MultiMove_ClearIconFromBg(u8 x, u8 y) if (species != SPECIES_NONE) { - FillWindowPixelRect8Bit(sPSSData->multiMoveWindowId, + FillWindowPixelRect8Bit(sStorage->multiMoveWindowId, PIXEL_FILL(0), 24 * x, 24 * y, @@ -8584,7 +8584,7 @@ static void CreateItemIconSprites(void) struct CompressedSpriteSheet spriteSheet; struct SpriteTemplate spriteTemplate; - if (sPSSData->boxOption == OPTION_MOVE_ITEMS) + if (sStorage->boxOption == OPTION_MOVE_ITEMS) { spriteSheet.data = sItemIconGfxBuffer; spriteSheet.size = 0x200; @@ -8594,26 +8594,26 @@ static void CreateItemIconSprites(void) { spriteSheet.tag = GFXTAG_ITEM_ICON_0 + i; LoadCompressedSpriteSheet(&spriteSheet); - sPSSData->itemIcons[i].tiles = GetSpriteTileStartByTag(spriteSheet.tag) * 32 + (void*)(OBJ_VRAM0); - sPSSData->itemIcons[i].palIndex = AllocSpritePalette(PALTAG_ITEM_ICON_0 + i); - sPSSData->itemIcons[i].palIndex *= 16; - sPSSData->itemIcons[i].palIndex += 0x100; + sStorage->itemIcons[i].tiles = GetSpriteTileStartByTag(spriteSheet.tag) * 32 + (void*)(OBJ_VRAM0); + sStorage->itemIcons[i].palIndex = AllocSpritePalette(PALTAG_ITEM_ICON_0 + i); + sStorage->itemIcons[i].palIndex *= 16; + sStorage->itemIcons[i].palIndex += 0x100; spriteTemplate.tileTag = GFXTAG_ITEM_ICON_0 + i; spriteTemplate.paletteTag = PALTAG_ITEM_ICON_0 + i; spriteId = CreateSprite(&spriteTemplate, 0, 0, 11); - sPSSData->itemIcons[i].sprite = &gSprites[spriteId]; - sPSSData->itemIcons[i].sprite->invisible = TRUE; - sPSSData->itemIcons[i].active = FALSE; + sStorage->itemIcons[i].sprite = &gSprites[spriteId]; + sStorage->itemIcons[i].sprite->invisible = TRUE; + sStorage->itemIcons[i].active = FALSE; } } - sPSSData->movingItemId = ITEM_NONE; + sStorage->movingItemId = ITEM_NONE; } static void TryLoadItemIconAtPos(u8 cursorArea, u8 cursorPos) { u16 heldItem; - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) return; // If we've already loaded the item here, stop @@ -8653,7 +8653,7 @@ static void TryHideItemIconAtPos(u8 cursorArea, u8 cursorPos) { u8 id; - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) return; id = GetItemIconIdxByPosition(cursorArea, cursorPos); @@ -8666,7 +8666,7 @@ static void TakeItemFromMon(u8 cursorArea, u8 cursorPos) u8 id; u16 itemId; - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) return; id = GetItemIconIdxByPosition(cursorArea, cursorPos); @@ -8685,7 +8685,7 @@ static void TakeItemFromMon(u8 cursorArea, u8 cursorPos) SetPartyMonIconObjMode(cursorPos, 1); } - sPSSData->movingItemId = sPSSData->displayMonItemId; + sStorage->movingItemId = sStorage->displayMonItemId; } static void InitItemIconInCursor(u16 itemId) @@ -8698,7 +8698,7 @@ static void InitItemIconInCursor(u16 itemId) SetItemIconCallback(id, ITEM_CB_TO_HAND, CURSOR_AREA_IN_BOX, 0); SetItemIconPosition(id, CURSOR_AREA_IN_HAND, 0); SetItemIconActive(id, TRUE); - sPSSData->movingItemId = itemId; + sStorage->movingItemId = itemId; } static void SwapItemsWithMon(u8 cursorArea, u8 cursorPos) @@ -8706,7 +8706,7 @@ static void SwapItemsWithMon(u8 cursorArea, u8 cursorPos) u8 id; u16 itemId; - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) return; id = GetItemIconIdxByPosition(cursorArea, cursorPos); @@ -8715,14 +8715,14 @@ static void SwapItemsWithMon(u8 cursorArea, u8 cursorPos) if (cursorArea == CURSOR_AREA_IN_BOX) { itemId = GetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM); - SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sPSSData->movingItemId); - sPSSData->movingItemId = itemId; + SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sStorage->movingItemId); + sStorage->movingItemId = itemId; } else { itemId = GetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM); - SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sPSSData->movingItemId); - sPSSData->movingItemId = itemId; + SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sStorage->movingItemId); + sStorage->movingItemId = itemId; } id = GetItemIconIdxByPosition(CURSOR_AREA_IN_HAND, 0); @@ -8734,7 +8734,7 @@ static void GiveItemToMon(u8 cursorArea, u8 cursorPos) { u8 id; - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) return; id = GetItemIconIdxByPosition(CURSOR_AREA_IN_HAND, 0); @@ -8742,12 +8742,12 @@ static void GiveItemToMon(u8 cursorArea, u8 cursorPos) SetItemIconCallback(id, ITEM_CB_TO_MON, cursorArea, cursorPos); if (cursorArea == CURSOR_AREA_IN_BOX) { - SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sPSSData->movingItemId); + SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sStorage->movingItemId); SetBoxMonIconObjMode(cursorPos, 0); } else { - SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sPSSData->movingItemId); + SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sStorage->movingItemId); SetPartyMonIconObjMode(cursorPos, 0); } } @@ -8757,7 +8757,7 @@ static void MoveItemFromMonToBag(u8 cursorArea, u8 cursorPos) u8 id; u16 itemId; - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) return; itemId = ITEM_NONE; @@ -8778,7 +8778,7 @@ static void MoveItemFromMonToBag(u8 cursorArea, u8 cursorPos) static void MoveItemFromCursorToBag(void) { - if (sPSSData->boxOption == OPTION_MOVE_ITEMS) + if (sStorage->boxOption == OPTION_MOVE_ITEMS) { u8 id = GetItemIconIdxByPosition(CURSOR_AREA_IN_HAND, 0); SetItemIconAffineAnim(id, ITEM_ANIM_PUT_AWAY); @@ -8793,13 +8793,13 @@ static void MoveHeldItemWithPartyMenu(void) { s32 i; - if (sPSSData->boxOption != OPTION_MOVE_ITEMS) + if (sStorage->boxOption != OPTION_MOVE_ITEMS) return; for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->itemIcons[i].active - && sPSSData->itemIcons[i].area == CURSOR_AREA_IN_PARTY) + if (sStorage->itemIcons[i].active + && sStorage->itemIcons[i].area == CURSOR_AREA_IN_PARTY) SetItemIconCallback(i, ITEM_CB_HIDE_PARTY, CURSOR_AREA_IN_HAND, 0); } } @@ -8810,13 +8810,13 @@ static bool8 IsItemIconAnimActive(void) for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->itemIcons[i].active) + if (sStorage->itemIcons[i].active) { - if (!sPSSData->itemIcons[i].sprite->affineAnimEnded - && sPSSData->itemIcons[i].sprite->affineAnimBeginning) + if (!sStorage->itemIcons[i].sprite->affineAnimEnded + && sStorage->itemIcons[i].sprite->affineAnimBeginning) return TRUE; - if (sPSSData->itemIcons[i].sprite->callback != SpriteCallbackDummy - && sPSSData->itemIcons[i].sprite->callback != SpriteCB_ItemIcon_SetPosToCursor) + if (sStorage->itemIcons[i].sprite->callback != SpriteCallbackDummy + && sStorage->itemIcons[i].sprite->callback != SpriteCB_ItemIcon_SetPosToCursor) return TRUE; } } @@ -8827,12 +8827,12 @@ static bool8 IsMovingItem(void) { s32 i; - if (sPSSData->boxOption == OPTION_MOVE_ITEMS) + if (sStorage->boxOption == OPTION_MOVE_ITEMS) { for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->itemIcons[i].active - && sPSSData->itemIcons[i].area == CURSOR_AREA_IN_HAND) + if (sStorage->itemIcons[i].active + && sStorage->itemIcons[i].area == CURSOR_AREA_IN_HAND) return TRUE; } } @@ -8841,12 +8841,12 @@ static bool8 IsMovingItem(void) static const u8 *GetMovingItemName(void) { - return ItemId_GetName(sPSSData->movingItemId); + return ItemId_GetName(sStorage->movingItemId); } static u16 GetMovingItemId(void) { - return sPSSData->movingItemId; + return sStorage->movingItemId; } static u8 GetNewItemIconIdx(void) @@ -8855,9 +8855,9 @@ static u8 GetNewItemIconIdx(void) for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (!sPSSData->itemIcons[i].active) + if (!sStorage->itemIcons[i].active) { - sPSSData->itemIcons[i].active = TRUE; + sStorage->itemIcons[i].active = TRUE; return i; } } @@ -8870,9 +8870,9 @@ static bool32 IsItemIconAtPosition(u8 cursorArea, u8 cursorPos) for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->itemIcons[i].active - && sPSSData->itemIcons[i].area == cursorArea - && sPSSData->itemIcons[i].pos == cursorPos) + if (sStorage->itemIcons[i].active + && sStorage->itemIcons[i].area == cursorArea + && sStorage->itemIcons[i].pos == cursorPos) return TRUE; } return FALSE; @@ -8884,9 +8884,9 @@ static u8 GetItemIconIdxByPosition(u8 cursorArea, u8 cursorPos) for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->itemIcons[i].active - && sPSSData->itemIcons[i].area == cursorArea - && sPSSData->itemIcons[i].pos == cursorPos) + if (sStorage->itemIcons[i].active + && sStorage->itemIcons[i].area == cursorArea + && sStorage->itemIcons[i].pos == cursorPos) return i; } return MAX_ITEM_ICONS; @@ -8898,8 +8898,8 @@ static u8 GetItemIconIdxBySprite(struct Sprite *sprite) for (i = 0; i < MAX_ITEM_ICONS; i++) { - if (sPSSData->itemIcons[i].active - && sPSSData->itemIcons[i].sprite == sprite) + if (sStorage->itemIcons[i].active + && sStorage->itemIcons[i].sprite == sprite) return i; } return MAX_ITEM_ICONS; @@ -8917,27 +8917,27 @@ static void SetItemIconPosition(u8 id, u8 cursorArea, u8 cursorPos) case CURSOR_AREA_IN_BOX: x = cursorPos % IN_BOX_COLUMNS; y = cursorPos / IN_BOX_COLUMNS; - sPSSData->itemIcons[id].sprite->pos1.x = (24 * x) + 112; - sPSSData->itemIcons[id].sprite->pos1.y = (24 * y) + 56; - sPSSData->itemIcons[id].sprite->oam.priority = 2; + sStorage->itemIcons[id].sprite->pos1.x = (24 * x) + 112; + sStorage->itemIcons[id].sprite->pos1.y = (24 * y) + 56; + sStorage->itemIcons[id].sprite->oam.priority = 2; break; case CURSOR_AREA_IN_PARTY: if (cursorPos == 0) { - sPSSData->itemIcons[id].sprite->pos1.x = 116; - sPSSData->itemIcons[id].sprite->pos1.y = 76; + sStorage->itemIcons[id].sprite->pos1.x = 116; + sStorage->itemIcons[id].sprite->pos1.y = 76; } else { - sPSSData->itemIcons[id].sprite->pos1.x = 164; - sPSSData->itemIcons[id].sprite->pos1.y = 24 * (cursorPos - 1) + 28; + sStorage->itemIcons[id].sprite->pos1.x = 164; + sStorage->itemIcons[id].sprite->pos1.y = 24 * (cursorPos - 1) + 28; } - sPSSData->itemIcons[id].sprite->oam.priority = 1; + sStorage->itemIcons[id].sprite->oam.priority = 1; break; } - sPSSData->itemIcons[id].area = cursorArea; - sPSSData->itemIcons[id].pos = cursorPos; + sStorage->itemIcons[id].area = cursorArea; + sStorage->itemIcons[id].pos = cursorPos; } static void LoadItemIconGfx(u8 id, const u32 *itemTiles, const u32 *itemPal) @@ -8947,14 +8947,14 @@ static void LoadItemIconGfx(u8 id, const u32 *itemTiles, const u32 *itemPal) if (id >= MAX_ITEM_ICONS) return; - CpuFastFill(0, sPSSData->field_42C4, 0x200); - LZ77UnCompWram(itemTiles, sPSSData->tileBuffer); + CpuFastFill(0, sStorage->field_42C4, 0x200); + LZ77UnCompWram(itemTiles, sStorage->tileBuffer); for (i = 0; i < 3; i++) - CpuFastCopy(&sPSSData->tileBuffer[i * 0x60], &sPSSData->field_42C4[i * 0x80], 0x60); + CpuFastCopy(&sStorage->tileBuffer[i * 0x60], &sStorage->field_42C4[i * 0x80], 0x60); - CpuFastCopy(sPSSData->field_42C4, sPSSData->itemIcons[id].tiles, 0x200); - LZ77UnCompWram(itemPal, sPSSData->field_42C4); - LoadPalette(sPSSData->field_42C4, sPSSData->itemIcons[id].palIndex, 0x20); + CpuFastCopy(sStorage->field_42C4, sStorage->itemIcons[id].tiles, 0x200); + LZ77UnCompWram(itemPal, sStorage->field_42C4); + LoadPalette(sStorage->field_42C4, sStorage->itemIcons[id].palIndex, 0x20); } static void SetItemIconAffineAnim(u8 id, u8 animNum) @@ -8962,7 +8962,7 @@ static void SetItemIconAffineAnim(u8 id, u8 animNum) if (id >= MAX_ITEM_ICONS) return; - StartSpriteAffineAnim(sPSSData->itemIcons[id].sprite, animNum); + StartSpriteAffineAnim(sStorage->itemIcons[id].sprite, animNum); } #define sItemIconId data[0] @@ -8978,36 +8978,36 @@ static void SetItemIconCallback(u8 id, u8 callbackId, u8 cursorArea, u8 cursorPo switch (callbackId) { case ITEM_CB_WAIT_ANIM: - sPSSData->itemIcons[id].sprite->sItemIconId = id; - sPSSData->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_WaitAnim; + sStorage->itemIcons[id].sprite->sItemIconId = id; + sStorage->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_WaitAnim; break; case ITEM_CB_TO_HAND: - sPSSData->itemIcons[id].sprite->sState = 0; - sPSSData->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_ToHand; + sStorage->itemIcons[id].sprite->sState = 0; + sStorage->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_ToHand; break; case ITEM_CB_TO_MON: - sPSSData->itemIcons[id].sprite->sState = 0; - sPSSData->itemIcons[id].sprite->sCursorArea = cursorArea; - sPSSData->itemIcons[id].sprite->sCursorPos = cursorPos; - sPSSData->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_ToMon; + sStorage->itemIcons[id].sprite->sState = 0; + sStorage->itemIcons[id].sprite->sCursorArea = cursorArea; + sStorage->itemIcons[id].sprite->sCursorPos = cursorPos; + sStorage->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_ToMon; break; case ITEM_CB_SWAP_TO_HAND: - sPSSData->itemIcons[id].sprite->sState = 0; - sPSSData->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_SwapToHand; - sPSSData->itemIcons[id].sprite->sCursorArea = cursorArea; - sPSSData->itemIcons[id].sprite->sCursorPos = cursorPos; + sStorage->itemIcons[id].sprite->sState = 0; + sStorage->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_SwapToHand; + sStorage->itemIcons[id].sprite->sCursorArea = cursorArea; + sStorage->itemIcons[id].sprite->sCursorPos = cursorPos; break; case ITEM_CB_SWAP_TO_MON: - sPSSData->itemIcons[id].sprite->sState = 0; - sPSSData->itemIcons[id].sprite->sCursorArea = cursorArea; - sPSSData->itemIcons[id].sprite->sCursorPos = cursorPos; - sPSSData->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_SwapToMon; + sStorage->itemIcons[id].sprite->sState = 0; + sStorage->itemIcons[id].sprite->sCursorArea = cursorArea; + sStorage->itemIcons[id].sprite->sCursorPos = cursorPos; + sStorage->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_SwapToMon; break; case ITEM_CB_HIDE_PARTY: // If cursor is on a Pokémon with a held item and // the player closes the party menu, have the held // item follow the Pokémon as the menu slides out - sPSSData->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_HideParty; + sStorage->itemIcons[id].sprite->callback = SpriteCB_ItemIcon_HideParty; break; } } @@ -9017,8 +9017,8 @@ static void SetItemIconActive(u8 id, bool8 active) if (id >= MAX_ITEM_ICONS) return; - sPSSData->itemIcons[id].active = active; - sPSSData->itemIcons[id].sprite->invisible = (active == FALSE); + sStorage->itemIcons[id].active = active; + sStorage->itemIcons[id].sprite->invisible = (active == FALSE); } static const u32 *GetItemIconPic(u16 itemId) @@ -9036,9 +9036,9 @@ static void PrintItemDescription(void) const u8 *description; if (IsMovingItem()) - description = ItemId_GetDescription(sPSSData->movingItemId); + description = ItemId_GetDescription(sStorage->movingItemId); else - description = ItemId_GetDescription(sPSSData->displayMonItemId); + description = ItemId_GetDescription(sStorage->displayMonItemId); FillWindowPixelBuffer(2, PIXEL_FILL(1)); AddTextPrinterParameterized5(2, 1, description, 4, 0, 0, NULL, 0, 1); @@ -9046,7 +9046,7 @@ static void PrintItemDescription(void) static void InitItemInfoWindow(void) { - sPSSData->itemInfoWindowOffset = 21; + sStorage->itemInfoWindowOffset = 21; LoadBgTiles(0, sItemInfoFrame_Gfx, 0x80, 0x13A); DrawItemInfoWindow(0); } @@ -9055,33 +9055,33 @@ static bool8 UpdateItemInfoWindowSlideIn(void) { s32 i, pos; - if (sPSSData->itemInfoWindowOffset == 0) + if (sStorage->itemInfoWindowOffset == 0) return FALSE; - sPSSData->itemInfoWindowOffset--; - pos = 21 - sPSSData->itemInfoWindowOffset; + sStorage->itemInfoWindowOffset--; + pos = 21 - sStorage->itemInfoWindowOffset; for (i = 0; i < pos; i++) - WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + sPSSData->itemInfoWindowOffset + i, i, 13, 1, 7, 15, 21); + WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + sStorage->itemInfoWindowOffset + i, i, 13, 1, 7, 15, 21); DrawItemInfoWindow(pos); - return (sPSSData->itemInfoWindowOffset != 0); + return (sStorage->itemInfoWindowOffset != 0); } static bool8 UpdateItemInfoWindowSlideOut(void) { s32 i, pos; - if (sPSSData->itemInfoWindowOffset == 22) + if (sStorage->itemInfoWindowOffset == 22) return FALSE; - if (sPSSData->itemInfoWindowOffset == 0) + if (sStorage->itemInfoWindowOffset == 0) FillBgTilemapBufferRect(0, 0, 21, 12, 1, 9, 17); - sPSSData->itemInfoWindowOffset++; - pos = 21 - sPSSData->itemInfoWindowOffset; + sStorage->itemInfoWindowOffset++; + pos = 21 - sStorage->itemInfoWindowOffset; for (i = 0; i < pos; i++) { - WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + sPSSData->itemInfoWindowOffset + i, i, 13, 1, 7, 15, 21); + WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + sStorage->itemInfoWindowOffset + i, i, 13, 1, 7, 15, 21); } if (pos >= 0) @@ -9138,9 +9138,9 @@ static void SpriteCB_ItemIcon_ToHand(struct Sprite *sprite) static void SpriteCB_ItemIcon_SetPosToCursor(struct Sprite *sprite) { - sprite->pos1.x = sPSSData->cursorSprite->pos1.x + 4; - sprite->pos1.y = sPSSData->cursorSprite->pos1.y + sPSSData->cursorSprite->pos2.y + 8; - sprite->oam.priority = sPSSData->cursorSprite->oam.priority; + sprite->pos1.x = sStorage->cursorSprite->pos1.x + 4; + sprite->pos1.y = sStorage->cursorSprite->pos1.y + sStorage->cursorSprite->pos2.y + 8; + sprite->oam.priority = sStorage->cursorSprite->oam.priority; } static void SpriteCB_ItemIcon_ToMon(struct Sprite *sprite) From 52495e889fcc5a0045a77234ab28e06fd957f542 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 17 Apr 2021 23:55:24 -0400 Subject: [PATCH 56/63] Doc storage - cleanup --- .../unknown.pal} | 0 .../unused.pal} | 0 .../wallpapers/unused.bin} | 0 src/data/wallpapers.h | 2 +- src/pokemon_storage_system.c | 713 +++++++++++------- 5 files changed, 438 insertions(+), 277 deletions(-) rename graphics/{unknown/unknown_5726F4.pal => pokemon_storage/unknown.pal} (100%) rename graphics/{unused/unknown_5726B4.pal => pokemon_storage/unused.pal} (100%) rename graphics/{unused/tilemap_5773C4.bin => pokemon_storage/wallpapers/unused.bin} (100%) diff --git a/graphics/unknown/unknown_5726F4.pal b/graphics/pokemon_storage/unknown.pal similarity index 100% rename from graphics/unknown/unknown_5726F4.pal rename to graphics/pokemon_storage/unknown.pal diff --git a/graphics/unused/unknown_5726B4.pal b/graphics/pokemon_storage/unused.pal similarity index 100% rename from graphics/unused/unknown_5726B4.pal rename to graphics/pokemon_storage/unused.pal diff --git a/graphics/unused/tilemap_5773C4.bin b/graphics/pokemon_storage/wallpapers/unused.bin similarity index 100% rename from graphics/unused/tilemap_5773C4.bin rename to graphics/pokemon_storage/wallpapers/unused.bin diff --git a/src/data/wallpapers.h b/src/data/wallpapers.h index e198423c7..64c61fe2d 100644 --- a/src/data/wallpapers.h +++ b/src/data/wallpapers.h @@ -148,7 +148,7 @@ static const u32 sWallpaperTiles_Plain[] = INCBIN_U32("graphics/pokemon_storage/ static const u32 sWallpaperTilemap_Plain[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/plain/tilemap.bin.lz"); // 12x18 tilemap -static const u32 gUnknown_085773C4[] = INCBIN_U32("graphics/unused/tilemap_5773C4.bin"); +static const u32 sWallpaperTilemap_Unused[] = INCBIN_U32("graphics/pokemon_storage/wallpapers/unused.bin"); // Shadow color, text color static const u16 sBoxTitleColors[WALLPAPER_COUNT][2] = diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index c4b3c6f60..c17b20437 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -42,6 +42,14 @@ #include "constants/rgb.h" #include "constants/songs.h" +/* + NOTE: This file is large. Some general groups of functions have + been labeled with commented headers to make navigation easier. + Search for "SECTION:" to locate them. These sections are not + hard and fast rules, but give a basic idea of where certain + types of functions are likely located. +*/ + // PC main menu options enum { OPTION_WITHDRAW, @@ -215,10 +223,10 @@ enum { PALTAG_4, // Unused PALTAG_5, // Unused PALTAG_DISPLAY_MON, - PALTAG_7, + PALTAG_MISC_1, PALTAG_MARKING_COMBO, PALTAG_BOX_TITLE, - PALTAG_10, + PALTAG_MISC_2, PALTAG_ITEM_ICON_0, PALTAG_ITEM_ICON_1, // Used implicitly in CreateItemIconSprites PALTAG_ITEM_ICON_2, // Used implicitly in CreateItemIconSprites @@ -316,6 +324,7 @@ enum { MULTIMOVE_PLACE_MONS, }; +// IDs for TilemapUtil enum { TILEMAPID_PKMN_DATA, // The "Pkmn Data" text at the top of the display TILEMAPID_PARTY_MENU, @@ -394,9 +403,9 @@ struct PokemonStorageSystemData struct UnkUtil unkUtil; struct UnkUtilData unkUtilData[8]; u16 partyMenuTilemapBuffer[0x108]; - u16 partyMenuUnused; // Never read + u16 partyMenuUnused1; // Never read u16 partyMenuY; - u8 field_2C4; // Unused + u8 partyMenuUnused2; // Unused u8 partyMenuMoveTimer; u8 showPartyMenuState; bool8 closeBoxFlashing; @@ -415,7 +424,7 @@ struct PokemonStorageSystemData u16 scrollUnused4; // Never read u16 scrollUnused5; // Never read u16 scrollUnused6; // Never read - u8 filler[22]; + u8 filler1[22]; u8 boxTitleTiles[1024]; u8 boxTitleCycleId; u8 wallpaperLoadState; // Written to, but never read. @@ -427,9 +436,9 @@ struct PokemonStorageSystemData struct Sprite *curBoxTitleSprites[2]; struct Sprite *nextBoxTitleSprites[2]; struct Sprite *arrowSprites[2]; - u32 boxTitlePalBits; - u8 field_73C[80]; // Unused - u16 field_78C; // Never read. + u32 wallpaperPalBits; + u8 filler2[80]; // Unused + u16 unkUnused1; // Never read. s16 wallpaperSetId; s16 wallpaperId; u16 wallpaperTilemap[360]; @@ -441,14 +450,14 @@ struct PokemonStorageSystemData struct Sprite *movingMonSprite; struct Sprite *partySprites[PARTY_SIZE]; struct Sprite *boxMonsSprites[IN_BOX_COUNT]; - struct Sprite **field_B00; + struct Sprite **shiftMonSpritePtr; struct Sprite **releaseMonSpritePtr; u16 numIconsPerSpecies[MAX_MON_ICONS]; u16 iconSpeciesList[MAX_MON_ICONS]; u16 boxSpecies[IN_BOX_COUNT]; u32 boxPersonalities[IN_BOX_COUNT]; - u8 field_C5C; - u8 field_C5D; + u8 incomingBoxId; + u8 shiftTimer; u8 numPartyToCompact; u16 iconScrollDistance; s16 iconScrollPos; @@ -496,7 +505,7 @@ struct PokemonStorageSystemData u8 displayMonItemName[36]; bool8 (*monPlaceChangeFunc)(void); u8 monPlaceChangeState; - u8 field_D91; + u8 shiftBoxId; struct Sprite *markingComboSprite; struct Sprite *waveformSprites[2]; u16 *markingComboTilesPtr; @@ -530,14 +539,14 @@ struct PokemonStorageSystemData struct ItemIcon itemIcons[MAX_ITEM_ICONS]; u16 movingItemId; u16 itemInfoWindowOffset; - u8 field_2238; // Unused + u8 unkUnused2; // Unused u16 displayMonPalOffset; u16 *displayMonTilePtr; struct Sprite *displayMonSprite; u16 displayMonPalBuffer[0x40]; u8 tileBuffer[0x800]; - u8 field_2AC4[0x1800]; // Unused - u8 field_42C4[0x800]; + u8 unusedBuffer[0x1800]; // Unused + u8 itemIconBuffer[0x800]; u8 wallpaperBgTilemapBuffer[0x1000]; u8 displayMenuTilemapBuffer[0x800]; }; @@ -561,122 +570,8 @@ EWRAM_DATA static u8 sMovingMonOrigBoxId = 0; EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0; EWRAM_DATA static bool8 sAutoActionOn = 0; -static void CreateMainMenu(u8, s16 *); +// Main tasks static void EnterPokeStorage(u8); -static u8 GetCurrentBoxOption(void); -static u8 HandleInput(void); -static u8 GetSavedCursorPos(void); -static u8 GetNumPartySpritesCompacting(void); -static void LoadWallpaperGfx(u8, s8); -static void CreateIncomingBoxTitle(u8, s8); -static void StartBoxScrollArrowsSlide(s8); -static void SetCurrentBox(u8); -static void CreateInitBoxTask(u8); -static void ChooseBoxMenu_CreateSprites(u8); -static void TrimOldWallpaper(void *); -static void ChooseBoxMenu_DestroySprites(void); -static void ChooseBoxMenu_MoveLeft(void); -static void ScrollBackground(void); -static void ChooseBoxMenu_MoveRight(void); -static void ChooseBoxMenu_PrintInfo(void); -static void UpdateCloseBoxButtonFlash(void); -static void ToggleCursorAutoAction(void); -static void LoadSavedMovingMon(void); -static void SetSelectionAfterSummaryScreen(void); -static void GiveChosenBagItem(void); -static void SetUpHidePartyMenu(void); -static void DestroyAllPartyMonIcons(void); -static void MoveHeldItemWithPartyMenu(void); -static void LoadPokeStorageMenuGfx(void); -static void LoadWaveformSpritePalette(void); -static void SaveCursorPos(void); -static void sub_80CD36C(void); -static void sub_80CD3EC(void); -static void sub_80CAC1C(void); -static void ReshowDisplayMon(void); -static void SetScrollingBackground(void); -static void sub_80CABE0(void); -static void sub_80CAEAC(void); -static void CreateItemIconSprites(void); -static void TryHideItemAtCursor(void); -static void ClearSavedCursorPos(void); -static void InitMonIconFields(void); -static void sub_80CA0D8(void); -static void AddMenu(void); -static void InitReleaseMon(void); -static void InitCanReleaseMonVars(void); -static void ReleaseMon(void); -static void RefreshDisplayMonData(void); -static void CreateDisplayMonSprite(void); -static void CreateMarkingComboSprite(void); -static void CreateWaveformSprites(void); -static void ReshowReleaseMon(void); -static void TrySetCursorFistAnim(void); -static void ClearBottomWindow(void); -static void InitSupplementalTilemaps(void); -static void RemoveMenu(void); -static void RefreshDisplayMon(void); -static void MoveItemFromCursorToBag(void); -static void PrintDisplayMonInfo(void); -static void UpdateWaveformAnimation(void); -static void AddWallpaperSetsMenu(void); -static void CreateBoxScrollArrows(void); -static void InitMenu(void); -static void StopBoxScrollArrowsSlide(void); -static void CreateCursorSprites(void); -static void TryRefreshDisplayMon(void); -static void CycleBoxTitleSprites(void); -static void InitItemInfoWindow(void); -static void DrawItemInfoWindow(u32); -static void SetPartySlotTilemaps(void); -static void PrintItemDescription(void); -static void SaveMovingMon(void); -static void SetCursorInParty(void); -static void InitSummaryScreenData(void); -static void TryShowItemAtCursor(void); -static void StopFlashingCloseBoxButton(void); -static void FreePokeStorageData(void); -static void AddBoxMenu(void); -static void CycleBoxTitleColor(void); -static void MoveMon(void); -static void PlaceMon(void); -static void UpdatePartySlotColors(void); -static void sub_80CE22C(void); -static void DoCursorNewPosUpdate(void); -static void CompactPartySprites(void); -static void StartFlashingCloseBoxButton(void); -static void SetUpDoShowPartyMenu(void); -static void StartDisplayMonMosaicEffect(void); -static void SpriteCB_ChooseBoxArrow(struct Sprite *); -static void SpriteCB_HeldMon(struct Sprite *); -static void SpriteCB_BoxMonIconScrollOut(struct Sprite *); -static void SpriteCB_Arrow(struct Sprite *); -static bool32 WaitForWallpaperGfxLoad(void); -static bool8 InitPokeStorageWindows(void); -static bool8 ResetReleaseMonSpritePtr(void); -static bool8 TryHideReleaseMon(void); -static bool8 IsInitBoxActive(void); -static bool8 MonPlaceChange_CursorDown(void); -static bool8 MonPlaceChange_CursorUp(void); -static bool8 UpdateItemInfoWindowSlideIn(void); -static bool8 UpdateItemInfoWindowSlideOut(void); -static bool8 DoShowPartyMenu(void); -static bool8 IsItemIconAnimActive(void); -static bool8 ScrollToBox(void); -static bool8 UpdateCursorPos(void); -static bool8 HidePartyMenu(void); -static bool8 IsMovingItem(void); -static bool8 IsDisplayMosaicActive(void); -static bool8 DoWallpaperGfxChange(void); -static bool8 DoMonPlaceChange(void); -static bool8 IsMenuLoading(void); -static bool8 IsRemovingLastPartyMon(void); -static bool8 CanShiftMon(void); -static bool8 IsCursorOnCloseBox(void); -static bool8 IsCursorOnBoxTitle(void); -static bool8 IsCursorInBox(void); -static bool8 IsMonBeingMoved(void); -static bool8 TryStorePartyMonInBox(u8); static void Task_InitPokeStorage(u8); static void Task_PlaceMon(u8); static void Task_ChangeScreen(u8); @@ -708,72 +603,81 @@ static void Task_HandleWallpapers(u8); static void Task_NameBox(u8); static void Task_PrintCantStoreMail(u8); static void Task_HandleMovingMonFromParty(u8); -static void SetUpScrollToBox(u8); -static void StartCursorAnim(u8); -static void SetMovingMonPriority(u8); -static void InitMonPlaceChange(u8); -static void SetMonMarkings(u8); -static void ShowYesNoWindow(s8); -static void SetCursorBoxPosition(u8); -static void AnimateBoxScrollArrows(bool8); -static void UpdateCloseBoxButtonTilemap(bool8); -static void CreatePartyMonsSprites(bool8); -static void PrintMessage(u8 id); -static s16 HandleMenuInput(void); -static s8 RunCanReleaseMon(void); -static u8 GetCursorPosition(void); -static void TakeItemFromMon(u8, u8); -static void GiveItemToMon(u8, u8); -static void MoveItemFromMonToBag(u8, u8); -static void SwapItemsWithMon(u8, u8); -static struct Sprite *CreateChooseBoxArrows(u16, u16, u8, u8, u8); -static void SetWallpaperForCurrentBox(u8); -static void AddWallpapersMenu(u8); -static u16 GetMovingItemId(void); -static void LoadDisplayMonGfx(u16, u32); -static void SpriteCB_DisplayMonMosaic(struct Sprite *); -static void SpriteCB_OutgoingBoxTitle(struct Sprite *); -static void SpriteCB_MovePartyMonToNextSlot(struct Sprite *); -static void SpriteCB_IncomingBoxTitle(struct Sprite *); -static void MovePartySprites(s16); -static void SetPartySlotTilemap(u8, bool8); -static const u8 *GetMovingItemName(void); -static void SetMenuText(u8); -static void TryLoadItemIconAtPos(u8, u8); -static void TryHideItemIconAtPos(u8, u8); -static void InitItemIconInCursor(u16); -static struct Sprite *CreateMonIconSprite(u16, u32, s16, s16, u8, u8); -static void DestroyBoxMonIcon(struct Sprite *); -static void SetBoxSpeciesAndPersonalities(u8); -static void MovePartySpriteToNextSlot(struct Sprite *, u16); -static void Task_InitBox(u8); -static void InitBoxTitle(u8); -static s8 DetermineBoxScrollDirection(u8); -static void DrawWallpaper(const void *, s8, u8); -static s16 GetBoxTitleBaseX(const u8 *); -static bool8 MonPlaceChange_Shift(void); -static bool8 MonPlaceChange_Grab(void); -static bool8 MonPlaceChange_Place(void); -static bool8 MultiMonPlaceChange_Up(void); -static bool8 MultiMonPlaceChange_Down(void); -static void GetCursorCoordsByPos(u8, u8, u16 *, u16 *); -static void SetShiftedMonData(u8, u8); -static void SetMovingMonData(u8, u8); -static void SetPlacedMonData(u8, u8); -static void PurgeMonOrBoxMon(u8, u8); -static void SetDisplayMonData(void *, u8); -static bool32 AtLeastThreeUsableMons(void); + +// Input handlers static u8 InBoxInput_Normal(void); static u8 InBoxInput_MovingMultiple(void); static u8 InBoxInput_SelectingMultiple(void); -static s8 GetMenuItemTextId(u8); +static u8 HandleInput(void); +static void AddBoxOptionsMenu(void); static u8 SetSelectionMenuTexts(void); static bool8 SetMenuTexts_Mon(void); static bool8 SetMenuTexts_Item(void); -static u8 GetBoxWallpaper(u8); -static void SetBoxWallpaper(u8, u8); -// Functions for moving multiple Pokémon at once +// Choose box menu +static void ChooseBoxMenu_CreateSprites(u8); +static void ChooseBoxMenu_DestroySprites(void); +static void ChooseBoxMenu_MoveLeft(void); +static void ChooseBoxMenu_MoveRight(void); +static void ChooseBoxMenu_PrintInfo(void); +static void SpriteCB_ChooseBoxArrow(struct Sprite *); + +// Options menus +static void InitMenu(void); +static void SetMenuText(u8); +static s8 GetMenuItemTextId(u8); +static void AddMenu(void); +static bool8 IsMenuLoading(void); +static s16 HandleMenuInput(void); +static void RemoveMenu(void); + +// Pokémon sprites +static void InitMonIconFields(void); +static void SpriteCB_BoxMonIconScrollOut(struct Sprite *); +static void GetIncomingBoxMonData(u8); +static void CreatePartyMonsSprites(bool8); +static void CompactPartySprites(void); +static u8 GetNumPartySpritesCompacting(void); +static void MovePartySpriteToNextSlot(struct Sprite *, u16); +static void SpriteCB_MovePartyMonToNextSlot(struct Sprite *); +static void MovePartySprites(s16); +static void DestroyAllPartyMonIcons(void); +static void ReshowReleaseMon(void); +static bool8 ResetReleaseMonSpritePtr(void); +static void SetMovingMonPriority(u8); +static void SpriteCB_HeldMon(struct Sprite *); +static struct Sprite *CreateMonIconSprite(u16, u32, s16, s16, u8, u8); +static void DestroyBoxMonIcon(struct Sprite *); + +// Pokémon data +static void MoveMon(void); +static void PlaceMon(void); +static void RefreshDisplayMon(void); +static void SetMovingMonData(u8, u8); +static void SetPlacedMonData(u8, u8); +static void PurgeMonOrBoxMon(u8, u8); +static void SetShiftedMonData(u8, u8); +static bool8 TryStorePartyMonInBox(u8); +static void ResetSelectionAfterDeposit(void); +static void InitReleaseMon(void); +static bool8 TryHideReleaseMon(void); +static void InitCanReleaseMonVars(void); +static void ReleaseMon(void); +static bool32 AtLeastThreeUsableMons(void); +static s8 RunCanReleaseMon(void); +static void SaveMovingMon(void); +static void LoadSavedMovingMon(void); +static void InitSummaryScreenData(void); +static void SetSelectionAfterSummaryScreen(void); +static void SetMonMarkings(u8); +static bool8 IsRemovingLastPartyMon(void); +static bool8 CanShiftMon(void); +static bool8 IsMonBeingMoved(void); +static void TryRefreshDisplayMon(void); +static void ReshowDisplayMon(void); +static void SetDisplayMonData(void *, u8); + +// Moving multiple Pokémon at once static void MultiMove_Free(void); static bool8 MultiMove_Init(void); static bool8 MultiMove_RunFunction(void); @@ -802,7 +706,7 @@ static void MultiMove_SelectRow(u8, u8, u8); static void MultiMove_SelectColumn(u8, u8, u8); static void MultiMove_DeselectColumn(u8, u8, u8); -// Functions for Move Items mode +// Move Items mode static bool32 IsItemIconAtPosition(u8, u8); static const u32 *GetItemIconPic(u16); static const u32 *GetItemIconPalette(u16); @@ -812,6 +716,25 @@ static void LoadItemIconGfx(u8, const u32 *, const u32 *); static void SetItemIconAffineAnim(u8, u8); static void SetItemIconActive(u8, bool8); static u8 GetItemIconIdxByPosition(u8, u8); +static void CreateItemIconSprites(void); +static void TryLoadItemIconAtPos(u8, u8); +static void TryHideItemIconAtPos(u8, u8); +static void TakeItemFromMon(u8, u8); +static void InitItemIconInCursor(u16); +static void SwapItemsWithMon(u8, u8); +static void GiveItemToMon(u8, u8); +static void MoveItemFromMonToBag(u8, u8); +static void MoveItemFromCursorToBag(void); +static void MoveHeldItemWithPartyMenu(void); +static bool8 IsItemIconAnimActive(void); +static bool8 IsMovingItem(void); +static const u8 *GetMovingItemName(void); +static u16 GetMovingItemId(void); +static void PrintItemDescription(void); +static void InitItemInfoWindow(void); +static bool8 UpdateItemInfoWindowSlideIn(void); +static bool8 UpdateItemInfoWindowSlideOut(void); +static void DrawItemInfoWindow(u32); static void SetItemIconCallback(u8, u8, u8, u8); static void SpriteCB_ItemIcon_SetPosToCursor(struct Sprite *); static void SpriteCB_ItemIcon_WaitAnim(struct Sprite *); @@ -821,7 +744,116 @@ static void SpriteCB_ItemIcon_SwapToHand(struct Sprite *); static void SpriteCB_ItemIcon_HideParty(struct Sprite *); static void SpriteCB_ItemIcon_SwapToMon(struct Sprite *); -// Functions for the tilemap updating utility +// Cursor +static void CreateCursorSprites(void); +static void ToggleCursorAutoAction(void); +static u8 GetCursorPosition(void); +static void StartCursorAnim(u8); +static void TryHideItemAtCursor(void); +static void TryShowItemAtCursor(void); +static void InitCursor(void); +static void InitCursorOnReopen(void); +static void GetCursorCoordsByPos(u8, u8, u16 *, u16 *); +static bool8 UpdateCursorPos(void); +static void DoCursorNewPosUpdate(void); +static void SetCursorInParty(void); +static void SetCursorBoxPosition(u8); +static void ClearSavedCursorPos(void); +static void SaveCursorPos(void); +static u8 GetSavedCursorPos(void); +static void InitMonPlaceChange(u8); +static bool8 DoMonPlaceChange(void); +static bool8 MonPlaceChange_Shift(void); +static bool8 MonPlaceChange_Grab(void); +static bool8 MonPlaceChange_Place(void); +static bool8 MultiMonPlaceChange_Up(void); +static bool8 MultiMonPlaceChange_Down(void); +static bool8 MonPlaceChange_CursorDown(void); +static bool8 MonPlaceChange_CursorUp(void); +static void TrySetCursorFistAnim(void); +static bool8 IsCursorOnCloseBox(void); +static bool8 IsCursorOnBoxTitle(void); +static bool8 IsCursorInBox(void); + +// Scroll arrows +static void CreateBoxScrollArrows(void); +static void StartBoxScrollArrowsSlide(s8); +static void StopBoxScrollArrowsSlide(void); +static void AnimateBoxScrollArrows(bool8); +static void SpriteCB_Arrow(struct Sprite *); +static struct Sprite *CreateChooseBoxArrows(u16, u16, u8, u8, u8); + +// Box title +static void InitBoxTitle(u8); +static void CreateIncomingBoxTitle(u8, s8); +static void CycleBoxTitleSprites(void); +static void SpriteCB_IncomingBoxTitle(struct Sprite *); +static void SpriteCB_OutgoingBoxTitle(struct Sprite *); +static void CycleBoxTitleColor(void); +static s16 GetBoxTitleBaseX(const u8 *); + +// Wallpaper +static void SetWallpaperForCurrentBox(u8); +static bool8 DoWallpaperGfxChange(void); +static void LoadWallpaperGfx(u8, s8); +static bool32 WaitForWallpaperGfxLoad(void); +static void DrawWallpaper(const void *, s8, u8); +static void TrimOldWallpaper(void *); +static void AddWallpaperSetsMenu(void); +static void AddWallpapersMenu(u8); +static u8 GetBoxWallpaper(u8); +static void SetBoxWallpaper(u8, u8); + +// General box +static void CreateInitBoxTask(u8); +static bool8 IsInitBoxActive(void); +static void Task_InitBox(u8); +static void SetUpScrollToBox(u8); +static bool8 ScrollToBox(void); +static s8 DetermineBoxScrollDirection(u8); +static void SetCurrentBox(u8); + +// Misc +static void CreateMainMenu(u8, s16 *); +static u8 GetCurrentBoxOption(void); +static void ScrollBackground(void); +static void UpdateCloseBoxButtonFlash(void); +static void GiveChosenBagItem(void); +static void SetUpHidePartyMenu(void); +static void LoadPokeStorageMenuGfx(void); +static void LoadWaveformSpritePalette(void); +static void InitPokeStorageBg0(void); +static void SetScrollingBackground(void); +static void UpdateBoxToSendMons(void); +static void InitCursorItemIcon(void); +static void InitPalettesAndSprites(void); +static void RefreshDisplayMonData(void); +static void CreateDisplayMonSprite(void); +static void CreateMarkingComboSprite(void); +static void CreateWaveformSprites(void); +static void ClearBottomWindow(void); +static void InitSupplementalTilemaps(void); +static void PrintDisplayMonInfo(void); +static void UpdateWaveformAnimation(void); +static void SetPartySlotTilemaps(void); +static void StopFlashingCloseBoxButton(void); +static void FreePokeStorageData(void); +static void UpdatePartySlotColors(void); +static void StartFlashingCloseBoxButton(void); +static void SetUpDoShowPartyMenu(void); +static void StartDisplayMonMosaicEffect(void); +static bool8 InitPokeStorageWindows(void); +static bool8 DoShowPartyMenu(void); +static bool8 HidePartyMenu(void); +static bool8 IsDisplayMosaicActive(void); +static void ShowYesNoWindow(s8); +static void UpdateCloseBoxButtonTilemap(bool8); +static void PrintMessage(u8 id); +static void LoadDisplayMonGfx(u16, u32); +static void SpriteCB_DisplayMonMosaic(struct Sprite *); +static void SetPartySlotTilemap(u8, bool8); + +// Tilemap utility static void TilemapUtil_SetRect(u8, u16, u16, u16, u16); static void TilemapUtil_Move(u8, u8, s8); static void TilemapUtil_SetMap(u8, u8, const void *, u16, u16); @@ -832,7 +864,7 @@ static void TilemapUtil_Update(u8); static void TilemapUtil_DrawPrev(u8); static void TilemapUtil_Draw(u8); -// Functions for unknown utility +// Unknown utility static void UnkUtil_Init(struct UnkUtil *, struct UnkUtilData *, u32); static void UnkUtil_Run(void); static void UnkUtil_CpuRun(struct UnkUtilData *); @@ -945,8 +977,8 @@ static const u16 sPartySlotEmpty_Tilemap[] = static const u16 sWaveform_Pal[] = INCBIN_U16("graphics/pokemon_storage/waveform.gbapal"); static const u32 sWaveform_Gfx[] = INCBIN_U32("graphics/pokemon_storage/waveform.4bpp"); -static const u16 gUnknown_085726B4[] = INCBIN_U16("graphics/unused/unknown_5726B4.gbapal"); -static const u16 gUnknown_085726F4[] = INCBIN_U16("graphics/unknown/unknown_5726F4.gbapal"); +static const u16 sUnused_Pal[] = INCBIN_U16("graphics/pokemon_storage/unused.gbapal"); +static const u16 sUnknown_Pal[] = INCBIN_U16("graphics/pokemon_storage/unknown.gbapal"); static const struct WindowTemplate sWindowTemplates[] = { @@ -1022,7 +1054,7 @@ static const struct BgTemplate sBgTemplates[] = static const struct SpritePalette gWaveformSpritePalette = { - sWaveform_Pal, PALTAG_10 + sWaveform_Pal, PALTAG_MISC_2 }; static const struct SpriteSheet sSpriteSheet_Waveform = @@ -1161,7 +1193,7 @@ static const union AnimCmd *const sAnims_Waveform[] = static const struct SpriteTemplate sSpriteTemplate_Waveform = { .tileTag = GFXTAG_WAVEFORM, - .paletteTag = PALTAG_10, + .paletteTag = PALTAG_MISC_2, .oam = &sOamData_Waveform, .anims = sAnims_Waveform, .images = NULL, @@ -1254,7 +1286,7 @@ static const struct SpriteTemplate sSpriteTemplate_BoxTitle = .paletteTag = PALTAG_BOX_TITLE, .oam = &sOamData_BoxTitle, .anims = sAnims_BoxTitle, - .images NULL, + .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy }; @@ -1287,7 +1319,7 @@ static const union AnimCmd *const sAnims_Arrow[] = static const struct SpriteTemplate sSpriteTemplate_Arrow = { .tileTag = GFXTAG_ARROW, - .paletteTag = PALTAG_10, + .paletteTag = PALTAG_MISC_2, .oam = &sOamData_Arrow, .anims = sAnims_Arrow, .images = NULL, @@ -1299,6 +1331,12 @@ static const u16 sHandCursor_Pal[] = INCBIN_U16("graphics/pokemon_storage/hand_c static const u8 sHandCursor_Gfx[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor.4bpp"); static const u8 sHandCursorShadow_Gfx[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor_shadow.4bpp"); + +//------------------------------------------------------------------------------ +// SECTION: Misc utility +//------------------------------------------------------------------------------ + + void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero2, s32 bytesToBuffer) { s32 i, tileBytesToBuffer, remainingBytes; @@ -1461,7 +1499,8 @@ u8 *StringCopyAndFillWithSpaces(u8 *dst, const u8 *src, u16 n) return str; } -static void sub_80C7128(u16 *dest, u16 dest_left, u16 dest_top, const u16 *src, u16 src_left, u16 src_top, u16 dest_width, u16 dest_height, u16 src_width) +// Unused +static void UnusedWriteRectCpu(u16 *dest, u16 dest_left, u16 dest_top, const u16 *src, u16 src_left, u16 src_top, u16 dest_width, u16 dest_height, u16 src_width) { u16 i; @@ -1476,7 +1515,8 @@ static void sub_80C7128(u16 *dest, u16 dest_left, u16 dest_top, const u16 *src, } } -static void sub_80C71A4(u16 *dest, u16 dest_left, u16 dest_top, u16 width, u16 height) +// Unused +static void UnusedWriteRectDma(u16 *dest, u16 dest_left, u16 dest_top, u16 width, u16 height) { u16 i; @@ -1486,6 +1526,16 @@ static void sub_80C71A4(u16 *dest, u16 dest_left, u16 dest_top, u16 width, u16 h Dma3FillLarge16_(0, dest, width); } + +//------------------------------------------------------------------------------ +// SECTION: Main menu +// +// The below functions generally handle the PC main menu where the main +// options can be selected (Withdraw, Deposit, etc.), as well as exiting +// Pokémon Storage back to this menu. +//------------------------------------------------------------------------------ + + enum { STATE_LOAD, STATE_FADE_IN, @@ -1714,6 +1764,16 @@ void ResetPokemonStorageSystem(void) ResetWaldaWallpaper(); } + +//------------------------------------------------------------------------------ +// SECTION: Choose Box menu +// +// The below functions handle the popup menu that allows the player to cycle +// through the boxes and select one. Used when storing Pokémon in Deposit mode +// and for the Jump feature. +//------------------------------------------------------------------------------ + + static void LoadChooseBoxMenuGfx(struct ChooseBoxMenu *menu, u16 tileTag, u16 palTag, u8 subpriority, bool32 loadPal) { struct SpritePalette palette = @@ -1919,6 +1979,17 @@ static void SpriteCB_ChooseBoxArrow(struct Sprite *sprite) } } + +//------------------------------------------------------------------------------ +// SECTION: Main tasks +// +// Below are the main task callbacks that handle the primary actions the +// player can take in the PC. The most 'important' of these tasks is the +// primary one, Task_PokeStorageMain. Also included are some basic +// initialization functions. +//------------------------------------------------------------------------------ + + static void VBlankCB_PokeStorage(void) { LoadOam(); @@ -1989,7 +2060,7 @@ static void ResetAllBgCoords(void) SetGpuReg(REG_OFFSET_BG3VOFS, 0); } -static void sub_80C7E98(void) +static void ResetForPokeStorage(void) { ResetPaletteFade(); ResetSpriteData(); @@ -2006,7 +2077,7 @@ static void sub_80C7E98(void) sStorage->closeBoxFlashing = FALSE; } -static void sub_80C7F1C(void) +static void InitStartingPosData(void) { ClearSavedCursorPos(); sInPartyMenu = (sStorage->boxOption == OPTION_DEPOSIT); @@ -2036,7 +2107,7 @@ static void Task_InitPokeStorage(u8 taskId) case 0: SetVBlankCallback(NULL); SetGpuReg(REG_OFFSET_DISPCNT, 0); - sub_80C7E98(); + ResetForPokeStorage(); if (sStorage->isReopening) { switch (sWhichToReshow) @@ -2074,14 +2145,14 @@ static void Task_InitPokeStorage(u8 taskId) case 3: ResetAllBgCoords(); if (!sStorage->isReopening) - sub_80C7F1C(); + InitStartingPosData(); break; case 4: InitMonIconFields(); if (!sStorage->isReopening) - sub_80CD36C(); + InitCursor(); else - sub_80CD3EC(); + InitCursorOnReopen(); break; case 5: if (!MultiMove_Init()) @@ -2092,11 +2163,11 @@ static void Task_InitPokeStorage(u8 taskId) else { SetScrollingBackground(); - sub_80CAC1C(); + InitPokeStorageBg0(); } break; case 6: - sub_80CA0D8(); + InitPalettesAndSprites(); break; case 7: InitSupplementalTilemaps(); @@ -2118,7 +2189,7 @@ static void Task_InitPokeStorage(u8 taskId) else { CreateItemIconSprites(); - sub_80CAEAC(); + InitCursorItemIcon(); } break; case 10: @@ -2795,7 +2866,7 @@ static void Task_DepositMenu(u8 taskId) { case 0: PrintMessage(MSG_DEPOSIT_IN_WHICH_BOX); - LoadChooseBoxMenuGfx(&sStorage->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, PALTAG_7, 3, FALSE); + LoadChooseBoxMenuGfx(&sStorage->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, PALTAG_MISC_1, 3, FALSE); CreateChooseBoxMenuSprites(sDepositBoxId); sStorage->state++; break; @@ -2836,7 +2907,7 @@ static void Task_DepositMenu(u8 taskId) case 3: if (GetNumPartySpritesCompacting() == 0) { - sub_80CE22C(); + ResetSelectionAfterDeposit(); StartDisplayMonMosaicEffect(); UpdatePartySlotColors(); SetPokeStorageTask(Task_PokeStorageMain); @@ -3450,7 +3521,7 @@ static void Task_JumpBox(u8 taskId) { case 0: PrintMessage(MSG_JUMP_TO_WHICH_BOX); - LoadChooseBoxMenuGfx(&sStorage->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, PALTAG_7, 3, FALSE); + LoadChooseBoxMenuGfx(&sStorage->chooseBoxMenu, GFXTAG_CHOOSE_BOX_MENU, PALTAG_MISC_1, 3, FALSE); CreateChooseBoxMenuSprites(StorageGetCurrentBox()); sStorage->state++; break; @@ -3601,7 +3672,7 @@ static void Task_OnCloseBoxPressed(u8 taskId) case 4: if (!IsComputerScreenCloseEffectActive()) { - sub_80CABE0(); + UpdateBoxToSendMons(); gPlayerPartyCount = CalculatePlayerPartyCount(); sStorage->screenChangeType = SCREEN_CHANGE_EXIT_BOX; SetPokeStorageTask(Task_ChangeScreen); @@ -3662,7 +3733,7 @@ static void Task_OnBPressed(u8 taskId) case 4: if (!IsComputerScreenCloseEffectActive()) { - sub_80CABE0(); + UpdateBoxToSendMons(); gPlayerPartyCount = CalculatePlayerPartyCount(); sStorage->screenChangeType = SCREEN_CHANGE_EXIT_BOX; SetPokeStorageTask(Task_ChangeScreen); @@ -3737,6 +3808,16 @@ static void FreePokeStorageData(void) FreeAllWindowBuffers(); } + +//------------------------------------------------------------------------------ +// SECTION: Misc +// +// No real uniform section below. Misc functions including more initialization, +// showing/hiding the party menu, updating the Close Box button, printing +// messages, doing the mosaic effect when transitioning between Pokémon, etc. +//------------------------------------------------------------------------------ + + static void SetScrollingBackground(void) { SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) | BGCNT_CHARBASE(3) | BGCNT_16COLOR | BGCNT_SCREENBASE(31)); @@ -3778,11 +3859,11 @@ static void LoadWaveformSpritePalette(void) LoadSpritePalette(&gWaveformSpritePalette); } -static void sub_80CA0D8(void) +static void InitPalettesAndSprites(void) { LoadPalette(sInterface_Pal, 0, sizeof(sInterface_Pal)); LoadPalette(sPkmnDataGray_Pal, 0x20, sizeof(sPkmnDataGray_Pal)); - LoadPalette(gUnknown_085726F4, 0xF0, sizeof(gUnknown_085726F4)); + LoadPalette(sUnknown_Pal, 0xF0, sizeof(sUnknown_Pal)); if (sStorage->boxOption != OPTION_MOVE_ITEMS) LoadPalette(sBg_Pal, 0x30, sizeof(sBg_Pal)); else @@ -4003,7 +4084,7 @@ static void InitSupplementalTilemaps(void) static void SetUpShowPartyMenu(void) { - sStorage->partyMenuUnused = 20; + sStorage->partyMenuUnused1 = 20; sStorage->partyMenuY = 2; sStorage->partyMenuMoveTimer = 0; CreatePartyMonsSprites(FALSE); @@ -4014,7 +4095,7 @@ static bool8 ShowPartyMenu(void) if (sStorage->partyMenuMoveTimer == 20) return FALSE; - sStorage->partyMenuUnused--; + sStorage->partyMenuUnused1--; sStorage->partyMenuY++; TilemapUtil_Move(TILEMAPID_PARTY_MENU, 3, 1); TilemapUtil_Update(TILEMAPID_PARTY_MENU); @@ -4033,7 +4114,7 @@ static bool8 ShowPartyMenu(void) static void SetUpHidePartyMenu(void) { - sStorage->partyMenuUnused = 0; + sStorage->partyMenuUnused1 = 0; sStorage->partyMenuY = 22; sStorage->partyMenuMoveTimer = 0; if (sStorage->boxOption == OPTION_MOVE_ITEMS) @@ -4044,7 +4125,7 @@ static bool8 HidePartyMenu(void) { if (sStorage->partyMenuMoveTimer != 20) { - sStorage->partyMenuUnused++; + sStorage->partyMenuUnused1++; sStorage->partyMenuY--; TilemapUtil_Move(TILEMAPID_PARTY_MENU, 3, -1); TilemapUtil_Update(TILEMAPID_PARTY_MENU); @@ -4186,7 +4267,7 @@ static bool8 DoShowPartyMenu(void) return TRUE; } -static void sub_80CABE0(void) +static void UpdateBoxToSendMons(void) { if (sLastUsedBox != StorageGetCurrentBox()) { @@ -4195,7 +4276,7 @@ static void sub_80CABE0(void) } } -static void sub_80CAC1C(void) +static void InitPokeStorageBg0(void) { SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(29)); LoadUserWindowBorderGfx(1, 2, 208); @@ -4307,7 +4388,7 @@ static u8 GetCurrentBoxOption(void) return sCurrentBoxOption; } -static void sub_80CAEAC(void) +static void InitCursorItemIcon(void) { if (!IsCursorOnBoxTitle()) { @@ -4324,6 +4405,16 @@ static void sub_80CAEAC(void) } } + +//------------------------------------------------------------------------------ +// SECTION: Pokémon sprites +// +// The below functions generally handle the Pokémon icon sprites, including +// moving them with a scrolling box, shifting the party sprites, and +// animating released Pokémon. +//------------------------------------------------------------------------------ + + static void InitMonIconFields(void) { u16 i; @@ -4339,7 +4430,7 @@ static void InitMonIconFields(void) sStorage->boxMonsSprites[i] = NULL; sStorage->movingMonSprite = NULL; - sStorage->field_78C = 0; + sStorage->unkUnused1 = 0; } static u8 GetMonIconPriorityByCursorPos(void) @@ -4538,7 +4629,7 @@ static u8 CreateBoxMonIconsInColumn(u8 column, u16 distance, s16 speed) sStorage->boxMonsSprites[boxPosition]->sSpeed = speed; sStorage->boxMonsSprites[boxPosition]->sScrollInDestX = xDest; sStorage->boxMonsSprites[boxPosition]->callback = SpriteCB_BoxMonIconScrollIn; - if (GetBoxMonDataAt(sStorage->field_C5C, boxPosition, MON_DATA_HELD_ITEM) == ITEM_NONE) + if (GetBoxMonDataAt(sStorage->incomingBoxId, boxPosition, MON_DATA_HELD_ITEM) == ITEM_NONE) sStorage->boxMonsSprites[boxPosition]->oam.objMode = ST_OAM_OBJ_BLEND; iconsCreated++; } @@ -4565,7 +4656,7 @@ static void InitBoxMonIconScroll(u8 boxId, s8 direction) sStorage->iconScrollDistance = 32; sStorage->iconScrollSpeed = -(6 * direction); sStorage->iconScrollNumIncoming = 0; - SetBoxSpeciesAndPersonalities(boxId); + GetIncomingBoxMonData(boxId); if (direction > 0) sStorage->iconScrollCurColumn = 0; else @@ -4625,7 +4716,7 @@ static bool8 UpdateBoxMonIconScroll(void) return TRUE; } -static void SetBoxSpeciesAndPersonalities(u8 boxId) +static void GetIncomingBoxMonData(u8 boxId) { s32 i, j, boxPosition; @@ -4641,7 +4732,7 @@ static void SetBoxSpeciesAndPersonalities(u8 boxId) } } - sStorage->field_C5C = boxId; + sStorage->incomingBoxId = boxId; } static void DestroyBoxMonIconAtPosition(u8 boxPosition) @@ -4867,7 +4958,7 @@ static void SetMovingMonSprite(u8 mode, u8 id) sStorage->movingMonSprite->subpriority = 7; } -static void sub_80CBCAC(u8 boxId, u8 position) +static void SetPlacedMonSprite(u8 boxId, u8 position) { if (boxId == TOTAL_BOXES_COUNT) // party mon { @@ -4885,47 +4976,47 @@ static void sub_80CBCAC(u8 boxId, u8 position) sStorage->movingMonSprite = NULL; } -static void sub_80CBD5C(u8 boxId, u8 position) +static void SaveMonSpriteAtPos(u8 boxId, u8 position) { if (boxId == TOTAL_BOXES_COUNT) // party mon - sStorage->field_B00 = &sStorage->partySprites[position]; + sStorage->shiftMonSpritePtr = &sStorage->partySprites[position]; else - sStorage->field_B00 = &sStorage->boxMonsSprites[position]; + sStorage->shiftMonSpritePtr = &sStorage->boxMonsSprites[position]; sStorage->movingMonSprite->callback = SpriteCallbackDummy; - sStorage->field_C5D = 0; + sStorage->shiftTimer = 0; } -static bool8 sub_80CBDC4(void) +static bool8 MoveShiftingMons(void) { - if (sStorage->field_C5D == 16) + if (sStorage->shiftTimer == 16) return FALSE; - sStorage->field_C5D++; - if (sStorage->field_C5D & 1) + sStorage->shiftTimer++; + if (sStorage->shiftTimer & 1) { - (*sStorage->field_B00)->pos1.y--; + (*sStorage->shiftMonSpritePtr)->pos1.y--; sStorage->movingMonSprite->pos1.y++; } - (*sStorage->field_B00)->pos2.x = gSineTable[sStorage->field_C5D * 8] / 16; - sStorage->movingMonSprite->pos2.x = -(gSineTable[sStorage->field_C5D * 8] / 16); - if (sStorage->field_C5D == 8) + (*sStorage->shiftMonSpritePtr)->pos2.x = gSineTable[sStorage->shiftTimer * 8] / 16; + sStorage->movingMonSprite->pos2.x = -(gSineTable[sStorage->shiftTimer * 8] / 16); + if (sStorage->shiftTimer == 8) { - sStorage->movingMonSprite->oam.priority = (*sStorage->field_B00)->oam.priority; - sStorage->movingMonSprite->subpriority = (*sStorage->field_B00)->subpriority; - (*sStorage->field_B00)->oam.priority = GetMonIconPriorityByCursorPos(); - (*sStorage->field_B00)->subpriority = 7; + sStorage->movingMonSprite->oam.priority = (*sStorage->shiftMonSpritePtr)->oam.priority; + sStorage->movingMonSprite->subpriority = (*sStorage->shiftMonSpritePtr)->subpriority; + (*sStorage->shiftMonSpritePtr)->oam.priority = GetMonIconPriorityByCursorPos(); + (*sStorage->shiftMonSpritePtr)->subpriority = 7; } - if (sStorage->field_C5D == 16) + if (sStorage->shiftTimer == 16) { struct Sprite *sprite = sStorage->movingMonSprite; - sStorage->movingMonSprite = (*sStorage->field_B00); - *sStorage->field_B00 = sprite; + sStorage->movingMonSprite = (*sStorage->shiftMonSpritePtr); + *sStorage->shiftMonSpritePtr = sprite; sStorage->movingMonSprite->callback = SpriteCB_HeldMon; - (*sStorage->field_B00)->callback = SpriteCallbackDummy; + (*sStorage->shiftMonSpritePtr)->callback = SpriteCallbackDummy; } return TRUE; @@ -5091,6 +5182,14 @@ static void DestroyBoxMonIcon(struct Sprite *sprite) DestroySprite(sprite); } + +//------------------------------------------------------------------------------ +// SECTION: General box +// +// Some basic box functions, including initializing the box and scrolling. +//------------------------------------------------------------------------------ + + #define tState data[0] #define tDmaIdx data[1] #define tBoxId data[2] @@ -5221,6 +5320,12 @@ static s8 DetermineBoxScrollDirection(u8 boxId) return (i < TOTAL_BOXES_COUNT / 2) ? 1 : -1; } + +//------------------------------------------------------------------------------ +// SECTION: Wallpaper gfx +//------------------------------------------------------------------------------ + + static void SetWallpaperForCurrentBox(u8 wallpaperId) { u8 boxId = StorageGetCurrentBox(); @@ -5233,7 +5338,7 @@ static bool8 DoWallpaperGfxChange(void) switch (sStorage->wallpaperChangeState) { case 0: - BeginNormalPaletteFade(sStorage->boxTitlePalBits, 1, 0, 16, RGB_WHITEALPHA); + BeginNormalPaletteFade(sStorage->wallpaperPalBits, 1, 0, 16, RGB_WHITEALPHA); sStorage->wallpaperChangeState++; break; case 1: @@ -5248,7 +5353,7 @@ static bool8 DoWallpaperGfxChange(void) if (WaitForWallpaperGfxLoad() == TRUE) { CycleBoxTitleColor(); - BeginNormalPaletteFade(sStorage->boxTitlePalBits, 1, 16, 0, RGB_WHITEALPHA); + BeginNormalPaletteFade(sStorage->wallpaperPalBits, 1, 16, 0, RGB_WHITEALPHA); sStorage->wallpaperChangeState++; } break; @@ -5369,6 +5474,12 @@ static void TrimOldWallpaper(void *tilemap) } } + +//------------------------------------------------------------------------------ +// SECTION: Box Title +//------------------------------------------------------------------------------ + + static void InitBoxTitle(u8 boxId) { u8 tagIndex; @@ -5386,11 +5497,11 @@ static void InitBoxTitle(u8 boxId) sStorage->boxTitlePal[14] = sBoxTitleColors[wallpaperId][0]; // Shadow color sStorage->boxTitlePal[15] = sBoxTitleColors[wallpaperId][1]; // Text Color LoadSpritePalettes(palettes); - sStorage->boxTitlePalBits = 0x3f0; + sStorage->wallpaperPalBits = 0x3f0; tagIndex = IndexOfSpritePaletteTag(PALTAG_BOX_TITLE); sStorage->boxTitlePalOffset = 0x10e + 16 * tagIndex; - sStorage->boxTitlePalBits |= 0x10000 << tagIndex; + sStorage->wallpaperPalBits |= 0x10000 << tagIndex; // The below seems intended to have separately tracked // the incoming wallpaper title's palette, but as they now @@ -5398,7 +5509,7 @@ static void InitBoxTitle(u8 boxId) // this is redundant along with the use of boxTitleAltPalOffset tagIndex = IndexOfSpritePaletteTag(PALTAG_BOX_TITLE); sStorage->boxTitleAltPalOffset = 0x10e + 16 * tagIndex; - sStorage->boxTitlePalBits |= 0x10000 << tagIndex; + sStorage->wallpaperPalBits |= 0x10000 << tagIndex; StringCopyPadded(sStorage->boxTitleText, GetBoxNamePtr(boxId), 0, 8); DrawTextWindowAndBufferTiles(sStorage->boxTitleText, sStorage->boxTitleTiles, 0, 0, 2); @@ -5526,6 +5637,12 @@ static s16 GetBoxTitleBaseX(const u8 *string) return DISPLAY_WIDTH - 64 - GetStringWidth(1, string, 0) / 2; } + +//------------------------------------------------------------------------------ +// SECTION: Scroll arrows +//------------------------------------------------------------------------------ + + // Sprite data for box scroll arrows #define sState data[0] #define sTimer data[1] @@ -5673,7 +5790,16 @@ static struct Sprite *CreateChooseBoxArrows(u16 x, u16 y, u8 animId, u8 priority return &gSprites[spriteId]; } -static void sub_80CD36C(void) + +//------------------------------------------------------------------------------ +// SECTION: Cursor movement +// +// The functions below generally handle the cursor's movement, including +// moving around the box and picking up/putting down Pokémon. +//------------------------------------------------------------------------------ + + +static void InitCursor(void) { if (sStorage->boxOption != OPTION_DEPOSIT) sCursorArea = CURSOR_AREA_IN_BOX; @@ -5692,7 +5818,7 @@ static void sub_80CD36C(void) TryRefreshDisplayMon(); } -static void sub_80CD3EC(void) +static void InitCursorOnReopen(void) { CreateCursorSprites(); ReshowDisplayMon(); @@ -6111,23 +6237,23 @@ static bool8 MonPlaceChange_Shift(void) switch (sCursorArea) { case CURSOR_AREA_IN_PARTY: - sStorage->field_D91 = TOTAL_BOXES_COUNT; + sStorage->shiftBoxId = TOTAL_BOXES_COUNT; break; case CURSOR_AREA_IN_BOX: - sStorage->field_D91 = StorageGetCurrentBox(); + sStorage->shiftBoxId = StorageGetCurrentBox(); break; default: return FALSE; } StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_OPEN); - sub_80CBD5C(sStorage->field_D91, sCursorPosition); + SaveMonSpriteAtPos(sStorage->shiftBoxId, sCursorPosition); sStorage->monPlaceChangeState++; break; case 1: - if (!sub_80CBDC4()) + if (!MoveShiftingMons()) { StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_FIST); - SetShiftedMonData(sStorage->field_D91, sCursorPosition); + SetShiftedMonData(sStorage->shiftBoxId, sCursorPosition); sStorage->monPlaceChangeState++; } break; @@ -6179,6 +6305,16 @@ static bool8 MonPlaceChange_CursorUp(void) return TRUE; } + +//------------------------------------------------------------------------------ +// SECTION: Pokémon data +// +// The functions below handle moving Pokémon data around while using the PC, +// including changing the positions of Pokémon, releasing Pokémon, viewing the +// summary screen, and updating the display of the currently selected Pokémon. +//------------------------------------------------------------------------------ + + static void MoveMon(void) { switch (sCursorArea) @@ -6209,12 +6345,12 @@ static void PlaceMon(void) { case CURSOR_AREA_IN_PARTY: SetPlacedMonData(TOTAL_BOXES_COUNT, sCursorPosition); - sub_80CBCAC(TOTAL_BOXES_COUNT, sCursorPosition); + SetPlacedMonSprite(TOTAL_BOXES_COUNT, sCursorPosition); break; case CURSOR_AREA_IN_BOX: boxId = StorageGetCurrentBox(); SetPlacedMonData(boxId, sCursorPosition); - sub_80CBCAC(boxId, sCursorPosition); + SetPlacedMonSprite(boxId, sCursorPosition); break; default: return; @@ -6301,7 +6437,7 @@ static bool8 TryStorePartyMonInBox(u8 boxId) return TRUE; } -static void sub_80CE22C(void) +static void ResetSelectionAfterDeposit(void) { StartSpriteAnim(sStorage->cursorSprite, CURSOR_ANIM_BOUNCE); TryRefreshDisplayMon(); @@ -6867,6 +7003,14 @@ static void SetDisplayMonData(void *pokemon, u8 mode) } } + +//------------------------------------------------------------------------------ +// SECTION: Input handlers +// +// The functions below process context-dependent input +//------------------------------------------------------------------------------ + + static u8 HandleInput_InBox(void) { switch (sStorage->inBoxMovingMode) @@ -7344,7 +7488,7 @@ static u8 HandleInput_OnBox(void) if (JOY_NEW(A_BUTTON)) { AnimateBoxScrollArrows(FALSE); - AddBoxMenu(); + AddBoxOptionsMenu(); return INPUT_BOX_OPTIONS; } @@ -7470,7 +7614,7 @@ static u8 HandleInput(void) return INPUT_NONE; } -static void AddBoxMenu(void) +static void AddBoxOptionsMenu(void) { InitMenu(); SetMenuText(MENU_JUMP); @@ -7588,6 +7732,14 @@ static bool8 SetMenuTexts_Item(void) return TRUE; } + +//------------------------------------------------------------------------------ +// SECTION: Cursor +// +// The functions below handle a few of the generic cursor features. +//------------------------------------------------------------------------------ + + static void SpriteCB_CursorShadow(struct Sprite *sprite) { sprite->pos1.x = sStorage->cursorSprite->pos1.x; @@ -7608,7 +7760,7 @@ static void CreateCursorSprites(void) struct SpritePalette spritePalettes[] = { - {sHandCursor_Pal, PALTAG_7}, + {sHandCursor_Pal, PALTAG_MISC_1}, {} }; @@ -7658,7 +7810,7 @@ static void CreateCursorSprites(void) static const struct SpriteTemplate sSpriteTemplate_Cursor = { .tileTag = GFXTAG_CURSOR, - .paletteTag = PALTAG_10, + .paletteTag = PALTAG_MISC_2, .oam = &sOamData_Cursor, .anims = sAnims_Cursor, .images = NULL, @@ -7669,7 +7821,7 @@ static void CreateCursorSprites(void) static const struct SpriteTemplate sSpriteTemplate_CursorShadow = { .tileTag = GFXTAG_CURSOR_SHADOW, - .paletteTag = PALTAG_10, + .paletteTag = PALTAG_MISC_2, .oam = &sOamData_CursorShadow, .anims = gDummySpriteAnimTable, .images = NULL, @@ -7679,8 +7831,8 @@ static void CreateCursorSprites(void) LoadSpriteSheets(spriteSheets); LoadSpritePalettes(spritePalettes); - sStorage->cursorPalNums[0] = IndexOfSpritePaletteTag(PALTAG_10); // White hand, normal - sStorage->cursorPalNums[1] = IndexOfSpritePaletteTag(PALTAG_7); // Yellow hand, when auto-action is on + sStorage->cursorPalNums[0] = IndexOfSpritePaletteTag(PALTAG_MISC_2); // White hand, normal + sStorage->cursorPalNums[1] = IndexOfSpritePaletteTag(PALTAG_MISC_1); // Yellow hand, when auto-action is on GetCursorCoordsByPos(sCursorArea, sCursorPosition, &x, &y); spriteId = CreateSprite(&sSpriteTemplate_Cursor, x, y, 6); @@ -7775,6 +7927,15 @@ static void TryShowItemAtCursor(void) TryLoadItemIconAtPos(CURSOR_AREA_IN_BOX, sCursorPosition); } + +//------------------------------------------------------------------------------ +// SECTION: Menu +// +// The functions below handle the generic options menu that comes up whenever +// something in the PC is selected. +//------------------------------------------------------------------------------ + + static void InitMenu(void) { sStorage->menuItemsCount = 0; @@ -8947,14 +9108,14 @@ static void LoadItemIconGfx(u8 id, const u32 *itemTiles, const u32 *itemPal) if (id >= MAX_ITEM_ICONS) return; - CpuFastFill(0, sStorage->field_42C4, 0x200); + CpuFastFill(0, sStorage->itemIconBuffer, 0x200); LZ77UnCompWram(itemTiles, sStorage->tileBuffer); for (i = 0; i < 3; i++) - CpuFastCopy(&sStorage->tileBuffer[i * 0x60], &sStorage->field_42C4[i * 0x80], 0x60); + CpuFastCopy(&sStorage->tileBuffer[i * 0x60], &sStorage->itemIconBuffer[i * 0x80], 0x60); - CpuFastCopy(sStorage->field_42C4, sStorage->itemIcons[id].tiles, 0x200); - LZ77UnCompWram(itemPal, sStorage->field_42C4); - LoadPalette(sStorage->field_42C4, sStorage->itemIcons[id].palIndex, 0x20); + CpuFastCopy(sStorage->itemIconBuffer, sStorage->itemIcons[id].tiles, 0x200); + LZ77UnCompWram(itemPal, sStorage->itemIconBuffer); + LoadPalette(sStorage->itemIconBuffer, sStorage->itemIcons[id].palIndex, 0x20); } static void SetItemIconAffineAnim(u8 id, u8 animNum) From d542baf14bd38110389046e90dde40043d4e2b6a Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Mon, 19 Apr 2021 23:44:24 -0400 Subject: [PATCH 57/63] THE BEAST IS SLAIN --- src/m4a.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/m4a.c b/src/m4a.c index 7d7193334..3bb440f65 100644 --- a/src/m4a.c +++ b/src/m4a.c @@ -887,18 +887,13 @@ void CgbModVol(struct CgbChannel *chan) if ((soundInfo->mode & 1) || !CgbPan(chan)) { chan->pan = 0xFF; - chan->envelopeGoal = (u32)(chan->rightVolume + chan->leftVolume) >> 4; + chan->envelopeGoal = (u32)(chan->leftVolume + chan->rightVolume); + chan->envelopeGoal /= 16; } else { - // Force chan->rightVolume and chan->leftVolume to be read from memory again, - // even though there is no reason to do so. - // The command line option "-fno-gcse" achieves the same result as this. - #ifndef NONMATCHING - asm("" : : : "memory"); - #endif - - chan->envelopeGoal = (u32)(chan->rightVolume + chan->leftVolume) >> 4; + chan->envelopeGoal = (u32)(chan->leftVolume + chan->rightVolume); + chan->envelopeGoal /= 16; if (chan->envelopeGoal > 15) chan->envelopeGoal = 15; } From 21f05a3c0115e3effd9b6c40c14f6b19482f03fe Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Tue, 20 Apr 2021 12:58:50 -0400 Subject: [PATCH 58/63] Resolve sio32intr_clock_slave fakematching. One left! --- src/librfu_intr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/librfu_intr.c b/src/librfu_intr.c index 1361be40e..19ea60b06 100644 --- a/src/librfu_intr.c +++ b/src/librfu_intr.c @@ -148,11 +148,7 @@ static void sio32intr_clock_slave(void) { u32 regSIODATA32; u32 r0; - #ifndef NONMATCHING - register u32 reqLen asm("r2"); - #else - u32 reqLen; - #endif + u32 reqLen; gSTWIStatus->timerActive = 0; STWI_set_timer_in_RAM(100); @@ -165,10 +161,14 @@ static void sio32intr_clock_slave(void) ((u32*)gSTWIStatus->rxPacket)[0] = regSIODATA32; gSTWIStatus->reqNext = 1; r0 = 0x99660000; - if ((regSIODATA32 >> 16) == (r0 >> 16)) + // variable reuse required + reqLen = (regSIODATA32 >> 16); + if (reqLen == (r0 >> 16)) { - gSTWIStatus->reqLength = reqLen = regSIODATA32 >> 8; - gSTWIStatus->reqActiveCommand = regSIODATA32; + // only reqLen = regSIODATA32 >> 8 is needed to match, but it looks a bit + // more consistent when both lines update the variables. Might have been a macro? + gSTWIStatus->reqLength = reqLen = (regSIODATA32 >> 8); + gSTWIStatus->reqActiveCommand = reqLen = (regSIODATA32 >> 0); if (gSTWIStatus->reqLength == 0) { if ( From 57948b86a8cb464849d915a838ccb83b0b941531 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Tue, 20 Apr 2021 21:31:39 -0400 Subject: [PATCH 59/63] Eliminate the last fakematching. We are free of nonmatchings/fakematchings! --- src/librfu_rfu.c | 3 --- src/librfu_sio32id.c | 29 ++++++++++++----------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/librfu_rfu.c b/src/librfu_rfu.c index f39ccb74c..be2fa61e4 100644 --- a/src/librfu_rfu.c +++ b/src/librfu_rfu.c @@ -1758,9 +1758,6 @@ static void rfu_constructSendLLFrame(void) { u8 *maxSize = llf_p - offsetof(struct RfuFixed, LLFBuffer[1]); - // Does the volatile qualifier make sense? - // It's the same as: - // asm("":::"memory"); pakcketSize = maxSize - *(u8 *volatile *)&gRfuFixed; } } diff --git a/src/librfu_sio32id.c b/src/librfu_sio32id.c index b6623540f..1c02840e8 100644 --- a/src/librfu_sio32id.c +++ b/src/librfu_sio32id.c @@ -123,34 +123,29 @@ static void Sio32IDIntr(void) { u32 regSIODATA32; u16 delay; -#ifndef NONMATCHING - register u32 rfuSIO32IdUnk0_times_16 asm("r1"); - register u16 negRfuSIO32IdUnk6 asm("r0"); -#else u32 rfuSIO32IdUnk0_times_16; - u16 negRfuSIO32IdUnk6; -#endif regSIODATA32 = REG_SIODATA32; if (gRfuSIO32Id.MS_mode != AGB_CLK_MASTER) REG_SIOCNT |= SIO_ENABLE; - rfuSIO32IdUnk0_times_16 = 16 * gRfuSIO32Id.MS_mode; // to handle side effect of inline asm - rfuSIO32IdUnk0_times_16 = (regSIODATA32 << rfuSIO32IdUnk0_times_16) >> 16; + rfuSIO32IdUnk0_times_16 = (regSIODATA32 << (16 * gRfuSIO32Id.MS_mode)) >> 16; regSIODATA32 = (regSIODATA32 << 16 * (1 - gRfuSIO32Id.MS_mode)) >> 16; if (gRfuSIO32Id.lastId == 0) { - if (rfuSIO32IdUnk0_times_16 == gRfuSIO32Id.recv_id) + u16 backup = rfuSIO32IdUnk0_times_16; + if (backup == gRfuSIO32Id.recv_id) { - if (gRfuSIO32Id.count > 3) + if (gRfuSIO32Id.count < 4) { + backup = (u16)~gRfuSIO32Id.send_id; + if (gRfuSIO32Id.recv_id == backup) + { + if (regSIODATA32 == (u16)~gRfuSIO32Id.recv_id) + ++gRfuSIO32Id.count; + } + } + else gRfuSIO32Id.lastId = regSIODATA32; - } - else if (rfuSIO32IdUnk0_times_16 == (u16)~gRfuSIO32Id.send_id) - { - negRfuSIO32IdUnk6 = ~gRfuSIO32Id.recv_id; - if (regSIODATA32 == negRfuSIO32IdUnk6) - ++gRfuSIO32Id.count; - } } else { From 00eeb727db5b339fd8a62660d66d9368651cb6f8 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Wed, 21 Apr 2021 21:37:12 -0400 Subject: [PATCH 60/63] fix rfu_NI_stopReceivingData fakematching; i guess it aint over yet cowboy --- src/librfu_rfu.c | 120 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 114 insertions(+), 6 deletions(-) diff --git a/src/librfu_rfu.c b/src/librfu_rfu.c index be2fa61e4..df6362890 100644 --- a/src/librfu_rfu.c +++ b/src/librfu_rfu.c @@ -1550,21 +1550,20 @@ u16 rfu_changeSendTarget(u8 connType, u8 slotStatusIndex, u8 bmNewTgtSlot) u16 rfu_NI_stopReceivingData(u8 slotStatusIndex) { - struct NIComm *NI_comm; u16 imeBak; + struct NIComm *NI_comm; if (slotStatusIndex >= RFU_CHILD_MAX) return ERR_SLOT_NO; NI_comm = &gRfuSlotStatusNI[slotStatusIndex]->recv; imeBak = REG_IME; - ++imeBak; --imeBak; // fix imeBak, NI_comm register swap REG_IME = 0; - if (gRfuSlotStatusNI[slotStatusIndex]->recv.state & SLOT_BUSY_FLAG) + if (NI_comm->state & SLOT_BUSY_FLAG) { - if (gRfuSlotStatusNI[slotStatusIndex]->recv.state == SLOT_STATE_RECV_LAST) - gRfuSlotStatusNI[slotStatusIndex]->recv.state = SLOT_STATE_RECV_SUCCESS_AND_SENDSIDE_UNKNOWN; + if (NI_comm->state == SLOT_STATE_RECV_LAST) + NI_comm->state = SLOT_STATE_RECV_SUCCESS_AND_SENDSIDE_UNKNOWN; else - gRfuSlotStatusNI[slotStatusIndex]->recv.state = SLOT_STATE_RECV_FAILED; + NI_comm->state = SLOT_STATE_RECV_FAILED; gRfuLinkStatus->recvSlotNIFlag &= ~(1 << slotStatusIndex); rfu_STC_releaseFrame(slotStatusIndex, 1, NI_comm); } @@ -1572,6 +1571,115 @@ u16 rfu_NI_stopReceivingData(u8 slotStatusIndex) return 0; } +/* + .globl rfu_NI_stopReceivingData + .type rfu_NI_stopReceivingData,function + .thumb_func +rfu_NI_stopReceivingData: +.LFB64: +.LM902: + + push {r4, r5, lr} + lsl r0, r0, #0x18 + lsr r3, r0, #0x18 +.LM903: + +.LBB50: +.LM904: + + cmp r3, #0x3 + bls .L683 @cond_branch +.LM905: + + mov r0, #0x80 + lsl r0, r0, #0x3 + b .L687 +.L683: +.LM906: + + ldr r1, .L689 + lsl r0, r3, #0x2 + add r0, r0, r1 + ldr r2, [r0] + add r5, r2, #0 + add r5, r5, #0x34 +.LM907: + + ldr r1, .L689+0x4 + ldrh r0, [r1] +.LM908: + + add r4, r0, #0 +.LM909: + + mov r0, #0x0 + strh r0, [r1] +.LM910: + + ldrh r1, [r2, #0x34] + mov r0, #0x80 + lsl r0, r0, #0x8 + and r0, r0, r1 + cmp r0, #0 + beq .L684 @cond_branch +.LM911: + + ldr r0, .L689+0x8 + cmp r1, r0 + bne .L685 @cond_branch +.LM912: + + mov r0, #0x48 + b .L688 +.L690: + .align 2, 0 +.L689: + .word gRfuSlotStatusNI + .word 0x4000208 + .word 0x8043 +.L685: +.LM913: + + mov r0, #0x47 +.L688: + strh r0, [r2, #0x34] +.LM914: + + ldr r0, .L691 + ldr r2, [r0] + mov r1, #0x1 + lsl r1, r1, r3 + ldrb r0, [r2, #0x5] + bic r0, r0, r1 + strb r0, [r2, #0x5] +.LM915: + + add r0, r3, #0 + mov r1, #0x1 + add r2, r5, #0 + bl rfu_STC_releaseFrame +.L684: +.LM916: + + ldr r0, .L691+0x4 + strh r4, [r0] +.LM917: + + mov r0, #0x0 +.L687: +.LM918: + +.LBE50: + pop {r4, r5} + pop {r1} + bx r1 +.L692: + .align 2, 0 +.L691: + .word gRfuLinkStatus + .word 0x4000208 +*/ + u16 rfu_UNI_changeAndReadySendData(u8 slotStatusIndex, const void *src, u8 size) { struct UNISend *UNI_send; From ddc15340980898a949e2ece62ce9c846a992a4b6 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Wed, 21 Apr 2021 21:38:42 -0400 Subject: [PATCH 61/63] idiot, get rid of code in block --- src/librfu_rfu.c | 109 ----------------------------------------------- 1 file changed, 109 deletions(-) diff --git a/src/librfu_rfu.c b/src/librfu_rfu.c index df6362890..309fc4ead 100644 --- a/src/librfu_rfu.c +++ b/src/librfu_rfu.c @@ -1571,115 +1571,6 @@ u16 rfu_NI_stopReceivingData(u8 slotStatusIndex) return 0; } -/* - .globl rfu_NI_stopReceivingData - .type rfu_NI_stopReceivingData,function - .thumb_func -rfu_NI_stopReceivingData: -.LFB64: -.LM902: - - push {r4, r5, lr} - lsl r0, r0, #0x18 - lsr r3, r0, #0x18 -.LM903: - -.LBB50: -.LM904: - - cmp r3, #0x3 - bls .L683 @cond_branch -.LM905: - - mov r0, #0x80 - lsl r0, r0, #0x3 - b .L687 -.L683: -.LM906: - - ldr r1, .L689 - lsl r0, r3, #0x2 - add r0, r0, r1 - ldr r2, [r0] - add r5, r2, #0 - add r5, r5, #0x34 -.LM907: - - ldr r1, .L689+0x4 - ldrh r0, [r1] -.LM908: - - add r4, r0, #0 -.LM909: - - mov r0, #0x0 - strh r0, [r1] -.LM910: - - ldrh r1, [r2, #0x34] - mov r0, #0x80 - lsl r0, r0, #0x8 - and r0, r0, r1 - cmp r0, #0 - beq .L684 @cond_branch -.LM911: - - ldr r0, .L689+0x8 - cmp r1, r0 - bne .L685 @cond_branch -.LM912: - - mov r0, #0x48 - b .L688 -.L690: - .align 2, 0 -.L689: - .word gRfuSlotStatusNI - .word 0x4000208 - .word 0x8043 -.L685: -.LM913: - - mov r0, #0x47 -.L688: - strh r0, [r2, #0x34] -.LM914: - - ldr r0, .L691 - ldr r2, [r0] - mov r1, #0x1 - lsl r1, r1, r3 - ldrb r0, [r2, #0x5] - bic r0, r0, r1 - strb r0, [r2, #0x5] -.LM915: - - add r0, r3, #0 - mov r1, #0x1 - add r2, r5, #0 - bl rfu_STC_releaseFrame -.L684: -.LM916: - - ldr r0, .L691+0x4 - strh r4, [r0] -.LM917: - - mov r0, #0x0 -.L687: -.LM918: - -.LBE50: - pop {r4, r5} - pop {r1} - bx r1 -.L692: - .align 2, 0 -.L691: - .word gRfuLinkStatus - .word 0x4000208 -*/ - u16 rfu_UNI_changeAndReadySendData(u8 slotStatusIndex, const void *src, u8 size) { struct UNISend *UNI_send; From 5c51a3ecc6558caca77e59761150def944cbb76c Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Thu, 22 Apr 2021 16:40:46 -0400 Subject: [PATCH 62/63] get rid of apprentice fakematching(s) --- src/apprentice.c | 46 ++++++++++++++-------------------------------- 1 file changed, 14 insertions(+), 32 deletions(-) diff --git a/src/apprentice.c b/src/apprentice.c index 7053a8b63..0afee8d9b 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -322,17 +322,8 @@ static void SetRandomQuestionData(void) FREE_AND_SET_NULL(gApprenticePartyMovesData); } -// No idea why a do-while loop is needed, but it will not match without it. - -#define APPRENTICE_SPECIES_ID(speciesArrId, monId) speciesArrId = (PLAYER_APPRENTICE.speciesIds[monId] >> \ - (((PLAYER_APPRENTICE.party >> monId) & 1) << 2)) & 0xF; \ - do {} while (0) - -// Why the need to have two macros do the exact thing differently? -#define APPRENTICE_SPECIES_ID_2(speciesArrId, monId) { u8 a0 = ((PLAYER_APPRENTICE.party >> monId) & 1);\ - speciesArrId = PLAYER_APPRENTICE.speciesIds[monId]; \ - speciesArrId = ((speciesArrId) >> (a0 << 2)) & 0xF; \ - } +#define APPRENTICE_SPECIES_ID(monId) \ + ((monId < MULTI_PARTY_SIZE) ? (PLAYER_APPRENTICE.speciesIds[monId] >> (((PLAYER_APPRENTICE.party >> monId) & 1) << 2) & 0xF) : 0) // Get the second move choice for the "Which move" question // Unlike the first move choice, this can be either a level up move or a TM/HM move @@ -348,15 +339,7 @@ static u16 GetRandomAlternateMove(u8 monId) bool32 shouldUseMove; u8 level; - if (monId < MULTI_PARTY_SIZE) - { - APPRENTICE_SPECIES_ID(id, monId); - } - else - { - id = 0; - } - + id = APPRENTICE_SPECIES_ID(monId); species = gApprentices[PLAYER_APPRENTICE.id].species[id]; learnset = gLevelUpLearnsets[species]; j = 0; @@ -551,7 +534,7 @@ static void SaveApprenticeParty(u8 numQuestions) // Save party species for (i = 0; i < MULTI_PARTY_SIZE; i++) { - APPRENTICE_SPECIES_ID(speciesTableId, i); + speciesTableId = APPRENTICE_SPECIES_ID(i); apprenticeMons[i]->species = gApprentices[PLAYER_APPRENTICE.id].species[speciesTableId]; GetLatestLearnedMoves(apprenticeMons[i]->species, apprenticeMons[i]->moves); } @@ -605,7 +588,7 @@ static void CreateApprenticeMenu(u8 menu) u16 species; u32 speciesTableId; - APPRENTICE_SPECIES_ID(speciesTableId, i); + speciesTableId = APPRENTICE_SPECIES_ID(i); species = gApprentices[PLAYER_APPRENTICE.id].species[speciesTableId]; strings[i] = gSpeciesNames[species]; } @@ -1014,9 +997,12 @@ static void InitQuestionData(void) && PLAYER_APPRENTICE.questionsAnswered < count + NUM_WHICH_MON_QUESTIONS && PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].questionId == QUESTION_ID_WHICH_MOVE) { + u8 a0; // count re-used as monId count = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].monId; - APPRENTICE_SPECIES_ID_2(id1, count); + a0 = ((PLAYER_APPRENTICE.party >> count) & 1); + id1 = PLAYER_APPRENTICE.speciesIds[count]; + id1 = ((id1) >> (a0 << 2)) & 0xF; gApprenticeQuestionData->speciesId = gApprentices[PLAYER_APPRENTICE.id].species[id1]; gApprenticeQuestionData->moveId1 = GetDefaultMove(count, id1, PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].moveSlot); gApprenticeQuestionData->moveId2 = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data; @@ -1028,9 +1014,12 @@ static void InitQuestionData(void) && PLAYER_APPRENTICE.questionsAnswered < count + NUM_WHICH_MON_QUESTIONS && PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].questionId == QUESTION_ID_WHAT_ITEM) { + u8 a0; // count re-used as monId count = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].monId; - APPRENTICE_SPECIES_ID_2(id2, count); + a0 = ((PLAYER_APPRENTICE.party >> count) & 1); + id2 = PLAYER_APPRENTICE.speciesIds[count]; + id2 = ((id2) >> (a0 << 2)) & 0xF; gApprenticeQuestionData->speciesId = gApprentices[PLAYER_APPRENTICE.id].species[id2]; } } @@ -1097,14 +1086,7 @@ static void ApprenticeBufferString(void) StringCopy(stringDst, gStringVar4); break; case APPRENTICE_BUFF_LEAD_MON_SPECIES: - if (PLAYER_APPRENTICE.leadMonId < MULTI_PARTY_SIZE) - { - APPRENTICE_SPECIES_ID(speciesArrayId, PLAYER_APPRENTICE.leadMonId); - } - else - { - speciesArrayId = 0; - } + speciesArrayId = APPRENTICE_SPECIES_ID(PLAYER_APPRENTICE.leadMonId); StringCopy(stringDst, gSpeciesNames[gApprentices[PLAYER_APPRENTICE.id].species[speciesArrayId]]); break; } From 6ebd0ccb577fb5ec9136173fb31202f25b548c47 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Thu, 22 Apr 2021 17:20:28 -0400 Subject: [PATCH 63/63] add NO_COND macro --- src/apprentice.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/apprentice.c b/src/apprentice.c index 0afee8d9b..f93a3e30b 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -325,6 +325,10 @@ static void SetRandomQuestionData(void) #define APPRENTICE_SPECIES_ID(monId) \ ((monId < MULTI_PARTY_SIZE) ? (PLAYER_APPRENTICE.speciesIds[monId] >> (((PLAYER_APPRENTICE.party >> monId) & 1) << 2) & 0xF) : 0) +#define APPRENTICE_SPECIES_ID_NO_COND(monId, count) \ + monId = ((PLAYER_APPRENTICE.party >> count) & 1); \ + monId = ((PLAYER_APPRENTICE.speciesIds[count]) >> (monId << 2)) & 0xF; \ + // Get the second move choice for the "Which move" question // Unlike the first move choice, this can be either a level up move or a TM/HM move static u16 GetRandomAlternateMove(u8 monId) @@ -997,12 +1001,9 @@ static void InitQuestionData(void) && PLAYER_APPRENTICE.questionsAnswered < count + NUM_WHICH_MON_QUESTIONS && PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].questionId == QUESTION_ID_WHICH_MOVE) { - u8 a0; // count re-used as monId count = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].monId; - a0 = ((PLAYER_APPRENTICE.party >> count) & 1); - id1 = PLAYER_APPRENTICE.speciesIds[count]; - id1 = ((id1) >> (a0 << 2)) & 0xF; + APPRENTICE_SPECIES_ID_NO_COND(id1, count); gApprenticeQuestionData->speciesId = gApprentices[PLAYER_APPRENTICE.id].species[id1]; gApprenticeQuestionData->moveId1 = GetDefaultMove(count, id1, PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].moveSlot); gApprenticeQuestionData->moveId2 = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data; @@ -1014,12 +1015,9 @@ static void InitQuestionData(void) && PLAYER_APPRENTICE.questionsAnswered < count + NUM_WHICH_MON_QUESTIONS && PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].questionId == QUESTION_ID_WHAT_ITEM) { - u8 a0; // count re-used as monId count = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].monId; - a0 = ((PLAYER_APPRENTICE.party >> count) & 1); - id2 = PLAYER_APPRENTICE.speciesIds[count]; - id2 = ((id2) >> (a0 << 2)) & 0xF; + APPRENTICE_SPECIES_ID_NO_COND(id2, count); gApprenticeQuestionData->speciesId = gApprentices[PLAYER_APPRENTICE.id].species[id2]; } }