diff options
Diffstat (limited to 'src')
65 files changed, 2855 insertions, 2715 deletions
diff --git a/src/apprentice.c b/src/apprentice.c index ad157f301..20c0cb9e3 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -923,7 +923,7 @@ static void Script_PrintApprenticeMessage(void) { ScriptContext2_Enable(); FreezeObjectEvents(); - sub_808B864(); + PlayerFreeze(); sub_808BCF4(); DrawDialogueFrame(0, 1); PrintApprenticeMessage(); diff --git a/src/bard_music.c b/src/bard_music.c index 1a61c25ff..ad065249a 100644 --- a/src/bard_music.c +++ b/src/bard_music.c @@ -1,5 +1,3 @@ - -// Includes #include "global.h" #include "bard_music.h" #include "constants/easy_chat.h" @@ -10,9 +8,9 @@ #include "data/bard_music/default_sound.h" #include "data/bard_music/length_table.h" -s16 CalcWordPitch(int arg0, int songPos) +static s16 CalcWordPitch(int arg0, int songPos) { - return gBardSoundPitchTables[arg0][songPos]; + return sBardSoundPitchTables[arg0][songPos]; } const struct BardSound *GetWordSounds(u16 word) @@ -21,7 +19,7 @@ const struct BardSound *GetWordSounds(u16 word) u32 subword; const struct BardSound (*ptr)[6]; - if (ECWord_CheckIfOutsideOfValidRange(word)) + if (IsBardWordInvalid(word)) { return gBardSound_InvalidWord; } diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index 10eb013fe..8dc939919 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -95,16 +95,16 @@ static void Cmd_if_equal_(void); static void Cmd_if_not_equal_(void); static void Cmd_if_user_goes(void); static void Cmd_if_user_doesnt_go(void); -static void Cmd_nullsub_2A(void); -static void Cmd_nullsub_2B(void); +static void Cmd_nop_2A(void); +static void Cmd_nop_2B(void); static void Cmd_count_usable_party_mons(void); static void Cmd_get_considered_move(void); static void Cmd_get_considered_move_effect(void); static void Cmd_get_ability(void); static void Cmd_get_highest_type_effectiveness(void); static void Cmd_if_type_effectiveness(void); -static void Cmd_nullsub_32(void); -static void Cmd_nullsub_33(void); +static void Cmd_nop_32(void); +static void Cmd_nop_33(void); static void Cmd_if_status_in_party(void); static void Cmd_if_status_not_in_party(void); static void Cmd_get_weather(void); @@ -135,12 +135,12 @@ static void Cmd_get_move_type_from_result(void); static void Cmd_get_move_power_from_result(void); static void Cmd_get_move_effect_from_result(void); static void Cmd_get_protect_count(void); -static void Cmd_nullsub_52(void); -static void Cmd_nullsub_53(void); -static void Cmd_nullsub_54(void); -static void Cmd_nullsub_55(void); -static void Cmd_nullsub_56(void); -static void Cmd_nullsub_57(void); +static void Cmd_nop_52(void); +static void Cmd_nop_53(void); +static void Cmd_nop_54(void); +static void Cmd_nop_55(void); +static void Cmd_nop_56(void); +static void Cmd_nop_57(void); static void Cmd_call(void); static void Cmd_goto(void); static void Cmd_end(void); @@ -204,16 +204,16 @@ static const BattleAICmdFunc sBattleAICmdTable[] = Cmd_if_not_equal_, // 0x27 Cmd_if_user_goes, // 0x28 Cmd_if_user_doesnt_go, // 0x29 - Cmd_nullsub_2A, // 0x2A - Cmd_nullsub_2B, // 0x2B + Cmd_nop_2A, // 0x2A + Cmd_nop_2B, // 0x2B Cmd_count_usable_party_mons, // 0x2C Cmd_get_considered_move, // 0x2D Cmd_get_considered_move_effect, // 0x2E Cmd_get_ability, // 0x2F Cmd_get_highest_type_effectiveness, // 0x30 Cmd_if_type_effectiveness, // 0x31 - Cmd_nullsub_32, // 0x32 - Cmd_nullsub_33, // 0x33 + Cmd_nop_32, // 0x32 + Cmd_nop_33, // 0x33 Cmd_if_status_in_party, // 0x34 Cmd_if_status_not_in_party, // 0x35 Cmd_get_weather, // 0x36 @@ -244,12 +244,12 @@ static const BattleAICmdFunc sBattleAICmdTable[] = Cmd_get_move_power_from_result, // 0x4F Cmd_get_move_effect_from_result, // 0x50 Cmd_get_protect_count, // 0x51 - Cmd_nullsub_52, // 0x52 - Cmd_nullsub_53, // 0x53 - Cmd_nullsub_54, // 0x54 - Cmd_nullsub_55, // 0x55 - Cmd_nullsub_56, // 0x56 - Cmd_nullsub_57, // 0x57 + Cmd_nop_52, // 0x52 + Cmd_nop_53, // 0x53 + Cmd_nop_54, // 0x54 + Cmd_nop_55, // 0x55 + Cmd_nop_56, // 0x56 + Cmd_nop_57, // 0x57 Cmd_call, // 0x58 Cmd_goto, // 0x59 Cmd_end, // 0x5A @@ -1278,11 +1278,11 @@ static void Cmd_if_user_doesnt_go(void) gAIScriptPtr += 6; } -static void Cmd_nullsub_2A(void) +static void Cmd_nop_2A(void) { } -static void Cmd_nullsub_2B(void) +static void Cmd_nop_2B(void) { } @@ -1539,11 +1539,11 @@ static void Cmd_if_type_effectiveness(void) gAIScriptPtr += 6; } -static void Cmd_nullsub_32(void) +static void Cmd_nop_32(void) { } -static void Cmd_nullsub_33(void) +static void Cmd_nop_33(void) { } @@ -2134,27 +2134,27 @@ static void Cmd_get_protect_count(void) gAIScriptPtr += 2; } -static void Cmd_nullsub_52(void) +static void Cmd_nop_52(void) { } -static void Cmd_nullsub_53(void) +static void Cmd_nop_53(void) { } -static void Cmd_nullsub_54(void) +static void Cmd_nop_54(void) { } -static void Cmd_nullsub_55(void) +static void Cmd_nop_55(void) { } -static void Cmd_nullsub_56(void) +static void Cmd_nop_56(void) { } -static void Cmd_nullsub_57(void) +static void Cmd_nop_57(void) { } diff --git a/src/battle_anim_bug.c b/src/battle_anim_bug.c index b8aba8976..9d9952979 100644 --- a/src/battle_anim_bug.c +++ b/src/battle_anim_bug.c @@ -274,7 +274,7 @@ static void AnimTranslateWebThread(struct Sprite *sprite) SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->data[2], &sprite->data[4]); } - sub_80A6FD4(sprite); + InitAnimLinearTranslationWithSpeed(sprite); sprite->data[5] = gBattleAnimArgs[3]; sprite->callback = AnimTranslateWebThread_Step; } diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 04bab2f85..a2f52304a 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -3074,7 +3074,7 @@ static void AnimPresent(struct Sprite* sprite) sprite->callback = AnimItemSteal_Step1; } -static void sub_80FFB90(struct Sprite* sprite) +static void AnimKnockOffOpponentsItem(struct Sprite* sprite) { int zero; sprite->data[0] += ((sprite->data[3] * 128) / sprite->data[4]); @@ -3116,7 +3116,7 @@ static void AnimKnockOffItem(struct Sprite* sprite) sub_80FF9B8(sprite, 40); sprite->data[3] = 3; sprite->data[4] = 60; - sprite->callback = sub_80FFB90; + sprite->callback = AnimKnockOffOpponentsItem; } } @@ -3731,7 +3731,7 @@ static void AnimNeedleArmSpike_Step(struct Sprite* sprite) } } -static void sub_81009DC(struct Sprite* sprite) +static void AnimWhipHit_WaitEnd(struct Sprite* sprite) { if (sprite->animEnded) DestroyAnimSprite(sprite); @@ -3759,7 +3759,7 @@ static void AnimWhipHit(struct Sprite* sprite) if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) StartSpriteAnim(sprite, 1); - sprite->callback = sub_81009DC; + sprite->callback = AnimWhipHit_WaitEnd; SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; } diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index d891a4d01..f8d46af3f 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -1784,7 +1784,7 @@ static void AnimCoinThrow(struct Sprite *sprite) sprite->data[0] = gBattleAnimArgs[4]; sprite->data[2] = r6; sprite->data[4] = r7; - sprite->callback = sub_80A7000; + sprite->callback = InitAnimLinearTranslationWithSpeedAndPos; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } @@ -2569,7 +2569,7 @@ static void AnimBlendThinRing(struct Sprite *sprite) sprite->callback(sprite); } -void sub_8105284(struct Sprite *sprite) +static void AnimHyperVoiceRing_WaitEnd(struct Sprite *sprite) { if (AnimTranslateLinear(sprite)) { @@ -2659,7 +2659,7 @@ static void AnimHyperVoiceRing(struct Sprite *sprite) sprite->data[4] = sp1; sprite->data[0] = gBattleAnimArgs[0]; InitAnimLinearTranslation(sprite); - sprite->callback = sub_8105284; + sprite->callback = AnimHyperVoiceRing_WaitEnd; sprite->callback(sprite); } @@ -3523,7 +3523,7 @@ static void AnimAngel(struct Sprite *sprite) DestroyAnimSprite(sprite); } -static void sub_8106A64(struct Sprite *sprite) +static void AnimPinkHeart_Step(struct Sprite *sprite) { sprite->data[5]++; sprite->pos2.x = Sin(sprite->data[3], 5); @@ -3552,7 +3552,7 @@ static void AnimPinkHeart(struct Sprite *sprite) sprite->data[3] = (sprite->data[3] + 3) & 0xFF; if (sprite->data[3] > 70) { - sprite->callback = sub_8106A64; + sprite->callback = AnimPinkHeart_Step; sprite->pos1.x += sprite->pos2.x; sprite->pos1.y += sprite->pos2.y; sprite->pos2.x = 0; diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index f73a2dee7..7be5fa31c 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -2321,7 +2321,7 @@ void AnimTask_TransformMon(u8 taskId) if (IsSpeciesNotUnown(gContestResources->moveAnim->targetSpecies)) gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gUnknown_082FF6C0; else - gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gUnknown_082FF694; + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteOpponentSide; StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], 0); } @@ -3248,7 +3248,7 @@ void AnimTask_RolePlaySilhouette(u8 taskId) coord1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); coord2 = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); - spriteId = sub_80A8394(species, isBackPic, 0, coord1 + xOffset, coord2, 5, personality, otId, gBattleAnimTarget, 1); + spriteId = CreateAdditionalMonSpriteForMoveAnim(species, isBackPic, 0, coord1 + xOffset, coord2, 5, personality, otId, gBattleAnimTarget, TRUE); gSprites[spriteId].oam.priority = priority; gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND; @@ -5066,7 +5066,7 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId) } } - spriteId2 = sub_80A8394(species, isBackPic, 0, x, GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y), subpriority, personality, otId, gBattleAnimAttacker, 0); + spriteId2 = CreateAdditionalMonSpriteForMoveAnim(species, isBackPic, 0, x, GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y), subpriority, personality, otId, gBattleAnimAttacker, FALSE); if (gBattleSpritesDataPtr->battlerData[gBattleAnimAttacker].transformSpecies != SPECIES_NONE) BlendPalette((gSprites[spriteId2].oam.paletteNum * 16) | 0x100, 16, 6, RGB_WHITE); diff --git a/src/battle_anim_fight.c b/src/battle_anim_fight.c index 5211860e0..344ea7c1f 100644 --- a/src/battle_anim_fight.c +++ b/src/battle_anim_fight.c @@ -835,7 +835,7 @@ static void AnimSuperpowerOrb_Step(struct Sprite *sprite) InitAnimLinearTranslation(sprite); StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); - sprite->callback = sub_80A6F98; + sprite->callback = AnimTranslateLinear_WaitEnd; } } @@ -931,7 +931,7 @@ static void AnimSuperpowerFireball(struct Sprite *sprite) InitAnimLinearTranslation(sprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = sub_80A6F98; + sprite->callback = AnimTranslateLinear_WaitEnd; } static void AnimArmThrustHit_Step(struct Sprite *sprite) diff --git a/src/battle_anim_fire.c b/src/battle_anim_fire.c index c8402f727..1073f10fa 100644 --- a/src/battle_anim_fire.c +++ b/src/battle_anim_fire.c @@ -1115,7 +1115,7 @@ static void AnimWillOWispOrb(struct Sprite *sprite) sprite->data[3] = sprite->pos1.y; sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); - sub_80A6FD4(sprite); + InitAnimLinearTranslationWithSpeed(sprite); sprite->callback = AnimWillOWispOrb_Step; } break; diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index 632954351..98d951108 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -225,7 +225,7 @@ static void AnimConfuseRayBallBounce(struct Sprite *sprite) sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); sprite->data[3] = sprite->pos1.y; sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); - sub_80A6FD4(sprite); + InitAnimLinearTranslationWithSpeed(sprite); sprite->callback = AnimConfuseRayBallBounce_Step1; sprite->data[6] = 16; SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL)); diff --git a/src/battle_anim_ice.c b/src/battle_anim_ice.c index 24ddf3b32..9ce9a249c 100644 --- a/src/battle_anim_ice.c +++ b/src/battle_anim_ice.c @@ -710,7 +710,7 @@ static void AnimSwirlingSnowball(struct Sprite *sprite) for (i = 0; i < 8; i++) sprite->data[i] = tempDataHolder[i]; - sprite->callback = sub_80A718C; + sprite->callback = InitAnimFastLinearTranslationWithSpeedAndPos; StoreSpriteCallbackInData6(sprite, AnimSwirlingSnowball_Step1); } @@ -1311,7 +1311,7 @@ static void MovePoisonGasCloud(struct Sprite *sprite) sprite->data[7]++; sprite->pos2.x = sprite->pos2.y = 0; - sub_80A6FD4(sprite); + InitAnimLinearTranslationWithSpeed(sprite); } break; case 2: diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index 0c3d4ea47..3e86f31f7 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -21,15 +21,15 @@ extern const struct OamData gOamData_AffineNormal_ObjNormal_64x64; static void sub_80A6FB4(struct Sprite *sprite); -static void sub_80A7144(struct Sprite *sprite); +static void AnimFastTranslateLinearWaitEnd(struct Sprite *sprite); static void AnimThrowProjectile_Step(struct Sprite *sprite); static void sub_80A8DFC(struct Sprite *sprite); -static void sub_80A8E88(struct Sprite *sprite); +static void AnimWeatherBallUp_Step(struct Sprite *sprite); static u16 GetBattlerYDeltaFromSpriteId(u8 spriteId); static void AnimTask_BlendPalInAndOutSetup(struct Task *task); -static void sub_80A7AFC(u8 taskId); -static void sub_80A8CAC(u8 taskId); -static void AnimTask_BlendMonInAndOutStep(u8 taskId); +static void AnimTask_AlphaFadeIn_Step(u8 taskId); +static void AnimTask_AttackerPunchWithTrace_Step(u8 taskId); +static void AnimTask_BlendMonInAndOut_Step(u8 taskId); static bool8 sub_80A7238(void); static void sub_80A8D78(struct Task *task, u8 taskId); @@ -79,11 +79,15 @@ static const u8 sCastformBackSpriteYCoords[] = 0, // HAIL }; -static const struct SpriteTemplate sUnknown_08525F90[] = +// Placeholders for pokemon sprites to be created for a move animation effect (e.g. Role Play / Snatch) +#define TAG_MOVE_EFFECT_MON_1 55125 +#define TAG_MOVE_EFFECT_MON_2 55126 + +static const struct SpriteTemplate sSpriteTemplate_MoveEffectMons[] = { { - .tileTag = 55125, - .paletteTag = 55125, + .tileTag = TAG_MOVE_EFFECT_MON_1, + .paletteTag = TAG_MOVE_EFFECT_MON_1, .oam = &gOamData_AffineNormal_ObjNormal_64x64, .anims = gDummySpriteAnimTable, .images = NULL, @@ -91,8 +95,8 @@ static const struct SpriteTemplate sUnknown_08525F90[] = .callback = SpriteCallbackDummy, }, { - .tileTag = 55126, - .paletteTag = 55126, + .tileTag = TAG_MOVE_EFFECT_MON_2, + .paletteTag = TAG_MOVE_EFFECT_MON_2, .oam = &gOamData_AffineNormal_ObjNormal_64x64, .anims = gDummySpriteAnimTable, .images = NULL, @@ -101,10 +105,10 @@ static const struct SpriteTemplate sUnknown_08525F90[] = } }; -static const struct SpriteSheet sUnknown_08525FC0[] = +static const struct SpriteSheet sSpriteSheet_MoveEffectMons[] = { - { gMiscBlank_Gfx, 0x800, 55125, }, - { gMiscBlank_Gfx, 0x800, 55126, }, + { gMiscBlank_Gfx, 0x800, TAG_MOVE_EFFECT_MON_1, }, + { gMiscBlank_Gfx, 0x800, TAG_MOVE_EFFECT_MON_2, }, }; u8 GetBattlerSpriteCoord(u8 battlerId, u8 coordType) @@ -1032,7 +1036,7 @@ void StartAnimLinearTranslation(struct Sprite *sprite) sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; InitAnimLinearTranslation(sprite); - sprite->callback = sub_80A6F98; + sprite->callback = AnimTranslateLinear_WaitEnd; sprite->callback(sprite); } @@ -1075,7 +1079,7 @@ bool8 AnimTranslateLinear(struct Sprite *sprite) return FALSE; } -void sub_80A6F98(struct Sprite *sprite) +void AnimTranslateLinear_WaitEnd(struct Sprite *sprite) { if (AnimTranslateLinear(sprite)) SetCallbackToStoredInData6(sprite); @@ -1088,19 +1092,19 @@ static void sub_80A6FB4(struct Sprite *sprite) SetCallbackToStoredInData6(sprite); } -void sub_80A6FD4(struct Sprite *sprite) +void InitAnimLinearTranslationWithSpeed(struct Sprite *sprite) { int v1 = abs(sprite->data[2] - sprite->data[1]) << 8; sprite->data[0] = v1 / sprite->data[0]; InitAnimLinearTranslation(sprite); } -void sub_80A7000(struct Sprite *sprite) +void InitAnimLinearTranslationWithSpeedAndPos(struct Sprite *sprite) { sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; - sub_80A6FD4(sprite); - sprite->callback = sub_80A6F98; + InitAnimLinearTranslationWithSpeed(sprite); + sprite->callback = AnimTranslateLinear_WaitEnd; sprite->callback(sprite); } @@ -1137,7 +1141,7 @@ void InitAndRunAnimFastLinearTranslation(struct Sprite *sprite) sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; InitAnimFastLinearTranslation(sprite); - sprite->callback = sub_80A7144; + sprite->callback = AnimFastTranslateLinearWaitEnd; sprite->callback(sprite); } @@ -1171,7 +1175,7 @@ bool8 AnimFastTranslateLinear(struct Sprite *sprite) return FALSE; } -static void sub_80A7144(struct Sprite *sprite) +static void AnimFastTranslateLinearWaitEnd(struct Sprite *sprite) { if (AnimFastTranslateLinear(sprite)) SetCallbackToStoredInData6(sprite); @@ -1184,12 +1188,12 @@ void InitAnimFastLinearTranslationWithSpeed(struct Sprite *sprite) InitAnimFastLinearTranslation(sprite); } -void sub_80A718C(struct Sprite *sprite) +void InitAnimFastLinearTranslationWithSpeedAndPos(struct Sprite *sprite) { sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; InitAnimFastLinearTranslationWithSpeed(sprite); - sprite->callback = sub_80A7144; + sprite->callback = AnimFastTranslateLinearWaitEnd; sprite->callback(sprite); } @@ -1438,9 +1442,10 @@ u32 sub_80A76C4(u8 a1, u8 a2, u8 a3, u8 a4) return var; } -u8 sub_80A77AC(u8 a1) +// Presumably something commented here, just returns arg +u8 AnimDummyReturnArg(u8 battler) { - return a1; + return battler; } static u8 GetBattlerAtPosition_(u8 position) @@ -1611,10 +1616,10 @@ void AnimTask_AlphaFadeIn(u8 taskId) gTasks[taskId].data[7] = gBattleAnimArgs[2]; gTasks[taskId].data[8] = gBattleAnimArgs[3]; SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gBattleAnimArgs[0], gBattleAnimArgs[1])); - gTasks[taskId].func = sub_80A7AFC; + gTasks[taskId].func = AnimTask_AlphaFadeIn_Step; } -static void sub_80A7AFC(u8 taskId) +static void AnimTask_AlphaFadeIn_Step(u8 taskId) { struct Task *task = &gTasks[taskId]; @@ -1668,10 +1673,10 @@ static void AnimTask_BlendPalInAndOutSetup(struct Task *task) task->data[5] = gBattleAnimArgs[3]; task->data[6] = 0; task->data[7] = gBattleAnimArgs[4]; - task->func = AnimTask_BlendMonInAndOutStep; + task->func = AnimTask_BlendMonInAndOut_Step; } -static void AnimTask_BlendMonInAndOutStep(u8 taskId) +static void AnimTask_BlendMonInAndOut_Step(u8 taskId) { struct Task *task = &gTasks[taskId]; @@ -2021,18 +2026,19 @@ u8 GetBattlerSpriteBGPriorityRank(u8 battlerId) return 1; } -u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, u32 a10) +// Create pokemon sprite to be used for a move animation effect (e.g. Role Play / Snatch) +u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm) { u8 spriteId; - u16 sheet = LoadSpriteSheet(&sUnknown_08525FC0[a3]); - u16 palette = AllocSpritePalette(sUnknown_08525F90[a3].paletteTag); + u16 sheet = LoadSpriteSheet(&sSpriteSheet_MoveEffectMons[id]); + u16 palette = AllocSpritePalette(sSpriteTemplate_MoveEffectMons[id].paletteTag); if (gMonSpritesGfxPtr != NULL && gMonSpritesGfxPtr->buffer == NULL) gMonSpritesGfxPtr->buffer = AllocZeroed(0x2000); if (!isBackpic) { LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, trainerId, personality), (palette * 0x10) + 0x100, 0x20); - if (a10 == 1 || sub_80688F8(5, battlerId) == 1 || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != 0) + if (ignoreDeoxysForm == TRUE || ShouldIgnoreDeoxysForm(5, battlerId) == TRUE || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != 0) LoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->buffer, species, @@ -2048,7 +2054,7 @@ u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority else { LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, trainerId, personality), (palette * 0x10) + 0x100, 0x20); - if (a10 == 1 || sub_80688F8(5, battlerId) == 1 || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != 0) + if (ignoreDeoxysForm == TRUE || ShouldIgnoreDeoxysForm(5, battlerId) == TRUE || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != 0) LoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], gMonSpritesGfxPtr->buffer, species, @@ -2066,9 +2072,9 @@ u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority FREE_AND_SET_NULL(gMonSpritesGfxPtr->buffer); if (!isBackpic) - spriteId = CreateSprite(&sUnknown_08525F90[a3], x, y + gMonFrontPicCoords[species].y_offset, subpriority); + spriteId = CreateSprite(&sSpriteTemplate_MoveEffectMons[id], x, y + gMonFrontPicCoords[species].y_offset, subpriority); else - spriteId = CreateSprite(&sUnknown_08525F90[a3], x, y + gMonBackPicCoords[species].y_offset, subpriority); + spriteId = CreateSprite(&sSpriteTemplate_MoveEffectMons[id], x, y + gMonBackPicCoords[species].y_offset, subpriority); if (IsContest()) { @@ -2337,7 +2343,7 @@ void AnimTask_AttackerPunchWithTrace(u8 taskId) task->data[2] = 0; task->data[3] = 0; gSprites[task->data[0]].pos2.x -= task->data[0]; - task->data[4] = AllocSpritePalette(10097); + task->data[4] = AllocSpritePalette(ANIM_TAG_BENT_SPOON); task->data[5] = 0; dest = (task->data[4] + 0x10) * 0x10; @@ -2349,10 +2355,10 @@ void AnimTask_AttackerPunchWithTrace(u8 taskId) task->data[6] = 3; CpuCopy32(&gPlttBufferUnfaded[src], &gPlttBufferFaded[dest], 0x20); BlendPalette(dest, 16, gBattleAnimArgs[1], gBattleAnimArgs[0]); - task->func = sub_80A8CAC; + task->func = AnimTask_AttackerPunchWithTrace_Step; } -static void sub_80A8CAC(u8 taskId) +static void AnimTask_AttackerPunchWithTrace_Step(u8 taskId) { struct Task *task = &gTasks[taskId]; switch (task->data[2]) @@ -2419,10 +2425,10 @@ void AnimWeatherBallUp(struct Sprite *sprite) else sprite->data[0] = -10; sprite->data[1] = -40; - sprite->callback = sub_80A8E88; + sprite->callback = AnimWeatherBallUp_Step; } -static void sub_80A8E88(struct Sprite *sprite) +static void AnimWeatherBallUp_Step(struct Sprite *sprite) { sprite->data[2] += sprite->data[0]; sprite->data[3] += sprite->data[1]; diff --git a/src/battle_anim_utility_funcs.c b/src/battle_anim_utility_funcs.c index 9790cf9ea..598d27f09 100644 --- a/src/battle_anim_utility_funcs.c +++ b/src/battle_anim_utility_funcs.c @@ -40,10 +40,10 @@ static void AnimTask_WaitAndRestoreVisibility(u8); const u16 gUnknown_08597418 = RGB(31, 31, 31); -// These belong in battle_intro.c, but there putting them there causes 2 bytes of alignment padding +// These belong in battle_intro.c, but putting them there causes 2 bytes of alignment padding // between the two .rodata segments. Perhaps battle_intro.c actually belongs in this file, too. -const u8 gUnknown_0859741A[] = {REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFSET_BG2CNT, REG_OFFSET_BG3CNT}; -const u8 gUnknown_0859741E[] = {REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFSET_BG2CNT, REG_OFFSET_BG3CNT}; +const u8 gBattleAnimBgCntSet[] = {REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFSET_BG2CNT, REG_OFFSET_BG3CNT}; +const u8 gBattleAnimBgCntGet[] = {REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFSET_BG2CNT, REG_OFFSET_BG3CNT}; void AnimTask_BlendBattleAnimPal(u8 taskId) { @@ -97,7 +97,7 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId) for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++) { if (battler != animBattlers[0] && battler != animBattlers[1] && IsBattlerSpriteVisible(battler)) - selectedPalettes |= 0x10000 << sub_80A77AC(battler); + selectedPalettes |= 0x10000 << AnimDummyReturnArg(battler); } StartBlendAnimSpriteColor(taskId, selectedPalettes); diff --git a/src/battle_bg.c b/src/battle_bg.c index ad992f7b3..af0e374e2 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -100,7 +100,7 @@ static const struct SpriteTemplate sVsLetter_V_SpriteTemplate = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = sVsLetterAffineAnimTable, - .callback = nullsub_17 + .callback = SpriteCB_VsLetterDummy }; static const struct SpriteTemplate sVsLetter_S_SpriteTemplate = @@ -111,7 +111,7 @@ static const struct SpriteTemplate sVsLetter_S_SpriteTemplate = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = sVsLetterAffineAnimTable, - .callback = nullsub_17 + .callback = SpriteCB_VsLetterDummy }; static const struct CompressedSpriteSheet sVsLettersSpriteSheet = diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 718fe30c9..dd44bc91b 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -51,7 +51,7 @@ static void LinkOpponentHandleMoveAnimation(void); static void LinkOpponentHandlePrintString(void); static void LinkOpponentHandlePrintSelectionString(void); static void LinkOpponentHandleChooseAction(void); -static void LinkOpponentHandleUnknownYesNoBox(void); +static void LinkOpponentHandleYesNoBox(void); static void LinkOpponentHandleChooseMove(void); static void LinkOpponentHandleChooseItem(void); static void LinkOpponentHandleChoosePokemon(void); @@ -87,20 +87,20 @@ static void LinkOpponentHandleSpriteInvisibility(void); static void LinkOpponentHandleBattleAnimation(void); static void LinkOpponentHandleLinkStandbyMsg(void); static void LinkOpponentHandleResetActionMoveSelection(void); -static void LinkOpponentHandleCmd55(void); +static void LinkOpponentHandleEndLinkBattle(void); static void LinkOpponentCmdEnd(void); static void LinkOpponentBufferRunCommand(void); static void LinkOpponentBufferExecCompleted(void); -static void sub_8064DD0(void); +static void SwitchIn_HandleSoundAndEnd(void); static u32 CopyLinkOpponentMonData(u8 monId, u8 *dst); static void SetLinkOpponentMonData(u8 monId); -static void sub_8066494(u8 battlerId, bool8 dontClearSubstituteBit); +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit); static void DoSwitchOutAnimation(void); static void LinkOpponentDoMoveAnimation(void); -static void sub_8067618(u8 taskId); -static void sub_80676FC(struct Sprite *sprite); -static void sub_806782C(void); +static void Task_StartSendOutAnim(u8 taskId); +static void SpriteCB_FreeOpponentSprite(struct Sprite *sprite); +static void EndDrawPartyStatusSummary(void); static void (*const sLinkOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { @@ -123,7 +123,7 @@ static void (*const sLinkOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_PRINTSTRING] = LinkOpponentHandlePrintString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = LinkOpponentHandlePrintSelectionString, [CONTROLLER_CHOOSEACTION] = LinkOpponentHandleChooseAction, - [CONTROLLER_UNKNOWNYESNOBOX] = LinkOpponentHandleUnknownYesNoBox, + [CONTROLLER_YESNOBOX] = LinkOpponentHandleYesNoBox, [CONTROLLER_CHOOSEMOVE] = LinkOpponentHandleChooseMove, [CONTROLLER_OPENBAG] = LinkOpponentHandleChooseItem, [CONTROLLER_CHOOSEPOKEMON] = LinkOpponentHandleChoosePokemon, @@ -159,11 +159,11 @@ static void (*const sLinkOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_BATTLEANIMATION] = LinkOpponentHandleBattleAnimation, [CONTROLLER_LINKSTANDBYMSG] = LinkOpponentHandleLinkStandbyMsg, [CONTROLLER_RESETACTIONMOVESELECTION] = LinkOpponentHandleResetActionMoveSelection, - [CONTROLLER_55] = LinkOpponentHandleCmd55, + [CONTROLLER_ENDLINKBATTLE] = LinkOpponentHandleEndLinkBattle, [CONTROLLER_TERMINATOR_NOP] = LinkOpponentCmdEnd }; -static void nullsub_28(void) +static void LinkOpponentDummy(void) { } @@ -195,7 +195,7 @@ static void CompleteOnBankSpriteCallbackDummy2(void) LinkOpponentBufferExecCompleted(); } -static void sub_8064470(void) +static void FreeTrainerSpriteAfterSlide(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { @@ -206,38 +206,38 @@ static void sub_8064470(void) } } -static void sub_80644D8(void) +static void Intro_DelayAndEnd(void) { - if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF) + if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay == (u8)-1) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 0; LinkOpponentBufferExecCompleted(); } } -static void sub_8064520(void) +static void Intro_WaitForShinyAnimAndHealthbox(void) { - bool32 r8 = FALSE; - bool32 r4 = FALSE; + bool32 healthboxAnimDone = FALSE; + bool32 twoMons = FALSE; if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI))) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) - r8 = TRUE; + healthboxAnimDone = TRUE; } else { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy) { - r8 = TRUE; + healthboxAnimDone = TRUE; } - r4 = TRUE; + twoMons = TRUE; } - if (r8) + if (healthboxAnimDone) { - if (r4 || !IsBattlerSpriteVisible(BATTLE_PARTNER(gActiveBattler))) + if (twoMons || !IsBattlerSpriteVisible(BATTLE_PARTNER(gActiveBattler))) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) return; @@ -250,8 +250,8 @@ static void sub_8064520(void) gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); } else { @@ -263,19 +263,19 @@ static void sub_8064520(void) if (GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_RIGHT) { - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); } } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 3; - gBattlerControllerFuncs[gActiveBattler] = sub_80644D8; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 3; + gBattlerControllerFuncs[gActiveBattler] = Intro_DelayAndEnd; } } -static void sub_8064734(void) +static void Intro_TryShinyAnimShowHealthbox(void) { - bool32 r10 = FALSE; + bool32 bgmRestored = FALSE; if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim @@ -294,27 +294,27 @@ static void sub_8064734(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted) { if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { UpdateHealthboxAttribute(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)], &gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], HEALTHBOX_ALL); - sub_8076918(BATTLE_PARTNER(gActiveBattler)); + StartHealthboxSlideIn(BATTLE_PARTNER(gActiveBattler)); SetHealthboxSpriteVisible(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]); } UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 = 1; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted = TRUE; } - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x40 - && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 - && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].field_1_x40 + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].waitForCry + && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted + && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].waitForCry && !IsCryPlayingOrClearCrySongs()) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) { @@ -327,42 +327,42 @@ static void sub_8064734(void) } } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20 = 1; - r10 = TRUE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE; + bgmRestored = TRUE; } - if (r10) + if (bgmRestored) { - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI && GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_RIGHT) { - if (++gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 1) + if (++gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay == 1) return; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 0; } if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { - DestroySprite(&gSprites[gUnknown_03005D7C[BATTLE_PARTNER(gActiveBattler)]]); + DestroySprite(&gSprites[gBattleControllerData[BATTLE_PARTNER(gActiveBattler)]]); SetBattlerShadowSpriteCallback(BATTLE_PARTNER(gActiveBattler), GetMonData(&gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], MON_DATA_SPECIES)); } - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); - gBattleSpritesDataPtr->animationData->field_9_x1 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 = 0; + gBattleSpritesDataPtr->animationData->introAnimActive = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted = FALSE; - gBattlerControllerFuncs[gActiveBattler] = sub_8064520; + gBattlerControllerFuncs[gActiveBattler] = Intro_WaitForShinyAnimAndHealthbox; } } } -static void sub_8064B04(void) +static void TryShinyAnimAfterMonAnim(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0) @@ -377,8 +377,8 @@ static void sub_8064B04(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); LinkOpponentBufferExecCompleted(); } } @@ -401,7 +401,7 @@ static void CompleteOnHealthbarDone(void) } } -static void sub_8064C14(void) +static void HideHealthboxAfterMonFaint(void) { if (!gSprites[gBattlerSpriteIds[gActiveBattler]].inUse) { @@ -410,7 +410,7 @@ static void sub_8064C14(void) } } -static void sub_8064C58(void) +static void FreeMonSpriteAfterSwitchOutAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { @@ -447,18 +447,18 @@ static void DoHitAnimBlinkSpriteEffect(void) } } -static void sub_8064D60(void) +static void SwitchIn_ShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute) InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); - gBattlerControllerFuncs[gActiveBattler] = sub_8064DD0; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_HandleSoundAndEnd; } } -static void sub_8064DD0(void) +static void SwitchIn_HandleSoundAndEnd(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive && !IsCryPlayingOrClearCrySongs()) { @@ -471,7 +471,7 @@ static void sub_8064DD0(void) } } -static void sub_8064E50(void) +static void SwitchIn_ShowHealthbox(void) { if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) @@ -479,20 +479,20 @@ static void sub_8064E50(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); CopyBattleSpriteInvisibility(gActiveBattler); - gBattlerControllerFuncs[gActiveBattler] = sub_8064D60; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_ShowSubstitute; } } -static void sub_8064F40(void) +static void SwitchIn_TryShinyAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim) @@ -500,12 +500,12 @@ static void sub_8064F40(void) TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); } - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) { - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); - gBattlerControllerFuncs[gActiveBattler] = sub_8064E50; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_ShowHealthbox; } } @@ -1141,24 +1141,24 @@ static void LinkOpponentHandleLoadMonSprite(void) SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); - gBattlerControllerFuncs[gActiveBattler] = sub_8064B04; + gBattlerControllerFuncs[gActiveBattler] = TryShinyAnimAfterMonAnim; } static void LinkOpponentHandleSwitchInAnim(void) { gBattlerPartyIndexes[gActiveBattler] = gBattleBufferA[gActiveBattler][1]; - sub_8066494(gActiveBattler, gBattleBufferA[gActiveBattler][2]); - gBattlerControllerFuncs[gActiveBattler] = sub_8064F40; + StartSendOutAnim(gActiveBattler, gBattleBufferA[gActiveBattler][2]); + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim; } -static void sub_8066494(u8 battlerId, bool8 dontClearSubstituteBit) +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) { u16 species; ClearTemporarySpeciesSpriteData(battlerId, dontClearSubstituteBit); gBattlerPartyIndexes[battlerId] = gBattleBufferA[battlerId][1]; species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); - gUnknown_03005D7C[battlerId] = CreateInvisibleSpriteWithCallback(sub_805D714); + gBattleControllerData[battlerId] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim); BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlerPartyIndexes[battlerId]], battlerId); SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(battlerId)); @@ -1168,8 +1168,8 @@ static void sub_8066494(u8 battlerId, bool8 dontClearSubstituteBit) GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteSubpriority(battlerId)); - gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; - gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; + gSprites[gBattleControllerData[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; + gSprites[gBattleControllerData[battlerId]].data[2] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[0] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; @@ -1180,7 +1180,7 @@ static void sub_8066494(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT); + gSprites[gBattleControllerData[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT); } static void LinkOpponentHandleReturnMonToBall(void) @@ -1215,12 +1215,14 @@ static void DoSwitchOutAnimation(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_SWITCH_OUT_OPPONENT_MON); - gBattlerControllerFuncs[gActiveBattler] = sub_8064C58; + gBattlerControllerFuncs[gActiveBattler] = FreeMonSpriteAfterSwitchOutAnim; } break; } } +#define sSpeedX data[0] + static void LinkOpponentHandleDrawTrainerPic(void) { s16 xPos; @@ -1301,10 +1303,10 @@ static void LinkOpponentHandleDrawTrainerPic(void) GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = 2; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineParam = trainerPicId; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gBattlerControllerFuncs[gActiveBattler] = CompleteOnBattlerSpriteCallbackDummy; } @@ -1324,15 +1326,17 @@ static void LinkOpponentHandleTrainerSlide(void) gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 96; gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.x += 32; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = -2; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineParam = trainerPicId; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gBattlerControllerFuncs[gActiveBattler] = CompleteOnBankSpriteCallbackDummy2; // this line is redundant, because LinkOpponentBufferExecCompleted changes the battle battlerId function LinkOpponentBufferExecCompleted(); } +#undef sSpeedX + static void LinkOpponentHandleTrainerSlideBack(void) { SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]); @@ -1341,7 +1345,7 @@ static void LinkOpponentHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); - gBattlerControllerFuncs[gActiveBattler] = sub_8064470; + gBattlerControllerFuncs[gActiveBattler] = FreeTrainerSpriteAfterSlide; } static void LinkOpponentHandleFaintAnimation(void) @@ -1359,7 +1363,7 @@ static void LinkOpponentHandleFaintAnimation(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; PlaySE12WithPanning(SE_FAINT, SOUND_PAN_TARGET); gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintOpponentMon; - gBattlerControllerFuncs[gActiveBattler] = sub_8064C14; + gBattlerControllerFuncs[gActiveBattler] = HideHealthboxAfterMonFaint; } } } @@ -1386,7 +1390,7 @@ static void LinkOpponentHandlePause(void) static void LinkOpponentHandleMoveAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u16 move = gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8); @@ -1429,7 +1433,7 @@ static void LinkOpponentDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(ST_OAM_AFFINE_OFF); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1438,7 +1442,7 @@ static void LinkOpponentDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(ST_OAM_AFFINE_NORMAL); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); @@ -1482,7 +1486,7 @@ static void LinkOpponentHandleChooseAction(void) LinkOpponentBufferExecCompleted(); } -static void LinkOpponentHandleUnknownYesNoBox(void) +static void LinkOpponentHandleYesNoBox(void) { LinkOpponentBufferExecCompleted(); } @@ -1538,7 +1542,7 @@ static void LinkOpponentHandleExpUpdate(void) static void LinkOpponentHandleStatusIconUpdate(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 battlerId; @@ -1551,7 +1555,7 @@ static void LinkOpponentHandleStatusIconUpdate(void) static void LinkOpponentHandleStatusAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8) | (gBattleBufferA[gActiveBattler][4] << 16) | (gBattleBufferA[gActiveBattler][5] << 24)); @@ -1702,19 +1706,19 @@ static void LinkOpponentHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; - StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_80676FC); + StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCB_FreeOpponentSprite); - taskId = CreateTask(sub_8067618, 5); + taskId = CreateTask(Task_StartSendOutAnim, 5); gTasks[taskId].data[0] = gActiveBattler; if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown) gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary; - gBattleSpritesDataPtr->animationData->field_9_x1 = 1; - gBattlerControllerFuncs[gActiveBattler] = nullsub_28; + gBattleSpritesDataPtr->animationData->introAnimActive = TRUE; + gBattlerControllerFuncs[gActiveBattler] = LinkOpponentDummy; } -static void sub_8067618(u8 taskId) +static void Task_StartSendOutAnim(u8 taskId) { u8 savedActiveBank = gActiveBattler; @@ -1722,23 +1726,23 @@ static void sub_8067618(u8 taskId) if (!IsDoubleBattle() || (gBattleTypeFlags & BATTLE_TYPE_MULTI)) { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_8066494(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); } else { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_8066494(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler = BATTLE_PARTNER(gActiveBattler); gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_8066494(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler = BATTLE_PARTNER(gActiveBattler); } - gBattlerControllerFuncs[gActiveBattler] = sub_8064734; + gBattlerControllerFuncs[gActiveBattler] = Intro_TryShinyAnimShowHealthbox; gActiveBattler = savedActiveBank; DestroyTask(taskId); } -static void sub_80676FC(struct Sprite *sprite) +static void SpriteCB_FreeOpponentSprite(struct Sprite *sprite) { FreeTrainerFrontPicPalette(sprite->oam.affineParam); FreeSpriteOamMatrix(sprite); @@ -1769,20 +1773,20 @@ static void LinkOpponentHandleDrawPartyStatusSummary(void) } gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]); - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; if (gBattleBufferA[gActiveBattler][2] != 0) - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 93; - gBattlerControllerFuncs[gActiveBattler] = sub_806782C; + gBattlerControllerFuncs[gActiveBattler] = EndDrawPartyStatusSummary; } } -static void sub_806782C(void) +static void EndDrawPartyStatusSummary(void) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5++ > 0x5C) + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer++ > 92) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; LinkOpponentBufferExecCompleted(); } } @@ -1811,7 +1815,7 @@ static void LinkOpponentHandleSpriteInvisibility(void) static void LinkOpponentHandleBattleAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 animationId = gBattleBufferA[gActiveBattler][1]; u16 argument = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8); @@ -1827,7 +1831,7 @@ static void LinkOpponentHandleBattleAnimation(void) static void LinkOpponentHandleLinkStandbyMsg(void) { - sub_81851A8(&gBattleBufferA[gActiveBattler][2]); + RecordedBattle_RecordAllBattlerData(&gBattleBufferA[gActiveBattler][2]); LinkOpponentBufferExecCompleted(); } @@ -1836,9 +1840,9 @@ static void LinkOpponentHandleResetActionMoveSelection(void) LinkOpponentBufferExecCompleted(); } -static void LinkOpponentHandleCmd55(void) +static void LinkOpponentHandleEndLinkBattle(void) { - sub_81851A8(&gBattleBufferA[gActiveBattler][4]); + RecordedBattle_RecordAllBattlerData(&gBattleBufferA[gActiveBattler][4]); if (gBattleBufferA[gActiveBattler][1] == B_OUTCOME_DREW) gBattleOutcome = gBattleBufferA[gActiveBattler][1]; @@ -1849,7 +1853,7 @@ static void LinkOpponentHandleCmd55(void) FadeOutMapMusic(5); BeginFastPaletteFade(3); LinkOpponentBufferExecCompleted(); - gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; + gBattlerControllerFuncs[gActiveBattler] = SetBattleEndCallbacks; } static void LinkOpponentCmdEnd(void) diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index d3037bb90..3d6cd7c3b 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -49,7 +49,7 @@ static void LinkPartnerHandleMoveAnimation(void); static void LinkPartnerHandlePrintString(void); static void LinkPartnerHandlePrintSelectionString(void); static void LinkPartnerHandleChooseAction(void); -static void LinkPartnerHandleUnknownYesNoBox(void); +static void LinkPartnerHandleYesNoBox(void); static void LinkPartnerHandleChooseMove(void); static void LinkPartnerHandleChooseItem(void); static void LinkPartnerHandleChoosePokemon(void); @@ -85,19 +85,19 @@ static void LinkPartnerHandleSpriteInvisibility(void); static void LinkPartnerHandleBattleAnimation(void); static void LinkPartnerHandleLinkStandbyMsg(void); static void LinkPartnerHandleResetActionMoveSelection(void); -static void LinkPartnerHandleCmd55(void); +static void LinkPartnerHandleEndLinkBattle(void); static void LinkPartnerCmdEnd(void); static void LinkPartnerBufferRunCommand(void); static void LinkPartnerBufferExecCompleted(void); -static void sub_814B554(void); +static void SwitchIn_WaitAndEnd(void); static u32 CopyLinkPartnerMonData(u8 monId, u8 *dst); static void SetLinkPartnerMonData(u8 monId); -static void sub_814CC98(u8 battlerId, bool8 dontClearSubstituteBit); +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit); static void DoSwitchOutAnimation(void); static void LinkPartnerDoMoveAnimation(void); -static void sub_814DCCC(u8 taskId); -static void sub_814DE9C(void); +static void Task_StartSendOutAnim(u8 taskId); +static void EndDrawPartyStatusSummary(void); static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { @@ -120,7 +120,7 @@ static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_PRINTSTRING] = LinkPartnerHandlePrintString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = LinkPartnerHandlePrintSelectionString, [CONTROLLER_CHOOSEACTION] = LinkPartnerHandleChooseAction, - [CONTROLLER_UNKNOWNYESNOBOX] = LinkPartnerHandleUnknownYesNoBox, + [CONTROLLER_YESNOBOX] = LinkPartnerHandleYesNoBox, [CONTROLLER_CHOOSEMOVE] = LinkPartnerHandleChooseMove, [CONTROLLER_OPENBAG] = LinkPartnerHandleChooseItem, [CONTROLLER_CHOOSEPOKEMON] = LinkPartnerHandleChoosePokemon, @@ -156,7 +156,7 @@ static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_BATTLEANIMATION] = LinkPartnerHandleBattleAnimation, [CONTROLLER_LINKSTANDBYMSG] = LinkPartnerHandleLinkStandbyMsg, [CONTROLLER_RESETACTIONMOVESELECTION] = LinkPartnerHandleResetActionMoveSelection, - [CONTROLLER_55] = LinkPartnerHandleCmd55, + [CONTROLLER_ENDLINKBATTLE] = LinkPartnerHandleEndLinkBattle, [CONTROLLER_TERMINATOR_NOP] = LinkPartnerCmdEnd }; @@ -186,84 +186,84 @@ static void CompleteOnBattlerSpriteCallbackDummy(void) LinkPartnerBufferExecCompleted(); } -static void sub_814AF54(void) +static void FreeTrainerSpriteAfterSlide(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { - nullsub_25(0); + BattleGfxSfxDummy3(MALE); FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]); DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]); LinkPartnerBufferExecCompleted(); } } -static void sub_814AFBC(void) +static void Intro_DelayAndEnd(void) { - if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF) + if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay == (u8)-1) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 0; LinkPartnerBufferExecCompleted(); } } -static void sub_814B004(void) +static void Intro_WaitForHealthbox(void) { - bool32 r6 = FALSE; + bool32 finished = FALSE; if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI))) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) - r6 = TRUE; + finished = TRUE; } else { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy) { - r6 = TRUE; + finished = TRUE; } } if (IsCryPlayingOrClearCrySongs()) - r6 = FALSE; + finished = FALSE; - if (r6) + if (finished) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 3; - gBattlerControllerFuncs[gActiveBattler] = sub_814AFBC; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 3; + gBattlerControllerFuncs[gActiveBattler] = Intro_DelayAndEnd; } } -static void sub_814B0E8(void) +static void Intro_ShowHealthbox(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive - && gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + && gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy - && ++gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 != 1) + && ++gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay != 1) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 0; if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler ^ BIT_FLANK]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler ^ BIT_FLANK); + StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]); } - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - gBattleSpritesDataPtr->animationData->field_9_x1 = 0; + gBattleSpritesDataPtr->animationData->introAnimActive = FALSE; - gBattlerControllerFuncs[gActiveBattler] = sub_814B004; + gBattlerControllerFuncs[gActiveBattler] = Intro_WaitForHealthbox; } } -static void sub_814B290(void) +static void WaitForMonAnimAfterLoad(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].animEnded && gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0) LinkPartnerBufferExecCompleted(); @@ -286,13 +286,13 @@ static void CompleteOnHealthbarDone(void) } } -static void sub_814B340(void) +static void FreeMonSpriteAfterFaintAnim(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y > DISPLAY_HEIGHT) { u16 species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - nullsub_24(species); + BattleGfxSfxDummy2(species); FreeOamMatrix(gSprites[gBattlerSpriteIds[gActiveBattler]].oam.matrixNum); DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]); SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]); @@ -300,7 +300,7 @@ static void sub_814B340(void) } } -static void sub_814B3DC(void) +static void FreeMonSpriteAfterSwitchOutAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { @@ -336,7 +336,7 @@ static void DoHitAnimBlinkSpriteEffect(void) } } -static void sub_814B4E0(void) +static void SwitchIn_ShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { @@ -344,11 +344,11 @@ static void sub_814B4E0(void) if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute) InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); - gBattlerControllerFuncs[gActiveBattler] = sub_814B554; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_WaitAndEnd; } } -static void sub_814B554(void) +static void SwitchIn_WaitAndEnd(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) @@ -357,28 +357,28 @@ static void sub_814B554(void) } } -static void sub_814B5A8(void) +static void SwitchIn_ShowHealthbox(void) { if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); - CreateTask(c3_0802FDF4, 10); + CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10); HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - gBattlerControllerFuncs[gActiveBattler] = sub_814B4E0; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_ShowSubstitute; } } -static void sub_814B69C(void) +static void SwitchIn_TryShinyAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) @@ -386,11 +386,11 @@ static void sub_814B69C(void) TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); } - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) { - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); - gBattlerControllerFuncs[gActiveBattler] = sub_814B5A8; + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_ShowHealthbox; } } @@ -1025,7 +1025,7 @@ static void LinkPartnerHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); - gBattlerControllerFuncs[gActiveBattler] = sub_814B290; + gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad; } static void LinkPartnerHandleSwitchInAnim(void) @@ -1033,18 +1033,18 @@ static void LinkPartnerHandleSwitchInAnim(void) ClearTemporarySpeciesSpriteData(gActiveBattler, gBattleBufferA[gActiveBattler][2]); gBattlerPartyIndexes[gActiveBattler] = gBattleBufferA[gActiveBattler][1]; BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); - sub_814CC98(gActiveBattler, gBattleBufferA[gActiveBattler][2]); - gBattlerControllerFuncs[gActiveBattler] = sub_814B69C; + StartSendOutAnim(gActiveBattler, gBattleBufferA[gActiveBattler][2]); + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim; } -static void sub_814CC98(u8 battlerId, bool8 dontClearSubstituteBit) +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) { u16 species; ClearTemporarySpeciesSpriteData(battlerId, dontClearSubstituteBit); gBattlerPartyIndexes[battlerId] = gBattleBufferA[battlerId][1]; species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); - gUnknown_03005D7C[battlerId] = CreateInvisibleSpriteWithCallback(sub_805D714); + gBattleControllerData[battlerId] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim); SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(battlerId)); gBattlerSpriteIds[battlerId] = CreateSprite( @@ -1053,8 +1053,8 @@ static void sub_814CC98(u8 battlerId, bool8 dontClearSubstituteBit) GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteSubpriority(battlerId)); - gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; - gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; + gSprites[gBattleControllerData[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; + gSprites[gBattleControllerData[battlerId]].data[2] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[0] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; @@ -1065,7 +1065,7 @@ static void sub_814CC98(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); + gSprites[gBattleControllerData[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); } static void LinkPartnerHandleReturnMonToBall(void) @@ -1099,12 +1099,14 @@ static void DoSwitchOutAnimation(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_SWITCH_OUT_PLAYER_MON); - gBattlerControllerFuncs[gActiveBattler] = sub_814B3DC; + gBattlerControllerFuncs[gActiveBattler] = FreeMonSpriteAfterSwitchOutAnim; } break; } } +#define sSpeedX data[0] + static void LinkPartnerHandleDrawTrainerPic(void) { s16 xPos; @@ -1142,13 +1144,15 @@ static void LinkPartnerHandleDrawTrainerPic(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, (8 - gTrainerBackPicCoords[trainerPicId].size) * 4 + 80, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = DISPLAY_WIDTH; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = -2; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gBattlerControllerFuncs[gActiveBattler] = CompleteOnBattlerSpriteCallbackDummy; } +#undef sSpeedX + static void LinkPartnerHandleTrainerSlide(void) { LinkPartnerBufferExecCompleted(); @@ -1162,9 +1166,12 @@ static void LinkPartnerHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); - gBattlerControllerFuncs[gActiveBattler] = sub_814AF54; + gBattlerControllerFuncs[gActiveBattler] = FreeTrainerSpriteAfterSlide; } +#define sSpeedX data[1] +#define sSpeedY data[2] + static void LinkPartnerHandleFaintAnimation(void) { if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState == 0) @@ -1180,14 +1187,17 @@ static void LinkPartnerHandleFaintAnimation(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); PlaySE12WithPanning(SE_FAINT, SOUND_PAN_ATTACKER); - gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 5; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8039C00; - gBattlerControllerFuncs[gActiveBattler] = sub_814B340; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = 0; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedY = 5; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintSlideAnim; + gBattlerControllerFuncs[gActiveBattler] = FreeMonSpriteAfterFaintAnim; } } } +#undef sSpeedX +#undef sSpeedY + static void LinkPartnerHandlePaletteFade(void) { LinkPartnerBufferExecCompleted(); @@ -1210,7 +1220,7 @@ static void LinkPartnerHandlePause(void) static void LinkPartnerHandleMoveAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u16 move = gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8); @@ -1253,7 +1263,7 @@ static void LinkPartnerDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(ST_OAM_AFFINE_OFF); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1262,7 +1272,7 @@ static void LinkPartnerDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(ST_OAM_AFFINE_NORMAL); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); @@ -1306,7 +1316,7 @@ static void LinkPartnerHandleChooseAction(void) LinkPartnerBufferExecCompleted(); } -static void LinkPartnerHandleUnknownYesNoBox(void) +static void LinkPartnerHandleYesNoBox(void) { LinkPartnerBufferExecCompleted(); } @@ -1362,7 +1372,7 @@ static void LinkPartnerHandleExpUpdate(void) static void LinkPartnerHandleStatusIconUpdate(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 battlerId; @@ -1375,7 +1385,7 @@ static void LinkPartnerHandleStatusIconUpdate(void) static void LinkPartnerHandleStatusAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8) | (gBattleBufferA[gActiveBattler][4] << 16) | (gBattleBufferA[gActiveBattler][5] << 24)); @@ -1529,7 +1539,7 @@ static void LinkPartnerHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gActiveBattler; - StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_805CC00); + StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCB_FreePlayerSpriteLoadMonSprite); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 1); paletteNum = AllocSpritePalette(0xD6F9); @@ -1553,17 +1563,17 @@ static void LinkPartnerHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = paletteNum; - taskId = CreateTask(sub_814DCCC, 5); + taskId = CreateTask(Task_StartSendOutAnim, 5); gTasks[taskId].data[0] = gActiveBattler; if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown) gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary; - gBattleSpritesDataPtr->animationData->field_9_x1 = 1; + gBattleSpritesDataPtr->animationData->introAnimActive = TRUE; gBattlerControllerFuncs[gActiveBattler] = SpriteCB_Null2; } -static void sub_814DCCC(u8 taskId) +static void Task_StartSendOutAnim(u8 taskId) { if (gTasks[taskId].data[1] < 24) { @@ -1577,19 +1587,19 @@ static void sub_814DCCC(u8 taskId) if (!IsDoubleBattle() || (gBattleTypeFlags & BATTLE_TYPE_MULTI)) { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_814CC98(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); } else { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_814CC98(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler ^= BIT_FLANK; gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); - sub_814CC98(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler ^= BIT_FLANK; } - gBattlerControllerFuncs[gActiveBattler] = sub_814B0E8; + gBattlerControllerFuncs[gActiveBattler] = Intro_ShowHealthbox; gActiveBattler = savedActiveBank; DestroyTask(taskId); } @@ -1605,20 +1615,20 @@ static void LinkPartnerHandleDrawPartyStatusSummary(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1; gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]); - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; if (gBattleBufferA[gActiveBattler][2] != 0) - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 93; - gBattlerControllerFuncs[gActiveBattler] = sub_814DE9C; + gBattlerControllerFuncs[gActiveBattler] = EndDrawPartyStatusSummary; } } -static void sub_814DE9C(void) +static void EndDrawPartyStatusSummary(void) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5++ > 0x5C) + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer++ > 92) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; LinkPartnerBufferExecCompleted(); } } @@ -1647,7 +1657,7 @@ static void LinkPartnerHandleSpriteInvisibility(void) static void LinkPartnerHandleBattleAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 animationId = gBattleBufferA[gActiveBattler][1]; u16 argument = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8); @@ -1663,7 +1673,7 @@ static void LinkPartnerHandleBattleAnimation(void) static void LinkPartnerHandleLinkStandbyMsg(void) { - sub_81851A8(&gBattleBufferA[gActiveBattler][2]); + RecordedBattle_RecordAllBattlerData(&gBattleBufferA[gActiveBattler][2]); LinkPartnerBufferExecCompleted(); } @@ -1672,15 +1682,15 @@ static void LinkPartnerHandleResetActionMoveSelection(void) LinkPartnerBufferExecCompleted(); } -static void LinkPartnerHandleCmd55(void) +static void LinkPartnerHandleEndLinkBattle(void) { - sub_81851A8(&gBattleBufferA[gActiveBattler][4]); + RecordedBattle_RecordAllBattlerData(&gBattleBufferA[gActiveBattler][4]); gBattleOutcome = gBattleBufferA[gActiveBattler][1]; gSaveBlock2Ptr->frontier.disableRecordBattle = gBattleBufferA[gActiveBattler][2]; FadeOutMapMusic(5); BeginFastPaletteFade(3); LinkPartnerBufferExecCompleted(); - gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; + gBattlerControllerFuncs[gActiveBattler] = SetBattleEndCallbacks; } static void LinkPartnerCmdEnd(void) diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index d241d335f..69f729ee0 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -56,7 +56,7 @@ static void OpponentHandleMoveAnimation(void); static void OpponentHandlePrintString(void); static void OpponentHandlePrintSelectionString(void); static void OpponentHandleChooseAction(void); -static void OpponentHandleUnknownYesNoBox(void); +static void OpponentHandleYesNoBox(void); static void OpponentHandleChooseMove(void); static void OpponentHandleChooseItem(void); static void OpponentHandleChoosePokemon(void); @@ -92,20 +92,20 @@ static void OpponentHandleSpriteInvisibility(void); static void OpponentHandleBattleAnimation(void); static void OpponentHandleLinkStandbyMsg(void); static void OpponentHandleResetActionMoveSelection(void); -static void OpponentHandleCmd55(void); +static void OpponentHandleEndLinkBattle(void); static void OpponentCmdEnd(void); static void OpponentBufferRunCommand(void); static void OpponentBufferExecCompleted(void); -static void sub_805FC80(void); +static void SwitchIn_HandleSoundAndEnd(void); static u32 GetOpponentMonData(u8 monId, u8 *dst); static void SetOpponentMonData(u8 monId); -static void sub_80613DC(u8 battlerId, bool8 dontClearSubstituteBit); +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit); static void DoSwitchOutAnimation(void); static void OpponentDoMoveAnimation(void); -static void sub_806280C(struct Sprite *sprite); -static void sub_8062828(u8 taskId); -static void sub_8062A2C(void); +static void SpriteCB_FreeOpponentSprite(struct Sprite *sprite); +static void Task_StartSendOutAnim(u8 taskId); +static void EndDrawPartyStatusSummary(void); static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { @@ -128,7 +128,7 @@ static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_PRINTSTRING] = OpponentHandlePrintString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = OpponentHandlePrintSelectionString, [CONTROLLER_CHOOSEACTION] = OpponentHandleChooseAction, - [CONTROLLER_UNKNOWNYESNOBOX] = OpponentHandleUnknownYesNoBox, + [CONTROLLER_YESNOBOX] = OpponentHandleYesNoBox, [CONTROLLER_CHOOSEMOVE] = OpponentHandleChooseMove, [CONTROLLER_OPENBAG] = OpponentHandleChooseItem, [CONTROLLER_CHOOSEPOKEMON] = OpponentHandleChoosePokemon, @@ -164,14 +164,14 @@ static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_BATTLEANIMATION] = OpponentHandleBattleAnimation, [CONTROLLER_LINKSTANDBYMSG] = OpponentHandleLinkStandbyMsg, [CONTROLLER_RESETACTIONMOVESELECTION] = OpponentHandleResetActionMoveSelection, - [CONTROLLER_55] = OpponentHandleCmd55, + [CONTROLLER_ENDLINKBATTLE] = OpponentHandleEndLinkBattle, [CONTROLLER_TERMINATOR_NOP] = OpponentCmdEnd }; // unknown unused data static const u8 sUnused[] = {0xB0, 0xB0, 0xC8, 0x98, 0x28, 0x28, 0x28, 0x20}; -static void nullsub_26(void) +static void OpponentDummy(void) { } @@ -203,7 +203,7 @@ static void CompleteOnBankSpriteCallbackDummy2(void) OpponentBufferExecCompleted(); } -static void sub_805F240(void) +static void FreeTrainerSpriteAfterSlide(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { @@ -214,40 +214,40 @@ static void sub_805F240(void) } } -static void sub_805F2A8(void) +static void Intro_DelayAndEnd(void) { - if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF) + if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay == (u8)-1) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 0; OpponentBufferExecCompleted(); } } -static void sub_805F2F0(void) +static void Intro_WaitForShinyAnimAndHealthbox(void) { - bool8 var = FALSE; - bool8 var2; + bool8 healthboxAnimDone = FALSE; + bool8 twoMons; if (!IsDoubleBattle() || ((IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI)) || (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS))) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) - var = TRUE; - var2 = FALSE; + healthboxAnimDone = TRUE; + twoMons = FALSE; } else { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy) - var = TRUE; - var2 = TRUE; + healthboxAnimDone = TRUE; + twoMons = TRUE; } - gUnknown_020244D8 = &gBattleSpritesDataPtr->healthBoxesData[gActiveBattler]; - gUnknown_020244DC = &gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK]; + gBattleControllerOpponentHealthboxData = &gBattleSpritesDataPtr->healthBoxesData[gActiveBattler]; + gBattleControllerOpponentFlankHealthboxData = &gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK]; - if (var) + if (healthboxAnimDone) { - if (var2 == TRUE) + if (twoMons == TRUE) { if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim) @@ -256,8 +256,8 @@ static void sub_805F2F0(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); } else return; @@ -269,8 +269,8 @@ static void sub_805F2F0(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim) { - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); } else return; @@ -281,15 +281,15 @@ static void sub_805F2F0(void) else return; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 3; - gBattlerControllerFuncs[gActiveBattler] = sub_805F2A8; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 3; + gBattlerControllerFuncs[gActiveBattler] = Intro_DelayAndEnd; } } -static void sub_805F560(void) +static void Intro_TryShinyAnimShowHealthbox(void) { - bool32 sp = FALSE; - bool32 r10 = FALSE; + bool32 bgmRestored = FALSE; + bool32 battlerAnimsDone = FALSE; if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive @@ -306,27 +306,27 @@ static void sub_805F560(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted) { if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler ^ BIT_FLANK); + StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]); } UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 = 1; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted = TRUE; } - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x40 - && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 - && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x40 + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].waitForCry + && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted + && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].waitForCry && !IsCryPlayingOrClearCrySongs()) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) { @@ -336,48 +336,48 @@ static void sub_805F560(void) else m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20 = 1; - sp = TRUE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE; + bgmRestored = TRUE; } if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI))) { - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { - r10 = TRUE; + battlerAnimsDone = TRUE; } } else { - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy - && gSprites[gUnknown_03005D7C[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy + && gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy) { - r10 = TRUE; + battlerAnimsDone = TRUE; } } - if (sp && r10) + if (bgmRestored && battlerAnimsDone) { if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler ^ BIT_FLANK]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]); SetBattlerShadowSpriteCallback(gActiveBattler ^ BIT_FLANK, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], MON_DATA_SPECIES)); } - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); - gBattleSpritesDataPtr->animationData->field_9_x1 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 = 0; + gBattleSpritesDataPtr->animationData->introAnimActive = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted = FALSE; - gBattlerControllerFuncs[gActiveBattler] = sub_805F2F0; + gBattlerControllerFuncs[gActiveBattler] = Intro_WaitForShinyAnimAndHealthbox; } } -static void sub_805F994(void) +static void TryShinyAnimAfterMonAnim(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim @@ -389,8 +389,8 @@ static void sub_805F994(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); OpponentBufferExecCompleted(); } } @@ -407,7 +407,7 @@ static void CompleteOnHealthbarDone(void) OpponentBufferExecCompleted(); } -static void sub_805FAC4(void) +static void HideHealthboxAfterMonFaint(void) { if (!gSprites[gBattlerSpriteIds[gActiveBattler]].inUse) { @@ -416,7 +416,7 @@ static void sub_805FAC4(void) } } -static void sub_805FB08(void) +static void FreeMonSpriteAfterSwitchOutAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { @@ -453,21 +453,22 @@ static void DoHitAnimBlinkSpriteEffect(void) } } -static void sub_805FC10(void) +static void SwitchIn_ShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute) InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); - gBattlerControllerFuncs[gActiveBattler] = sub_805FC80; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_HandleSoundAndEnd; } } -static void sub_805FC80(void) +static void SwitchIn_HandleSoundAndEnd(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive && !IsCryPlayingOrClearCrySongs()) { - if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy || gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy_2) + if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy + || gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy_2) { m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); OpponentBufferExecCompleted(); @@ -475,36 +476,36 @@ static void sub_805FC80(void) } } -static void sub_805FD00(void) +static void SwitchIn_ShowHealthbox(void) { if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); CopyBattleSpriteInvisibility(gActiveBattler); - gBattlerControllerFuncs[gActiveBattler] = sub_805FC10; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_ShowSubstitute; } } -static void sub_805FDF0(void) +static void SwitchIn_TryShinyAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) { - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); - gBattlerControllerFuncs[gActiveBattler] = sub_805FD00; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_ShowHealthbox; } } @@ -1150,25 +1151,25 @@ static void OpponentHandleLoadMonSprite(void) SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); - gBattlerControllerFuncs[gActiveBattler] = sub_805F994; + gBattlerControllerFuncs[gActiveBattler] = TryShinyAnimAfterMonAnim; } static void OpponentHandleSwitchInAnim(void) { *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = 6; gBattlerPartyIndexes[gActiveBattler] = gBattleBufferA[gActiveBattler][1]; - sub_80613DC(gActiveBattler, gBattleBufferA[gActiveBattler][2]); - gBattlerControllerFuncs[gActiveBattler] = sub_805FDF0; + StartSendOutAnim(gActiveBattler, gBattleBufferA[gActiveBattler][2]); + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim; } -static void sub_80613DC(u8 battlerId, bool8 dontClearSubstituteBit) +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) { u16 species; ClearTemporarySpeciesSpriteData(battlerId, dontClearSubstituteBit); gBattlerPartyIndexes[battlerId] = gBattleBufferA[battlerId][1]; species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); - gUnknown_03005D7C[battlerId] = CreateInvisibleSpriteWithCallback(sub_805D714); + gBattleControllerData[battlerId] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim); BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlerPartyIndexes[battlerId]], battlerId); SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(battlerId)); @@ -1180,8 +1181,8 @@ static void sub_80613DC(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].data[0] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; - gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; - gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; + gSprites[gBattleControllerData[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; + gSprites[gBattleControllerData[battlerId]].data[2] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].oam.paletteNum = battlerId; @@ -1190,7 +1191,7 @@ static void sub_80613DC(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT); + gSprites[gBattleControllerData[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT); } static void OpponentHandleReturnMonToBall(void) @@ -1225,12 +1226,14 @@ static void DoSwitchOutAnimation(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_SWITCH_OUT_OPPONENT_MON); - gBattlerControllerFuncs[gActiveBattler] = sub_805FB08; + gBattlerControllerFuncs[gActiveBattler] = FreeMonSpriteAfterSwitchOutAnim; } break; } } +#define sSpeedX data[0] + static void OpponentHandleDrawTrainerPic(void) { u32 trainerPicId; @@ -1308,10 +1311,10 @@ static void OpponentHandleDrawTrainerPic(void) GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = 2; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineParam = trainerPicId; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gBattlerControllerFuncs[gActiveBattler] = CompleteOnBattlerSpriteCallbackDummy; } @@ -1378,14 +1381,16 @@ static void OpponentHandleTrainerSlide(void) gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 96; gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.x += 32; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = -2; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineParam = trainerPicId; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gBattlerControllerFuncs[gActiveBattler] = CompleteOnBankSpriteCallbackDummy2; } +#undef sSpeedX + static void OpponentHandleTrainerSlideBack(void) { SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]); @@ -1394,7 +1399,7 @@ static void OpponentHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); - gBattlerControllerFuncs[gActiveBattler] = sub_805F240; + gBattlerControllerFuncs[gActiveBattler] = FreeTrainerSpriteAfterSlide; } static void OpponentHandleFaintAnimation(void) @@ -1412,7 +1417,7 @@ static void OpponentHandleFaintAnimation(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; PlaySE12WithPanning(SE_FAINT, SOUND_PAN_TARGET); gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintOpponentMon; - gBattlerControllerFuncs[gActiveBattler] = sub_805FAC4; + gBattlerControllerFuncs[gActiveBattler] = HideHealthboxAfterMonFaint; } } } @@ -1439,7 +1444,7 @@ static void OpponentHandlePause(void) static void OpponentHandleMoveAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u16 move = gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8); @@ -1481,7 +1486,7 @@ static void OpponentDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(ST_OAM_AFFINE_OFF); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1490,7 +1495,7 @@ static void OpponentDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(ST_OAM_AFFINE_NORMAL); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); @@ -1535,7 +1540,7 @@ static void OpponentHandleChooseAction(void) OpponentBufferExecCompleted(); } -static void OpponentHandleUnknownYesNoBox(void) +static void OpponentHandleYesNoBox(void) { OpponentBufferExecCompleted(); } @@ -1703,7 +1708,7 @@ static void OpponentHandleExpUpdate(void) static void OpponentHandleStatusIconUpdate(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 battlerId; @@ -1716,7 +1721,7 @@ static void OpponentHandleStatusIconUpdate(void) static void OpponentHandleStatusAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8) | (gBattleBufferA[gActiveBattler][4] << 16) | (gBattleBufferA[gActiveBattler][5] << 24)); @@ -1867,26 +1872,26 @@ static void OpponentHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; - StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_806280C); + StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCB_FreeOpponentSprite); - taskId = CreateTask(sub_8062828, 5); + taskId = CreateTask(Task_StartSendOutAnim, 5); gTasks[taskId].data[0] = gActiveBattler; if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown) gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary; - gBattleSpritesDataPtr->animationData->field_9_x1 = 1; - gBattlerControllerFuncs[gActiveBattler] = nullsub_26; + gBattleSpritesDataPtr->animationData->introAnimActive = TRUE; + gBattlerControllerFuncs[gActiveBattler] = OpponentDummy; } -static void sub_806280C(struct Sprite *sprite) +static void SpriteCB_FreeOpponentSprite(struct Sprite *sprite) { FreeTrainerFrontPicPalette(sprite->oam.affineParam); FreeSpriteOamMatrix(sprite); DestroySprite(sprite); } -static void sub_8062828(u8 taskId) +static void Task_StartSendOutAnim(u8 taskId) { u8 savedActiveBank = gActiveBattler; @@ -1894,23 +1899,23 @@ static void sub_8062828(u8 taskId) if (!IsDoubleBattle() || (gBattleTypeFlags & BATTLE_TYPE_MULTI)) { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_80613DC(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); } else if ((gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS)) { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_80613DC(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); } else { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_80613DC(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler ^= BIT_FLANK; gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_80613DC(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler ^= BIT_FLANK; } - gBattlerControllerFuncs[gActiveBattler] = sub_805F560; + gBattlerControllerFuncs[gActiveBattler] = Intro_TryShinyAnimShowHealthbox; gActiveBattler = savedActiveBank; DestroyTask(taskId); } @@ -1939,20 +1944,20 @@ static void OpponentHandleDrawPartyStatusSummary(void) } gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]); - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; if (gBattleBufferA[gActiveBattler][2] != 0) - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 93; - gBattlerControllerFuncs[gActiveBattler] = sub_8062A2C; + gBattlerControllerFuncs[gActiveBattler] = EndDrawPartyStatusSummary; } } -static void sub_8062A2C(void) +static void EndDrawPartyStatusSummary(void) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5++ > 0x5C) + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer++ > 92) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; OpponentBufferExecCompleted(); } } @@ -1981,7 +1986,7 @@ static void OpponentHandleSpriteInvisibility(void) static void OpponentHandleBattleAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 animationId = gBattleBufferA[gActiveBattler][1]; u16 argument = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8); @@ -2003,7 +2008,7 @@ static void OpponentHandleResetActionMoveSelection(void) OpponentBufferExecCompleted(); } -static void OpponentHandleCmd55(void) +static void OpponentHandleEndLinkBattle(void) { if (gBattleTypeFlags & BATTLE_TYPE_LINK && !(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)) { diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index c1d7fc2a4..2717e4a28 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -57,7 +57,7 @@ static void PlayerHandleMoveAnimation(void); static void PlayerHandlePrintString(void); static void PlayerHandlePrintSelectionString(void); static void PlayerHandleChooseAction(void); -static void PlayerHandleUnknownYesNoBox(void); +static void PlayerHandleYesNoBox(void); static void PlayerHandleChooseMove(void); static void PlayerHandleChooseItem(void); static void PlayerHandleChoosePokemon(void); @@ -93,7 +93,7 @@ static void PlayerHandleSpriteInvisibility(void); static void PlayerHandleBattleAnimation(void); static void PlayerHandleLinkStandbyMsg(void); static void PlayerHandleResetActionMoveSelection(void); -static void PlayerHandleCmd55(void); +static void PlayerHandleEndLinkBattle(void); static void PlayerCmdEnd(void); static void PlayerBufferRunCommand(void); @@ -106,22 +106,22 @@ static void MoveSelectionDisplayPpString(void); static void MoveSelectionDisplayMoveType(void); static void MoveSelectionDisplayMoveNames(void); static void HandleMoveSwitching(void); -static void sub_8058FC0(void); +static void SwitchIn_HandleSoundAndEnd(void); static void WaitForMonSelection(void); static void CompleteWhenChoseItem(void); static void Task_LaunchLvlUpAnim(u8 taskId); static void Task_PrepareToGiveExpWithExpBar(u8 taskId); static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8 taskId); -static void sub_8059400(u8 taskId); +static void Task_GiveExpWithExpBar(u8 taskId); static void Task_UpdateLvlInHealthbox(u8 taskId); static void PrintLinkStandbyMsg(void); static u32 CopyPlayerMonData(u8 monId, u8 *dst); static void SetPlayerMonData(u8 monId); -static void sub_805B258(u8 battlerId, bool8 dontClearSubstituteBit); +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit); static void DoSwitchOutAnimation(void); static void PlayerDoMoveAnimation(void); -static void task05_08033660(u8 taskId); -static void sub_805CE38(void); +static void Task_StartSendOutAnim(u8 taskId); +static void EndDrawPartyStatusSummary(void); static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { @@ -144,7 +144,7 @@ static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_PRINTSTRING] = PlayerHandlePrintString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = PlayerHandlePrintSelectionString, [CONTROLLER_CHOOSEACTION] = PlayerHandleChooseAction, - [CONTROLLER_UNKNOWNYESNOBOX] = PlayerHandleUnknownYesNoBox, + [CONTROLLER_YESNOBOX] = PlayerHandleYesNoBox, [CONTROLLER_CHOOSEMOVE] = PlayerHandleChooseMove, [CONTROLLER_OPENBAG] = PlayerHandleChooseItem, [CONTROLLER_CHOOSEPOKEMON] = PlayerHandleChoosePokemon, @@ -180,16 +180,16 @@ static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_BATTLEANIMATION] = PlayerHandleBattleAnimation, [CONTROLLER_LINKSTANDBYMSG] = PlayerHandleLinkStandbyMsg, [CONTROLLER_RESETACTIONMOVESELECTION] = PlayerHandleResetActionMoveSelection, - [CONTROLLER_55] = PlayerHandleCmd55, + [CONTROLLER_ENDLINKBATTLE] = PlayerHandleEndLinkBattle, [CONTROLLER_TERMINATOR_NOP] = PlayerCmdEnd }; -static const u8 sTargetIdentities[] = {B_POSITION_PLAYER_LEFT, B_POSITION_PLAYER_RIGHT, B_POSITION_OPPONENT_RIGHT, B_POSITION_OPPONENT_LEFT}; +static const u8 sTargetIdentities[MAX_BATTLERS_COUNT] = {B_POSITION_PLAYER_LEFT, B_POSITION_PLAYER_RIGHT, B_POSITION_OPPONENT_RIGHT, B_POSITION_OPPONENT_LEFT}; // unknown unused data static const u8 sUnused[] = {0x48, 0x48, 0x20, 0x5a, 0x50, 0x50, 0x50, 0x58}; -void nullsub_21(void) +void BattleControllerDummy(void) { } @@ -332,7 +332,7 @@ static void HandleInputChooseAction(void) } } -static void sub_80577F0(void) // unused +static void UnusedEndBounceEffect(void) { EndBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX); EndBounceEffect(gActiveBattler, BOUNCE_MON); @@ -342,7 +342,7 @@ static void sub_80577F0(void) // unused static void HandleInputChooseTarget(void) { s32 i; - u8 identities[4]; + u8 identities[MAX_BATTLERS_COUNT]; memcpy(identities, sTargetIdentities, ARRAY_COUNT(sTargetIdentities)); DoBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX, 15, 1); @@ -398,7 +398,11 @@ static void HandleInputChooseTarget(void) do { if (--i < 0) +#ifdef UBFIX + i = MAX_BATTLERS_COUNT - 1; +#else i = MAX_BATTLERS_COUNT; // UB: array out of range +#endif gMultiUsePlayerCursor = GetBattlerAtPosition(identities[i]); } while (gMultiUsePlayerCursor == gBattlersCount); @@ -613,7 +617,7 @@ static void HandleInputChooseMove(void) } } -u32 sub_8057FBC(void) // unused +static u32 HandleMoveInputUnused(void) { u32 var = 0; @@ -847,7 +851,7 @@ static void HandleMoveSwitching(void) } } -static void sub_80586F8(void) +static void SetLinkBattleEndCallbacks(void) { if (gWirelessCommType == 0) { @@ -856,7 +860,7 @@ static void sub_80586F8(void) m4aSongNumStop(SE_LOW_HEALTH); gMain.inBattle = 0; gMain.callback1 = gPreBattleCallback1; - SetMainCallback2(sub_8038D64); + SetMainCallback2(CB2_InitEndLinkBattle); if (gBattleOutcome == B_OUTCOME_WON) TryPutLinkBattleTvShowOnAir(); FreeAllWindowBuffers(); @@ -869,7 +873,7 @@ static void sub_80586F8(void) m4aSongNumStop(SE_LOW_HEALTH); gMain.inBattle = 0; gMain.callback1 = gPreBattleCallback1; - SetMainCallback2(sub_8038D64); + SetMainCallback2(CB2_InitEndLinkBattle); if (gBattleOutcome == B_OUTCOME_WON) TryPutLinkBattleTvShowOnAir(); FreeAllWindowBuffers(); @@ -877,7 +881,8 @@ static void sub_80586F8(void) } } -void sub_80587B0(void) +// Despite handling link battles separately, this is only ever used by link battles +void SetBattleEndCallbacks(void) { if (!gPaletteFade.active) { @@ -890,7 +895,7 @@ void sub_80587B0(void) else SetLinkStandbyCallback(); - gBattlerControllerFuncs[gActiveBattler] = sub_80586F8; + gBattlerControllerFuncs[gActiveBattler] = SetLinkBattleEndCallbacks; } } else @@ -915,161 +920,174 @@ static void CompleteOnBankSpriteCallbackDummy2(void) PlayerBufferExecCompleted(); } -static void sub_80588B4(void) +static void FreeTrainerSpriteAfterSlide(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { - nullsub_25(gSaveBlock2Ptr->playerGender); + BattleGfxSfxDummy3(gSaveBlock2Ptr->playerGender); FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]); DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]); PlayerBufferExecCompleted(); } } -static void sub_8058924(void) +static void Intro_DelayAndEnd(void) { - if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF) + if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay == (u8)-1) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 0; PlayerBufferExecCompleted(); } } -static void sub_805896C(void) +static void Intro_WaitForShinyAnimAndHealthbox(void) { - bool8 var = FALSE; + bool8 healthboxAnimDone = FALSE; + // Check if healthbox has finished sliding in if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI))) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) - var = TRUE; + healthboxAnimDone = TRUE; } else { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy) - var = TRUE; + healthboxAnimDone = TRUE; } - if (var && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim + // If healthbox and shiny anim are done + if (healthboxAnimDone && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim) { + // Reset shiny anim (even if it didn't occur) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); if (IsDoubleBattle()) HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], gActiveBattler ^ BIT_FLANK); - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 3; - gBattlerControllerFuncs[gActiveBattler] = sub_8058924; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 3; + gBattlerControllerFuncs[gActiveBattler] = Intro_DelayAndEnd; } } -static void sub_8058B40(void) +static void Intro_TryShinyAnimShowHealthbox(void) { - bool32 r9 = FALSE; - bool32 r8 = FALSE; + bool32 bgmRestored = FALSE; + bool32 battlerAnimsDone = FALSE; + // Start shiny animation if applicable for 1st pokemon if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); + // Start shiny animation if applicable for 2nd pokemon if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive) TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]); - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive) + // Show healthbox after ball anim + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive + && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted) { if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler ^ BIT_FLANK); + StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]); } UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 = 1; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted = TRUE; } - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x40 - && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 - && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x40 + // Restore bgm after cry has played and healthbox anim is started + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].waitForCry + && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted + && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].waitForCry && !IsCryPlayingOrClearCrySongs()) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) m4aMPlayContinue(&gMPlayInfo_BGM); else m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20 = 1; - r9 = TRUE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE; + bgmRestored = TRUE; } + // Wait for battler anims if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI))) { - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { - r8 = TRUE; + battlerAnimsDone = TRUE; } } else { - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy - && gSprites[gUnknown_03005D7C[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy + && gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy) { - r8 = TRUE; + battlerAnimsDone = TRUE; } } - if (r9 && r8) + // Clean up + if (bgmRestored && battlerAnimsDone) { if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler ^ BIT_FLANK]]); - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); - gBattleSpritesDataPtr->animationData->field_9_x1 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 = 0; + gBattleSpritesDataPtr->animationData->introAnimActive = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted = FALSE; - gBattlerControllerFuncs[gActiveBattler] = sub_805896C; + gBattlerControllerFuncs[gActiveBattler] = Intro_WaitForShinyAnimAndHealthbox; } } -static void sub_8058EDC(void) +static void SwitchIn_CleanShinyAnimShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { CopyBattleSpriteInvisibility(gActiveBattler); + + // Reset shiny anim (even if it didn't occur) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); + // Check if Substitute should be shown if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute) InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); - gBattlerControllerFuncs[gActiveBattler] = sub_8058FC0; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_HandleSoundAndEnd; } } -static void sub_8058FC0(void) +static void SwitchIn_HandleSoundAndEnd(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive && !IsCryPlayingOrClearCrySongs()) @@ -1080,24 +1098,26 @@ static void sub_8058FC0(void) } } -static void sub_805902C(void) +static void SwitchIn_TryShinyAnimShowHealthbox(void) { + // Start shiny animation if applicable if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + // Wait for ball anim, then show healthbox + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) { - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - gBattlerControllerFuncs[gActiveBattler] = sub_8058EDC; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_CleanShinyAnimShowSubstitute; } } -void c3_0802FDF4(u8 taskId) +void Task_PlayerController_RestoreBgmAfterCry(u8 taskId) { if (!IsCryPlayingOrClearCrySongs()) { @@ -1196,10 +1216,10 @@ static void Task_PrepareToGiveExpWithExpBar(u8 taskId) expToNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLvlExp; SetBattleBarStruct(battlerId, gHealthboxSpriteIds[battlerId], expToNextLvl, exp, -gainedExp); PlaySE(SE_EXP); - gTasks[taskId].func = sub_8059400; + gTasks[taskId].func = Task_GiveExpWithExpBar; } -static void sub_8059400(u8 taskId) +static void Task_GiveExpWithExpBar(u8 taskId) { if (gTasks[taskId].tExpTask_frames < 13) { @@ -1294,13 +1314,13 @@ static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8 taskId) DestroyTask(taskId); } -static void sub_80596A8(void) +static void FreeMonSpriteAfterFaintAnim(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y > DISPLAY_HEIGHT) { u16 species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - nullsub_24(species); + BattleGfxSfxDummy2(species); FreeOamMatrix(gSprites[gBattlerSpriteIds[gActiveBattler]].oam.matrixNum); DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]); SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]); @@ -1308,7 +1328,7 @@ static void sub_80596A8(void) } } -static void sub_8059744(void) +static void FreeMonSpriteAfterSwitchOutAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { @@ -1332,8 +1352,8 @@ static void OpenPartyMenuToChooseMon(void) u8 caseId; gBattlerControllerFuncs[gActiveBattler] = WaitForMonSelection; - caseId = gTasks[gUnknown_03005D7C[gActiveBattler]].data[0]; - DestroyTask(gUnknown_03005D7C[gActiveBattler]); + caseId = gTasks[gBattleControllerData[gActiveBattler]].data[0]; + DestroyTask(gBattleControllerData[gActiveBattler]); FreeAllWindowBuffers(); OpenPartyMenuInBattle(caseId); } @@ -1360,7 +1380,7 @@ static void OpenBagAndChooseItem(void) if (!gPaletteFade.active) { gBattlerControllerFuncs[gActiveBattler] = CompleteWhenChoseItem; - nullsub_35(); + ReshowBattleScreenDummy(); FreeAllWindowBuffers(); CB2_BagMenuFromBattle(); } @@ -1400,7 +1420,7 @@ static void DoHitAnimBlinkSpriteEffect(void) } } -static void PlayerHandleUnknownYesNoInput(void) +static void PlayerHandleYesNoInput(void) { if (JOY_NEW(DPAD_UP) && gMultiUsePlayerCursor != 0) { @@ -2171,18 +2191,18 @@ static void PlayerHandleSwitchInAnim(void) BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); gActionSelectionCursor[gActiveBattler] = 0; gMoveSelectionCursor[gActiveBattler] = 0; - sub_805B258(gActiveBattler, gBattleBufferA[gActiveBattler][2]); - gBattlerControllerFuncs[gActiveBattler] = sub_805902C; + StartSendOutAnim(gActiveBattler, gBattleBufferA[gActiveBattler][2]); + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnimShowHealthbox; } -static void sub_805B258(u8 battlerId, bool8 dontClearSubstituteBit) +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) { u16 species; ClearTemporarySpeciesSpriteData(battlerId, dontClearSubstituteBit); gBattlerPartyIndexes[battlerId] = gBattleBufferA[battlerId][1]; species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); - gUnknown_03005D7C[battlerId] = CreateInvisibleSpriteWithCallback(sub_805D714); + gBattleControllerData[battlerId] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim); SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(battlerId)); gBattlerSpriteIds[battlerId] = CreateSprite( @@ -2191,8 +2211,8 @@ static void sub_805B258(u8 battlerId, bool8 dontClearSubstituteBit) GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteSubpriority(battlerId)); - gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; - gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; + gSprites[gBattleControllerData[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; + gSprites[gBattleControllerData[battlerId]].data[2] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[0] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; @@ -2203,7 +2223,7 @@ static void sub_805B258(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); + gSprites[gBattleControllerData[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); } static void PlayerHandleReturnMonToBall(void) @@ -2237,12 +2257,14 @@ static void DoSwitchOutAnimation(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_SWITCH_OUT_PLAYER_MON); - gBattlerControllerFuncs[gActiveBattler] = sub_8059744; + gBattlerControllerFuncs[gActiveBattler] = FreeMonSpriteAfterSwitchOutAnim; } break; } } +#define sSpeedX data[0] + // In emerald it's possible to have a tag battle in the battle frontier facilities with AI // which use the front sprite for both the player and the partner as opposed to any other battles (including the one with Steven) // that use an animated back pic. @@ -2306,10 +2328,10 @@ static void PlayerHandleDrawTrainerPic(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y = 48; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = -2; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = ST_OAM_AFFINE_OFF; gSprites[gBattlerSpriteIds[gActiveBattler]].hFlip = 1; } @@ -2321,9 +2343,9 @@ static void PlayerHandleDrawTrainerPic(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = DISPLAY_WIDTH; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = -2; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; } gBattlerControllerFuncs[gActiveBattler] = CompleteOnBattlerSpriteCallbackDummy; @@ -2361,12 +2383,14 @@ static void PlayerHandleTrainerSlide(void) gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -96; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = 2; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gBattlerControllerFuncs[gActiveBattler] = CompleteOnBankSpriteCallbackDummy2; } +#undef sSpeedX + static void PlayerHandleTrainerSlideBack(void) { SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]); @@ -2376,9 +2400,12 @@ static void PlayerHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 1); - gBattlerControllerFuncs[gActiveBattler] = sub_80588B4; + gBattlerControllerFuncs[gActiveBattler] = FreeTrainerSpriteAfterSlide; } +#define sSpeedX data[1] +#define sSpeedY data[2] + static void PlayerHandleFaintAnimation(void) { if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState == 0) @@ -2394,14 +2421,17 @@ static void PlayerHandleFaintAnimation(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); PlaySE12WithPanning(SE_FAINT, SOUND_PAN_ATTACKER); - gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 5; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8039C00; - gBattlerControllerFuncs[gActiveBattler] = sub_80596A8; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = 0; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedY = 5; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintSlideAnim; + gBattlerControllerFuncs[gActiveBattler] = FreeMonSpriteAfterFaintAnim; } } } +#undef sSpeedX +#undef sSpeedY + static void PlayerHandlePaletteFade(void) { BeginNormalPaletteFade(0xFFFFFFFF, 2, 0, 16, RGB_BLACK); @@ -2428,18 +2458,17 @@ static void PlayerHandleBallThrowAnim(void) static void PlayerHandlePause(void) { - u8 var = gBattleBufferA[gActiveBattler][1]; + u8 timer = gBattleBufferA[gActiveBattler][1]; - // WTF is this?? - while (var != 0) - var--; + while (timer != 0) + timer--; PlayerBufferExecCompleted(); } static void PlayerHandleMoveAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u16 move = gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8); @@ -2482,7 +2511,7 @@ static void PlayerDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(ST_OAM_AFFINE_OFF); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -2491,7 +2520,7 @@ static void PlayerDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(ST_OAM_AFFINE_NORMAL); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); @@ -2560,7 +2589,7 @@ static void PlayerHandleChooseAction(void) BattlePutTextOnWindow(gDisplayedStringBattle, 1); } -static void PlayerHandleUnknownYesNoBox(void) +static void PlayerHandleYesNoBox(void) { if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) { @@ -2568,7 +2597,7 @@ static void PlayerHandleUnknownYesNoBox(void) BattlePutTextOnWindow(gText_BattleYesNoChoice, 12); gMultiUsePlayerCursor = 1; BattleCreateYesNoCursorAt(1); - gBattlerControllerFuncs[gActiveBattler] = PlayerHandleUnknownYesNoInput; + gBattlerControllerFuncs[gActiveBattler] = PlayerHandleYesNoInput; } else { @@ -2648,10 +2677,10 @@ static void PlayerHandleChoosePokemon(void) } else { - gUnknown_03005D7C[gActiveBattler] = CreateTask(TaskDummy, 0xFF); - gTasks[gUnknown_03005D7C[gActiveBattler]].data[0] = gBattleBufferA[gActiveBattler][1] & 0xF; + gBattleControllerData[gActiveBattler] = CreateTask(TaskDummy, 0xFF); + gTasks[gBattleControllerData[gActiveBattler]].data[0] = gBattleBufferA[gActiveBattler][1] & 0xF; *(&gBattleStruct->battlerPreventingSwitchout) = gBattleBufferA[gActiveBattler][1] >> 4; - *(&gBattleStruct->field_8B) = gBattleBufferA[gActiveBattler][2]; + *(&gBattleStruct->prevSelectedPartySlot) = gBattleBufferA[gActiveBattler][2]; *(&gBattleStruct->abilityPreventingSwitchout) = gBattleBufferA[gActiveBattler][3]; BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); gBattlerControllerFuncs[gActiveBattler] = OpenPartyMenuToChooseMon; @@ -2715,7 +2744,7 @@ static void PlayerHandleExpUpdate(void) gTasks[taskId].tExpTask_monId = monId; gTasks[taskId].tExpTask_gainedExp = expPointsToGive; gTasks[taskId].tExpTask_battler = gActiveBattler; - gBattlerControllerFuncs[gActiveBattler] = nullsub_21; + gBattlerControllerFuncs[gActiveBattler] = BattleControllerDummy; } } @@ -2726,7 +2755,7 @@ static void PlayerHandleExpUpdate(void) static void PlayerHandleStatusIconUpdate(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 battlerId; @@ -2739,7 +2768,7 @@ static void PlayerHandleStatusIconUpdate(void) static void PlayerHandleStatusAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8) | (gBattleBufferA[gActiveBattler][4] << 16) | (gBattleBufferA[gActiveBattler][5] << 24)); @@ -2909,6 +2938,12 @@ static void PlayerHandleIntroSlide(void) PlayerBufferExecCompleted(); } +// Task data for Task_StartSendOutAnim +#define tBattlerId data[0] +#define tStartTimer data[1] + +#define sBattlerId data[5] + static void PlayerHandleIntroTrainerBallThrow(void) { u8 paletteNum; @@ -2920,68 +2955,77 @@ static void PlayerHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gActiveBattler; + gSprites[gBattlerSpriteIds[gActiveBattler]].sBattlerId = gActiveBattler; - StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_805CC00); + StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCB_FreePlayerSpriteLoadMonSprite); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 1); paletteNum = AllocSpritePalette(0xD6F8); LoadCompressedPalette(gTrainerBackPicPaletteTable[gSaveBlock2Ptr->playerGender].data, 0x100 + paletteNum * 16, 32); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = paletteNum; - taskId = CreateTask(task05_08033660, 5); - gTasks[taskId].data[0] = gActiveBattler; + taskId = CreateTask(Task_StartSendOutAnim, 5); + gTasks[taskId].tBattlerId = gActiveBattler; if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown) gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary; - gBattleSpritesDataPtr->animationData->field_9_x1 = 1; - gBattlerControllerFuncs[gActiveBattler] = nullsub_21; + gBattleSpritesDataPtr->animationData->introAnimActive = TRUE; + gBattlerControllerFuncs[gActiveBattler] = BattleControllerDummy; } -void sub_805CC00(struct Sprite *sprite) +void SpriteCB_FreePlayerSpriteLoadMonSprite(struct Sprite *sprite) { - u8 battlerId = sprite->data[5]; + u8 battlerId = sprite->sBattlerId; + // Free player trainer sprite FreeSpriteOamMatrix(sprite); FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum)); DestroySprite(sprite); + + // Load mon sprite BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlerPartyIndexes[battlerId]], battlerId); StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], 0); } -static void task05_08033660(u8 taskId) +#undef sBattlerId + +// Send out at start of battle +static void Task_StartSendOutAnim(u8 taskId) { - if (gTasks[taskId].data[1] < 31) + if (gTasks[taskId].tStartTimer < 31) { - gTasks[taskId].data[1]++; + gTasks[taskId].tStartTimer++; } else { u8 savedActiveBattler = gActiveBattler; - gActiveBattler = gTasks[taskId].data[0]; + gActiveBattler = gTasks[taskId].tBattlerId; if (!IsDoubleBattle() || (gBattleTypeFlags & BATTLE_TYPE_MULTI)) { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_805B258(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); } else { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_805B258(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler ^= BIT_FLANK; gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); - sub_805B258(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler ^= BIT_FLANK; } - gBattlerControllerFuncs[gActiveBattler] = sub_8058B40; + gBattlerControllerFuncs[gActiveBattler] = Intro_TryShinyAnimShowHealthbox; gActiveBattler = savedActiveBattler; DestroyTask(taskId); } } +#undef tBattlerId +#undef tStartTimer + static void PlayerHandleDrawPartyStatusSummary(void) { if (gBattleBufferA[gActiveBattler][1] != 0 && GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) @@ -2992,20 +3036,21 @@ static void PlayerHandleDrawPartyStatusSummary(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1; gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]); - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; + // If intro, skip the delay after drawing if (gBattleBufferA[gActiveBattler][2] != 0) - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 93; - gBattlerControllerFuncs[gActiveBattler] = sub_805CE38; + gBattlerControllerFuncs[gActiveBattler] = EndDrawPartyStatusSummary; } } -static void sub_805CE38(void) +static void EndDrawPartyStatusSummary(void) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5++ > 0x5C) + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer++ > 92) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; PlayerBufferExecCompleted(); } } @@ -3036,7 +3081,7 @@ static void PlayerHandleSpriteInvisibility(void) static void PlayerHandleBattleAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 animationId = gBattleBufferA[gActiveBattler][1]; u16 argument = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8); @@ -3052,7 +3097,7 @@ static void PlayerHandleBattleAnimation(void) static void PlayerHandleLinkStandbyMsg(void) { - sub_81851A8(&gBattleBufferA[gActiveBattler][2]); + RecordedBattle_RecordAllBattlerData(&gBattleBufferA[gActiveBattler][2]); switch (gBattleBufferA[gActiveBattler][1]) { case 0: @@ -3087,15 +3132,15 @@ static void PlayerHandleResetActionMoveSelection(void) PlayerBufferExecCompleted(); } -static void PlayerHandleCmd55(void) +static void PlayerHandleEndLinkBattle(void) { - sub_81851A8(&gBattleBufferA[gActiveBattler][4]); + RecordedBattle_RecordAllBattlerData(&gBattleBufferA[gActiveBattler][4]); gBattleOutcome = gBattleBufferA[gActiveBattler][1]; gSaveBlock2Ptr->frontier.disableRecordBattle = gBattleBufferA[gActiveBattler][2]; FadeOutMapMusic(5); BeginFastPaletteFade(3); PlayerBufferExecCompleted(); - gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; + gBattlerControllerFuncs[gActiveBattler] = SetBattleEndCallbacks; } static void PlayerCmdEnd(void) diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index d826d2183..251542a48 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -47,7 +47,7 @@ static void PlayerPartnerHandleMoveAnimation(void); static void PlayerPartnerHandlePrintString(void); static void PlayerPartnerHandlePrintSelectionString(void); static void PlayerPartnerHandleChooseAction(void); -static void PlayerPartnerHandleUnknownYesNoBox(void); +static void PlayerPartnerHandleYesNoBox(void); static void PlayerPartnerHandleChooseMove(void); static void PlayerPartnerHandleChooseItem(void); static void PlayerPartnerHandleChoosePokemon(void); @@ -83,25 +83,24 @@ static void PlayerPartnerHandleSpriteInvisibility(void); static void PlayerPartnerHandleBattleAnimation(void); static void PlayerPartnerHandleLinkStandbyMsg(void); static void PlayerPartnerHandleResetActionMoveSelection(void); -static void PlayerPartnerHandleCmd55(void); +static void PlayerPartnerHandleEndLinkBattle(void); static void PlayerPartnerCmdEnd(void); static void PlayerPartnerBufferRunCommand(void); static void PlayerPartnerBufferExecCompleted(void); -static void sub_81BB628(u8 taskId); +static void Task_LaunchLvlUpAnim(u8 taskId); static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8 taskId); static void Task_PrepareToGiveExpWithExpBar(u8 taskId); -static void sub_81BB4E4(u8 taskId); -static void sub_81BB628(u8 taskId); -static void sub_81BB688(u8 taskId); -static void sub_81BB9A0(void); +static void Task_GiveExpWithExpBar(u8 taskId); +static void Task_UpdateLvlInHealthbox(u8 taskId); +static void SwitchIn_WaitAndEnd(void); static u32 CopyPlayerPartnerMonData(u8 monId, u8 *dst); static void SetPlayerPartnerMonData(u8 monId); -static void sub_81BD0E4(u8 battlerId, bool8 dontClearSubstituteBit); +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit); static void DoSwitchOutAnimation(void); static void PlayerPartnerDoMoveAnimation(void); -static void sub_81BE2C8(u8 taskId); -static void sub_81BE498(void); +static void Task_StartSendOutAnim(u8 taskId); +static void EndDrawPartyStatusSummary(void); static void (*const sPlayerPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { @@ -124,7 +123,7 @@ static void (*const sPlayerPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_PRINTSTRING] = PlayerPartnerHandlePrintString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = PlayerPartnerHandlePrintSelectionString, [CONTROLLER_CHOOSEACTION] = PlayerPartnerHandleChooseAction, - [CONTROLLER_UNKNOWNYESNOBOX] = PlayerPartnerHandleUnknownYesNoBox, + [CONTROLLER_YESNOBOX] = PlayerPartnerHandleYesNoBox, [CONTROLLER_CHOOSEMOVE] = PlayerPartnerHandleChooseMove, [CONTROLLER_OPENBAG] = PlayerPartnerHandleChooseItem, [CONTROLLER_CHOOSEPOKEMON] = PlayerPartnerHandleChoosePokemon, @@ -160,7 +159,7 @@ static void (*const sPlayerPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_BATTLEANIMATION] = PlayerPartnerHandleBattleAnimation, [CONTROLLER_LINKSTANDBYMSG] = PlayerPartnerHandleLinkStandbyMsg, [CONTROLLER_RESETACTIONMOVESELECTION] = PlayerPartnerHandleResetActionMoveSelection, - [CONTROLLER_55] = PlayerPartnerHandleCmd55, + [CONTROLLER_ENDLINKBATTLE] = PlayerPartnerHandleEndLinkBattle, [CONTROLLER_TERMINATOR_NOP] = PlayerPartnerCmdEnd }; @@ -173,7 +172,7 @@ static const u8 sUnused[] = 0x3b, 0x43, 0xda, 0x36, 0x79, 0x2a, 0x0e, 0x53, }; -static void nullsub_77(void) +static void PlayerPartnerDummy(void) { } @@ -199,84 +198,84 @@ static void CompleteOnBattlerSpriteCallbackDummy(void) PlayerPartnerBufferExecCompleted(); } -static void sub_81BAE98(void) +static void FreeTrainerSpriteAfterSlide(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { - nullsub_25(0); + BattleGfxSfxDummy3(MALE); FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]); DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]); PlayerPartnerBufferExecCompleted(); } } -static void sub_81BAF00(void) +static void Intro_DelayAndEnd(void) { - if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF) + if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay == (u8)-1) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 0; PlayerPartnerBufferExecCompleted(); } } -static void sub_81BAF48(void) +static void Intro_WaitForHealthbox(void) { - bool32 r6 = FALSE; + bool32 finished = FALSE; if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI))) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) - r6 = TRUE; + finished = TRUE; } else { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy) { - r6 = TRUE; + finished = TRUE; } } if (IsCryPlayingOrClearCrySongs()) - r6 = FALSE; + finished = FALSE; - if (r6) + if (finished) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 3; - gBattlerControllerFuncs[gActiveBattler] = sub_81BAF00; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 3; + gBattlerControllerFuncs[gActiveBattler] = Intro_DelayAndEnd; } } -static void sub_81BB02C(void) +static void Intro_ShowHealthbox(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive - && gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + && gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy - && ++gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 != 1) + && ++gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay != 1) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 0; if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler ^ BIT_FLANK]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler ^ BIT_FLANK); + StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]); } - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - gBattleSpritesDataPtr->animationData->field_9_x1 = 0; + gBattleSpritesDataPtr->animationData->introAnimActive = FALSE; - gBattlerControllerFuncs[gActiveBattler] = sub_81BAF48; + gBattlerControllerFuncs[gActiveBattler] = Intro_WaitForHealthbox; } } -static void sub_81BB1D4(void) +static void WaitForMonAnimAfterLoad(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].animEnded && gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0) PlayerPartnerBufferExecCompleted(); @@ -339,7 +338,7 @@ static void Task_GiveExpToMon(u8 taskId) if (IsDoubleBattle() == TRUE && ((u16)(monId) == gBattlerPartyIndexes[battlerId] || (u16)(monId) == gBattlerPartyIndexes[battlerId ^ BIT_FLANK])) - gTasks[taskId].func = sub_81BB628; + gTasks[taskId].func = Task_LaunchLvlUpAnim; else gTasks[taskId].func = DestroyExpTaskAndCompleteOnInactiveTextPrinter; } @@ -373,10 +372,10 @@ static void Task_PrepareToGiveExpWithExpBar(u8 taskId) expToNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLvlExp; SetBattleBarStruct(battlerId, gHealthboxSpriteIds[battlerId], expToNextLvl, exp, -gainedExp); PlaySE(SE_EXP); - gTasks[taskId].func = sub_81BB4E4; + gTasks[taskId].func = Task_GiveExpWithExpBar; } -static void sub_81BB4E4(u8 taskId) +static void Task_GiveExpWithExpBar(u8 taskId) { if (gTasks[taskId].tExpTask_frames < 13) { @@ -415,7 +414,7 @@ static void sub_81BB4E4(u8 taskId) gActiveBattler = battlerId; BtlController_EmitTwoReturnValues(1, RET_VALUE_LEVELED_UP, gainedExp); gActiveBattler = savedActiveBank; - gTasks[taskId].func = sub_81BB628; + gTasks[taskId].func = Task_LaunchLvlUpAnim; } else { @@ -428,7 +427,7 @@ static void sub_81BB4E4(u8 taskId) } } -static void sub_81BB628(u8 taskId) +static void Task_LaunchLvlUpAnim(u8 taskId) { u8 battlerId = gTasks[taskId].tExpTask_bank; u8 monIndex = gTasks[taskId].tExpTask_monId; @@ -437,10 +436,10 @@ static void sub_81BB628(u8 taskId) battlerId ^= BIT_FLANK; InitAndLaunchSpecialAnimation(battlerId, battlerId, battlerId, B_ANIM_LVL_UP); - gTasks[taskId].func = sub_81BB688; + gTasks[taskId].func = Task_UpdateLvlInHealthbox; } -static void sub_81BB688(u8 taskId) +static void Task_UpdateLvlInHealthbox(u8 taskId) { u8 battlerId = gTasks[taskId].tExpTask_bank; @@ -471,13 +470,13 @@ static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8 taskId) DestroyTask(taskId); } -static void sub_81BB78C(void) +static void FreeMonSpriteAfterFaintAnim(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y > DISPLAY_HEIGHT) { u16 species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - nullsub_24(species); + BattleGfxSfxDummy2(species); FreeOamMatrix(gSprites[gBattlerSpriteIds[gActiveBattler]].oam.matrixNum); DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]); SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]); @@ -485,7 +484,7 @@ static void sub_81BB78C(void) } } -static void sub_81BB828(void) +static void FreeMonSpriteAfterSwitchOutAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { @@ -521,7 +520,7 @@ static void DoHitAnimBlinkSpriteEffect(void) } } -static void sub_81BB92C(void) +static void SwitchIn_ShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { @@ -529,11 +528,11 @@ static void sub_81BB92C(void) if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute) InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); - gBattlerControllerFuncs[gActiveBattler] = sub_81BB9A0; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_WaitAndEnd; } } -static void sub_81BB9A0(void) +static void SwitchIn_WaitAndEnd(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) @@ -542,28 +541,28 @@ static void sub_81BB9A0(void) } } -static void sub_81BB9F4(void) +static void SwitchIn_ShowHealthbox(void) { if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); - CreateTask(c3_0802FDF4, 10); + CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10); HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - gBattlerControllerFuncs[gActiveBattler] = sub_81BB92C; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_ShowSubstitute; } } -static void sub_81BBAE8(void) +static void SwitchIn_TryShinyAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) @@ -571,11 +570,11 @@ static void sub_81BBAE8(void) TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); } - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) { - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); - gBattlerControllerFuncs[gActiveBattler] = sub_81BB9F4; + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_ShowHealthbox; } } @@ -1210,7 +1209,7 @@ static void PlayerPartnerHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); - gBattlerControllerFuncs[gActiveBattler] = sub_81BB1D4; + gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad; } static void PlayerPartnerHandleSwitchInAnim(void) @@ -1218,18 +1217,18 @@ static void PlayerPartnerHandleSwitchInAnim(void) ClearTemporarySpeciesSpriteData(gActiveBattler, gBattleBufferA[gActiveBattler][2]); gBattlerPartyIndexes[gActiveBattler] = gBattleBufferA[gActiveBattler][1]; BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); - sub_81BD0E4(gActiveBattler, gBattleBufferA[gActiveBattler][2]); - gBattlerControllerFuncs[gActiveBattler] = sub_81BBAE8; + StartSendOutAnim(gActiveBattler, gBattleBufferA[gActiveBattler][2]); + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim; } -static void sub_81BD0E4(u8 battlerId, bool8 dontClearSubstituteBit) +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) { u16 species; ClearTemporarySpeciesSpriteData(battlerId, dontClearSubstituteBit); gBattlerPartyIndexes[battlerId] = gBattleBufferA[battlerId][1]; species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); - gUnknown_03005D7C[battlerId] = CreateInvisibleSpriteWithCallback(sub_805D714); + gBattleControllerData[battlerId] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim); SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(battlerId)); gBattlerSpriteIds[battlerId] = CreateSprite( @@ -1238,8 +1237,8 @@ static void sub_81BD0E4(u8 battlerId, bool8 dontClearSubstituteBit) GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteSubpriority(battlerId)); - gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; - gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; + gSprites[gBattleControllerData[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; + gSprites[gBattleControllerData[battlerId]].data[2] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[0] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; @@ -1250,7 +1249,7 @@ static void sub_81BD0E4(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); + gSprites[gBattleControllerData[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); } static void PlayerPartnerHandleReturnMonToBall(void) @@ -1284,12 +1283,14 @@ static void DoSwitchOutAnimation(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_SWITCH_OUT_PLAYER_MON); - gBattlerControllerFuncs[gActiveBattler] = sub_81BB828; + gBattlerControllerFuncs[gActiveBattler] = FreeMonSpriteAfterSwitchOutAnim; } break; } } +#define sSpeedX data[0] + // some explanation here // in emerald it's possible to have a tag battle in the battle frontier facilities with AI // which use the front sprite for both the player and the partner as opposed to any other battles (including the one with Steven) that use the back pic as well as animate it @@ -1319,9 +1320,9 @@ static void PlayerPartnerHandleDrawTrainerPic(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = DISPLAY_WIDTH; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = -2; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; } else // otherwise use front sprite { @@ -1330,10 +1331,10 @@ static void PlayerPartnerHandleDrawTrainerPic(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y = 48; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = -2; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = ST_OAM_AFFINE_OFF; gSprites[gBattlerSpriteIds[gActiveBattler]].hFlip = 1; } @@ -1341,6 +1342,8 @@ static void PlayerPartnerHandleDrawTrainerPic(void) gBattlerControllerFuncs[gActiveBattler] = CompleteOnBattlerSpriteCallbackDummy; } +#undef sSpeedX + static void PlayerPartnerHandleTrainerSlide(void) { PlayerPartnerBufferExecCompleted(); @@ -1354,9 +1357,12 @@ static void PlayerPartnerHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); - gBattlerControllerFuncs[gActiveBattler] = sub_81BAE98; + gBattlerControllerFuncs[gActiveBattler] = FreeTrainerSpriteAfterSlide; } +#define sSpeedX data[1] +#define sSpeedY data[2] + static void PlayerPartnerHandleFaintAnimation(void) { if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState == 0) @@ -1372,14 +1378,17 @@ static void PlayerPartnerHandleFaintAnimation(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); PlaySE12WithPanning(SE_FAINT, SOUND_PAN_ATTACKER); - gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 5; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8039C00; - gBattlerControllerFuncs[gActiveBattler] = sub_81BB78C; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = 0; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedY = 5; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintSlideAnim; + gBattlerControllerFuncs[gActiveBattler] = FreeMonSpriteAfterFaintAnim; } } } +#undef sSpeedX +#undef sSpeedY + static void PlayerPartnerHandlePaletteFade(void) { PlayerPartnerBufferExecCompleted(); @@ -1402,7 +1411,7 @@ static void PlayerPartnerHandlePause(void) static void PlayerPartnerHandleMoveAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u16 move = gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8); @@ -1444,7 +1453,7 @@ static void PlayerPartnerDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(ST_OAM_AFFINE_OFF); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1453,7 +1462,7 @@ static void PlayerPartnerDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(ST_OAM_AFFINE_NORMAL); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); @@ -1497,7 +1506,7 @@ static void PlayerPartnerHandleChooseAction(void) PlayerPartnerBufferExecCompleted(); } -static void PlayerPartnerHandleUnknownYesNoBox(void) +static void PlayerPartnerHandleYesNoBox(void) { PlayerPartnerBufferExecCompleted(); } @@ -1602,7 +1611,7 @@ static void PlayerPartnerHandleExpUpdate(void) gTasks[taskId].tExpTask_monId = monId; gTasks[taskId].tExpTask_gainedExp = expPointsToGive; gTasks[taskId].tExpTask_bank = gActiveBattler; - gBattlerControllerFuncs[gActiveBattler] = nullsub_21; + gBattlerControllerFuncs[gActiveBattler] = BattleControllerDummy; } } @@ -1613,7 +1622,7 @@ static void PlayerPartnerHandleExpUpdate(void) static void PlayerPartnerHandleStatusIconUpdate(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 battlerId; @@ -1626,7 +1635,7 @@ static void PlayerPartnerHandleStatusIconUpdate(void) static void PlayerPartnerHandleStatusAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8) | (gBattleBufferA[gActiveBattler][4] << 16) | (gBattleBufferA[gActiveBattler][5] << 24)); @@ -1779,7 +1788,7 @@ static void PlayerPartnerHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gActiveBattler; - StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_805CC00); + StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCB_FreePlayerSpriteLoadMonSprite); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 1); paletteNum = AllocSpritePalette(0xD6F9); @@ -1797,17 +1806,17 @@ static void PlayerPartnerHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = paletteNum; - taskId = CreateTask(sub_81BE2C8, 5); + taskId = CreateTask(Task_StartSendOutAnim, 5); gTasks[taskId].data[0] = gActiveBattler; if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown) gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary; - gBattleSpritesDataPtr->animationData->field_9_x1 = 1; - gBattlerControllerFuncs[gActiveBattler] = nullsub_77; + gBattleSpritesDataPtr->animationData->introAnimActive = TRUE; + gBattlerControllerFuncs[gActiveBattler] = PlayerPartnerDummy; } -static void sub_81BE2C8(u8 taskId) +static void Task_StartSendOutAnim(u8 taskId) { if (gTasks[taskId].data[1] < 24) { @@ -1821,19 +1830,19 @@ static void sub_81BE2C8(u8 taskId) if (!IsDoubleBattle() || (gBattleTypeFlags & BATTLE_TYPE_MULTI)) { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_81BD0E4(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); } else { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_81BD0E4(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler ^= BIT_FLANK; gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); - sub_81BD0E4(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler ^= BIT_FLANK; } - gBattlerControllerFuncs[gActiveBattler] = sub_81BB02C; + gBattlerControllerFuncs[gActiveBattler] = Intro_ShowHealthbox; gActiveBattler = savedActiveBank; DestroyTask(taskId); } @@ -1849,20 +1858,20 @@ static void PlayerPartnerHandleDrawPartyStatusSummary(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1; gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]); - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; if (gBattleBufferA[gActiveBattler][2] != 0) - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 93; - gBattlerControllerFuncs[gActiveBattler] = sub_81BE498; + gBattlerControllerFuncs[gActiveBattler] = EndDrawPartyStatusSummary; } } -static void sub_81BE498(void) +static void EndDrawPartyStatusSummary(void) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5++ > 0x5C) + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer++ > 92) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; PlayerPartnerBufferExecCompleted(); } } @@ -1891,7 +1900,7 @@ static void PlayerPartnerHandleSpriteInvisibility(void) static void PlayerPartnerHandleBattleAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 animationId = gBattleBufferA[gActiveBattler][1]; u16 argument = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8); @@ -1913,13 +1922,13 @@ static void PlayerPartnerHandleResetActionMoveSelection(void) PlayerPartnerBufferExecCompleted(); } -static void PlayerPartnerHandleCmd55(void) +static void PlayerPartnerHandleEndLinkBattle(void) { gBattleOutcome = gBattleBufferA[gActiveBattler][1]; FadeOutMapMusic(5); BeginFastPaletteFade(3); PlayerPartnerBufferExecCompleted(); - gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; + gBattlerControllerFuncs[gActiveBattler] = SetBattleEndCallbacks; } static void PlayerPartnerCmdEnd(void) diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 23269dbad..26d93ad28 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -51,7 +51,7 @@ static void RecordedOpponentHandleMoveAnimation(void); static void RecordedOpponentHandlePrintString(void); static void RecordedOpponentHandlePrintSelectionString(void); static void RecordedOpponentHandleChooseAction(void); -static void RecordedOpponentHandleUnknownYesNoBox(void); +static void RecordedOpponentHandleYesNoBox(void); static void RecordedOpponentHandleChooseMove(void); static void RecordedOpponentHandleChooseItem(void); static void RecordedOpponentHandleChoosePokemon(void); @@ -87,20 +87,20 @@ static void RecordedOpponentHandleSpriteInvisibility(void); static void RecordedOpponentHandleBattleAnimation(void); static void RecordedOpponentHandleLinkStandbyMsg(void); static void RecordedOpponentHandleResetActionMoveSelection(void); -static void RecordedOpponentHandleCmd55(void); +static void RecordedOpponentHandleEndLinkBattle(void); static void RecordedOpponentCmdEnd(void); static void RecordedOpponentBufferRunCommand(void); static void RecordedOpponentBufferExecCompleted(void); -static void sub_8186F14(void); +static void SwitchIn_HandleSoundAndEnd(void); static u32 CopyRecordedOpponentMonData(u8 monId, u8 *dst); static void SetRecordedOpponentMonData(u8 monId); -static void sub_81885D8(u8 battlerId, bool8 dontClearSubstituteBit); +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit); static void DoSwitchOutAnimation(void); static void RecordedOpponentDoMoveAnimation(void); -static void sub_8189548(u8 taskId); -static void sub_818962C(struct Sprite *sprite); -static void sub_818975C(void); +static void Task_StartSendOutAnim(u8 taskId); +static void SpriteCB_FreeOpponentSprite(struct Sprite *sprite); +static void EndDrawPartyStatusSummary(void); static void (*const sRecordedOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { @@ -123,7 +123,7 @@ static void (*const sRecordedOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void [CONTROLLER_PRINTSTRING] = RecordedOpponentHandlePrintString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = RecordedOpponentHandlePrintSelectionString, [CONTROLLER_CHOOSEACTION] = RecordedOpponentHandleChooseAction, - [CONTROLLER_UNKNOWNYESNOBOX] = RecordedOpponentHandleUnknownYesNoBox, + [CONTROLLER_YESNOBOX] = RecordedOpponentHandleYesNoBox, [CONTROLLER_CHOOSEMOVE] = RecordedOpponentHandleChooseMove, [CONTROLLER_OPENBAG] = RecordedOpponentHandleChooseItem, [CONTROLLER_CHOOSEPOKEMON] = RecordedOpponentHandleChoosePokemon, @@ -159,11 +159,11 @@ static void (*const sRecordedOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void [CONTROLLER_BATTLEANIMATION] = RecordedOpponentHandleBattleAnimation, [CONTROLLER_LINKSTANDBYMSG] = RecordedOpponentHandleLinkStandbyMsg, [CONTROLLER_RESETACTIONMOVESELECTION] = RecordedOpponentHandleResetActionMoveSelection, - [CONTROLLER_55] = RecordedOpponentHandleCmd55, + [CONTROLLER_ENDLINKBATTLE] = RecordedOpponentHandleEndLinkBattle, [CONTROLLER_TERMINATOR_NOP] = RecordedOpponentCmdEnd }; -static void nullsub_70(void) +static void RecordedOpponentDummy(void) { } @@ -195,7 +195,7 @@ static void CompleteOnBankSpriteCallbackDummy2(void) RecordedOpponentBufferExecCompleted(); } -static void sub_81865C8(void) +static void FreeTrainerSpriteAfterSlide(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { @@ -206,24 +206,24 @@ static void sub_81865C8(void) } } -static void sub_8186630(void) +static void Intro_DelayAndEnd(void) { - if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF) + if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay == (u8)-1) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 0; RecordedOpponentBufferExecCompleted(); } } -static void sub_8186678(void) +static void Intro_WaitForShinyAnimAndHealthbox(void) { - bool8 var = FALSE; + bool8 healthboxAnimDone = FALSE; if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI))) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].animEnded) - var = TRUE; + healthboxAnimDone = TRUE; } else @@ -232,10 +232,10 @@ static void sub_8186678(void) && gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].animEnded && gSprites[gBattlerSpriteIds[gActiveBattler ^ BIT_FLANK]].animEnded) - var = TRUE; + healthboxAnimDone = TRUE; } - if (var) + if (healthboxAnimDone) { if (GetBattlerPosition(gActiveBattler) == B_POSITION_OPPONENT_LEFT) { @@ -248,19 +248,19 @@ static void sub_8186678(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 3; - gBattlerControllerFuncs[gActiveBattler] = sub_8186630; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 3; + gBattlerControllerFuncs[gActiveBattler] = Intro_DelayAndEnd; } } -static void sub_818686C(void) +static void Intro_TryShinyAnimShowHealthbox(void) { - bool32 r9 = FALSE; - bool32 r8 = FALSE; + bool32 bgmRestored = FALSE; + bool32 battlerAnimsDone = FALSE; if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) @@ -272,27 +272,27 @@ static void sub_818686C(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted) { if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler ^ BIT_FLANK); + StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]); } UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 = 1; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted = TRUE; } - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x40 - && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 - && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x40 + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].waitForCry + && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted + && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].waitForCry && !IsCryPlayingOrClearCrySongs()) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) { @@ -304,49 +304,49 @@ static void sub_818686C(void) m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100); } } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20 = 1; - r9 = TRUE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE; + bgmRestored = TRUE; } if (!IsDoubleBattle()) { - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { - r8 = TRUE; + battlerAnimsDone = TRUE; } } else { - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy - && gSprites[gUnknown_03005D7C[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy + && gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy) { - r8 = TRUE; + battlerAnimsDone = TRUE; } } - if (r9 && r8) + if (bgmRestored && battlerAnimsDone) { if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler ^ BIT_FLANK]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]); SetBattlerShadowSpriteCallback(gActiveBattler ^ BIT_FLANK, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], MON_DATA_SPECIES)); } - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); - gBattleSpritesDataPtr->animationData->field_9_x1 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 = 0; + gBattleSpritesDataPtr->animationData->introAnimActive = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted = FALSE; - gBattlerControllerFuncs[gActiveBattler] = sub_8186678; + gBattlerControllerFuncs[gActiveBattler] = Intro_WaitForShinyAnimAndHealthbox; } } -static void sub_8186C48(void) +static void TryShinyAnimAfterMonAnim(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0) @@ -361,8 +361,8 @@ static void sub_8186C48(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); RecordedOpponentBufferExecCompleted(); } } @@ -385,7 +385,7 @@ static void CompleteOnHealthbarDone(void) } } -static void sub_8186D58(void) +static void HideHealthboxAfterMonFaint(void) { if (!gSprites[gBattlerSpriteIds[gActiveBattler]].inUse) { @@ -394,7 +394,7 @@ static void sub_8186D58(void) } } -static void sub_8186D9C(void) +static void FreeMonSpriteAfterSwitchOutAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { @@ -431,18 +431,18 @@ static void DoHitAnimBlinkSpriteEffect(void) } } -static void sub_8186EA4(void) +static void SwitchIn_ShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute) InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); - gBattlerControllerFuncs[gActiveBattler] = sub_8186F14; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_HandleSoundAndEnd; } } -static void sub_8186F14(void) +static void SwitchIn_HandleSoundAndEnd(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive && !IsCryPlayingOrClearCrySongs()) @@ -456,7 +456,7 @@ static void sub_8186F14(void) } } -static void sub_8186F94(void) +static void SwitchIn_ShowHealthbox(void) { if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) @@ -464,31 +464,31 @@ static void sub_8186F94(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); CopyBattleSpriteInvisibility(gActiveBattler); - gBattlerControllerFuncs[gActiveBattler] = sub_8186EA4; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_ShowSubstitute; } } -static void sub_8187084(void) +static void SwitchIn_TryShinyAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim) TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]); - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) { - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); - gBattlerControllerFuncs[gActiveBattler] = sub_8186F94; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_ShowHealthbox; } } @@ -1124,24 +1124,24 @@ static void RecordedOpponentHandleLoadMonSprite(void) SetBattlerShadowSpriteCallback(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES)); - gBattlerControllerFuncs[gActiveBattler] = sub_8186C48; + gBattlerControllerFuncs[gActiveBattler] = TryShinyAnimAfterMonAnim; } static void RecordedOpponentHandleSwitchInAnim(void) { gBattlerPartyIndexes[gActiveBattler] = gBattleBufferA[gActiveBattler][1]; - sub_81885D8(gActiveBattler, gBattleBufferA[gActiveBattler][2]); - gBattlerControllerFuncs[gActiveBattler] = sub_8187084; + StartSendOutAnim(gActiveBattler, gBattleBufferA[gActiveBattler][2]); + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim; } -static void sub_81885D8(u8 battlerId, bool8 dontClearSubstituteBit) +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) { u16 species; ClearTemporarySpeciesSpriteData(battlerId, dontClearSubstituteBit); gBattlerPartyIndexes[battlerId] = gBattleBufferA[battlerId][1]; species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); - gUnknown_03005D7C[battlerId] = CreateInvisibleSpriteWithCallback(sub_805D714); + gBattleControllerData[battlerId] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim); BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlerPartyIndexes[battlerId]], battlerId); SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(battlerId)); @@ -1150,8 +1150,8 @@ static void sub_81885D8(u8 battlerId, bool8 dontClearSubstituteBit) GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteSubpriority(battlerId)); - gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; - gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; + gSprites[gBattleControllerData[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; + gSprites[gBattleControllerData[battlerId]].data[2] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[0] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; @@ -1162,7 +1162,7 @@ static void sub_81885D8(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT); + gSprites[gBattleControllerData[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT); } static void RecordedOpponentHandleReturnMonToBall(void) @@ -1197,12 +1197,14 @@ static void DoSwitchOutAnimation(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_SWITCH_OUT_OPPONENT_MON); - gBattlerControllerFuncs[gActiveBattler] = sub_8186D9C; + gBattlerControllerFuncs[gActiveBattler] = FreeMonSpriteAfterSwitchOutAnim; } break; } } +#define sSpeedX data[0] + static void RecordedOpponentHandleDrawTrainerPic(void) { s16 xPos; @@ -1248,14 +1250,16 @@ static void RecordedOpponentHandleDrawTrainerPic(void) GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = 2; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineParam = trainerPicId; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gBattlerControllerFuncs[gActiveBattler] = CompleteOnBattlerSpriteCallbackDummy; } +#undef sSpeedX + static void RecordedOpponentHandleTrainerSlide(void) { RecordedOpponentBufferExecCompleted(); @@ -1269,7 +1273,7 @@ static void RecordedOpponentHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); - gBattlerControllerFuncs[gActiveBattler] = sub_81865C8; + gBattlerControllerFuncs[gActiveBattler] = FreeTrainerSpriteAfterSlide; } static void RecordedOpponentHandleFaintAnimation(void) @@ -1287,7 +1291,7 @@ static void RecordedOpponentHandleFaintAnimation(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; PlaySE12WithPanning(SE_FAINT, SOUND_PAN_TARGET); gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintOpponentMon; - gBattlerControllerFuncs[gActiveBattler] = sub_8186D58; + gBattlerControllerFuncs[gActiveBattler] = HideHealthboxAfterMonFaint; } } } @@ -1314,7 +1318,7 @@ static void RecordedOpponentHandlePause(void) static void RecordedOpponentHandleMoveAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u16 move = gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8); @@ -1356,7 +1360,7 @@ static void RecordedOpponentDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(ST_OAM_AFFINE_OFF); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1365,7 +1369,7 @@ static void RecordedOpponentDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(ST_OAM_AFFINE_NORMAL); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); @@ -1409,7 +1413,7 @@ static void RecordedOpponentHandleChooseAction(void) RecordedOpponentBufferExecCompleted(); } -static void RecordedOpponentHandleUnknownYesNoBox(void) +static void RecordedOpponentHandleYesNoBox(void) { RecordedOpponentBufferExecCompleted(); } @@ -1478,7 +1482,7 @@ static void RecordedOpponentHandleExpUpdate(void) static void RecordedOpponentHandleStatusIconUpdate(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 battlerId; @@ -1491,7 +1495,7 @@ static void RecordedOpponentHandleStatusIconUpdate(void) static void RecordedOpponentHandleStatusAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8) | (gBattleBufferA[gActiveBattler][4] << 16) | (gBattleBufferA[gActiveBattler][5] << 24)); @@ -1642,19 +1646,19 @@ static void RecordedOpponentHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; - StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_818962C); + StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCB_FreeOpponentSprite); - taskId = CreateTask(sub_8189548, 5); + taskId = CreateTask(Task_StartSendOutAnim, 5); gTasks[taskId].data[0] = gActiveBattler; if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown) gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary; - gBattleSpritesDataPtr->animationData->field_9_x1 = 1; - gBattlerControllerFuncs[gActiveBattler] = nullsub_70; + gBattleSpritesDataPtr->animationData->introAnimActive = TRUE; + gBattlerControllerFuncs[gActiveBattler] = RecordedOpponentDummy; } -static void sub_8189548(u8 taskId) +static void Task_StartSendOutAnim(u8 taskId) { u8 savedActiveBank = gActiveBattler; @@ -1662,23 +1666,23 @@ static void sub_8189548(u8 taskId) if (!IsDoubleBattle() || (gBattleTypeFlags & BATTLE_TYPE_MULTI)) { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_81885D8(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); } else { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_81885D8(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler ^= BIT_FLANK; gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_81885D8(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler ^= BIT_FLANK; } - gBattlerControllerFuncs[gActiveBattler] = sub_818686C; + gBattlerControllerFuncs[gActiveBattler] = Intro_TryShinyAnimShowHealthbox; gActiveBattler = savedActiveBank; DestroyTask(taskId); } -static void sub_818962C(struct Sprite *sprite) +static void SpriteCB_FreeOpponentSprite(struct Sprite *sprite) { FreeTrainerFrontPicPalette(sprite->oam.affineParam); FreeSpriteOamMatrix(sprite); @@ -1709,20 +1713,20 @@ static void RecordedOpponentHandleDrawPartyStatusSummary(void) } gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]); - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; if (gBattleBufferA[gActiveBattler][2] != 0) - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 93; - gBattlerControllerFuncs[gActiveBattler] = sub_818975C; + gBattlerControllerFuncs[gActiveBattler] = EndDrawPartyStatusSummary; } } -static void sub_818975C(void) +static void EndDrawPartyStatusSummary(void) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5++ > 0x5C) + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer++ > 92) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; RecordedOpponentBufferExecCompleted(); } } @@ -1751,7 +1755,7 @@ static void RecordedOpponentHandleSpriteInvisibility(void) static void RecordedOpponentHandleBattleAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 animationId = gBattleBufferA[gActiveBattler][1]; u16 argument = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8); @@ -1773,7 +1777,7 @@ static void RecordedOpponentHandleResetActionMoveSelection(void) RecordedOpponentBufferExecCompleted(); } -static void RecordedOpponentHandleCmd55(void) +static void RecordedOpponentHandleEndLinkBattle(void) { if (gBattleBufferA[gActiveBattler][1] == B_OUTCOME_DREW) gBattleOutcome = gBattleBufferA[gActiveBattler][1]; @@ -1783,7 +1787,7 @@ static void RecordedOpponentHandleCmd55(void) FadeOutMapMusic(5); BeginFastPaletteFade(3); RecordedOpponentBufferExecCompleted(); - gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; + gBattlerControllerFuncs[gActiveBattler] = SetBattleEndCallbacks; } static void RecordedOpponentCmdEnd(void) diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 86e4f8809..63a04ac40 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -47,7 +47,7 @@ static void RecordedPlayerHandleMoveAnimation(void); static void RecordedPlayerHandlePrintString(void); static void RecordedPlayerHandlePrintSelectionString(void); static void RecordedPlayerHandleChooseAction(void); -static void RecordedPlayerHandleUnknownYesNoBox(void); +static void RecordedPlayerHandleYesNoBox(void); static void RecordedPlayerHandleChooseMove(void); static void RecordedPlayerHandleChooseItem(void); static void RecordedPlayerHandleChoosePokemon(void); @@ -83,19 +83,19 @@ static void RecordedPlayerHandleSpriteInvisibility(void); static void RecordedPlayerHandleBattleAnimation(void); static void RecordedPlayerHandleLinkStandbyMsg(void); static void RecordedPlayerHandleResetActionMoveSelection(void); -static void RecordedPlayerHandleCmd55(void); +static void RecordedPlayerHandleEndLinkBattle(void); static void RecordedPlayerCmdEnd(void); static void RecordedPlayerBufferRunCommand(void); static void RecordedPlayerBufferExecCompleted(void); -static void sub_818A328(void); +static void SwitchIn_WaitAndEnd(void); static u32 CopyRecordedPlayerMonData(u8 monId, u8 *dst); static void SetRecordedPlayerMonData(u8 monId); -static void sub_818BA6C(u8 battlerId, bool8 dontClearSubstituteBit); +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit); static void DoSwitchOutAnimation(void); static void RecordedPlayerDoMoveAnimation(void); -static void sub_818CC24(u8 taskId); -static void sub_818CDF4(void); +static void Task_StartSendOutAnim(u8 taskId); +static void EndDrawPartyStatusSummary(void); static void (*const sRecordedPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { @@ -118,7 +118,7 @@ static void (*const sRecordedPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) [CONTROLLER_PRINTSTRING] = RecordedPlayerHandlePrintString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = RecordedPlayerHandlePrintSelectionString, [CONTROLLER_CHOOSEACTION] = RecordedPlayerHandleChooseAction, - [CONTROLLER_UNKNOWNYESNOBOX] = RecordedPlayerHandleUnknownYesNoBox, + [CONTROLLER_YESNOBOX] = RecordedPlayerHandleYesNoBox, [CONTROLLER_CHOOSEMOVE] = RecordedPlayerHandleChooseMove, [CONTROLLER_OPENBAG] = RecordedPlayerHandleChooseItem, [CONTROLLER_CHOOSEPOKEMON] = RecordedPlayerHandleChoosePokemon, @@ -154,11 +154,11 @@ static void (*const sRecordedPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) [CONTROLLER_BATTLEANIMATION] = RecordedPlayerHandleBattleAnimation, [CONTROLLER_LINKSTANDBYMSG] = RecordedPlayerHandleLinkStandbyMsg, [CONTROLLER_RESETACTIONMOVESELECTION] = RecordedPlayerHandleResetActionMoveSelection, - [CONTROLLER_55] = RecordedPlayerHandleCmd55, + [CONTROLLER_ENDLINKBATTLE] = RecordedPlayerHandleEndLinkBattle, [CONTROLLER_TERMINATOR_NOP] = RecordedPlayerCmdEnd }; -static void nullsub_120(void) +static void RecordedPlayerDummy(void) { } @@ -184,47 +184,47 @@ static void CompleteOnBattlerSpriteCallbackDummy(void) RecordedPlayerBufferExecCompleted(); } -static void sub_81899F0(void) +static void FreeTrainerSpriteAfterSlide(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { - nullsub_25(0); + BattleGfxSfxDummy3(MALE); FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]); DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]); RecordedPlayerBufferExecCompleted(); } } -static void sub_8189A58(void) +static void Intro_DelayAndEnd(void) { - if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 == 0xFF) + if (--gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay == (u8)-1) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 0; RecordedPlayerBufferExecCompleted(); } } -static void sub_8189AA0(void) +static void Intro_WaitForShinyAnimAndHealthbox(void) { - bool32 r6 = FALSE; + bool32 healthboxAnimDone = FALSE; if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_LEFT) { if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI))) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) - r6 = TRUE; + healthboxAnimDone = TRUE; } else { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy) { - r6 = TRUE; + healthboxAnimDone = TRUE; } } - if (r6 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim + if (healthboxAnimDone && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; @@ -233,15 +233,15 @@ static void sub_8189AA0(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); if (IsDoubleBattle()) HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], gActiveBattler ^ BIT_FLANK); - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 3; - gBattlerControllerFuncs[gActiveBattler] = sub_8189A58; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 3; + gBattlerControllerFuncs[gActiveBattler] = Intro_DelayAndEnd; } } else @@ -249,31 +249,31 @@ static void sub_8189AA0(void) if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI))) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) - r6 = TRUE; + healthboxAnimDone = TRUE; } else { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy) { - r6 = TRUE; + healthboxAnimDone = TRUE; } } if (IsCryPlayingOrClearCrySongs()) - r6 = FALSE; + healthboxAnimDone = FALSE; - if (r6) + if (healthboxAnimDone) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_9 = 3; - gBattlerControllerFuncs[gActiveBattler] = sub_8189A58; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 3; + gBattlerControllerFuncs[gActiveBattler] = Intro_DelayAndEnd; } } } -static void sub_8189D40(void) +static void Intro_TryShinyAnimShowHealthbox(void) { - bool32 r10 = FALSE; + bool32 bgmRestored = FALSE; if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_LEFT) { @@ -289,27 +289,27 @@ static void sub_8189D40(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted) { if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler ^ BIT_FLANK); + StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]); } UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 = 1; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted = TRUE; } - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 - && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x40 - && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].field_1_x40 + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted + && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].waitForCry + && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].waitForCry && !IsCryPlayingOrClearCrySongs()) { - if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20) + if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored) { if ((gBattleTypeFlags & BATTLE_TYPE_LINK) && (gBattleTypeFlags & BATTLE_TYPE_MULTI)) { @@ -322,25 +322,25 @@ static void sub_8189D40(void) } } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20 = 1; - r10 = TRUE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE; + bgmRestored = TRUE; } - if (r10 && gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (bgmRestored && gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler ^ BIT_FLANK]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]); - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); - gBattleSpritesDataPtr->animationData->field_9_x1 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x20 = 0; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x80 = 0; - gBattlerControllerFuncs[gActiveBattler] = sub_8189AA0; + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); + gBattleSpritesDataPtr->animationData->introAnimActive = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted = FALSE; + gBattlerControllerFuncs[gActiveBattler] = Intro_WaitForShinyAnimAndHealthbox; } } -static void sub_818A064(void) +static void WaitForMonAnimAfterLoad(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].animEnded && gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x == 0) RecordedPlayerBufferExecCompleted(); @@ -363,13 +363,13 @@ static void CompleteOnHealthbarDone(void) } } -static void sub_818A114(void) +static void FreeMonSpriteAfterFaintAnim(void) { if (gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y > DISPLAY_HEIGHT) { u16 species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES); - nullsub_24(species); + BattleGfxSfxDummy2(species); FreeOamMatrix(gSprites[gBattlerSpriteIds[gActiveBattler]].oam.matrixNum); DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]); SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]); @@ -377,7 +377,7 @@ static void sub_818A114(void) } } -static void sub_818A1B0(void) +static void FreeMonSpriteAfterSwitchOutAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { @@ -413,7 +413,7 @@ static void DoHitAnimBlinkSpriteEffect(void) } } -static void sub_818A2B4(void) +static void SwitchIn_ShowSubstitute(void) { if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { @@ -421,11 +421,11 @@ static void sub_818A2B4(void) if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute) InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); - gBattlerControllerFuncs[gActiveBattler] = sub_818A328; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_WaitAndEnd; } } -static void sub_818A328(void) +static void SwitchIn_WaitAndEnd(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) @@ -434,28 +434,28 @@ static void sub_818A328(void) } } -static void sub_818A37C(void) +static void SwitchIn_ShowHealthbox(void) { if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); - CreateTask(c3_0802FDF4, 10); + CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10); HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - gBattlerControllerFuncs[gActiveBattler] = sub_818A2B4; + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_ShowSubstitute; } } -static void sub_818A470(void) +static void SwitchIn_TryShinyAnim(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) @@ -463,11 +463,11 @@ static void sub_818A470(void) TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]); } - if (gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) { - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); - gBattlerControllerFuncs[gActiveBattler] = sub_818A37C; + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_ShowHealthbox; } } @@ -1102,7 +1102,7 @@ static void RecordedPlayerHandleLoadMonSprite(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], gBattleMonForms[gActiveBattler]); - gBattlerControllerFuncs[gActiveBattler] = sub_818A064; + gBattlerControllerFuncs[gActiveBattler] = WaitForMonAnimAfterLoad; } static void RecordedPlayerHandleSwitchInAnim(void) @@ -1110,18 +1110,18 @@ static void RecordedPlayerHandleSwitchInAnim(void) ClearTemporarySpeciesSpriteData(gActiveBattler, gBattleBufferA[gActiveBattler][2]); gBattlerPartyIndexes[gActiveBattler] = gBattleBufferA[gActiveBattler][1]; BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); - sub_818BA6C(gActiveBattler, gBattleBufferA[gActiveBattler][2]); - gBattlerControllerFuncs[gActiveBattler] = sub_818A470; + StartSendOutAnim(gActiveBattler, gBattleBufferA[gActiveBattler][2]); + gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim; } -static void sub_818BA6C(u8 battlerId, bool8 dontClearSubstituteBit) +static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit) { u16 species; ClearTemporarySpeciesSpriteData(battlerId, dontClearSubstituteBit); gBattlerPartyIndexes[battlerId] = gBattleBufferA[battlerId][1]; species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); - gUnknown_03005D7C[battlerId] = CreateInvisibleSpriteWithCallback(sub_805D714); + gBattleControllerData[battlerId] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim); SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(battlerId)); gBattlerSpriteIds[battlerId] = CreateSprite( @@ -1130,8 +1130,8 @@ static void sub_818BA6C(u8 battlerId, bool8 dontClearSubstituteBit) GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteSubpriority(battlerId)); - gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; - gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; + gSprites[gBattleControllerData[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; + gSprites[gBattleControllerData[battlerId]].data[2] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[0] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; @@ -1142,7 +1142,7 @@ static void sub_818BA6C(u8 battlerId, bool8 dontClearSubstituteBit) gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); + gSprites[gBattleControllerData[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); } static void RecordedPlayerHandleReturnMonToBall(void) @@ -1176,12 +1176,14 @@ static void DoSwitchOutAnimation(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_SWITCH_OUT_PLAYER_MON); - gBattlerControllerFuncs[gActiveBattler] = sub_818A1B0; + gBattlerControllerFuncs[gActiveBattler] = FreeMonSpriteAfterSwitchOutAnim; } break; } } +#define sSpeedX data[0] + static void RecordedPlayerHandleDrawTrainerPic(void) { s16 xPos, yPos; @@ -1231,10 +1233,10 @@ static void RecordedPlayerHandleDrawTrainerPic(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = DISPLAY_WIDTH; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.y = 48; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = -2; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineMode = ST_OAM_AFFINE_OFF; gSprites[gBattlerSpriteIds[gActiveBattler]].hFlip = 1; } @@ -1245,14 +1247,16 @@ static void RecordedPlayerHandleDrawTrainerPic(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = DISPLAY_WIDTH; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = -2; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; } gBattlerControllerFuncs[gActiveBattler] = CompleteOnBattlerSpriteCallbackDummy; } +#undef sSpeedX + static void RecordedPlayerHandleTrainerSlide(void) { RecordedPlayerBufferExecCompleted(); @@ -1266,9 +1270,12 @@ static void RecordedPlayerHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); - gBattlerControllerFuncs[gActiveBattler] = sub_81899F0; + gBattlerControllerFuncs[gActiveBattler] = FreeTrainerSpriteAfterSlide; } +#define sSpeedX data[1] +#define sSpeedY data[2] + static void RecordedPlayerHandleFaintAnimation(void) { if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState == 0) @@ -1284,14 +1291,17 @@ static void RecordedPlayerHandleFaintAnimation(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); PlaySE12WithPanning(SE_FAINT, -64); - gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 5; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8039C00; - gBattlerControllerFuncs[gActiveBattler] = sub_818A114; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = 0; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedY = 5; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_FaintSlideAnim; + gBattlerControllerFuncs[gActiveBattler] = FreeMonSpriteAfterFaintAnim; } } } +#undef sSpeedX +#undef sSpeedY + static void RecordedPlayerHandlePaletteFade(void) { RecordedPlayerBufferExecCompleted(); @@ -1314,7 +1324,7 @@ static void RecordedPlayerHandlePause(void) static void RecordedPlayerHandleMoveAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u16 move = gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8); @@ -1356,7 +1366,7 @@ static void RecordedPlayerDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(ST_OAM_AFFINE_OFF); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1365,7 +1375,7 @@ static void RecordedPlayerDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(ST_OAM_AFFINE_NORMAL); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute && multihit < 2) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); @@ -1425,7 +1435,7 @@ static void RecordedPlayerHandleChooseAction(void) } } -static void RecordedPlayerHandleUnknownYesNoBox(void) +static void RecordedPlayerHandleYesNoBox(void) { RecordedPlayerBufferExecCompleted(); } @@ -1495,7 +1505,7 @@ static void RecordedPlayerHandleExpUpdate(void) static void RecordedPlayerHandleStatusIconUpdate(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 battlerId; @@ -1508,7 +1518,7 @@ static void RecordedPlayerHandleStatusIconUpdate(void) static void RecordedPlayerHandleStatusAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8) | (gBattleBufferA[gActiveBattler][4] << 16) | (gBattleBufferA[gActiveBattler][5] << 24)); @@ -1662,7 +1672,7 @@ static void RecordedPlayerHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gActiveBattler; - StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_805CC00); + StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCB_FreePlayerSpriteLoadMonSprite); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 1); paletteNum = AllocSpritePalette(0xD6F9); @@ -1675,17 +1685,17 @@ static void RecordedPlayerHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = paletteNum; - taskId = CreateTask(sub_818CC24, 5); + taskId = CreateTask(Task_StartSendOutAnim, 5); gTasks[taskId].data[0] = gActiveBattler; if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown) gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary; - gBattleSpritesDataPtr->animationData->field_9_x1 = 1; - gBattlerControllerFuncs[gActiveBattler] = nullsub_120; + gBattleSpritesDataPtr->animationData->introAnimActive = TRUE; + gBattlerControllerFuncs[gActiveBattler] = RecordedPlayerDummy; } -static void sub_818CC24(u8 taskId) +static void Task_StartSendOutAnim(u8 taskId) { if (gTasks[taskId].data[1] < 24) { @@ -1699,19 +1709,19 @@ static void sub_818CC24(u8 taskId) if (!IsDoubleBattle() || (gBattleTypeFlags & BATTLE_TYPE_MULTI)) { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_818BA6C(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); } else { gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_818BA6C(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler ^= BIT_FLANK; gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); - sub_818BA6C(gActiveBattler, FALSE); + StartSendOutAnim(gActiveBattler, FALSE); gActiveBattler ^= BIT_FLANK; } - gBattlerControllerFuncs[gActiveBattler] = sub_8189D40; + gBattlerControllerFuncs[gActiveBattler] = Intro_TryShinyAnimShowHealthbox; gActiveBattler = savedActiveBank; DestroyTask(taskId); } @@ -1727,20 +1737,20 @@ static void RecordedPlayerHandleDrawPartyStatusSummary(void) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1; gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]); - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; if (gBattleBufferA[gActiveBattler][2] != 0) - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0x5D; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 93; - gBattlerControllerFuncs[gActiveBattler] = sub_818CDF4; + gBattlerControllerFuncs[gActiveBattler] = EndDrawPartyStatusSummary; } } -static void sub_818CDF4(void) +static void EndDrawPartyStatusSummary(void) { - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5++ > 0x5C) + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer++ > 92) { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusDelayTimer = 0; RecordedPlayerBufferExecCompleted(); } } @@ -1769,7 +1779,7 @@ static void RecordedPlayerHandleSpriteInvisibility(void) static void RecordedPlayerHandleBattleAnimation(void) { - if (!mplay_80342A4(gActiveBattler)) + if (!IsBattleSEPlaying(gActiveBattler)) { u8 animationId = gBattleBufferA[gActiveBattler][1]; u16 argument = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8); @@ -1791,13 +1801,13 @@ static void RecordedPlayerHandleResetActionMoveSelection(void) RecordedPlayerBufferExecCompleted(); } -static void RecordedPlayerHandleCmd55(void) +static void RecordedPlayerHandleEndLinkBattle(void) { gBattleOutcome = gBattleBufferA[gActiveBattler][1]; FadeOutMapMusic(5); BeginFastPaletteFade(3); RecordedPlayerBufferExecCompleted(); - gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; + gBattlerControllerFuncs[gActiveBattler] = SetBattleEndCallbacks; } static void RecordedPlayerCmdEnd(void) diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index b357c689f..1c82cfbe3 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -44,7 +44,7 @@ static void SafariHandleMoveAnimation(void); static void SafariHandlePrintString(void); static void SafariHandlePrintSelectionString(void); static void SafariHandleChooseAction(void); -static void SafariHandleUnknownYesNoBox(void); +static void SafariHandleYesNoBox(void); static void SafariHandleChooseMove(void); static void SafariHandleChooseItem(void); static void SafariHandleChoosePokemon(void); @@ -80,7 +80,7 @@ static void SafariHandleSpriteInvisibility(void); static void SafariHandleBattleAnimation(void); static void SafariHandleLinkStandbyMsg(void); static void SafariHandleResetActionMoveSelection(void); -static void SafariHandleCmd55(void); +static void SafariHandleEndLinkBattle(void); static void SafariCmdEnd(void); static void SafariBufferRunCommand(void); @@ -108,7 +108,7 @@ static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_PRINTSTRING] = SafariHandlePrintString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = SafariHandlePrintSelectionString, [CONTROLLER_CHOOSEACTION] = SafariHandleChooseAction, - [CONTROLLER_UNKNOWNYESNOBOX] = SafariHandleUnknownYesNoBox, + [CONTROLLER_YESNOBOX] = SafariHandleYesNoBox, [CONTROLLER_CHOOSEMOVE] = SafariHandleChooseMove, [CONTROLLER_OPENBAG] = SafariHandleChooseItem, [CONTROLLER_CHOOSEPOKEMON] = SafariHandleChoosePokemon, @@ -144,7 +144,7 @@ static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_BATTLEANIMATION] = SafariHandleBattleAnimation, [CONTROLLER_LINKSTANDBYMSG] = SafariHandleLinkStandbyMsg, [CONTROLLER_RESETACTIONMOVESELECTION] = SafariHandleResetActionMoveSelection, - [CONTROLLER_55] = SafariHandleCmd55, + [CONTROLLER_ENDLINKBATTLE] = SafariHandleEndLinkBattle, [CONTROLLER_TERMINATOR_NOP] = SafariCmdEnd }; @@ -251,7 +251,7 @@ static void CompleteOnHealthboxSpriteCallbackDummy(void) SafariBufferExecCompleted(); } -static void sub_81595E4(void) +static void SafariSetBattleEndCallbacks(void) { if (!gPaletteFade.active) { @@ -349,6 +349,8 @@ static void SafariHandleReturnMonToBall(void) SafariBufferExecCompleted(); } +#define sSpeedX data[0] + static void SafariHandleDrawTrainerPic(void) { DecompressTrainerBackPic(gSaveBlock2Ptr->playerGender, gActiveBattler); @@ -359,12 +361,14 @@ static void SafariHandleDrawTrainerPic(void) (8 - gTrainerBackPicCoords[gSaveBlock2Ptr->playerGender].size) * 4 + 80, 30); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = DISPLAY_WIDTH; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = -2; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gBattlerControllerFuncs[gActiveBattler] = CompleteOnBattlerSpriteCallbackDummy; } +#undef sSpeedX + static void SafariHandleTrainerSlide(void) { SafariBufferExecCompleted(); @@ -458,7 +462,7 @@ static void SafariHandleChooseAction(void) BattlePutTextOnWindow(gDisplayedStringBattle, 1); } -static void SafariHandleUnknownYesNoBox(void) +static void SafariHandleYesNoBox(void) { SafariBufferExecCompleted(); } @@ -627,7 +631,7 @@ static void SafariHandleIntroSlide(void) static void SafariHandleIntroTrainerBallThrow(void) { UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_SAFARI_ALL_TEXT); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); gBattlerControllerFuncs[gActiveBattler] = CompleteOnHealthboxSpriteCallbackDummy; } @@ -673,14 +677,14 @@ static void SafariHandleResetActionMoveSelection(void) SafariBufferExecCompleted(); } -static void SafariHandleCmd55(void) +static void SafariHandleEndLinkBattle(void) { gBattleOutcome = gBattleBufferA[gActiveBattler][1]; FadeOutMapMusic(5); BeginFastPaletteFade(3); SafariBufferExecCompleted(); if ((gBattleTypeFlags & BATTLE_TYPE_LINK) && !(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)) - gBattlerControllerFuncs[gActiveBattler] = sub_81595E4; + gBattlerControllerFuncs[gActiveBattler] = SafariSetBattleEndCallbacks; } static void SafariCmdEnd(void) diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index 83a977073..ade2bc32c 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -52,7 +52,7 @@ static void WallyHandleMoveAnimation(void); static void WallyHandlePrintString(void); static void WallyHandlePrintSelectionString(void); static void WallyHandleChooseAction(void); -static void WallyHandleUnknownYesNoBox(void); +static void WallyHandleYesNoBox(void); static void WallyHandleChooseMove(void); static void WallyHandleChooseItem(void); static void WallyHandleChoosePokemon(void); @@ -88,17 +88,17 @@ static void WallyHandleSpriteInvisibility(void); static void WallyHandleBattleAnimation(void); static void WallyHandleLinkStandbyMsg(void); static void WallyHandleResetActionMoveSelection(void); -static void WallyHandleCmd55(void); +static void WallyHandleEndLinkBattle(void); static void WallyCmdEnd(void); static void WallyBufferRunCommand(void); static void WallyBufferExecCompleted(void); static void CompleteOnChosenItem(void); -static void sub_8168818(void); +static void Intro_WaitForShinyAnimAndHealthbox(void); static u32 CopyWallyMonData(u8 monId, u8 *dst); static void SetWallyMonData(u8 monId); static void WallyDoMoveAnimation(void); -static void sub_816AC04(u8 taskId); +static void Task_StartSendOutAnim(u8 taskId); static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { @@ -121,7 +121,7 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_PRINTSTRING] = WallyHandlePrintString, [CONTROLLER_PRINTSTRINGPLAYERONLY] = WallyHandlePrintSelectionString, [CONTROLLER_CHOOSEACTION] = WallyHandleChooseAction, - [CONTROLLER_UNKNOWNYESNOBOX] = WallyHandleUnknownYesNoBox, + [CONTROLLER_YESNOBOX] = WallyHandleYesNoBox, [CONTROLLER_CHOOSEMOVE] = WallyHandleChooseMove, [CONTROLLER_OPENBAG] = WallyHandleChooseItem, [CONTROLLER_CHOOSEPOKEMON] = WallyHandleChoosePokemon, @@ -157,7 +157,7 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) = [CONTROLLER_BATTLEANIMATION] = WallyHandleBattleAnimation, [CONTROLLER_LINKSTANDBYMSG] = WallyHandleLinkStandbyMsg, [CONTROLLER_RESETACTIONMOVESELECTION] = WallyHandleResetActionMoveSelection, - [CONTROLLER_55] = WallyHandleCmd55, + [CONTROLLER_ENDLINKBATTLE] = WallyHandleEndLinkBattle, [CONTROLLER_TERMINATOR_NOP] = WallyCmdEnd }; @@ -268,7 +268,7 @@ static void OpenBagAfterPaletteFade(void) if (!gPaletteFade.active) { gBattlerControllerFuncs[gActiveBattler] = CompleteOnChosenItem; - nullsub_35(); + ReshowBattleScreenDummy(); FreeAllWindowBuffers(); DoWallyTutorialBagMenu(); } @@ -283,7 +283,7 @@ static void CompleteOnChosenItem(void) } } -static void sub_816864C(void) +static void Intro_TryShinyAnimShowHealthbox(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive) @@ -295,35 +295,35 @@ static void sub_816864C(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive - && gSprites[gUnknown_03005D7C[gActiveBattler]].callback == SpriteCallbackDummy + && gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy && gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) { if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler ^ BIT_FLANK]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler ^ BIT_FLANK); + StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]); } - DestroySprite(&gSprites[gUnknown_03005D7C[gActiveBattler]]); + DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]); UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL); - sub_8076918(gActiveBattler); + StartHealthboxSlideIn(gActiveBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); - gBattleSpritesDataPtr->animationData->field_9_x1 = 0; - gBattlerControllerFuncs[gActiveBattler] = sub_8168818; + gBattleSpritesDataPtr->animationData->introAnimActive = FALSE; + gBattlerControllerFuncs[gActiveBattler] = Intro_WaitForShinyAnimAndHealthbox; } } -static void sub_8168818(void) +static void Intro_WaitForShinyAnimAndHealthbox(void) { - bool32 r4 = FALSE; + bool32 healthboxAnimDone = FALSE; if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy) - r4 = TRUE; + healthboxAnimDone = TRUE; - if (r4 && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim + if (healthboxAnimDone && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; @@ -332,10 +332,10 @@ static void sub_8168818(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE; gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE; - FreeSpriteTilesByTag(0x27F9); - FreeSpritePaletteByTag(0x27F9); + FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS); + FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); - CreateTask(c3_0802FDF4, 10); + CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10); HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler); WallyBufferExecCompleted(); @@ -378,7 +378,7 @@ static void DoHitAnimBlinkSpriteEffect(void) } } -static void sub_8168A20(void) +static void DoSwitchOutAnimation(void) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { @@ -1019,7 +1019,7 @@ static void WallyHandleReturnMonToBall(void) if (gBattleBufferA[gActiveBattler][1] == 0) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_SWITCH_OUT_PLAYER_MON); - gBattlerControllerFuncs[gActiveBattler] = sub_8168A20; + gBattlerControllerFuncs[gActiveBattler] = DoSwitchOutAnimation; } else { @@ -1030,6 +1030,8 @@ static void WallyHandleReturnMonToBall(void) } } +#define sSpeedX data[0] + static void WallyHandleDrawTrainerPic(void) { DecompressTrainerBackPic(TRAINER_BACK_PIC_WALLY, gActiveBattler); @@ -1039,9 +1041,9 @@ static void WallyHandleDrawTrainerPic(void) 80 + 4 * (8 - gTrainerBackPicCoords[TRAINER_BACK_PIC_WALLY].size), 30); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; - gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = DISPLAY_WIDTH; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = -2; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gBattlerControllerFuncs[gActiveBattler] = CompleteOnBattlerSpriteCallbackDummy; } @@ -1055,11 +1057,13 @@ static void WallyHandleTrainerSlide(void) 30); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -96; - gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_805D7AC; + gSprites[gBattlerSpriteIds[gActiveBattler]].sSpeedX = 2; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn; gBattlerControllerFuncs[gActiveBattler] = CompleteOnBankSpriteCallbackDummy2; } +#undef sSpeedX + static void WallyHandleTrainerSlideBack(void) { WallyBufferExecCompleted(); @@ -1137,7 +1141,7 @@ static void WallyDoMoveAnimation(void) case 1: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].specialAnimActive) { - sub_805EB9C(ST_OAM_AFFINE_OFF); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_OFF); DoMoveAnim(move); gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 2; } @@ -1146,7 +1150,7 @@ static void WallyDoMoveAnimation(void) gAnimScriptCallback(); if (!gAnimScriptActive) { - sub_805EB9C(ST_OAM_AFFINE_NORMAL); + SetBattlerSpriteAffineMode(ST_OAM_AFFINE_NORMAL); if (gBattleSpritesDataPtr->battlerData[gActiveBattler].behindSubstitute) { InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, B_ANIM_MON_TO_SUBSTITUTE); @@ -1211,7 +1215,7 @@ static void WallyHandleChooseAction(void) BattlePutTextOnWindow(gDisplayedStringBattle, 1); } -static void WallyHandleUnknownYesNoBox(void) +static void WallyHandleYesNoBox(void) { WallyBufferExecCompleted(); } @@ -1435,39 +1439,39 @@ static void WallyHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gActiveBattler; - StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_805CC00); + StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCB_FreePlayerSpriteLoadMonSprite); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 1); paletteNum = AllocSpritePalette(0xD6F8); LoadCompressedPalette(gTrainerBackPicPaletteTable[TRAINER_BACK_PIC_WALLY].data, 0x100 + paletteNum * 16, 32); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = paletteNum; - taskId = CreateTask(sub_816AC04, 5); + taskId = CreateTask(Task_StartSendOutAnim, 5); gTasks[taskId].data[0] = gActiveBattler; if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown) gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary; - gBattleSpritesDataPtr->animationData->field_9_x1 = 1; - gBattlerControllerFuncs[gActiveBattler] = nullsub_21; + gBattleSpritesDataPtr->animationData->introAnimActive = TRUE; + gBattlerControllerFuncs[gActiveBattler] = BattleControllerDummy; } -static void sub_816AA80(u8 battlerId) +static void StartSendOutAnim(u8 battlerId) { u16 species; gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies = 0; gBattlerPartyIndexes[battlerId] = gBattleBufferA[battlerId][1]; species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES); - gUnknown_03005D7C[battlerId] = CreateInvisibleSpriteWithCallback(sub_805D714); + gBattleControllerData[battlerId] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim); SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(battlerId)); gBattlerSpriteIds[battlerId] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteDefault_Y(battlerId), GetBattlerSpriteSubpriority(battlerId)); - gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; - gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; + gSprites[gBattleControllerData[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; + gSprites[gBattleControllerData[battlerId]].data[2] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[0] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; @@ -1476,10 +1480,10 @@ static void sub_816AA80(u8 battlerId) StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerId]], gBattleMonForms[battlerId]); gSprites[gBattlerSpriteIds[battlerId]].invisible = TRUE; gSprites[gBattlerSpriteIds[battlerId]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); + gSprites[gBattleControllerData[battlerId]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); } -static void sub_816AC04(u8 taskId) +static void Task_StartSendOutAnim(u8 taskId) { if (gTasks[taskId].data[1] < 31) { @@ -1491,8 +1495,8 @@ static void sub_816AC04(u8 taskId) gActiveBattler = gTasks[taskId].data[0]; gBattleBufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler]; - sub_816AA80(gActiveBattler); - gBattlerControllerFuncs[gActiveBattler] = sub_816864C; + StartSendOutAnim(gActiveBattler); + gBattlerControllerFuncs[gActiveBattler] = Intro_TryShinyAnimShowHealthbox; gActiveBattler = savedActiveBank; DestroyTask(taskId); } @@ -1548,7 +1552,7 @@ static void WallyHandleResetActionMoveSelection(void) WallyBufferExecCompleted(); } -static void WallyHandleCmd55(void) +static void WallyHandleEndLinkBattle(void) { gBattleOutcome = gBattleBufferA[gActiveBattler][1]; FadeOutMapMusic(5); @@ -1556,7 +1560,7 @@ static void WallyHandleCmd55(void) WallyBufferExecCompleted(); if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER) && gBattleTypeFlags & BATTLE_TYPE_LINK) - gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; + gBattlerControllerFuncs[gActiveBattler] = SetBattleEndCallbacks; } static void WallyCmdEnd(void) diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 20e638777..a9f3ab610 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -16,11 +16,10 @@ static EWRAM_DATA u8 sLinkSendTaskId = 0; static EWRAM_DATA u8 sLinkReceiveTaskId = 0; -static EWRAM_DATA u8 sUnknown_02022D0A = 0; +static EWRAM_DATA u8 sUnused = 0; // Debug? Never read EWRAM_DATA struct UnusedControllerStruct gUnusedControllerStruct = {}; // Debug? Unused code that writes to it, never read static EWRAM_DATA u8 sBattleBuffersTransferData[0x100] = {}; -// this file's funcionts static void CreateTasksForSendRecvLinkBuffers(void); static void InitLinkBtlControllers(void); static void InitSinglePlayerBtlControllers(void); @@ -45,11 +44,11 @@ void SetUpBattleVarsAndBirchZigzagoon(void) { s32 i; - gBattleMainFunc = nullsub_20; + gBattleMainFunc = BeginBattleIntroDummy; for (i = 0; i < MAX_BATTLERS_COUNT; i++) { - gBattlerControllerFuncs[i] = nullsub_21; + gBattlerControllerFuncs[i] = BattleControllerDummy; gBattlerPositions[i] = 0xFF; gActionSelectionCursor[i] = 0; gMoveSelectionCursor[i] = 0; @@ -69,18 +68,19 @@ void SetUpBattleVarsAndBirchZigzagoon(void) SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &i); } - gUnknown_02022FF4 = 0; - gUnknown_0202428C = 0; + // Below are never read + gUnusedFirstBattleVar1 = 0; + gUnusedFirstBattleVar2 = 0; } -void sub_8032768(void) +void InitBattleControllers(void) { s32 i; if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) - sub_8184DA4(1); + RecordedBattle_Init(B_RECORD_MODE_RECORDING); else - sub_8184DA4(2); + RecordedBattle_Init(B_RECORD_MODE_PLAYBACK); if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) RecordedBattle_SaveParties(); @@ -693,7 +693,7 @@ static void CreateTasksForSendRecvLinkBuffers(void) gTasks[sLinkReceiveTaskId].data[14] = 0; gTasks[sLinkReceiveTaskId].data[15] = 0; - sUnknown_02022D0A = 0; + sUnused = 0; } enum @@ -819,7 +819,7 @@ static void Task_HandleSendLinkBuffersData(u8 taskId) } } -void sub_8033648(void) +void TryReceiveLinkBattleData(void) { u8 i; s32 j; @@ -836,9 +836,9 @@ void sub_8033648(void) recvBuffer = (u8 *)gBlockRecvBuffer[i]; { u8 *dest, *src; - u16 r6 = gBlockRecvBuffer[i][2]; + u16 dataSize = gBlockRecvBuffer[i][2]; - if (gTasks[sLinkReceiveTaskId].data[14] + 9 + r6 > 0x1000) + if (gTasks[sLinkReceiveTaskId].data[14] + 9 + dataSize > 0x1000) { gTasks[sLinkReceiveTaskId].data[12] = gTasks[sLinkReceiveTaskId].data[14]; gTasks[sLinkReceiveTaskId].data[14] = 0; @@ -847,10 +847,10 @@ void sub_8033648(void) dest = &gLinkBattleRecvBuffer[gTasks[sLinkReceiveTaskId].data[14]]; src = recvBuffer; - for (j = 0; j < r6 + 8; j++) + for (j = 0; j < dataSize + 8; j++) dest[j] = src[j]; - gTasks[sLinkReceiveTaskId].data[14] = gTasks[sLinkReceiveTaskId].data[14] + r6 + 8; + gTasks[sLinkReceiveTaskId].data[14] = gTasks[sLinkReceiveTaskId].data[14] + dataSize + 8; } } } @@ -881,7 +881,7 @@ static void Task_HandleCopyReceivedLinkBuffersData(u8 taskId) return; memcpy(gBattleBufferA[battlerId], &gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_DATA], blockSize); - sub_803F850(battlerId); + MarkBattlerReceivedLinkData(battlerId); if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)) { @@ -1143,12 +1143,14 @@ void BtlController_EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2) PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitUnknownYesNoBox(u8 bufferId) +// Only used by the forfeit prompt in the Battle Frontier +// For other Yes/No boxes in battle, see Cmd_yesnobox +void BtlController_EmitYesNoBox(u8 bufferId) { - sBattleBuffersTransferData[0] = CONTROLLER_UNKNOWNYESNOBOX; - sBattleBuffersTransferData[1] = CONTROLLER_UNKNOWNYESNOBOX; - sBattleBuffersTransferData[2] = CONTROLLER_UNKNOWNYESNOBOX; - sBattleBuffersTransferData[3] = CONTROLLER_UNKNOWNYESNOBOX; + sBattleBuffersTransferData[0] = CONTROLLER_YESNOBOX; + sBattleBuffersTransferData[1] = CONTROLLER_YESNOBOX; + sBattleBuffersTransferData[2] = CONTROLLER_YESNOBOX; + sBattleBuffersTransferData[3] = CONTROLLER_YESNOBOX; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } @@ -1435,13 +1437,13 @@ void BtlController_EmitIntroTrainerBallThrow(u8 bufferId) PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 arg2) +void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 flags) { s32 i; sBattleBuffersTransferData[0] = CONTROLLER_DRAWPARTYSTATUSSUMMARY; - sBattleBuffersTransferData[1] = arg2 & 0x7F; - sBattleBuffersTransferData[2] = (arg2 & 0x80) >> 7; + sBattleBuffersTransferData[1] = flags & 0x7F; + sBattleBuffersTransferData[2] = (flags & 0x80) >> 7; // If true, skip delay after drawing. True during intro sBattleBuffersTransferData[3] = CONTROLLER_DRAWPARTYSTATUSSUMMARY; for (i = 0; i < (s32)(sizeof(struct HpAndStatus) * PARTY_SIZE); i++) sBattleBuffersTransferData[4 + i] = *(i + (u8*)(hpAndStatus)); @@ -1484,14 +1486,14 @@ void BtlController_EmitBattleAnimation(u8 bufferId, u8 animationId, u16 argument PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 arg1, bool32 arg2) +void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 arg1, bool32 record) { - bool8 arg2_ = arg2; + bool8 record_ = record; sBattleBuffersTransferData[0] = CONTROLLER_LINKSTANDBYMSG; sBattleBuffersTransferData[1] = arg1; - if (arg2_) - sBattleBuffersTransferData[3] = sBattleBuffersTransferData[2] = sub_81850DC(&sBattleBuffersTransferData[4]); + if (record_) + sBattleBuffersTransferData[3] = sBattleBuffersTransferData[2] = RecordedBattle_BufferNewBattlerData(&sBattleBuffersTransferData[4]); else sBattleBuffersTransferData[3] = sBattleBuffersTransferData[2] = 0; @@ -1505,12 +1507,12 @@ void BtlController_EmitResetActionMoveSelection(u8 bufferId, u8 caseId) PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2); } -void BtlController_EmitCmd55(u8 bufferId, u8 battleOutcome) +void BtlController_EmitEndLinkBattle(u8 bufferId, u8 battleOutcome) { - sBattleBuffersTransferData[0] = CONTROLLER_55; + sBattleBuffersTransferData[0] = CONTROLLER_ENDLINKBATTLE; sBattleBuffersTransferData[1] = battleOutcome; sBattleBuffersTransferData[2] = gSaveBlock2Ptr->frontier.disableRecordBattle; sBattleBuffersTransferData[3] = gSaveBlock2Ptr->frontier.disableRecordBattle; - sBattleBuffersTransferData[5] = sBattleBuffersTransferData[4] = sub_81850DC(&sBattleBuffersTransferData[6]); + sBattleBuffersTransferData[5] = sBattleBuffersTransferData[4] = RecordedBattle_BufferNewBattlerData(&sBattleBuffersTransferData[6]); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sBattleBuffersTransferData[4] + 6); } diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 77b91f1f4..d9e1cdc2f 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -39,7 +39,7 @@ extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow; // this file's functions static u8 GetBattlePalaceMoveGroup(u16 move); static u16 GetBattlePalaceTarget(void); -static void sub_805D7EC(struct Sprite *sprite); +static void SpriteCB_TrainerSlideVertical(struct Sprite *sprite); static bool8 ShouldAnimBeDoneRegardlessOfSubsitute(u8 animId); static void Task_ClearBitWhenBattleTableAnimDone(u8 taskId); static void Task_ClearBitWhenSpecialAnimDone(u8 taskId); @@ -336,7 +336,8 @@ static u16 GetBattlePalaceTarget(void) return (gActiveBattler ^ BIT_SIDE) << 8; } -void sub_805D714(struct Sprite *sprite) +// Wait for the pokemon to finish appearing out from the pokeball on send out +void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite) { u8 spriteId = sprite->data[1]; @@ -356,9 +357,9 @@ void sub_805D714(struct Sprite *sprite) } } -void sub_805D770(struct Sprite *sprite, bool8 arg1) +static void UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 arg1) { - sprite->animPaused = 1; + sprite->animPaused = TRUE; sprite->callback = SpriteCallbackDummy; if (!arg1) @@ -369,28 +370,33 @@ void sub_805D770(struct Sprite *sprite, bool8 arg1) AnimateSprite(sprite); } -void sub_805D7AC(struct Sprite *sprite) +#define sSpeedX data[0] + +void SpriteCB_TrainerSlideIn(struct Sprite *sprite) { if (!(gIntroSlideFlags & 1)) { - sprite->pos2.x += sprite->data[0]; + sprite->pos2.x += sprite->sSpeedX; if (sprite->pos2.x == 0) { if (sprite->pos2.y != 0) - sprite->callback = sub_805D7EC; + sprite->callback = SpriteCB_TrainerSlideVertical; else sprite->callback = SpriteCallbackDummy; } } } -static void sub_805D7EC(struct Sprite *sprite) +// Slide up to 0 if necessary (used by multi battle intro) +static void SpriteCB_TrainerSlideVertical(struct Sprite *sprite) { sprite->pos2.y -= 2; if (sprite->pos2.y == 0) sprite->callback = SpriteCallbackDummy; } +#undef sSpeedX + void InitAndLaunchChosenStatusAnimation(bool8 isStatus2, u32 status) { gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].statusAnimActive = 1; @@ -522,14 +528,15 @@ bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn) return FALSE; } -bool8 mplay_80342A4(u8 battlerId) +// Check if SE has finished or 30 calls, whichever comes first +bool8 IsBattleSEPlaying(u8 battlerId) { u8 zero = 0; if (IsSEPlaying()) { - gBattleSpritesDataPtr->healthBoxesData[battlerId].field_8++; - if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_8 < 30) + gBattleSpritesDataPtr->healthBoxesData[battlerId].soundTimer++; + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].soundTimer < 30) return TRUE; m4aMPlayStop(&gMPlayInfo_SE1); @@ -537,10 +544,11 @@ bool8 mplay_80342A4(u8 battlerId) } if (zero == 0) { - gBattleSpritesDataPtr->healthBoxesData[battlerId].field_8 = 0; + gBattleSpritesDataPtr->healthBoxesData[battlerId].soundTimer = 0; return FALSE; } + // Never reached return TRUE; } @@ -621,7 +629,7 @@ void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId) otId = GetMonData(mon, MON_DATA_OT_ID); position = GetBattlerPosition(battlerId); - if (sub_80688F8(1, battlerId) == 1 || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != SPECIES_NONE) + if (ShouldIgnoreDeoxysForm(1, battlerId) == TRUE || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != SPECIES_NONE) { HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites.ptr[position], @@ -660,11 +668,12 @@ void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId) } } -void nullsub_23(void) +// Unused +static void BattleGfxSfxDummy1(void) { } -void nullsub_24(u16 species) +void BattleGfxSfxDummy2(u16 species) { } @@ -687,7 +696,7 @@ void DecompressTrainerBackPic(u16 backPicId, u8 battlerId) 0x100 + 16 * battlerId, 0x20); } -void nullsub_25(u8 arg0) +void BattleGfxSfxDummy3(u8 gender) { } @@ -1110,7 +1119,7 @@ void HandleBattleLowHpMusicChange(void) } } -void sub_805EB9C(u8 affineMode) +void SetBattlerSpriteAffineMode(u8 affineMode) { s32 i; @@ -1246,7 +1255,7 @@ void AllocateMonSpritesGfx(void) for (i = 0; i < MAX_BATTLERS_COUNT; i++) { gMonSpritesGfxPtr->sprites.ptr[i] = gMonSpritesGfxPtr->firstDecompressed + (i * 0x2000); - *(gMonSpritesGfxPtr->templates + i) = gUnknown_08329D98[i]; + *(gMonSpritesGfxPtr->templates + i) = gBattlerSpriteTemplates[i]; for (j = 0; j < 4; j++) { diff --git a/src/battle_intro.c b/src/battle_intro.c index 2d5e602d1..c76e5bc31 100644 --- a/src/battle_intro.c +++ b/src/battle_intro.c @@ -13,8 +13,8 @@ static EWRAM_DATA u16 sBgCnt = 0; -extern const u8 gUnknown_0859741A[]; -extern const u8 gUnknown_0859741E[]; +extern const u8 gBattleAnimBgCntSet[]; +extern const u8 gBattleAnimBgCntGet[]; static void BattleIntroSlide1(u8); static void BattleIntroSlide2(u8); @@ -24,23 +24,23 @@ static void BattleIntroSlidePartner(u8); static const TaskFunc sBattleIntroSlideFuncs[] = { - BattleIntroSlide1, // BATTLE_TERRAIN_GRASS - BattleIntroSlide1, // BATTLE_TERRAIN_LONG_GRASS - BattleIntroSlide2, // BATTLE_TERRAIN_SAND - BattleIntroSlide2, // BATTLE_TERRAIN_UNDERWATER - BattleIntroSlide2, // BATTLE_TERRAIN_WATER - BattleIntroSlide1, // BATTLE_TERRAIN_POND - BattleIntroSlide1, // BATTLE_TERRAIN_MOUNTAIN - BattleIntroSlide1, // BATTLE_TERRAIN_CAVE - BattleIntroSlide3, // BATTLE_TERRAIN_BUILDING - BattleIntroSlide3, // BATTLE_TERRAIN_PLAIN + [BATTLE_TERRAIN_GRASS] = BattleIntroSlide1, + [BATTLE_TERRAIN_LONG_GRASS] = BattleIntroSlide1, + [BATTLE_TERRAIN_SAND] = BattleIntroSlide2, + [BATTLE_TERRAIN_UNDERWATER] = BattleIntroSlide2, + [BATTLE_TERRAIN_WATER] = BattleIntroSlide2, + [BATTLE_TERRAIN_POND] = BattleIntroSlide1, + [BATTLE_TERRAIN_MOUNTAIN] = BattleIntroSlide1, + [BATTLE_TERRAIN_CAVE] = BattleIntroSlide1, + [BATTLE_TERRAIN_BUILDING] = BattleIntroSlide3, + [BATTLE_TERRAIN_PLAIN] = BattleIntroSlide3, }; void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value) { if (bgId < 4) { - sBgCnt = GetGpuReg(gUnknown_0859741A[bgId]); + sBgCnt = GetGpuReg(gBattleAnimBgCntSet[bgId]); switch (attributeId) { case BG_ANIM_SCREEN_SIZE: @@ -66,7 +66,7 @@ void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value) break; } - SetGpuReg(gUnknown_0859741A[bgId], sBgCnt); + SetGpuReg(gBattleAnimBgCntSet[bgId], sBgCnt); } } @@ -76,7 +76,7 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId) if (bgId < 4) { - bgCnt = GetGpuReg(gUnknown_0859741E[bgId]); + bgCnt = GetGpuReg(gBattleAnimBgCntGet[bgId]); switch (attributeId) { case BG_ANIM_SCREEN_SIZE: @@ -99,6 +99,9 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId) return 0; } +#define tState data[0] +#define tTerrain data[1] + void HandleIntroSlide(u8 terrain) { u8 taskId; @@ -125,8 +128,8 @@ void HandleIntroSlide(u8 terrain) taskId = CreateTask(sBattleIntroSlideFuncs[terrain], 0); } - gTasks[taskId].data[0] = 0; - gTasks[taskId].data[1] = terrain; + gTasks[taskId].tState = 0; + gTasks[taskId].tTerrain = terrain; gTasks[taskId].data[2] = 0; gTasks[taskId].data[3] = 0; gTasks[taskId].data[4] = 0; @@ -134,7 +137,7 @@ void HandleIntroSlide(u8 terrain) gTasks[taskId].data[6] = 0; } -void sub_811828C(u8 taskId) +static void BattleIntroSlideEnd(u8 taskId) { DestroyTask(taskId); gBattle_BG1_X = 0; @@ -153,24 +156,24 @@ static void BattleIntroSlide1(u8 taskId) int i; gBattle_BG1_X += 6; - switch (gTasks[taskId].data[0]) + switch (gTasks[taskId].tState) { case 0: if (gBattleTypeFlags & BATTLE_TYPE_LINK) { gTasks[taskId].data[2] = 16; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; } else { gTasks[taskId].data[2] = 1; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; } break; case 1: if (--gTasks[taskId].data[2] == 0) { - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR); } break; @@ -178,7 +181,7 @@ static void BattleIntroSlide1(u8 taskId) gBattle_WIN0V -= 0xFF; if ((gBattle_WIN0V & 0xFF00) == 0x3000) { - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; gTasks[taskId].data[2] = 240; gTasks[taskId].data[3] = 32; gIntroSlideFlags &= ~1; @@ -191,7 +194,7 @@ static void BattleIntroSlide1(u8 taskId) } else { - if (gTasks[taskId].data[1] == 1) + if (gTasks[taskId].tTerrain == BATTLE_TERRAIN_LONG_GRASS) { if (gBattle_BG1_Y != 0xFFB0) gBattle_BG1_Y -= 2; @@ -219,7 +222,7 @@ static void BattleIntroSlide1(u8 taskId) if (!gTasks[taskId].data[2]) { gScanlineEffect.state = 3; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; CpuFill32(0, (void *)BG_SCREEN_ADDR(28), BG_SCREEN_SIZE); SetBgAttribute(1, BG_ATTR_CHARBASEINDEX, 0); SetBgAttribute(2, BG_ATTR_CHARBASEINDEX, 0); @@ -228,7 +231,7 @@ static void BattleIntroSlide1(u8 taskId) } break; case 4: - sub_811828C(taskId); + BattleIntroSlideEnd(taskId); break; } } @@ -237,18 +240,18 @@ static void BattleIntroSlide2(u8 taskId) { int i; - switch (gTasks[taskId].data[1]) + switch (gTasks[taskId].tTerrain) { - case 2: - case 4: + case BATTLE_TERRAIN_SAND: + case BATTLE_TERRAIN_WATER: gBattle_BG1_X += 8; break; - case 3: + case BATTLE_TERRAIN_UNDERWATER: gBattle_BG1_X += 6; break; } - if (gTasks[taskId].data[1] == 4) + if (gTasks[taskId].tTerrain == BATTLE_TERRAIN_WATER) { gBattle_BG1_Y = Cos2(gTasks[taskId].data[6]) / 512 - 8; if (gTasks[taskId].data[6] < 180) @@ -260,25 +263,25 @@ static void BattleIntroSlide2(u8 taskId) gTasks[taskId].data[6] = 0; } - switch (gTasks[taskId].data[0]) + switch (gTasks[taskId].tState) { case 0: gTasks[taskId].data[4] = 16; if (gBattleTypeFlags & BATTLE_TYPE_LINK) { gTasks[taskId].data[2] = 16; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; } else { gTasks[taskId].data[2] = 1; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; } break; case 1: if (--gTasks[taskId].data[2] == 0) { - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR); } break; @@ -286,7 +289,7 @@ static void BattleIntroSlide2(u8 taskId) gBattle_WIN0V -= 0xFF; if ((gBattle_WIN0V & 0xFF00) == 0x3000) { - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; gTasks[taskId].data[2] = 240; gTasks[taskId].data[3] = 32; gTasks[taskId].data[5] = 1; @@ -328,7 +331,7 @@ static void BattleIntroSlide2(u8 taskId) if (!gTasks[taskId].data[2]) { gScanlineEffect.state = 3; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; CpuFill32(0, (void *)BG_SCREEN_ADDR(28), BG_SCREEN_SIZE); SetBgAttribute(1, BG_ATTR_CHARBASEINDEX, 0); SetBgAttribute(2, BG_ATTR_CHARBASEINDEX, 0); @@ -337,11 +340,11 @@ static void BattleIntroSlide2(u8 taskId) } break; case 4: - sub_811828C(taskId); + BattleIntroSlideEnd(taskId); break; } - if (gTasks[taskId].data[0] != 4) + if (gTasks[taskId].tState != 4) SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[4], 0)); } @@ -350,7 +353,7 @@ static void BattleIntroSlide3(u8 taskId) int i; gBattle_BG1_X += 8; - switch (gTasks[taskId].data[0]) + switch (gTasks[taskId].tState) { case 0: SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ); @@ -360,18 +363,18 @@ static void BattleIntroSlide3(u8 taskId) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)) { gTasks[taskId].data[2] = 16; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; } else { gTasks[taskId].data[2] = 1; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; } break; case 1: if (--gTasks[taskId].data[2] == 0) { - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR); } break; @@ -379,7 +382,7 @@ static void BattleIntroSlide3(u8 taskId) gBattle_WIN0V -= 0xFF; if ((gBattle_WIN0V & 0xFF00) == 0x3000) { - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; gTasks[taskId].data[2] = 240; gTasks[taskId].data[3] = 32; gTasks[taskId].data[5] = 1; @@ -416,7 +419,7 @@ static void BattleIntroSlide3(u8 taskId) if (!gTasks[taskId].data[2]) { gScanlineEffect.state = 3; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; CpuFill32(0, (void *)BG_SCREEN_ADDR(28), BG_SCREEN_SIZE); SetBgAttribute(1, BG_ATTR_CHARBASEINDEX, 0); SetBgAttribute(2, BG_ATTR_CHARBASEINDEX, 0); @@ -425,11 +428,11 @@ static void BattleIntroSlide3(u8 taskId) } break; case 4: - sub_811828C(taskId); + BattleIntroSlideEnd(taskId); break; } - if (gTasks[taskId].data[0] != 4) + if (gTasks[taskId].tState != 4) SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[4], 0)); } @@ -437,7 +440,7 @@ static void BattleIntroSlideLink(u8 taskId) { int i; - if (gTasks[taskId].data[0] > 1 && !gTasks[taskId].data[4]) + if (gTasks[taskId].tState > 1 && !gTasks[taskId].data[4]) { u16 var0 = gBattle_BG1_X & 0x8000; if (var0 || gBattle_BG1_X < 80) @@ -453,20 +456,20 @@ static void BattleIntroSlideLink(u8 taskId) } } - switch (gTasks[taskId].data[0]) + switch (gTasks[taskId].tState) { case 0: gTasks[taskId].data[2] = 32; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; break; case 1: if (--gTasks[taskId].data[2] == 0) { - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; gSprites[gBattleStruct->linkBattleVsSpriteId_V].oam.objMode = ST_OAM_OBJ_WINDOW; - gSprites[gBattleStruct->linkBattleVsSpriteId_V].callback = sub_8038B74; + gSprites[gBattleStruct->linkBattleVsSpriteId_V].callback = SpriteCB_VsLetterInit; gSprites[gBattleStruct->linkBattleVsSpriteId_S].oam.objMode = ST_OAM_OBJ_WINDOW; - gSprites[gBattleStruct->linkBattleVsSpriteId_S].callback = sub_8038B74; + gSprites[gBattleStruct->linkBattleVsSpriteId_S].callback = SpriteCB_VsLetterInit; SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2); } @@ -475,7 +478,7 @@ static void BattleIntroSlideLink(u8 taskId) gBattle_WIN0V -= 0xFF; if ((gBattle_WIN0V & 0xFF00) == 0x3000) { - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; gTasks[taskId].data[2] = 240; gTasks[taskId].data[3] = 32; gIntroSlideFlags &= ~1; @@ -498,7 +501,7 @@ static void BattleIntroSlideLink(u8 taskId) if (!gTasks[taskId].data[2]) { gScanlineEffect.state = 3; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; SetBgAttribute(1, BG_ATTR_CHARBASEINDEX, 0); SetBgAttribute(2, BG_ATTR_CHARBASEINDEX, 0); SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_16COLOR | BGCNT_SCREENBASE(28) | BGCNT_TXT256x512); @@ -506,23 +509,23 @@ static void BattleIntroSlideLink(u8 taskId) } break; case 4: - sub_811828C(taskId); + BattleIntroSlideEnd(taskId); break; } } static void BattleIntroSlidePartner(u8 taskId) { - switch (gTasks[taskId].data[0]) + switch (gTasks[taskId].tState) { case 0: gTasks[taskId].data[2] = 1; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; break; case 1: if (--gTasks[taskId].data[2] == 0) { - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(2) | BGCNT_CHARBASE(2) | BGCNT_16COLOR | BGCNT_SCREENBASE(28) | BGCNT_TXT512x256); SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2) | BGCNT_CHARBASE(2) | BGCNT_16COLOR | BGCNT_SCREENBASE(30) | BGCNT_TXT512x256); SetGpuReg(REG_OFFSET_DISPCNT, GetGpuReg(REG_OFFSET_DISPCNT) | DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON | DISPCNT_WIN1_ON | DISPCNT_OBJWIN_ON); @@ -540,7 +543,7 @@ static void BattleIntroSlidePartner(u8 taskId) if ((gBattle_WIN0V & 0xFF00) == 0x2000) { - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; gTasks[taskId].data[2] = 240; gIntroSlideFlags &= ~1; } @@ -555,7 +558,7 @@ static void BattleIntroSlidePartner(u8 taskId) gBattle_BG1_X = gTasks[taskId].data[2]; gBattle_BG2_X = -gTasks[taskId].data[2]; if (!gTasks[taskId].data[2]) - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; break; case 4: gBattle_BG0_Y += 2; @@ -572,11 +575,11 @@ static void BattleIntroSlidePartner(u8 taskId) SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_16COLOR | BGCNT_SCREENBASE(28) | BGCNT_TXT256x512); SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_16COLOR | BGCNT_SCREENBASE(30) | BGCNT_TXT512x256); gScanlineEffect.state = 3; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; } break; case 5: - sub_811828C(taskId); + BattleIntroSlideEnd(taskId); break; } } diff --git a/src/battle_main.c b/src/battle_main.c index 940fab8ff..a415d894f 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -81,8 +81,8 @@ static void TryCorrectShedinjaLanguage(struct Pokemon *mon); static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 firstTrainer); static void BattleMainCB1(void); static void sub_8038538(struct Sprite *sprite); -static void sub_8038F14(void); -static void sub_8038F34(void); +static void CB2_EndLinkBattle(void); +static void EndLinkBattleInSteps(void); static void sub_80392A8(void); static void sub_803937C(void); static void sub_803939C(void); @@ -93,7 +93,7 @@ static void sub_80398D0(struct Sprite *sprite); static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite); static void SpriteCb_BlinkVisible(struct Sprite *sprite); static void SpriteCallbackDummy_3(struct Sprite *sprite); -static void oac_poke_ally_(struct Sprite *sprite); +static void SpriteCB_BattleSpriteSlideLeft(struct Sprite *sprite); static void TurnValuesCleanUp(bool8 var0); static void SpriteCB_BounceEffect(struct Sprite *sprite); static void BattleStartClearSetData(void); @@ -147,7 +147,7 @@ EWRAM_DATA u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT] = {0}; EWRAM_DATA static u32 sUnusedUnknownArray[25] = {0}; EWRAM_DATA u32 gBattleTypeFlags = 0; EWRAM_DATA u8 gBattleTerrain = 0; -EWRAM_DATA u32 gUnknown_02022FF4 = 0; +EWRAM_DATA u32 gUnusedFirstBattleVar1 = 0; // Never read EWRAM_DATA struct UnknownPokemonStruct4 gMultiPartnerParty[MULTI_PARTY_SIZE] = {0}; EWRAM_DATA static struct UnknownPokemonStruct4* sMultiPartnerPartyBuffer = NULL; EWRAM_DATA u8 *gUnknown_0202305C = NULL; @@ -200,7 +200,7 @@ EWRAM_DATA u8 gMoveResultFlags = 0; EWRAM_DATA u32 gHitMarker = 0; EWRAM_DATA static u8 sUnusedBattlersArray[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA u8 gTakenDmgByBattler[MAX_BATTLERS_COUNT] = {0}; -EWRAM_DATA u8 gUnknown_0202428C = 0; +EWRAM_DATA u8 gUnusedFirstBattleVar2 = 0; // Never read EWRAM_DATA u16 gSideStatuses[2] = {0}; EWRAM_DATA struct SideTimer gSideTimers[2] = {0}; EWRAM_DATA u32 gStatuses3[MAX_BATTLERS_COUNT] = {0}; @@ -233,8 +233,8 @@ EWRAM_DATA u32 gTransformedPersonalities[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA u8 gPlayerDpadHoldFrames = 0; EWRAM_DATA struct BattleSpriteData *gBattleSpritesDataPtr = NULL; EWRAM_DATA struct MonSpritesGfx *gMonSpritesGfxPtr = NULL; -EWRAM_DATA struct BattleHealthboxInfo *gUnknown_020244D8 = NULL; -EWRAM_DATA struct BattleHealthboxInfo *gUnknown_020244DC = NULL; +EWRAM_DATA struct BattleHealthboxInfo *gBattleControllerOpponentHealthboxData = NULL; // Never read +EWRAM_DATA struct BattleHealthboxInfo *gBattleControllerOpponentFlankHealthboxData = NULL; // Never read EWRAM_DATA u16 gBattleMovePower = 0; EWRAM_DATA u16 gMoveToLearn = 0; EWRAM_DATA u8 gBattleMonForms[MAX_BATTLERS_COUNT] = {0}; @@ -248,7 +248,7 @@ void (*gBattlerControllerFuncs[MAX_BATTLERS_COUNT])(void); u8 gHealthboxSpriteIds[MAX_BATTLERS_COUNT]; u8 gMultiUsePlayerCursor; u8 gNumberOfMovesToChoose; -u8 gUnknown_03005D7C[MAX_BATTLERS_COUNT]; +u8 gBattleControllerData[MAX_BATTLERS_COUNT]; // Used by the battle controllers to store misc sprite/task IDs for each battler // rom const data static const struct ScanlineEffectParams sIntroScanlineParams16Bit = @@ -275,7 +275,7 @@ const struct SpriteTemplate gUnknown_0831AC88 = static const u8 sText_ShedinjaJpnName[] = _("ヌケニン"); // Nukenin -const struct OamData gOamData_831ACA8 = +const struct OamData gOamData_BattleSpriteOpponentSide = { .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, @@ -290,7 +290,7 @@ const struct OamData gOamData_831ACA8 = .affineParam = 0, }; -const struct OamData gOamData_831ACB0 = +const struct OamData gOamData_BattleSpritePlayerSide = { .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, @@ -306,10 +306,10 @@ const struct OamData gOamData_831ACB0 = }; // Unknown and unused data. Feel free to remove. -static const u16 gUnknown_0831ACB8[] = {0, 5, 0xfffe, 0}; -static const u16 *const gUnknown_0831ACC0 = gUnknown_0831ACB8; -static const u16 gUnknown_0831ACC4[] = {0xfff0, 0, 0x0400, 0, 0, 0, 0x3c00, 0, 0x7ffe, 1, 0, 0}; -static const u16 *const gUnknown_0831ACDC = gUnknown_0831ACC4; +static const u16 sUnused1[] = {0, 5, 0xfffe, 0}; +static const u16 *const sUnused1Ptr = sUnused1; +static const u16 sUnused2[] = {0xfff0, 0, 0x0400, 0, 0, 0, 0x3c00, 0, 0x7ffe, 1, 0, 0}; +static const u16 *const sUnused2Ptr = sUnused2; static const s8 gUnknown_0831ACE0[] ={-32, -16, -16, -32, -32, 0, 0, 0}; @@ -700,39 +700,45 @@ static void CB2_InitBattleInternal(void) gBattleCommunication[MULTIUSE_STATE] = 0; } -static void sub_8036A5C(void) +#define BUFFER_PARTY_VS_SCREEN_STATUS(party, flags, i) \ + for ((i) = 0; (i) < PARTY_SIZE; (i)++) \ + { \ + u16 species = GetMonData(&(party)[(i)], MON_DATA_SPECIES2); \ + u16 hp = GetMonData(&(party)[(i)], MON_DATA_HP); \ + u32 status = GetMonData(&(party)[(i)], MON_DATA_STATUS); \ + \ + if (species == SPECIES_NONE) \ + continue; \ + \ + /* Is healthy mon? */ \ + if (species != SPECIES_EGG && hp != 0 && status == 0) \ + (flags) |= 1 << (i) * 2; \ + \ + if (species == SPECIES_NONE) /* Redundant */ \ + continue; \ + \ + /* Is Egg or statused? */ \ + if (hp != 0 && (species == SPECIES_EGG || status != 0)) \ + (flags) |= 2 << (i) * 2; \ + \ + if (species == SPECIES_NONE) /* Redundant */ \ + continue; \ + \ + /* Is fainted? */ \ + if (species != SPECIES_EGG && hp == 0) \ + (flags) |= 3 << (i) * 2; \ + } + +// For Vs Screen at link battle start +static void BufferPartyVsScreenHealth_AtStart(void) { - u16 r6 = 0; - u16 species = 0; - u16 hp = 0; - u32 status = 0; + u16 flags = 0; s32 i; - for (i = 0; i < PARTY_SIZE; i++) - { - species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2); - hp = GetMonData(&gPlayerParty[i], MON_DATA_HP); - status = GetMonData(&gPlayerParty[i], MON_DATA_STATUS); - - if (species == SPECIES_NONE) - continue; - if (species != SPECIES_EGG && hp != 0 && status == 0) - r6 |= 1 << i * 2; - - if (species == SPECIES_NONE) - continue; - if (hp != 0 && (species == SPECIES_EGG || status != 0)) - r6 |= 2 << i * 2; - - if (species == SPECIES_NONE) - continue; - if (species != SPECIES_EGG && hp == 0) - r6 |= 3 << i * 2; - } - - gBattleStruct->field_182 = r6; - *(&gBattleStruct->field_183) = r6 >> 8; - gBattleStruct->field_183 |= FlagGet(FLAG_SYS_FRONTIER_PASS) << 7; + BUFFER_PARTY_VS_SCREEN_STATUS(gPlayerParty, flags, i); + gBattleStruct->vsScreenHealthFlagsLo = flags; + *(&gBattleStruct->vsScreenHealthFlagsHi) = flags >> 8; + gBattleStruct->vsScreenHealthFlagsHi |= FlagGet(FLAG_SYS_FRONTIER_PASS) << 7; } static void SetPlayerBerryDataInBattleStruct(void) @@ -969,7 +975,7 @@ static void CB2_HandleStartBattle(void) { *(&gBattleStruct->field_180) = 0; *(&gBattleStruct->field_181) = 3; - sub_8036A5C(); + BufferPartyVsScreenHealth_AtStart(); SetPlayerBerryDataInBattleStruct(); if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM) @@ -1005,7 +1011,7 @@ static void CB2_HandleStartBattle(void) gTasks[taskId].data[1] = 0x10E; gTasks[taskId].data[2] = 0x5A; gTasks[taskId].data[5] = 0; - gTasks[taskId].data[3] = gBattleStruct->field_182 | (gBattleStruct->field_183 << 8); + gTasks[taskId].data[3] = gBattleStruct->vsScreenHealthFlagsLo | (gBattleStruct->vsScreenHealthFlagsHi << 8); gTasks[taskId].data[4] = gBlockRecvBuffer[enemyMultiplayerId][1]; sub_8185F90(gBlockRecvBuffer[playerMultiplayerId][1]); sub_8185F90(gBlockRecvBuffer[enemyMultiplayerId][1]); @@ -1065,7 +1071,7 @@ static void CB2_HandleStartBattle(void) } break; case 15: - sub_8032768(); + InitBattleControllers(); sub_8184E58(); gBattleCommunication[SPRITES_INIT_STATE1] = 0; gBattleCommunication[SPRITES_INIT_STATE2] = 0; @@ -1177,7 +1183,7 @@ static void CB2_HandleStartMultiPartnerBattle(void) { *(&gBattleStruct->field_180) = 0; *(&gBattleStruct->field_181) = 3; - sub_8036A5C(); + BufferPartyVsScreenHealth_AtStart(); SetPlayerBerryDataInBattleStruct(); SendBlock(bitmask_all_link_players_but_self(), &gBattleStruct->field_180, 32); gBattleCommunication[MULTIUSE_STATE] = 2; @@ -1325,7 +1331,7 @@ static void CB2_HandleStartMultiPartnerBattle(void) } break; case 13: - sub_8032768(); + InitBattleControllers(); sub_8184E58(); gBattleCommunication[SPRITES_INIT_STATE1] = 0; gBattleCommunication[SPRITES_INIT_STATE2] = 0; @@ -1564,7 +1570,7 @@ static void CB2_HandleStartMultiBattle(void) { *(&gBattleStruct->field_180) = 0; *(&gBattleStruct->field_181) = 3; - sub_8036A5C(); + BufferPartyVsScreenHealth_AtStart(); SetPlayerBerryDataInBattleStruct(); SendBlock(bitmask_all_link_players_but_self(), &gBattleStruct->field_180, 32); @@ -1762,7 +1768,7 @@ static void CB2_HandleStartMultiBattle(void) } break; case 7: - sub_8032768(); + InitBattleControllers(); sub_8184E58(); gBattleCommunication[SPRITES_INIT_STATE1] = 0; gBattleCommunication[SPRITES_INIT_STATE2] = 0; @@ -2064,12 +2070,12 @@ void VBlankCB_Battle(void) ScanlineEffect_InitHBlankDmaTransfer(); } -void nullsub_17(struct Sprite *sprite) +void SpriteCB_VsLetterDummy(struct Sprite *sprite) { } -static void sub_8038B04(struct Sprite *sprite) +static void SpriteCB_VsLetter(struct Sprite *sprite) { if (sprite->data[0] != 0) sprite->pos1.x = sprite->data[1] + ((sprite->data[2] & 0xFF00) >> 8); @@ -2080,100 +2086,60 @@ static void sub_8038B04(struct Sprite *sprite) if (sprite->affineAnimEnded) { - FreeSpriteTilesByTag(0x2710); - FreeSpritePaletteByTag(0x2710); + FreeSpriteTilesByTag(ANIM_SPRITES_START); + FreeSpritePaletteByTag(ANIM_SPRITES_START); FreeSpriteOamMatrix(sprite); DestroySprite(sprite); } } -void sub_8038B74(struct Sprite *sprite) +void SpriteCB_VsLetterInit(struct Sprite *sprite) { StartSpriteAffineAnim(sprite, 1); - sprite->callback = sub_8038B04; + sprite->callback = SpriteCB_VsLetter; PlaySE(SE_MUGSHOT); } -static void sub_8038B94(u8 taskId) +static void BufferPartyVsScreenHealth_AtEnd(u8 taskId) { - struct Pokemon *sp4 = NULL; - struct Pokemon *sp8 = NULL; - u8 r2 = gBattleScripting.multiplayerId; - u32 r7; + struct Pokemon *party1 = NULL; + struct Pokemon *party2 = NULL; + u8 multiplayerId = gBattleScripting.multiplayerId; + u32 flags; s32 i; if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { - switch (gLinkPlayers[r2].id) + switch (gLinkPlayers[multiplayerId].id) { case 0: case 2: - sp4 = gPlayerParty; - sp8 = gEnemyParty; + party1 = gPlayerParty; + party2 = gEnemyParty; break; case 1: case 3: - sp4 = gEnemyParty; - sp8 = gPlayerParty; + party1 = gEnemyParty; + party2 = gPlayerParty; break; } } else { - sp4 = gPlayerParty; - sp8 = gEnemyParty; + party1 = gPlayerParty; + party2 = gEnemyParty; } - r7 = 0; - for (i = 0; i < PARTY_SIZE; i++) - { - u16 species = GetMonData(&sp4[i], MON_DATA_SPECIES2); - u16 hp = GetMonData(&sp4[i], MON_DATA_HP); - u32 status = GetMonData(&sp4[i], MON_DATA_STATUS); - - if (species == SPECIES_NONE) - continue; - if (species != SPECIES_EGG && hp != 0 && status == 0) - r7 |= 1 << i * 2; - - if (species == SPECIES_NONE) - continue; - if (hp != 0 && (species == SPECIES_EGG || status != 0)) - r7 |= 2 << i * 2; - - if (species == SPECIES_NONE) - continue; - if (species != SPECIES_EGG && hp == 0) - r7 |= 3 << i * 2; - } - gTasks[taskId].data[3] = r7; + flags = 0; + BUFFER_PARTY_VS_SCREEN_STATUS(party1, flags, i); + gTasks[taskId].data[3] = flags; - r7 = 0; - for (i = 0; i < PARTY_SIZE; i++) - { - u16 species = GetMonData(&sp8[i], MON_DATA_SPECIES2); - u16 hp = GetMonData(&sp8[i], MON_DATA_HP); - u32 status = GetMonData(&sp8[i], MON_DATA_STATUS); - - if (species == SPECIES_NONE) - continue; - if (species != SPECIES_EGG && hp != 0 && status == 0) - r7 |= 1 << i * 2; - - if (species == SPECIES_NONE) - continue; - if (hp != 0 && (species == SPECIES_EGG || status != 0)) - r7 |= 2 << i * 2; - - if (species == SPECIES_NONE) - continue; - if (species != SPECIES_EGG && hp == 0) - r7 |= 3 << i * 2; - } - gTasks[taskId].data[4] = r7; + flags = 0; + BUFFER_PARTY_VS_SCREEN_STATUS(party2, flags, i); + gTasks[taskId].data[4] = flags; } -void sub_8038D64(void) +void CB2_InitEndLinkBattle(void) { s32 i; u8 taskId; @@ -2193,12 +2159,12 @@ void sub_8038D64(void) { CpuFill32(0, (void*)(VRAM), VRAM_SIZE); SetGpuReg(REG_OFFSET_MOSAIC, 0); - SetGpuReg(REG_OFFSET_WIN0H, 0xF0); - 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 = 0xF0; - gBattle_WIN0V = 0x5051; + gBattle_WIN0H = DISPLAY_WIDTH; + gBattle_WIN0V = WIN_RANGE(DISPLAY_HEIGHT / 2, DISPLAY_HEIGHT / 2 + 1); ScanlineEffect_Clear(); i = 0; @@ -2233,24 +2199,26 @@ void sub_8038D64(void) ResetSpriteData(); ResetTasks(); DrawBattleEntryBackground(); - SetGpuReg(REG_OFFSET_WINOUT, 0x37); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); FreeAllSpritePalettes(); gReservedSpritePaletteCount = 4; SetVBlankCallback(VBlankCB_Battle); + // Show end Vs screen with battle results taskId = CreateTask(InitLinkBattleVsScreen, 0); gTasks[taskId].data[1] = 0x10E; gTasks[taskId].data[2] = 0x5A; gTasks[taskId].data[5] = 1; - sub_8038B94(taskId); - SetMainCallback2(sub_8038F14); + BufferPartyVsScreenHealth_AtEnd(taskId); + + SetMainCallback2(CB2_EndLinkBattle); gBattleCommunication[MULTIUSE_STATE] = 0; } } -static void sub_8038F14(void) +static void CB2_EndLinkBattle(void) { - sub_8038F34(); + EndLinkBattleInSteps(); AnimateSprites(); BuildOamBuffer(); RunTextPrinters(); @@ -2258,7 +2226,7 @@ static void sub_8038F14(void) RunTasks(); } -static void sub_8038F34(void) +static void EndLinkBattleInSteps(void) { s32 i; @@ -2375,7 +2343,7 @@ static void sub_8038F34(void) } } -u32 sub_80391E0(u8 arrayId, u8 caseId) +u32 GetBattleBgTemplateData(u8 arrayId, u8 caseId) { u32 ret = 0; @@ -2396,7 +2364,7 @@ u32 sub_80391E0(u8 arrayId, u8 caseId) case 4: ret = gBattleBgTemplates[arrayId].paletteMode; break; - case 5: + case 5: // Only this case is used ret = gBattleBgTemplates[arrayId].priority; break; case 6: @@ -2627,7 +2595,7 @@ static void TryCorrectShedinjaLanguage(struct Pokemon *mon) } } -u32 sub_80397C4(u32 setId, u32 tableId) +u32 GetBattleWindowTemplatePixelWidth(u32 setId, u32 tableId) { return gBattleWindowTemplates[setId][tableId].width * 8; } @@ -2658,7 +2626,7 @@ static void SpriteCb_WildMonShowHealthbox(struct Sprite *sprite) { if (sprite->animEnded) { - sub_8076918(sprite->sBattler); + StartHealthboxSlideIn(sprite->sBattler); SetHealthboxSpriteVisible(gHealthboxSpriteIds[sprite->sBattler]); sprite->callback = SpriteCb_WildMonAnimate; StartSpriteAnimIfDifferent(sprite, 0); @@ -2679,7 +2647,8 @@ void SpriteCallbackDummy_2(struct Sprite *sprite) } -static void sub_80398BC(struct Sprite *sprite) // unused? +// Unused +static void sub_80398BC(struct Sprite *sprite) { sprite->data[3] = 6; sprite->data[4] = 1; @@ -2812,12 +2781,13 @@ void SpriteCb_OpponentMonFromBall(struct Sprite *sprite) } } -void sub_8039BB4(struct Sprite *sprite) +// This callback is frequently overwritten by SpriteCB_TrainerSlideIn +void SpriteCB_BattleSpriteStartSlideLeft(struct Sprite *sprite) { - sprite->callback = oac_poke_ally_; + sprite->callback = SpriteCB_BattleSpriteSlideLeft; } -static void oac_poke_ally_(struct Sprite *sprite) +static void SpriteCB_BattleSpriteSlideLeft(struct Sprite *sprite) { if (!(gIntroSlideFlags & 1)) { @@ -2830,7 +2800,8 @@ static void oac_poke_ally_(struct Sprite *sprite) } } -void sub_80105DC(struct Sprite *sprite) +// Unused +static void sub_80105DC(struct Sprite *sprite) { sprite->callback = SpriteCallbackDummy_3; } @@ -2839,15 +2810,21 @@ static void SpriteCallbackDummy_3(struct Sprite *sprite) { } -void sub_8039C00(struct Sprite *sprite) +#define sSpeedX data[1] +#define sSpeedY data[2] + +void SpriteCB_FaintSlideAnim(struct Sprite *sprite) { if (!(gIntroSlideFlags & 1)) { - sprite->pos2.x += sprite->data[1]; - sprite->pos2.y += sprite->data[2]; + sprite->pos2.x += sprite->sSpeedX; + sprite->pos2.y += sprite->sSpeedY; } } +#undef sSpeedX +#undef sSpeedY + #define sSinIndex data[0] #define sDelta data[1] #define sAmplitude data[2] @@ -2967,7 +2944,7 @@ void sub_8039E9C(struct Sprite *sprite) sprite->centerToCornerVecX = gUnknown_0831ACE0[sprite->animCmdIndex]; } -void nullsub_20(void) +void BeginBattleIntroDummy(void) { } @@ -4393,7 +4370,11 @@ static void HandleTurnActionSelectionState(void) } break; case STATE_WAIT_ACTION_CONFIRMED_STANDBY: - if (!(gBattleControllerExecFlags & ((gBitTable[gActiveBattler]) | (0xF0000000) | (gBitTable[gActiveBattler] << 4) | (gBitTable[gActiveBattler] << 8) | (gBitTable[gActiveBattler] << 0xC)))) + if (!(gBattleControllerExecFlags & ((gBitTable[gActiveBattler]) + | (0xF0000000) + | (gBitTable[gActiveBattler] << 4) + | (gBitTable[gActiveBattler] << 8) + | (gBitTable[gActiveBattler] << 12)))) { if (AllAtActionConfirmed()) i = TRUE; @@ -4962,7 +4943,7 @@ static void HandleEndTurn_BattleLost(void) } else { - gBattlescriptCurrInstr = BattleScript_82DAA0B; + gBattlescriptCurrInstr = BattleScript_FrontierLinkBattleLost; gBattleOutcome &= ~(B_OUTCOME_LINK_BATTLE_RAN); } } diff --git a/src/battle_message.c b/src/battle_message.c index 3f886c196..3920f94cf 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -3001,7 +3001,7 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId) if (printerTemplate.x == 0xFF) { - u32 width = sub_80397C4(gBattleScripting.windowsType, windowId); + u32 width = GetBattleWindowTemplatePixelWidth(gBattleScripting.windowsType, windowId); s32 alignX = GetStringCenterAlignXOffsetWithLetterSpacing(printerTemplate.fontId, printerTemplate.currentChar, width, printerTemplate.letterSpacing); printerTemplate.x = printerTemplate.currentX = alignX; } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index f6546ab25..d0aa9164a 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -163,7 +163,7 @@ static void Cmd_trainerslidein(void); static void Cmd_playse(void); static void Cmd_fanfare(void); static void Cmd_playfaintcry(void); -static void Cmd_unknown_57(void); +static void Cmd_endlinkbattle(void); static void Cmd_returntoball(void); static void Cmd_handlelearnnewmove(void); static void Cmd_yesnoboxlearnmove(void); @@ -415,7 +415,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_playse, //0x54 Cmd_fanfare, //0x55 Cmd_playfaintcry, //0x56 - Cmd_unknown_57, //0x57 + Cmd_endlinkbattle, //0x57 Cmd_returntoball, //0x58 Cmd_handlelearnnewmove, //0x59 Cmd_yesnoboxlearnmove, //0x5A @@ -4835,7 +4835,7 @@ static void Cmd_openpartyscreen(void) { gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); - BtlController_EmitLinkStandbyMsg(0, 2, 0); + BtlController_EmitLinkStandbyMsg(0, 2, FALSE); MarkBattlerForControllerExec(gActiveBattler); } else if (!gSpecialStatuses[gActiveBattler].flag40) @@ -4846,7 +4846,7 @@ static void Cmd_openpartyscreen(void) } else { - BtlController_EmitLinkStandbyMsg(0, 2, 0); + BtlController_EmitLinkStandbyMsg(0, 2, FALSE); MarkBattlerForControllerExec(gActiveBattler); } } @@ -4874,7 +4874,7 @@ static void Cmd_openpartyscreen(void) } else { - BtlController_EmitLinkStandbyMsg(0, 2, 0); + BtlController_EmitLinkStandbyMsg(0, 2, FALSE); MarkBattlerForControllerExec(gActiveBattler); flags |= 1; } @@ -4896,7 +4896,7 @@ static void Cmd_openpartyscreen(void) } else if (!(flags & 1)) { - BtlController_EmitLinkStandbyMsg(0, 2, 0); + BtlController_EmitLinkStandbyMsg(0, 2, FALSE); MarkBattlerForControllerExec(gActiveBattler); } } @@ -4917,7 +4917,7 @@ static void Cmd_openpartyscreen(void) } else { - BtlController_EmitLinkStandbyMsg(0, 2, 0); + BtlController_EmitLinkStandbyMsg(0, 2, FALSE); MarkBattlerForControllerExec(gActiveBattler); flags |= 2; } @@ -4939,7 +4939,7 @@ static void Cmd_openpartyscreen(void) } else if (!(flags & 2)) { - BtlController_EmitLinkStandbyMsg(0, 2, 0); + BtlController_EmitLinkStandbyMsg(0, 2, FALSE); MarkBattlerForControllerExec(gActiveBattler); } } @@ -4955,7 +4955,7 @@ static void Cmd_openpartyscreen(void) else gActiveBattler = 0; - BtlController_EmitLinkStandbyMsg(0, 2, 0); + BtlController_EmitLinkStandbyMsg(0, 2, FALSE); MarkBattlerForControllerExec(gActiveBattler); } @@ -4971,7 +4971,7 @@ static void Cmd_openpartyscreen(void) else gActiveBattler = 1; - BtlController_EmitLinkStandbyMsg(0, 2, 0); + BtlController_EmitLinkStandbyMsg(0, 2, FALSE); MarkBattlerForControllerExec(gActiveBattler); } } @@ -5079,7 +5079,7 @@ static void Cmd_openpartyscreen(void) { if (gActiveBattler != battlerId) { - BtlController_EmitLinkStandbyMsg(0, 2, 0); + BtlController_EmitLinkStandbyMsg(0, 2, FALSE); MarkBattlerForControllerExec(gActiveBattler); } } @@ -5090,7 +5090,7 @@ static void Cmd_openpartyscreen(void) if (gAbsentBattlerFlags & gBitTable[gActiveBattler]) gActiveBattler ^= BIT_FLANK; - BtlController_EmitLinkStandbyMsg(0, 2, 0); + BtlController_EmitLinkStandbyMsg(0, 2, FALSE); MarkBattlerForControllerExec(gActiveBattler); } } @@ -5282,10 +5282,10 @@ static void Cmd_playfaintcry(void) gBattlescriptCurrInstr += 2; } -static void Cmd_unknown_57(void) +static void Cmd_endlinkbattle(void) { gActiveBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); - BtlController_EmitCmd55(0, gBattleOutcome); + BtlController_EmitEndLinkBattle(0, gBattleOutcome); MarkBattlerForControllerExec(gActiveBattler); gBattlescriptCurrInstr += 1; @@ -6362,7 +6362,7 @@ static void Cmd_various(void) gDisableStructs[1].truantSwitchInHack = 1; break; case VARIOUS_EMIT_YESNOBOX: - BtlController_EmitUnknownYesNoBox(0); + BtlController_EmitYesNoBox(0); MarkBattlerForControllerExec(gActiveBattler); break; case 14: diff --git a/src/battle_setup.c b/src/battle_setup.c index 0a5e7e8b4..cb65d25d6 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -1197,7 +1197,7 @@ void ConfigureAndSetUpOneTrainerBattle(u8 trainerObjEventId, const u8 *trainerSc gSelectedObjectEvent = trainerObjEventId; gSpecialVar_LastTalked = gObjectEvents[trainerObjEventId].localId; BattleSetup_ConfigureTrainerBattle(trainerScript + 1); - ScriptContext1_SetupScript(EventScript_271354); + ScriptContext1_SetupScript(EventScript_StartTrainerApproach); ScriptContext2_Enable(); } @@ -1210,7 +1210,7 @@ void ConfigureTwoTrainersBattle(u8 trainerObjEventId, const u8 *trainerScript) void SetUpTwoTrainersBattle(void) { - ScriptContext1_SetupScript(EventScript_271354); + ScriptContext1_SetupScript(EventScript_StartTrainerApproach); ScriptContext2_Enable(); } @@ -1220,10 +1220,12 @@ bool32 GetTrainerFlagFromScriptPointer(const u8 *data) return FlagGet(TRAINER_FLAGS_START + flag); } -void SetUpTrainerMovement(void) +// Set trainer's movement type so they stop and remain facing that direction +// Note: Only for trainers who are spoken to directly +// For trainers who spot the player this is handled by PlayerFaceApproachingTrainer +void SetTrainerFacingDirection(void) { struct ObjectEvent *objectEvent = &gObjectEvents[gSelectedObjectEvent]; - SetTrainerMovementType(objectEvent, GetTrainerFacingDirectionMovementType(objectEvent->facingDirection)); } @@ -1437,7 +1439,7 @@ void ShowTrainerCantBattleSpeech(void) ShowFieldMessage(GetTrainerCantBattleSpeech()); } -void SetUpTrainerEncounterMusic(void) +void PlayTrainerEncounterMusic(void) { u16 trainerId; u16 music; diff --git a/src/battle_util.c b/src/battle_util.c index 7ea4566d2..b7919f904 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -819,14 +819,14 @@ void MarkBattlerForControllerExec(u8 battlerId) gBattleControllerExecFlags |= gBitTable[battlerId]; } -void sub_803F850(u8 arg0) +void MarkBattlerReceivedLinkData(u8 battlerId) { s32 i; for (i = 0; i < GetLinkPlayerCount(); i++) - gBattleControllerExecFlags |= gBitTable[arg0] << (i << 2); + gBattleControllerExecFlags |= gBitTable[battlerId] << (i << 2); - gBattleControllerExecFlags &= ~(0x10000000 << arg0); + gBattleControllerExecFlags &= ~(0x10000000 << battlerId); } void CancelMultiTurnMoves(u8 battler) diff --git a/src/berry.c b/src/berry.c index 98264f37b..022fdc934 100644 --- a/src/berry.c +++ b/src/berry.c @@ -1046,8 +1046,9 @@ void ClearBerryTrees(void) static bool32 BerryTreeGrow(struct BerryTree *tree) { - if (tree->growthSparkle) + if (tree->stopGrowth) return FALSE; + switch (tree->stage) { case BERRY_STAGE_NO_BERRY: @@ -1082,7 +1083,7 @@ void BerryTreeTimeUpdate(s32 minutes) { tree = &gSaveBlock1Ptr->berryTrees[i]; - if (tree->berry && tree->stage && !tree->growthSparkle) + if (tree->berry && tree->stage && !tree->stopGrowth) { if (minutes >= GetStageDurationByBerryType(tree->berry) * 71) { @@ -1111,7 +1112,7 @@ void BerryTreeTimeUpdate(s32 minutes) } } -void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 sparkle) +void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 allowGrowth) { struct BerryTree *tree = GetBerryTreeInfo(id); @@ -1125,8 +1126,10 @@ void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 sparkle) tree->minutesUntilNextStage *= 4; } - if (!sparkle) - tree->growthSparkle = TRUE; + // Stop growth, to keep tree at this stage until the player has seen it + // allowGrowth is always true for berry trees the player has planted + if (!allowGrowth) + tree->stopGrowth = TRUE; } void RemoveBerryTree(u8 id) @@ -1175,9 +1178,9 @@ void GetBerryCountStringByBerryType(u8 berry, u8* dest, u32 berryCount) GetBerryCountString(dest, GetBerryInfo(berry)->name, berryCount); } -void ResetBerryTreeSparkleFlag(u8 id) +void AllowBerryTreeGrowth(u8 id) { - GetBerryTreeInfo(id)->growthSparkle = FALSE; + GetBerryTreeInfo(id)->stopGrowth = FALSE; } static u8 BerryTreeGetNumStagesWatered(struct BerryTree *tree) @@ -1262,7 +1265,7 @@ void ObjectEventInteractionGetBerryTreeData(void) id = GetObjectEventBerryTreeId(gSelectedObjectEvent); berry = GetBerryTypeByBerryTreeId(id); - ResetBerryTreeSparkleFlag(id); + AllowBerryTreeGrowth(id); localId = gSpecialVar_LastTalked; num = gSaveBlock1Ptr->location.mapNum; group = gSaveBlock1Ptr->location.mapGroup; @@ -1313,7 +1316,7 @@ void ObjectEventInteractionPickBerryTree(void) void ObjectEventInteractionRemoveBerryTree(void) { RemoveBerryTree(GetObjectEventBerryTreeId(gSelectedObjectEvent)); - sub_8092EF0(gSpecialVar_LastTalked, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); + SetBerryTreeJustPicked(gSpecialVar_LastTalked, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); } bool8 PlayerHasBerries(void) @@ -1321,7 +1324,9 @@ bool8 PlayerHasBerries(void) return IsBagPocketNonEmpty(POCKET_BERRIES); } -void ResetBerryTreeSparkleFlags(void) +// Berry tree growth is frozen at their initial stage (usually, fully grown) until the player has seen the tree +// For all berry trees on screen, allow normal growth +void SetBerryTreesSeen(void) { s16 cam_left; s16 cam_top; @@ -1343,7 +1348,7 @@ void ResetBerryTreeSparkleFlags(void) cam_left = gObjectEvents[i].currentCoords.x; cam_top = gObjectEvents[i].currentCoords.y; if (left <= cam_left && cam_left <= right && top <= cam_top && cam_top <= bottom) - ResetBerryTreeSparkleFlag(gObjectEvents[i].trainerRange_berryTreeId); + AllowBerryTreeGrowth(gObjectEvents[i].trainerRange_berryTreeId); } } } diff --git a/src/bike.c b/src/bike.c index c4964b627..bbcda989c 100644 --- a/src/bike.c +++ b/src/bike.c @@ -963,9 +963,10 @@ bool8 IsBikingDisallowedByPlayer(void) return TRUE; } -bool8 player_should_look_direction_be_enforced_upon_movement(void) +bool8 IsPlayerNotUsingAcroBikeOnBumpySlope(void) { - if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_ACRO_BIKE) != FALSE && MetatileBehavior_IsBumpySlope(gObjectEvents[gPlayerAvatar.objectEventId].currentMetatileBehavior) != FALSE) + if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_ACRO_BIKE) + && MetatileBehavior_IsBumpySlope(gObjectEvents[gPlayerAvatar.objectEventId].currentMetatileBehavior)) return FALSE; else return TRUE; diff --git a/src/contest.c b/src/contest.c index e7c420448..36c32683a 100644 --- a/src/contest.c +++ b/src/contest.c @@ -3135,7 +3135,7 @@ static u8 CreateContestantSprite(u16 species, u32 otId, u32 personality, u32 ind if (IsSpeciesNotUnown(species)) gSprites[spriteId].affineAnims = gUnknown_082FF6C0; else - gSprites[spriteId].affineAnims = gUnknown_082FF694; + gSprites[spriteId].affineAnims = gAffineAnims_BattleSpriteOpponentSide; StartSpriteAffineAnim(gSprites + spriteId, 0); return spriteId; diff --git a/src/data.c b/src/data.c index 4861da18b..6a4295440 100644 --- a/src/data.c +++ b/src/data.c @@ -8,12 +8,11 @@ #include "constants/trainers.h" #include "constants/battle_ai.h" -const u16 gUnknown_082FF1D8[] = INCBIN_U16("graphics/link/minigame_digits.gbapal"); -const u32 gUnknown_082FF1F8[] = INCBIN_U32("graphics/link/minigame_digits.4bpp.lz"); -// unused -const u32 gUnknown_082FF2B8[] = INCBIN_U32("graphics/link/minigame_digits2.4bpp.lz"); +const u16 gMinigameDigits_Pal[] = INCBIN_U16("graphics/link/minigame_digits.gbapal"); +const u32 gMinigameDigits_Gfx[] = INCBIN_U32("graphics/link/minigame_digits.4bpp.lz"); +static const u32 sMinigameDigitsThin_Gfx[] = INCBIN_U32("graphics/link/minigame_digits2.4bpp.lz"); // Unused -const struct SpriteFrameImage gUnknown_082FF3A8[] = +const struct SpriteFrameImage gBattlerPicTable_PlayerLeft[] = { gHeap + 0x8000, 0x800, gHeap + 0x8800, 0x800, @@ -21,7 +20,7 @@ const struct SpriteFrameImage gUnknown_082FF3A8[] = gHeap + 0x9800, 0x800, }; -const struct SpriteFrameImage gUnknown_082FF3C8[] = +const struct SpriteFrameImage gBattlerPicTable_OpponentLeft[] = { gHeap + 0xA000, 0x800, gHeap + 0xA800, 0x800, @@ -29,7 +28,7 @@ const struct SpriteFrameImage gUnknown_082FF3C8[] = gHeap + 0xB800, 0x800, }; -const struct SpriteFrameImage gUnknown_082FF3E8[] = +const struct SpriteFrameImage gBattlerPicTable_PlayerRight[] = { gHeap + 0xC000, 0x800, gHeap + 0xC800, 0x800, @@ -37,7 +36,7 @@ const struct SpriteFrameImage gUnknown_082FF3E8[] = gHeap + 0xD800, 0x800, }; -const struct SpriteFrameImage gUnknown_082FF408[] = +const struct SpriteFrameImage gBattlerPicTable_OpponentRight[] = { gHeap + 0xE000, 0x800, gHeap + 0xE800, 0x800, @@ -189,7 +188,7 @@ static const union AffineAnimCmd gUnknown_082FF600[] = AFFINEANIMCMD_END, }; -const union AffineAnimCmd *const gUnknown_082FF618[] = +const union AffineAnimCmd *const gAffineAnims_BattleSpritePlayerSide[] = { gUnknown_082FF548, gUnknown_082FF568, @@ -229,7 +228,7 @@ static const union AffineAnimCmd gUnknown_082FF684[] = AFFINEANIMCMD_END, }; -const union AffineAnimCmd *const gUnknown_082FF694[] = +const union AffineAnimCmd *const gAffineAnims_BattleSpriteOpponentSide[] = { gUnknown_082FF548, gUnknown_082FF568, @@ -313,8 +312,7 @@ const union AnimCmd *const gUnknown_082FF70C[] = #include "data/pokemon_graphics/front_pic_anims.h" #include "data/pokemon_graphics/front_pic_table.h" -// unused -const u32 gUnknown830AF4C[] = +static const u32 sUnused[] = { 0x00000888, 0x00000888, 0x00000888, 0x00000888, 0x00000088, 0x00000888, 0x00000888, 0x00000886, diff --git a/src/data/bard_music/moves.h b/src/data/bard_music/moves.h index 6bb350a7c..06cc68d53 100644 --- a/src/data/bard_music/moves.h +++ b/src/data/bard_music/moves.h @@ -1,12 +1,12 @@ #ifndef GUARD_DATA_BARD_MUSIC_MOVES_H #define GUARD_DATA_BARD_MUSIC_MOVES_H -#include "moves.h" +#include "constants/moves.h" -const u16 gUnknown_085FA1D4 = 0x163; +const u16 gNumBardWords_Moves = MOVES_COUNT; -const struct BardSound gBardSounds_Moves[][6] = { - { +const struct BardSound gBardSounds_Moves[MOVES_COUNT][6] = { + [MOVE_NONE] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -14,7 +14,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_POUND] = { { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -22,7 +22,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_KARATE_CHOP] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, @@ -30,7 +30,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DOUBLE_SLAP] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0xa, 0x0, 0x0, 0x0, 0x0}, { 0x2, 0x0, 0x0, 0x0, 0x0}, @@ -38,7 +38,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_COMET_PUNCH] = { { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -46,7 +46,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MEGA_PUNCH] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -54,7 +54,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PAY_DAY] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -62,7 +62,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FIRE_PUNCH] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -70,7 +70,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ICE_PUNCH] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, @@ -78,7 +78,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_THUNDER_PUNCH] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -86,7 +86,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SCRATCH] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -94,7 +94,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_VICE_GRIP] = { { 0x14, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -102,7 +102,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_GUILLOTINE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, @@ -110,7 +110,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_RAZOR_WIND] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, @@ -118,7 +118,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SWORDS_DANCE] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x1, 0x0, 0x0, 0x0, 0x0}, @@ -126,7 +126,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CUT] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -134,7 +134,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_GUST] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -142,7 +142,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_WING_ATTACK] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -150,7 +150,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_WHIRLWIND] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, @@ -158,7 +158,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FLY] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -166,7 +166,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BIND] = { { 0x14, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -174,7 +174,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SLAM] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -182,7 +182,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_VINE_WHIP] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -190,7 +190,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_STOMP] = { { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -198,7 +198,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DOUBLE_KICK] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -206,7 +206,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MEGA_KICK] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -214,7 +214,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_JUMP_KICK] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -222,7 +222,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ROLLING_KICK] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -230,7 +230,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SAND_ATTACK] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -238,7 +238,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HEADBUTT] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -246,7 +246,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HORN_ATTACK] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -254,7 +254,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FURY_ATTACK] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -262,7 +262,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HORN_DRILL] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -270,7 +270,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TACKLE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -278,7 +278,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BODY_SLAM] = { { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2, 0x0, 0x0, 0x0, 0x0}, @@ -286,7 +286,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_WRAP] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -294,7 +294,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TAKE_DOWN] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x23, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -302,7 +302,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_THRASH] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x2, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -310,7 +310,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DOUBLE_EDGE] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0xa, 0x0, 0x0, 0x0, 0x0}, @@ -318,7 +318,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TAIL_WHIP] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -326,7 +326,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_POISON_STING] = { { 0x1e, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, @@ -334,7 +334,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TWINEEDLE] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, @@ -342,7 +342,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PIN_MISSILE] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, @@ -350,7 +350,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_LEER] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -358,7 +358,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BITE] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -366,7 +366,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_GROWL] = { { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -374,7 +374,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ROAR] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -382,7 +382,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SING] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -390,7 +390,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SUPERSONIC] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -398,7 +398,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SONIC_BOOM] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, @@ -406,7 +406,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DISABLE] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, @@ -414,7 +414,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ACID] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -422,7 +422,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_EMBER] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -430,7 +430,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FLAMETHROWER] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -438,7 +438,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MIST] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -446,7 +446,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_WATER_GUN] = { { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -454,7 +454,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HYDRO_PUMP] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -462,7 +462,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SURF] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -470,7 +470,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ICE_BEAM] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -478,7 +478,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BLIZZARD] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -486,7 +486,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PSYBEAM] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -494,7 +494,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BUBBLE_BEAM] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -502,7 +502,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_AURORA_BEAM] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -510,7 +510,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_HYPER_BEAM] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -518,7 +518,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PECK] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -526,7 +526,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DRILL_PECK] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -534,7 +534,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SUBMISSION] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, @@ -542,7 +542,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_LOW_KICK] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -550,7 +550,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_COUNTER] = { { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -558,7 +558,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SEISMIC_TOSS] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -566,7 +566,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_STRENGTH] = { { 0x32, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -574,7 +574,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ABSORB] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -582,7 +582,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MEGA_DRAIN] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, @@ -590,7 +590,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_LEECH_SEED] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -598,7 +598,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_GROWTH] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -606,7 +606,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_RAZOR_LEAF] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -614,7 +614,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SOLAR_BEAM] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -622,7 +622,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_POISON_POWDER] = { { 0x1e, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, @@ -630,7 +630,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_STUN_SPORE] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -638,7 +638,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SLEEP_POWDER] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -646,7 +646,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PETAL_DANCE] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x2, 0x0, 0x0, 0x0, 0x0}, @@ -654,7 +654,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_STRING_SHOT] = { { 0x32, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -662,7 +662,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DRAGON_RAGE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, @@ -670,7 +670,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_FIRE_SPIN] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, @@ -678,7 +678,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_THUNDER_SHOCK] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -686,7 +686,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_THUNDERBOLT] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, @@ -694,7 +694,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_THUNDER_WAVE] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, @@ -702,7 +702,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_THUNDER] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -710,7 +710,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ROCK_THROW] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -718,7 +718,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_EARTHQUAKE] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -726,7 +726,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FISSURE] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -734,7 +734,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DIG] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -742,7 +742,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TOXIC] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -750,7 +750,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CONFUSION] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x29, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -758,7 +758,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PSYCHIC] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -766,7 +766,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HYPNOSIS] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -774,7 +774,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MEDITATE] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, @@ -782,7 +782,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_AGILITY] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -790,7 +790,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_QUICK_ATTACK] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -798,7 +798,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_RAGE] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -806,7 +806,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TELEPORT] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, @@ -814,7 +814,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_NIGHT_SHADE] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -822,7 +822,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MIMIC] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -830,7 +830,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SCREECH] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xd, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -838,7 +838,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DOUBLE_TEAM] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -846,7 +846,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_RECOVER] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -854,7 +854,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HARDEN] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -862,7 +862,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MINIMIZE] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -870,7 +870,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SMOKESCREEN] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -878,7 +878,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CONFUSE_RAY] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x2d, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, @@ -886,7 +886,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_WITHDRAW] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -894,7 +894,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DEFENSE_CURL] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, @@ -902,7 +902,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BARRIER] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -910,7 +910,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_LIGHT_SCREEN] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -918,7 +918,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HAZE] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -926,7 +926,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_REFLECT] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -934,7 +934,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FOCUS_ENERGY] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, @@ -942,7 +942,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_BIDE] = { { 0xb, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -950,7 +950,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_METRONOME] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -958,7 +958,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MIRROR_MOVE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, { 0x29, 0x0, 0x0, 0x0, 0x0}, @@ -966,7 +966,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SELF_DESTRUCT] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -974,7 +974,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_EGG_BOMB] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -982,7 +982,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_LICK] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -990,7 +990,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SMOG] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -998,7 +998,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SLUDGE] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1006,7 +1006,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BONE_CLUB] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1014,7 +1014,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FIRE_BLAST] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1022,7 +1022,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_WATERFALL] = { { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, @@ -1030,7 +1030,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CLAMP] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1038,7 +1038,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SWIFT] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1046,7 +1046,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SKULL_BASH] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1054,7 +1054,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SPIKE_CANNON] = { { 0x14, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, @@ -1062,7 +1062,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CONSTRICT] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1070,7 +1070,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_AMNESIA] = { { 0x2, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -1078,7 +1078,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_KINESIS] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -1086,7 +1086,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SOFT_BOILED] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1e, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, @@ -1094,7 +1094,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HI_JUMP_KICK] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -1102,7 +1102,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_GLARE] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1110,7 +1110,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DREAM_EATER] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -1118,7 +1118,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_POISON_GAS] = { { 0x1e, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1126,7 +1126,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BARRAGE] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1134,7 +1134,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_LEECH_LIFE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1142,7 +1142,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_LOVELY_KISS] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -1150,7 +1150,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_SKY_ATTACK] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1158,7 +1158,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TRANSFORM] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1166,7 +1166,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BUBBLE] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1174,7 +1174,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DIZZY_PUNCH] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -1182,7 +1182,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SPORE] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1190,7 +1190,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FLASH] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1198,7 +1198,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PSYWAVE] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1206,7 +1206,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SPLASH] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1214,7 +1214,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ACID_ARMOR] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1222,7 +1222,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CRABHAMMER] = { { 0x2, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -1230,7 +1230,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_EXPLOSION] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -1238,7 +1238,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_FURY_SWIPES] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -1246,7 +1246,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BONEMERANG] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1254,7 +1254,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_REST] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1262,7 +1262,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ROCK_SLIDE] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1270,7 +1270,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HYPER_FANG] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1278,7 +1278,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SHARPEN] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1286,7 +1286,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CONVERSION] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -1294,7 +1294,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TRI_ATTACK] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1302,7 +1302,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SUPER_FANG] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x1, 0x0, 0x0, 0x0, 0x0}, @@ -1310,7 +1310,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SLASH] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1318,7 +1318,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SUBSTITUTE] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, @@ -1326,7 +1326,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_STRUGGLE] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1334,7 +1334,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SKETCH] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1342,7 +1342,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TRIPLE_KICK] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -1350,7 +1350,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_THIEF] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1358,7 +1358,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SPIDER_WEB] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, @@ -1366,7 +1366,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MIND_READER] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -1374,7 +1374,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_NIGHTMARE] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1382,7 +1382,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FLAME_WHEEL] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1390,7 +1390,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SNORE] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1398,7 +1398,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CURSE] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1406,7 +1406,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FLAIL] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1414,7 +1414,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CONVERSION_2] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -1422,7 +1422,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_AEROBLAST] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1430,7 +1430,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_COTTON_SPORE] = { { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, @@ -1438,7 +1438,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_REVERSAL] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, @@ -1446,7 +1446,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SPITE] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1454,7 +1454,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_POWDER_SNOW] = { { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -1462,7 +1462,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PROTECT] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1470,7 +1470,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MACH_PUNCH] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1478,7 +1478,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SCARY_FACE] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, @@ -1486,7 +1486,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FAINT_ATTACK] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1494,7 +1494,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SWEET_KISS] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1502,7 +1502,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BELLY_DRUM] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -1510,7 +1510,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SLUDGE_BOMB] = { { 0x2b, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1518,7 +1518,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MUD_SLAP] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1526,7 +1526,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_OCTAZOOKA] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x28, 0x0, 0x0, 0x0, 0x0}, @@ -1534,7 +1534,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SPIKES] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1542,7 +1542,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ZAP_CANNON] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -1550,7 +1550,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FORESIGHT] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x14, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1558,7 +1558,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DESTINY_BOND] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -1566,7 +1566,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PERISH_SONG] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1574,7 +1574,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ICY_WIND] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, @@ -1582,7 +1582,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DETECT] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1590,7 +1590,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BONE_RUSH] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1598,7 +1598,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_LOCK_ON] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1606,7 +1606,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_OUTRAGE] = { { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1614,7 +1614,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SANDSTORM] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1622,7 +1622,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_GIGA_DRAIN] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, @@ -1630,7 +1630,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ENDURE] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1638,7 +1638,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CHARM] = { { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1646,7 +1646,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ROLLOUT] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1654,7 +1654,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FALSE_SWIPE] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1662,7 +1662,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SWAGGER] = { { 0x2, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1670,7 +1670,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MILK_DRINK] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1678,7 +1678,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SPARK] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1686,7 +1686,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FURY_CUTTER] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -1694,7 +1694,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_STEEL_WING] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0xd, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1702,7 +1702,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MEAN_LOOK] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1710,7 +1710,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ATTRACT] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1718,7 +1718,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SLEEP_TALK] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1726,7 +1726,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HEAL_BELL] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0xa, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1734,7 +1734,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_RETURN] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1742,7 +1742,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PRESENT] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1750,7 +1750,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FRUSTRATION] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1758,7 +1758,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SAFEGUARD] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1766,7 +1766,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PAIN_SPLIT] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1774,7 +1774,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SACRED_FIRE] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -1782,7 +1782,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_MAGNITUDE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, @@ -1790,7 +1790,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DYNAMIC_PUNCH] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -1798,7 +1798,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MEGAHORN] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, @@ -1806,7 +1806,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DRAGON_BREATH] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, @@ -1814,7 +1814,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_BATON_PASS] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1822,7 +1822,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ENCORE] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1830,7 +1830,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PURSUIT] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1838,7 +1838,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_RAPID_SPIN] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, @@ -1846,7 +1846,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SWEET_SCENT] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1854,7 +1854,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_IRON_TAIL] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, @@ -1862,7 +1862,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_METAL_CLAW] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1870,7 +1870,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_VITAL_THROW] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -1878,7 +1878,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MORNING_SUN] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -1886,7 +1886,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SYNTHESIS] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, @@ -1894,7 +1894,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MOONLIGHT] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1902,7 +1902,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HIDDEN_POWER] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, @@ -1910,7 +1910,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CROSS_CHOP] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1918,7 +1918,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TWISTER] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1926,7 +1926,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_RAIN_DANCE] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1934,7 +1934,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SUNNY_DAY] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, @@ -1942,7 +1942,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CRUNCH] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1950,7 +1950,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MIRROR_COAT] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -1958,7 +1958,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_PSYCH_UP] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1966,7 +1966,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_EXTREME_SPEED] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -1974,7 +1974,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ANCIENT_POWER] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, @@ -1982,7 +1982,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_SHADOW_BALL] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1990,7 +1990,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FUTURE_SIGHT] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -1998,7 +1998,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ROCK_SMASH] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2006,7 +2006,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_WHIRLPOOL] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2014,7 +2014,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BEAT_UP] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2022,7 +2022,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FAKE_OUT] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2030,7 +2030,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_UPROAR] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2038,7 +2038,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_STOCKPILE] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x14, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2046,7 +2046,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SPIT_UP] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2054,7 +2054,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SWALLOW] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2062,7 +2062,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HEAT_WAVE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2070,7 +2070,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HAIL] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2078,7 +2078,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TORMENT] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2086,7 +2086,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FLATTER] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2094,7 +2094,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_WILL_O_WISP] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -2102,7 +2102,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MEMENTO] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -2110,7 +2110,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FACADE] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2118,7 +2118,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FOCUS_PUNCH] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -2126,7 +2126,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SMELLING_SALT] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -2134,7 +2134,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FOLLOW_ME] = { { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -2142,7 +2142,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_NATURE_POWER] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, @@ -2150,7 +2150,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CHARGE] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2158,7 +2158,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TAUNT] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2166,7 +2166,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HELPING_HAND] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -2174,7 +2174,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TRICK] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2182,7 +2182,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ROLE_PLAY] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2190,7 +2190,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_WISH] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2198,7 +2198,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ASSIST] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2206,7 +2206,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_INGRAIN] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2214,7 +2214,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SUPERPOWER] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, @@ -2222,7 +2222,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MAGIC_COAT] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -2230,7 +2230,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_RECYCLE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, @@ -2238,7 +2238,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_REVENGE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2246,7 +2246,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BRICK_BREAK] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2254,7 +2254,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_YAWN] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2262,7 +2262,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_KNOCK_OFF] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2270,7 +2270,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ENDEAVOR] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -2278,7 +2278,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ERUPTION] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, @@ -2286,7 +2286,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SKILL_SWAP] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2294,7 +2294,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_IMPRISON] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -2302,7 +2302,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_REFRESH] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2310,7 +2310,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_GRUDGE] = { { 0x2b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2318,7 +2318,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SNATCH] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2326,7 +2326,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SECRET_POWER] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, @@ -2334,7 +2334,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DIVE] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2342,7 +2342,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ARM_THRUST] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2350,7 +2350,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CAMOUFLAGE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -2358,7 +2358,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TAIL_GLOW] = { { 0x4, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2366,7 +2366,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_LUSTER_PURGE] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, @@ -2374,7 +2374,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MIST_BALL] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2382,7 +2382,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FEATHER_DANCE] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -2390,7 +2390,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TEETER_DANCE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -2398,7 +2398,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BLAZE_KICK] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2406,7 +2406,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MUD_SPORT] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -2414,7 +2414,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ICE_BALL] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2422,7 +2422,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_NEEDLE_ARM] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, @@ -2430,7 +2430,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SLACK_OFF] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2438,7 +2438,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HYPER_VOICE] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x1e, 0x0, 0x0, 0x0, 0x0}, @@ -2446,7 +2446,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_POISON_FANG] = { { 0x1e, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -2454,7 +2454,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CRUSH_CLAW] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2462,7 +2462,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BLAST_BURN] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -2470,7 +2470,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HYDRO_CANNON] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -2478,7 +2478,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_METEOR_MASH] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -2486,7 +2486,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0} }, - { + [MOVE_ASTONISH] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -2494,7 +2494,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_WEATHER_BALL] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -2502,7 +2502,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_AROMATHERAPY] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -2510,7 +2510,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0} }, - { + [MOVE_FAKE_TEARS] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2518,7 +2518,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_AIR_CUTTER] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -2526,7 +2526,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_OVERHEAT] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -2534,7 +2534,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ODOR_SLEUTH] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, @@ -2542,7 +2542,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ROCK_TOMB] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2550,7 +2550,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SILVER_WIND] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, @@ -2558,7 +2558,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_METAL_SOUND] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, @@ -2566,7 +2566,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_GRASS_WHISTLE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, @@ -2574,7 +2574,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_TICKLE] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2582,7 +2582,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_COSMIC_POWER] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, @@ -2590,7 +2590,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_WATER_SPOUT] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, @@ -2598,7 +2598,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SIGNAL_BEAM] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -2606,7 +2606,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SHADOW_PUNCH] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -2614,7 +2614,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_EXTRASENSORY] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, @@ -2622,7 +2622,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_SKY_UPPERCUT] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -2630,7 +2630,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SAND_TOMB] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2638,7 +2638,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SHEER_COLD] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -2646,7 +2646,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MUDDY_WATER] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -2654,7 +2654,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BULLET_SEED] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -2662,7 +2662,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_AERIAL_ACE] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -2670,7 +2670,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ICICLE_SPEAR] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -2678,7 +2678,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_IRON_DEFENSE] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -2686,7 +2686,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BLOCK] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2694,7 +2694,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_HOWL] = { { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2702,7 +2702,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DRAGON_CLAW] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, @@ -2710,7 +2710,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_FRENZY_PLANT] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -2718,7 +2718,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BULK_UP] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2726,7 +2726,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_BOUNCE] = { { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2734,7 +2734,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MUD_SHOT] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2742,7 +2742,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_POISON_TAIL] = { { 0x1e, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, @@ -2750,7 +2750,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_COVET] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2758,7 +2758,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_VOLT_TACKLE] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -2766,7 +2766,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_MAGICAL_LEAF] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, @@ -2774,7 +2774,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_WATER_SPORT] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, @@ -2782,7 +2782,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_CALM_MIND] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2790,7 +2790,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_LEAF_BLADE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2798,7 +2798,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DRAGON_DANCE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -2806,7 +2806,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_ROCK_BLAST] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2814,7 +2814,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_SHOCK_WAVE] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2822,7 +2822,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_WATER_PULSE] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -2830,7 +2830,7 @@ const struct BardSound gBardSounds_Moves[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [MOVE_DOOM_DESIRE] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -2838,7 +2838,7 @@ const struct BardSound gBardSounds_Moves[][6] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [MOVE_PSYCHO_BOOST] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, diff --git a/src/data/bard_music/pokemon.h b/src/data/bard_music/pokemon.h index 5ccf2f830..294cd4078 100644 --- a/src/data/bard_music/pokemon.h +++ b/src/data/bard_music/pokemon.h @@ -1,10 +1,10 @@ #ifndef GUARD_DATA_BARD_MUSIC_POKEMON_H #define GUARD_DATA_BARD_MUSIC_POKEMON_H -const u16 gNumSpeciesNames = NUM_SPECIES; +const u16 gNumBardWords_Species = NUM_SPECIES; -const struct BardSound gBardSounds_Pokemon[][6] = { - { +const struct BardSound gBardSounds_Pokemon[NUM_SPECIES][6] = { + [SPECIES_NONE] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -12,7 +12,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BULBASAUR] = { { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -20,7 +20,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_IVYSAUR] = { { 0x14, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, @@ -28,7 +28,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_VENUSAUR] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -36,7 +36,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CHARMANDER] = { { 0x6, 0x0, 0x0, 0x0, 0x0}, { 0x2, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, @@ -44,7 +44,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CHARMELEON] = { { 0x6, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -52,7 +52,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [SPECIES_CHARIZARD] = { { 0x6, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, @@ -60,7 +60,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [SPECIES_SQUIRTLE] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -68,7 +68,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WARTORTLE] = { { 0x8, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, @@ -76,7 +76,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BLASTOISE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1e, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -84,7 +84,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CATERPIE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -92,7 +92,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_METAPOD] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, @@ -100,7 +100,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BUTTERFREE] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -108,7 +108,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WEEDLE] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x26, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -116,7 +116,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_KAKUNA] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -124,7 +124,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BEEDRILL] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -132,7 +132,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PIDGEY] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -140,7 +140,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PIDGEOTTO] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -148,7 +148,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PIDGEOT] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, @@ -156,7 +156,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_RATTATA] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -164,7 +164,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_RATICATE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, @@ -172,7 +172,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SPEAROW] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -180,7 +180,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_FEAROW] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -188,7 +188,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_EKANS] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -196,7 +196,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ARBOK] = { { 0x6, 0x0, 0x0, 0x0, 0x0}, { 0x17, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -204,7 +204,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PIKACHU] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, @@ -212,7 +212,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_RAICHU] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -220,7 +220,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SANDSHREW] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -228,7 +228,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SANDSLASH] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -236,7 +236,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NIDORAN_F] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -244,7 +244,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NIDORINA] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -252,7 +252,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NIDOQUEEN] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -260,7 +260,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NIDORAN_M] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -268,7 +268,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NIDORINO] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -276,7 +276,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NIDOKING] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -284,7 +284,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CLEFAIRY] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -292,7 +292,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CLEFABLE] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, @@ -300,7 +300,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_VULPIX] = { { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -308,7 +308,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NINETALES] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -316,7 +316,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_JIGGLYPUFF] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -324,7 +324,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [SPECIES_WIGGLYTUFF] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -332,7 +332,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [SPECIES_ZUBAT] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -340,7 +340,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GOLBAT] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -348,7 +348,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ODDISH] = { { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -356,7 +356,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GLOOM] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -364,7 +364,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_VILEPLUME] = { { 0x14, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -372,7 +372,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PARAS] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -380,7 +380,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PARASECT] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, @@ -388,7 +388,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_VENONAT] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -396,7 +396,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_VENOMOTH] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, @@ -404,7 +404,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DIGLETT] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -412,7 +412,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DUGTRIO] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -420,7 +420,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MEOWTH] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -428,7 +428,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PERSIAN] = { { 0x32, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -436,7 +436,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PSYDUCK] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -444,7 +444,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GOLDUCK] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -452,7 +452,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MANKEY] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -460,7 +460,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PRIMEAPE] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -468,7 +468,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GROWLITHE] = { { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -476,7 +476,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ARCANINE] = { { 0x6, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -484,7 +484,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_POLIWAG] = { { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -492,7 +492,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_POLIWHIRL] = { { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -500,7 +500,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_POLIWRATH] = { { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -508,7 +508,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ABRA] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -516,7 +516,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_KADABRA] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -524,7 +524,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ALAKAZAM] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -532,7 +532,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MACHOP] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -540,7 +540,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MACHOKE] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -548,7 +548,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MACHAMP] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -556,7 +556,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BELLSPROUT] = { { 0xb, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -564,7 +564,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WEEPINBELL] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, @@ -572,7 +572,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_VICTREEBEL] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, @@ -580,7 +580,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TENTACOOL] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, @@ -588,7 +588,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TENTACRUEL] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, @@ -596,7 +596,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GEODUDE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, @@ -604,7 +604,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GRAVELER] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -612,7 +612,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GOLEM] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -620,7 +620,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PONYTA] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -628,7 +628,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_RAPIDASH] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -636,7 +636,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SLOWPOKE] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -644,7 +644,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SLOWBRO] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -652,7 +652,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MAGNEMITE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -660,7 +660,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MAGNETON] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -668,7 +668,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_FARFETCHD] = { { 0x6, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -676,7 +676,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DODUO] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -684,7 +684,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DODRIO] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -692,7 +692,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SEEL] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -700,7 +700,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DEWGONG] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -708,7 +708,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GRIMER] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -716,7 +716,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MUK] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -724,7 +724,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SHELLDER] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -732,7 +732,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CLOYSTER] = { { 0x1e, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -740,7 +740,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GASTLY] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -748,7 +748,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HAUNTER] = { { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -756,7 +756,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GENGAR] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x8, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -764,7 +764,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ONIX] = { { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -772,7 +772,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DROWZEE] = { { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -780,7 +780,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HYPNO] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -788,7 +788,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_KRABBY] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -796,7 +796,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_KINGLER] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -804,7 +804,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_VOLTORB] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -812,7 +812,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ELECTRODE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -820,7 +820,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_EXEGGCUTE] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, @@ -828,7 +828,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_EXEGGUTOR] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, @@ -836,7 +836,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [SPECIES_CUBONE] = { { 0x2d, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -844,7 +844,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MAROWAK] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -852,7 +852,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HITMONLEE] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -860,7 +860,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HITMONCHAN] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -868,7 +868,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LICKITUNG] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -876,7 +876,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_KOFFING] = { { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -884,7 +884,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WEEZING] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -892,7 +892,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_RHYHORN] = { { 0x14, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -900,7 +900,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_RHYDON] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -908,7 +908,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CHANSEY] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -916,7 +916,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TANGELA] = { { 0x2, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -924,7 +924,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_KANGASKHAN] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -932,7 +932,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HORSEA] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -940,7 +940,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SEADRA] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -948,7 +948,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GOLDEEN] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -956,7 +956,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SEAKING] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -964,7 +964,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_STARYU] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -972,7 +972,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_STARMIE] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -980,7 +980,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MR_MIME] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -988,7 +988,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SCYTHER] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -996,7 +996,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_JYNX] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1004,7 +1004,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ELECTABUZZ] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -1012,7 +1012,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MAGMAR] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1020,7 +1020,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PINSIR] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1028,7 +1028,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TAUROS] = { { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1036,7 +1036,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MAGIKARP] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1044,7 +1044,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GYARADOS] = { { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -1052,7 +1052,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LAPRAS] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1060,7 +1060,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DITTO] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1068,7 +1068,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_EEVEE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1076,7 +1076,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_VAPOREON] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -1084,7 +1084,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_JOLTEON] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, @@ -1092,7 +1092,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_FLAREON] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, @@ -1100,7 +1100,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PORYGON] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, @@ -1108,7 +1108,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OMANYTE] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -1116,7 +1116,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OMASTAR] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, @@ -1124,7 +1124,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_KABUTO] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, @@ -1132,7 +1132,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_KABUTOPS] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, @@ -1140,7 +1140,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_AERODACTYL] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1148,7 +1148,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SNORLAX] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1156,7 +1156,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ARTICUNO] = { { 0x6, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, @@ -1164,7 +1164,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ZAPDOS] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1172,7 +1172,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MOLTRES] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1180,7 +1180,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DRATINI] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -1188,7 +1188,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DRAGONAIR] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, @@ -1196,7 +1196,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DRAGONITE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -1204,7 +1204,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MEWTWO] = { { 0x2d, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND, @@ -1212,7 +1212,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MEW] = { { 0x2d, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -1220,7 +1220,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CHIKORITA] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -1228,7 +1228,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BAYLEEF] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1236,7 +1236,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MEGANIUM] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -1244,7 +1244,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CYNDAQUIL] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, @@ -1252,7 +1252,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_QUILAVA] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x6, 0x0, 0x0, 0x0, 0x0}, { 0x8, 0x0, 0x0, 0x0, 0x0}, @@ -1260,7 +1260,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TYPHLOSION] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1268,7 +1268,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { { 0x33, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [SPECIES_TOTODILE] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -1276,7 +1276,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CROCONAW] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1284,7 +1284,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_FERALIGATR] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, @@ -1292,7 +1292,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, NULL_BARD_SOUND }, - { + [SPECIES_SENTRET] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1300,7 +1300,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_FURRET] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1308,7 +1308,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HOOTHOOT] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1316,7 +1316,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NOCTOWL] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1324,7 +1324,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LEDYBA] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -1332,7 +1332,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LEDIAN] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1340,7 +1340,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SPINARAK] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -1348,7 +1348,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ARIADOS] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -1356,7 +1356,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CROBAT] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1364,7 +1364,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CHINCHOU] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1372,7 +1372,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LANTURN] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1380,7 +1380,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PICHU] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1388,7 +1388,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CLEFFA] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1396,7 +1396,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_IGGLYBUFF] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -1404,7 +1404,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TOGEPI] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -1412,7 +1412,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TOGETIC] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -1420,7 +1420,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NATU] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1428,7 +1428,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_XATU] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1436,7 +1436,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MAREEP] = { { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1444,7 +1444,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_FLAAFFY] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1452,7 +1452,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_AMPHAROS] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x6, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -1460,7 +1460,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BELLOSSOM] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -1468,7 +1468,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MARILL] = { { 0x8, 0x0, 0x0, 0x0, 0x0}, { 0x10, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1476,7 +1476,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_AZUMARILL] = { { 0x8, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -1484,7 +1484,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SUDOWOODO] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, @@ -1492,7 +1492,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_POLITOED] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -1500,7 +1500,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HOPPIP] = { { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1508,7 +1508,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SKIPLOOM] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1516,7 +1516,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_JUMPLUFF] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1524,7 +1524,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_AIPOM] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1532,7 +1532,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SUNKERN] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1540,7 +1540,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SUNFLORA] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -1548,7 +1548,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_YANMA] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1556,7 +1556,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WOOPER] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1564,7 +1564,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_QUAGSIRE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, @@ -1572,7 +1572,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ESPEON] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1580,7 +1580,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_UMBREON] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1588,7 +1588,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MURKROW] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1596,7 +1596,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SLOWKING] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1604,7 +1604,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MISDREAVUS] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, @@ -1612,7 +1612,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_UNOWN] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1620,7 +1620,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WOBBUFFET] = { { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, @@ -1628,7 +1628,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GIRAFARIG] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -1636,7 +1636,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PINECO] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1644,7 +1644,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_FORRETRESS] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, @@ -1652,7 +1652,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DUNSPARCE] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x1c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1660,7 +1660,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GLIGAR] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1668,7 +1668,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_STEELIX] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1676,7 +1676,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SNUBBULL] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1684,7 +1684,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GRANBULL] = { { 0x2, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1692,7 +1692,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_QWILFISH] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1700,7 +1700,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SCIZOR] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1708,7 +1708,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SHUCKLE] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x26, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1716,7 +1716,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HERACROSS] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1724,7 +1724,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SNEASEL] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x26, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1732,7 +1732,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TEDDIURSA] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -1740,7 +1740,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_URSARING] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -1748,7 +1748,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SLUGMA] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1756,7 +1756,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MAGCARGO] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -1764,7 +1764,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SWINUB] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1772,7 +1772,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PILOSWINE] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -1780,7 +1780,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CORSOLA] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -1788,7 +1788,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_REMORAID] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, @@ -1796,7 +1796,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OCTILLERY] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -1804,7 +1804,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DELIBIRD] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -1812,7 +1812,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MANTINE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1820,7 +1820,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SKARMORY] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -1828,7 +1828,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HOUNDOUR] = { { 0x23, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1836,7 +1836,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HOUNDOOM] = { { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1844,7 +1844,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_KINGDRA] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1852,7 +1852,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PHANPY] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1860,7 +1860,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DONPHAN] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1868,7 +1868,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PORYGON2] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1876,7 +1876,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_STANTLER] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1884,7 +1884,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SMEARGLE] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x26, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1892,7 +1892,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TYROGUE] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1900,7 +1900,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HITMONTOP] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, @@ -1908,7 +1908,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SMOOCHUM] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1916,7 +1916,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ELEKID] = { { 0xb, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -1924,7 +1924,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MAGBY] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1932,7 +1932,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MILTANK] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1940,7 +1940,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BLISSEY] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1948,7 +1948,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_RAIKOU] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1956,7 +1956,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ENTEI] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1964,7 +1964,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SUICUNE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -1972,7 +1972,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LARVITAR] = { { 0x15, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x15, 0x0, 0x0, 0x0, 0x0}, @@ -1980,7 +1980,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PUPITAR] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -1988,7 +1988,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TYRANITAR] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -1996,7 +1996,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LUGIA] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -2004,7 +2004,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HO_OH] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2012,7 +2012,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CELEBI] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -2020,7 +2020,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_B] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2028,7 +2028,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_C] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2036,7 +2036,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_D] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2044,7 +2044,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_E] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2052,7 +2052,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_F] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2060,7 +2060,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_G] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2068,7 +2068,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_H] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2076,7 +2076,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_I] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2084,7 +2084,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_J] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2092,7 +2092,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_K] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2100,7 +2100,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_L] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2108,7 +2108,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_M] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2116,7 +2116,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_N] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2124,7 +2124,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_O] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2132,7 +2132,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_P] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2140,7 +2140,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_Q] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2148,7 +2148,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_R] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2156,7 +2156,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_S] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2164,7 +2164,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_T] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2172,7 +2172,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_U] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2180,7 +2180,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_V] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2188,7 +2188,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_W] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2196,7 +2196,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_X] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2204,7 +2204,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_Y] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2212,7 +2212,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_OLD_UNOWN_Z] = { NULL_BARD_SOUND, NULL_BARD_SOUND, NULL_BARD_SOUND, @@ -2220,7 +2220,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TREECKO] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2228,7 +2228,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GROVYLE] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2236,7 +2236,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SCEPTILE] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2244,7 +2244,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TORCHIC] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2252,7 +2252,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_COMBUSKEN] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, @@ -2260,7 +2260,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BLAZIKEN] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, @@ -2268,7 +2268,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MUDKIP] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2276,7 +2276,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MARSHTOMP] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2284,7 +2284,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SWAMPERT] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2292,7 +2292,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_POOCHYENA] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, @@ -2300,7 +2300,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MIGHTYENA] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, @@ -2308,7 +2308,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ZIGZAGOON] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, @@ -2316,7 +2316,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LINOONE] = { { 0x14, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2324,7 +2324,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WURMPLE] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2332,7 +2332,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SILCOON] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x28, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2340,7 +2340,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BEAUTIFLY] = { { 0x2d, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -2348,7 +2348,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CASCOON] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2356,7 +2356,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DUSTOX] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x17, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2364,7 +2364,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LOTAD] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2372,7 +2372,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LOMBRE] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2380,7 +2380,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LUDICOLO] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, @@ -2388,7 +2388,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SEEDOT] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2396,7 +2396,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NUZLEAF] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2404,7 +2404,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SHIFTRY] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2412,7 +2412,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NINCADA] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x6, 0x0, 0x0, 0x0, 0x0}, { 0x6, 0x0, 0x0, 0x0, 0x0}, @@ -2420,7 +2420,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NINJASK] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2428,7 +2428,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SHEDINJA] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -2436,7 +2436,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TAILLOW] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2444,7 +2444,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SWELLOW] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2452,7 +2452,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SHROOMISH] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2460,7 +2460,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BRELOOM] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2468,7 +2468,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SPINDA] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2476,7 +2476,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WINGULL] = { { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2484,7 +2484,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PELIPPER] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -2492,7 +2492,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SURSKIT] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2500,7 +2500,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MASQUERAIN] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, @@ -2508,7 +2508,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WAILMER] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2516,7 +2516,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WAILORD] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2524,7 +2524,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SKITTY] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2532,7 +2532,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DELCATTY] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -2540,7 +2540,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_KECLEON] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -2548,7 +2548,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BALTOY] = { { 0x1, 0x0, 0x0, 0x0, 0x0}, { 0x1e, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2556,7 +2556,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CLAYDOL] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2564,7 +2564,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NOSEPASS] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2572,7 +2572,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TORKOAL] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2580,7 +2580,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SABLEYE] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -2588,7 +2588,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BARBOACH] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2596,7 +2596,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WHISCASH] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2604,7 +2604,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LUVDISC] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2612,7 +2612,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CORPHISH] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2620,7 +2620,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CRAWDAUNT] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2628,7 +2628,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_FEEBAS] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2636,7 +2636,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MILOTIC] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -2644,7 +2644,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CARVANHA] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -2652,7 +2652,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SHARPEDO] = { { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -2660,7 +2660,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TRAPINCH] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2668,7 +2668,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_VIBRAVA] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -2676,7 +2676,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_FLYGON] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2684,7 +2684,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MAKUHITA] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -2692,7 +2692,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HARIYAMA] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -2700,7 +2700,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ELECTRIKE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -2708,7 +2708,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MANECTRIC] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -2716,7 +2716,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_NUMEL] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0xb, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2724,7 +2724,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CAMERUPT] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -2732,7 +2732,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SPHEAL] = { { 0xe, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2740,7 +2740,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SEALEO] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -2748,7 +2748,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WALREIN] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2756,7 +2756,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CACNEA] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -2764,7 +2764,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CACTURNE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2772,7 +2772,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SNORUNT] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2780,7 +2780,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GLALIE] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2788,7 +2788,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LUNATONE] = { { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -2796,7 +2796,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SOLROCK] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2804,7 +2804,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_AZURILL] = { { 0x6, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, @@ -2812,7 +2812,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SPOINK] = { { 0x1e, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2820,7 +2820,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GRUMPIG] = { { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2828,7 +2828,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_PLUSLE] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2836,7 +2836,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MINUN] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2844,7 +2844,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MAWILE] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2852,7 +2852,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MEDITITE] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -2860,7 +2860,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_MEDICHAM] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -2868,7 +2868,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SWABLU] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2876,7 +2876,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ALTARIA] = { { 0x6, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -2884,7 +2884,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WYNAUT] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2892,7 +2892,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DUSKULL] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x26, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2900,7 +2900,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DUSCLOPS] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2908,7 +2908,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ROSELIA] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -2916,7 +2916,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SLAKOTH] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2924,7 +2924,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_VIGOROTH] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -2932,7 +2932,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SLAKING] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2940,7 +2940,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GULPIN] = { { 0x24, 0x0, 0x0, 0x0, 0x0}, { 0xf, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2948,7 +2948,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SWALOT] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2956,7 +2956,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_TROPIUS] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -2964,7 +2964,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_WHISMUR] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2972,7 +2972,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LOUDRED] = { { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2980,7 +2980,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_EXPLOUD] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2988,7 +2988,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CLAMPERL] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x32, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -2996,7 +2996,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_HUNTAIL] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3004,7 +3004,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GOREBYSS] = { { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x2c, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -3012,7 +3012,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ABSOL] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3020,7 +3020,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SHUPPET] = { { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3028,7 +3028,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BANETTE] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3036,7 +3036,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SEVIPER] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -3044,7 +3044,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ZANGOOSE] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3052,7 +3052,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_RELICANTH] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -3060,7 +3060,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ARON] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1d, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3068,7 +3068,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LAIRON] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3076,7 +3076,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_AGGRON] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3084,7 +3084,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CASTFORM] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x1a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3092,7 +3092,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_VOLBEAT] = { { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3100,7 +3100,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ILLUMISE] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x27, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -3108,7 +3108,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LILEEP] = { { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3116,7 +3116,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CRADILY] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -3124,7 +3124,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ANORITH] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -3132,7 +3132,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_ARMALDO] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -3140,7 +3140,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_RALTS] = { { 0x7, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3148,7 +3148,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_KIRLIA] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -3156,7 +3156,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GARDEVOIR] = { { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -3164,7 +3164,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BAGON] = { { 0x5, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3172,7 +3172,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SHELGON] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3180,7 +3180,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_SALAMENCE] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, @@ -3188,7 +3188,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_BELDUM] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3196,7 +3196,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_METANG] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3204,7 +3204,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_METAGROSS] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -3212,7 +3212,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_REGIROCK] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, @@ -3220,7 +3220,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_REGICE] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x12, 0x0, 0x0, 0x0, 0x0}, @@ -3228,7 +3228,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_REGISTEEL] = { { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0xe, 0x0, 0x0, 0x0, 0x0}, @@ -3236,7 +3236,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_KYOGRE] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, { 0x30, 0x0, 0x0, 0x0, 0x0}, @@ -3244,7 +3244,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_GROUDON] = { { 0x21, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x33, 0x0, 0x0, 0x0, 0x0}, @@ -3252,7 +3252,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_RAYQUAZA] = { { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x3, 0x0, 0x0, 0x0, 0x0}, { 0x2a, 0x0, 0x0, 0x0, 0x0}, @@ -3260,7 +3260,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LATIAS] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x0, 0x0, 0x0, 0x0, 0x0}, @@ -3268,7 +3268,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_LATIOS] = { { 0x0, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, @@ -3276,7 +3276,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_JIRACHI] = { { 0x30, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0xc, 0x0, 0x0, 0x0, 0x0}, @@ -3284,7 +3284,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_DEOXYS] = { { 0xc, 0x0, 0x0, 0x0, 0x0}, { 0x1b, 0x0, 0x0, 0x0, 0x0}, { 0x11, 0x0, 0x0, 0x0, 0x0}, @@ -3292,7 +3292,7 @@ const struct BardSound gBardSounds_Pokemon[][6] = { NULL_BARD_SOUND, NULL_BARD_SOUND }, - { + [SPECIES_CHIMECHO] = { { 0x12, 0x0, 0x0, 0x0, 0x0}, { 0x9, 0x0, 0x0, 0x0, 0x0}, { 0x18, 0x0, 0x0, 0x0, 0x0}, diff --git a/src/data/bard_music/word_pitch.h b/src/data/bard_music/word_pitch.h index 54a87acc9..35527017c 100644 --- a/src/data/bard_music/word_pitch.h +++ b/src/data/bard_music/word_pitch.h @@ -1,182 +1,186 @@ #ifndef GUARD_WORD_PITCH_H #define GUARD_WORD_PITCH_H -const s16 gUnknown_0860A1C0[] = { - -0x300, 0x1800 +#define PITCH_END 0x1800 + +static const s16 sPitch1_0[] = { + -0x300, PITCH_END }; -const s16 gUnknown_0860A1C4[] = { - 0x0900, 0x1800 +static const s16 sPitch1_1[] = { + 0x0900, PITCH_END }; -const s16 gUnknown_0860A1C8[] = { - 0x0100, 0x1800 +static const s16 sPitch1_2[] = { + 0x0100, PITCH_END }; -const s16 gUnknown_0860A1CC[] = { - 0x0400, 0x1800 +static const s16 sPitch1_3[] = { + 0x0400, PITCH_END }; -const s16 gUnknown_0860A1D0[] = { - 0x0b00, 0x1800 +static const s16 sPitch1_4[] = { + 0x0b00, PITCH_END }; -const s16 gUnknown_0860A1D4[] = { - -0x300, -0x100, 0x1800 +static const s16 sPitch2_0[] = { + -0x300, -0x100, PITCH_END }; -const s16 gUnknown_0860A1DA[] = { - -0x300, 0x0200, 0x1800 +static const s16 sPitch2_1[] = { + -0x300, 0x0200, PITCH_END }; -const s16 gUnknown_0860A1E0[] = { - 0x0200, 0x0400, 0x1800 +static const s16 sPitch2_2[] = { + 0x0200, 0x0400, PITCH_END }; -const s16 gUnknown_0860A1E6[] = { - 0x0600, 0x0800, 0x1800 +static const s16 sPitch2_3[] = { + 0x0600, 0x0800, PITCH_END }; -const s16 gUnknown_0860A1EC[] = { - 0x0900, 0x0800, 0x1800 +static const s16 sPitch2_4[] = { + 0x0900, 0x0800, PITCH_END }; -const s16 gUnknown_0860A1F2[] = { - -0x300, -0x100, -0x300, 0x1800 +static const s16 sPitch3_0[] = { + -0x300, -0x100, -0x300, PITCH_END }; -const s16 gUnknown_0860A1FA[] = { - 0x0400, -0x300, 0x0400, 0x1800 +static const s16 sPitch3_1[] = { + 0x0400, -0x300, 0x0400, PITCH_END }; -const s16 gUnknown_0860A202[] = { - 0x0900, 0x0800, 0x0600, 0x1800 +static const s16 sPitch3_2[] = { + 0x0900, 0x0800, 0x0600, PITCH_END }; -const s16 gUnknown_0860A20A[] = { - 0x0100, 0x0200, 0x0400, 0x1800 +static const s16 sPitch3_3[] = { + 0x0100, 0x0200, 0x0400, PITCH_END }; -const s16 gUnknown_0860A212[] = { - 0x0600, 0x1000, 0x0d00, 0x1800 +static const s16 sPitch3_4[] = { + 0x0600, 0x1000, 0x0d00, PITCH_END }; -const s16 gUnknown_0860A21A[] = { - 0x0400, 0x0900, 0x0400, 0x0900, 0x1800 +static const s16 sPitch4_0[] = { + 0x0400, 0x0900, 0x0400, 0x0900, PITCH_END }; -const s16 gUnknown_0860A224[] = { - 0x0900, 0x0400, 0x0d00, 0x0400, 0x1800 +static const s16 sPitch4_1[] = { + 0x0900, 0x0400, 0x0d00, 0x0400, PITCH_END }; -const s16 gUnknown_0860A22E[] = { - 0x0100, 0x0200, 0x0400, 0x0600, 0x1800 +static const s16 sPitch4_2[] = { + 0x0100, 0x0200, 0x0400, 0x0600, PITCH_END }; -const s16 gUnknown_0860A238[] = { - 0x0800, 0x0600, 0x0400, 0x0200, 0x1800 +static const s16 sPitch4_3[] = { + 0x0800, 0x0600, 0x0400, 0x0200, PITCH_END }; -const s16 gUnknown_0860A242[] = { - 0x0f00, 0x0d00, 0x0b00, 0x0a00, 0x1800 +static const s16 sPitch4_4[] = { + 0x0f00, 0x0d00, 0x0b00, 0x0a00, PITCH_END }; -const s16 gUnknown_0860A24C[] = { - -0x300, -0x100, 0x0100, 0x0200, 0x0400, 0x1800 +static const s16 sPitch5_0[] = { + -0x300, -0x100, 0x0100, 0x0200, 0x0400, PITCH_END }; -const s16 gUnknown_0860A258[] = { - 0x0900, 0x0800, 0x0600, 0x0400, 0x0200, 0x1800 +static const s16 sPitch5_1[] = { + 0x0900, 0x0800, 0x0600, 0x0400, 0x0200, PITCH_END }; -const s16 gUnknown_0860A264[] = { - 0x0100, 0x0400, 0x0900, 0x0400, 0x0100, 0x1800 +static const s16 sPitch5_2[] = { + 0x0100, 0x0400, 0x0900, 0x0400, 0x0100, PITCH_END }; -const s16 gUnknown_0860A270[] = { - 0x0900, 0x0400, 0x0900, 0x0400, -0x300, 0x1800 +static const s16 sPitch5_3[] = { + 0x0900, 0x0400, 0x0900, 0x0400, -0x300, PITCH_END }; -const s16 gUnknown_0860A27C[] = { - 0x0b00, 0x0800, 0x0400, 0x0400, 0x0600, 0x1800 +static const s16 sPitch5_4[] = { + 0x0b00, 0x0800, 0x0400, 0x0400, 0x0600, PITCH_END }; -const s16 gUnknown_0860A288[] = { - -0x300, -0x100, 0x0100, 0x0200, 0x0400, 0x0600, 0x1800 +static const s16 sPitch6_0[] = { + -0x300, -0x100, 0x0100, 0x0200, 0x0400, 0x0600, PITCH_END }; -const s16 gUnknown_0860A296[] = { - 0x0800, 0x0600, 0x0400, 0x0200, 0x0100, -0x100, 0x1800 +static const s16 sPitch6_1[] = { + 0x0800, 0x0600, 0x0400, 0x0200, 0x0100, -0x100, PITCH_END }; -const s16 gUnknown_0860A2A4[] = { - 0x0100, 0x0200, 0x0400, 0x0100, 0x0200, 0x1000, 0x1800 +static const s16 sPitch6_2[] = { + 0x0100, 0x0200, 0x0400, 0x0100, 0x0200, 0x1000, PITCH_END }; -const s16 gUnknown_0860A2B2[] = { - 0x0400, -0x300, 0x0900, 0x0400, 0x0900, 0x0400, 0x1800 +static const s16 sPitch6_3[] = { + 0x0400, -0x300, 0x0900, 0x0400, 0x0900, 0x0400, PITCH_END }; -const s16 gUnknown_0860A2C0[] = { - 0x0800, 0x0900, 0x0800, 0x0900, 0x0800, 0x0900, 0x1800 +static const s16 sPitch6_4[] = { + 0x0800, 0x0900, 0x0800, 0x0900, 0x0800, 0x0900, PITCH_END }; -const s16 gUnknown_0860A2CE[] = { - 0x0200, 0x0100, 0x0200, 0x0100, 0x0200, 0x0400, 0x0200, 0x1800 +static const s16 sPitch7_0[] = { + 0x0200, 0x0100, 0x0200, 0x0100, 0x0200, 0x0400, 0x0200, PITCH_END }; -const s16 gUnknown_0860A2DE[] = { - 0x0100, 0x0100, -0x100, -0x100, -0x300, 0x0400, -0x300, 0x1800 +static const s16 sPitch7_1[] = { + 0x0100, 0x0100, -0x100, -0x100, -0x300, 0x0400, -0x300, PITCH_END }; -const s16 gUnknown_0860A2EE[] = { - 0x0800, 0x0900, 0x0b00, 0x0d00, 0x0e00, 0x0d00, 0x0b00, 0x1800 +static const s16 sPitch7_2[] = { + 0x0800, 0x0900, 0x0b00, 0x0d00, 0x0e00, 0x0d00, 0x0b00, PITCH_END }; -const s16 gUnknown_0860A2FE[] = { - 0x0800, 0x0600, 0x0400, 0x0200, 0x0d00, 0x0b00, 0x0900, 0x1800 +static const s16 sPitch7_3[] = { + 0x0800, 0x0600, 0x0400, 0x0200, 0x0d00, 0x0b00, 0x0900, PITCH_END }; -const s16 gUnknown_0860A30E[] = { - 0x0300, 0x0400, 0x0600, 0x0800, 0x0700, 0x0800, 0x0400, 0x1800 +static const s16 sPitch7_4[] = { + 0x0300, 0x0400, 0x0600, 0x0800, 0x0700, 0x0800, 0x0400, PITCH_END }; -const s16 *const gBardSoundPitchTables[] = { - gUnknown_0860A1C0, - gUnknown_0860A1C4, - gUnknown_0860A1C8, - gUnknown_0860A1CC, - gUnknown_0860A1D0, - gUnknown_0860A1D4, - gUnknown_0860A1DA, - gUnknown_0860A1E0, - gUnknown_0860A1E6, - gUnknown_0860A1EC, - gUnknown_0860A1F2, - gUnknown_0860A1FA, - gUnknown_0860A202, - gUnknown_0860A20A, - gUnknown_0860A212, - gUnknown_0860A21A, - gUnknown_0860A224, - gUnknown_0860A22E, - gUnknown_0860A238, - gUnknown_0860A242, - gUnknown_0860A24C, - gUnknown_0860A258, - gUnknown_0860A264, - gUnknown_0860A270, - gUnknown_0860A27C, - gUnknown_0860A288, - gUnknown_0860A296, - gUnknown_0860A2A4, - gUnknown_0860A2B2, - gUnknown_0860A2C0, - gUnknown_0860A2CE, - gUnknown_0860A2DE, - gUnknown_0860A2EE, - gUnknown_0860A2FE, - gUnknown_0860A30E +// Only sPitch7_# are used below +// This table is always indexed with (x + 30), where x is some value 0 - 4 +static const s16 *const sBardSoundPitchTables[] = { + sPitch1_0, + sPitch1_1, + sPitch1_2, + sPitch1_3, + sPitch1_4, + sPitch2_0, + sPitch2_1, + sPitch2_2, + sPitch2_3, + sPitch2_4, + sPitch3_0, + sPitch3_1, + sPitch3_2, + sPitch3_3, + sPitch3_4, + sPitch4_0, + sPitch4_1, + sPitch4_2, + sPitch4_3, + sPitch4_4, + sPitch5_0, + sPitch5_1, + sPitch5_2, + sPitch5_3, + sPitch5_4, + sPitch6_0, + sPitch6_1, + sPitch6_2, + sPitch6_3, + sPitch6_4, + sPitch7_0, + sPitch7_1, + sPitch7_2, + sPitch7_3, + sPitch7_4 }; diff --git a/src/data/object_events/movement_type_func_tables.h b/src/data/object_events/movement_type_func_tables.h index 7d149a628..68dfeb730 100755 --- a/src/data/object_events/movement_type_func_tables.h +++ b/src/data/object_events/movement_type_func_tables.h @@ -63,11 +63,11 @@ u8 (*const gMovementTypeFuncs_FaceDirection[])(struct ObjectEvent *, struct Spri }; u8 (*const gMovementTypeFuncs_BerryTreeGrowth[])(struct ObjectEvent *, struct Sprite *) = { - MovementType_BerryTreeGrowth_Step0, - MovementType_BerryTreeGrowth_Step1, - MovementType_BerryTreeGrowth_Step2, - MovementType_BerryTreeGrowth_Step3, - MovementType_BerryTreeGrowth_Step4, + MovementType_BerryTreeGrowth_Normal, + MovementType_BerryTreeGrowth_Move, + MovementType_BerryTreeGrowth_SparkleStart, + MovementType_BerryTreeGrowth_Sparkle, + MovementType_BerryTreeGrowth_SparkleEnd, }; u8 (*const gMovementTypeFuncs_FaceDownAndUp[])(struct ObjectEvent *, struct Sprite *) = { diff --git a/src/daycare.c b/src/daycare.c index 2a1efefcc..7ae1e72c4 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -894,8 +894,8 @@ static bool8 TryProduceOrHatchEgg(struct DayCare *daycare) // Check if an egg should be produced if (daycare->offspringPersonality == 0 && validEggs == DAYCARE_MON_COUNT && (daycare->mons[1].steps & 0xFF) == 0xFF) { - u8 compatability = GetDaycareCompatibilityScore(daycare); - if (compatability > (Random() * 100u) / USHRT_MAX) + u8 compatibility = GetDaycareCompatibilityScore(daycare); + if (compatibility > (Random() * 100u) / USHRT_MAX) TriggerPendingDaycareEgg(); } @@ -1050,7 +1050,7 @@ static u8 GetDaycareCompatibilityScore(struct DayCare *daycare) if (trainerIds[0] == trainerIds[1]) return PARENTS_LOW_COMPATIBILITY; - return PARENTS_MED_COMPATABILITY; + return PARENTS_MED_COMPATIBILITY; } // neither parent is Ditto else @@ -1065,14 +1065,14 @@ static u8 GetDaycareCompatibilityScore(struct DayCare *daycare) if (species[0] == species[1]) { if (trainerIds[0] == trainerIds[1]) - return PARENTS_MED_COMPATABILITY; // same species, same trainer + return PARENTS_MED_COMPATIBILITY; // same species, same trainer - return PARENTS_MAX_COMPATABILITY; // same species, different trainers + return PARENTS_MAX_COMPATIBILITY; // same species, different trainers } else { if (trainerIds[0] != trainerIds[1]) - return PARENTS_MED_COMPATABILITY; // different species, different trainers + return PARENTS_MED_COMPATIBILITY; // different species, different trainers return PARENTS_LOW_COMPATIBILITY; // different species, same trainer } @@ -1095,9 +1095,9 @@ void SetDaycareCompatibilityString(void) whichString = 3; if (relationshipScore == PARENTS_LOW_COMPATIBILITY) whichString = 2; - if (relationshipScore == PARENTS_MED_COMPATABILITY) + if (relationshipScore == PARENTS_MED_COMPATIBILITY) whichString = 1; - if (relationshipScore == PARENTS_MAX_COMPATABILITY) + if (relationshipScore == PARENTS_MAX_COMPATIBILITY) whichString = 0; StringCopy(gStringVar4, sCompatibilityMessages[whichString]); diff --git a/src/easy_chat.c b/src/easy_chat.c index 6bb77bc84..fa3d4472a 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -4876,7 +4876,7 @@ bool8 sub_811EAA4(u16 easyChatWord) } } -bool8 ECWord_CheckIfOutsideOfValidRange(u16 easyChatWord) +bool8 IsBardWordInvalid(u16 easyChatWord) { int numWordsInGroup; u8 groupId = EC_GROUP(easyChatWord); @@ -4888,11 +4888,11 @@ bool8 ECWord_CheckIfOutsideOfValidRange(u16 easyChatWord) { case EC_GROUP_POKEMON: case EC_GROUP_POKEMON_2: - numWordsInGroup = gNumSpeciesNames; + numWordsInGroup = gNumBardWords_Species; break; case EC_GROUP_MOVE_1: case EC_GROUP_MOVE_2: - numWordsInGroup = gUnknown_085FA1D4; + numWordsInGroup = gNumBardWords_Moves; break; default: numWordsInGroup = gEasyChatGroups[groupId].numWords; diff --git a/src/event_object_lock.c b/src/event_object_lock.c index 67652a99b..dec2d7906 100644 --- a/src/event_object_lock.c +++ b/src/event_object_lock.c @@ -16,18 +16,19 @@ bool8 IsPlayerStandingStill(void) return TRUE; } -static void sub_80983A4(u8 taskId) +// Freeze player once their movement is finished +static void Task_FreezePlayer(u8 taskId) { if (IsPlayerStandingStill()) { - sub_808B864(); + PlayerFreeze(); DestroyTask(taskId); } } -bool8 sub_80983C4(void) +bool8 IsFreezePlayerFinished(void) { - if (FuncIsActiveTask(sub_80983A4)) + if (FuncIsActiveTask(Task_FreezePlayer)) { return FALSE; } @@ -42,30 +43,35 @@ bool8 sub_80983C4(void) void ScriptFreezeObjectEvents(void) { FreezeObjectEvents(); - CreateTask(sub_80983A4, 80); + CreateTask(Task_FreezePlayer, 80); } -static void sub_8098400(u8 taskId) +#define tPlayerFrozen data[0] +#define tObjectFrozen data[1] +#define tObjectId data[2] + +// Freeze selected object and player once their movement is finished +static void Task_FreezeSelectedObjectAndPlayer(u8 taskId) { struct Task *task = &gTasks[taskId]; - if (!task->data[0] && IsPlayerStandingStill() == TRUE) + if (!task->tPlayerFrozen && IsPlayerStandingStill() == TRUE) { - sub_808B864(); - task->data[0] = 1; + PlayerFreeze(); + task->tPlayerFrozen = TRUE; } - if (!task->data[1] && !gObjectEvents[gSelectedObjectEvent].singleMovementActive) + if (!task->tObjectFrozen && !gObjectEvents[gSelectedObjectEvent].singleMovementActive) { FreezeObjectEvent(&gObjectEvents[gSelectedObjectEvent]); - task->data[1] = 1; + task->tObjectFrozen = TRUE; } - if (task->data[0] && task->data[1]) + if (task->tPlayerFrozen && task->tObjectFrozen) DestroyTask(taskId); } -bool8 sub_809847C(void) +bool8 IsFreezeSelectedObjectAndPlayerFinished(void) { - if (FuncIsActiveTask(sub_8098400)) + if (FuncIsActiveTask(Task_FreezeSelectedObjectAndPlayer)) { return FALSE; } @@ -80,11 +86,11 @@ void LockSelectedObjectEvent(void) { u8 taskId; FreezeObjectEventsExceptOne(gSelectedObjectEvent); - taskId = CreateTask(sub_8098400, 80); + taskId = CreateTask(Task_FreezeSelectedObjectAndPlayer, 80); if (!gObjectEvents[gSelectedObjectEvent].singleMovementActive) { FreezeObjectEvent(&gObjectEvents[gSelectedObjectEvent]); - gTasks[taskId].data[1] = 1; + gTasks[taskId].tObjectFrozen = TRUE; } } @@ -118,64 +124,71 @@ void Script_ClearHeldMovement(void) ObjectEventClearHeldMovementIfActive(&gObjectEvents[gSelectedObjectEvent]); } -static void sub_80985BC(u8 taskId) +// Freeze designated object and player once their movement is finished +static void Task_FreezeObjectAndPlayer(u8 taskId) { struct Task *task = &gTasks[taskId]; - u8 objectEventId = task->data[2]; + u8 objectEventId = task->tObjectId; - if (!task->data[0] && IsPlayerStandingStill() == TRUE) + if (!task->tPlayerFrozen && IsPlayerStandingStill() == TRUE) { - sub_808B864(); - task->data[0] = 1; + PlayerFreeze(); + task->tPlayerFrozen = TRUE; } - if (!task->data[1] && !gObjectEvents[objectEventId].singleMovementActive) + if (!task->tObjectFrozen && !gObjectEvents[objectEventId].singleMovementActive) { FreezeObjectEvent(&gObjectEvents[objectEventId]); - task->data[1] = 1; + task->tObjectFrozen = TRUE; } - if (task->data[0] && task->data[1]) + if (task->tPlayerFrozen && task->tObjectFrozen) DestroyTask(taskId); } -void sub_8098630(void) +void FreezeForApproachingTrainers(void) { u8 trainerObjectId1, trainerObjectId2, taskId; trainerObjectId1 = GetChosenApproachingTrainerObjectEventId(0); - if(gNoOfApproachingTrainers == 2) + + if (gNoOfApproachingTrainers == 2) { + // Get second trainer, freeze all other objects trainerObjectId2 = GetChosenApproachingTrainerObjectEventId(1); - sub_8098074(trainerObjectId1, trainerObjectId2); - taskId = CreateTask(sub_80985BC, 80); - gTasks[taskId].data[2] = trainerObjectId1; - if(!gObjectEvents[trainerObjectId1].singleMovementActive) + FreezeObjectEventsExceptTwo(trainerObjectId1, trainerObjectId2); + + // Start task to freeze trainer 1 (and player) after movement + taskId = CreateTask(Task_FreezeObjectAndPlayer, 80); + gTasks[taskId].tObjectId = trainerObjectId1; + if (!gObjectEvents[trainerObjectId1].singleMovementActive) { FreezeObjectEvent(&gObjectEvents[trainerObjectId1]); - gTasks[taskId].data[1] = 1; + gTasks[taskId].tObjectFrozen = TRUE; } - taskId = CreateTask(sub_80985BC, 81); - gTasks[taskId].data[2] = trainerObjectId2; - if(!gObjectEvents[trainerObjectId2].singleMovementActive) + + // Start task to freeze trainer 2 after movement + taskId = CreateTask(Task_FreezeObjectAndPlayer, 81); + gTasks[taskId].tObjectId = trainerObjectId2; + if (!gObjectEvents[trainerObjectId2].singleMovementActive) { FreezeObjectEvent(&gObjectEvents[trainerObjectId2]); - gTasks[taskId].data[1] = 1; + gTasks[taskId].tObjectFrozen = TRUE; } } else { FreezeObjectEventsExceptOne(trainerObjectId1); - taskId = CreateTask(sub_80985BC, 80); - gTasks[taskId].data[2] = trainerObjectId1; - if(!gObjectEvents[trainerObjectId1].singleMovementActive) + taskId = CreateTask(Task_FreezeObjectAndPlayer, 80); + gTasks[taskId].tObjectId = trainerObjectId1; + if (!gObjectEvents[trainerObjectId1].singleMovementActive) { FreezeObjectEvent(&gObjectEvents[trainerObjectId1]); - gTasks[taskId].data[1] = 1; + gTasks[taskId].tObjectFrozen = TRUE; } } } -bool8 sub_8098734(void) +bool8 IsFreezeObjectAndPlayerFinished(void) { - if (FuncIsActiveTask(sub_80985BC)) + if (FuncIsActiveTask(Task_FreezeObjectAndPlayer)) { return FALSE; } @@ -185,3 +198,7 @@ bool8 sub_8098734(void) return TRUE; } } + +#undef tPlayerFrozen +#undef tObjectFrozen +#undef tObjectId diff --git a/src/event_object_movement.c b/src/event_object_movement.c index d9c06eb10..f6e638f31 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -1834,7 +1834,7 @@ void PlayerObjectTurn(struct PlayerAvatar *playerAvatar, u8 direction) ObjectEventTurn(&gObjectEvents[playerAvatar->objectEventId], direction); } -static void get_berry_tree_graphics(struct ObjectEvent *objectEvent, struct Sprite *sprite) +static void SetBerryTreeGraphics(struct ObjectEvent *objectEvent, struct Sprite *sprite) { u8 berryStage; u8 berryId; @@ -1842,7 +1842,7 @@ static void get_berry_tree_graphics(struct ObjectEvent *objectEvent, struct Spri objectEvent->invisible = TRUE; sprite->invisible = TRUE; berryStage = GetStageByBerryTreeId(objectEvent->trainerRange_berryTreeId); - if (berryStage != 0) + if (berryStage != BERRY_STAGE_NO_BERRY) { objectEvent->invisible = FALSE; sprite->invisible = FALSE; @@ -1888,13 +1888,13 @@ static void SetObjectEventDynamicGraphicsId(struct ObjectEvent *objectEvent) } } -void npc_by_local_id_and_map_set_field_1_bit_x20(u8 localId, u8 mapNum, u8 mapGroup, u8 state) +void SetObjectInvisibility(u8 localId, u8 mapNum, u8 mapGroup, bool8 invisible) { u8 objectEventId; if (!TryGetObjectEventIdByLocalIdAndMap(localId, mapNum, mapGroup, &objectEventId)) { - gObjectEvents[objectEventId].invisible = state; + gObjectEvents[objectEventId].invisible = invisible; } } @@ -1918,7 +1918,7 @@ void sub_808E75C(s16 x, s16 y) } } -void sub_808E78C(u8 localId, u8 mapNum, u8 mapGroup, u8 subpriority) +void SetObjectPriority(u8 localId, u8 mapNum, u8 mapGroup, u8 subpriority) { u8 objectEventId; struct ObjectEvent *objectEvent; @@ -1933,7 +1933,7 @@ void sub_808E78C(u8 localId, u8 mapNum, u8 mapGroup, u8 subpriority) } } -void sub_808E7E4(u8 localId, u8 mapNum, u8 mapGroup) +void ResetObjectPriority(u8 localId, u8 mapNum, u8 mapGroup) { u8 objectEventId; struct ObjectEvent *objectEvent; @@ -2595,7 +2595,7 @@ bool8 MovementType_WanderAround_Step4(struct ObjectEvent *objectEvent, struct Sp bool8 MovementType_WanderAround_Step5(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkNormalMovementAction(objectEvent->movementDirection)); - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->data[1] = 6; return TRUE; } @@ -2604,7 +2604,7 @@ bool8 MovementType_WanderAround_Step6(struct ObjectEvent *objectEvent, struct Sp { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 1; } return FALSE; @@ -2880,7 +2880,7 @@ bool8 MovementType_LookAround_Step2(struct ObjectEvent *objectEvent, struct Spri if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 3; } return FALSE; @@ -2964,7 +2964,7 @@ bool8 MovementType_WanderUpAndDown_Step4(struct ObjectEvent *objectEvent, struct bool8 MovementType_WanderUpAndDown_Step5(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkNormalMovementAction(objectEvent->movementDirection)); - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->data[1] = 6; return TRUE; } @@ -2973,7 +2973,7 @@ bool8 MovementType_WanderUpAndDown_Step6(struct ObjectEvent *objectEvent, struct { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 1; } return FALSE; @@ -3033,7 +3033,7 @@ bool8 MovementType_WanderLeftAndRight_Step4(struct ObjectEvent *objectEvent, str bool8 MovementType_WanderLeftAndRight_Step5(struct ObjectEvent *objectEvent, struct Sprite *sprite) { ObjectEventSetSingleMovement(objectEvent, sprite, GetWalkNormalMovementAction(objectEvent->movementDirection)); - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->data[1] = 6; return TRUE; } @@ -3042,7 +3042,7 @@ bool8 MovementType_WanderLeftAndRight_Step6(struct ObjectEvent *objectEvent, str { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 1; } return FALSE; @@ -3070,39 +3070,58 @@ bool8 MovementType_FaceDirection_Step1(struct ObjectEvent *objectEvent, struct S bool8 MovementType_FaceDirection_Step2(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; return FALSE; } static bool8 ObjectEventCB2_BerryTree(struct ObjectEvent *objectEvent, struct Sprite *sprite); extern bool8 (*const gMovementTypeFuncs_BerryTreeGrowth[])(struct ObjectEvent *objectEvent, struct Sprite *sprite); + +enum { + BERRYTREEFUNC_NORMAL, + BERRYTREEFUNC_MOVE, + BERRYTREEFUNC_SPARKLE_START, + BERRYTREEFUNC_SPARKLE, + BERRYTREEFUNC_SPARKLE_END, +}; + +#define sObjEventId data[0] +#define sFuncId data[1] +#define sTimer data[2] +#define sBerryTreeFlags data[7] + +#define BERRY_FLAG_SET_GFX (1 << 0) +#define BERRY_FLAG_SPARKLING (1 << 1) +#define BERRY_FLAG_JUST_PICKED (1 << 2) + void MovementType_BerryTreeGrowth(struct Sprite *sprite) { struct ObjectEvent *objectEvent; - objectEvent = &gObjectEvents[sprite->data[0]]; - if (!(sprite->data[7] & 1)) + objectEvent = &gObjectEvents[sprite->sObjEventId]; + if (!(sprite->sBerryTreeFlags & BERRY_FLAG_SET_GFX)) { - get_berry_tree_graphics(objectEvent, sprite); - sprite->data[7] |= 1; + SetBerryTreeGraphics(objectEvent, sprite); + sprite->sBerryTreeFlags |= BERRY_FLAG_SET_GFX; } UpdateObjectEventCurrentMovement(objectEvent, sprite, ObjectEventCB2_BerryTree); } static bool8 ObjectEventCB2_BerryTree(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - return gMovementTypeFuncs_BerryTreeGrowth[sprite->data[1]](objectEvent, sprite); + return gMovementTypeFuncs_BerryTreeGrowth[sprite->sFuncId](objectEvent, sprite); } -bool8 MovementType_BerryTreeGrowth_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite) +// BERRYTREEFUNC_NORMAL +bool8 MovementType_BerryTreeGrowth_Normal(struct ObjectEvent *objectEvent, struct Sprite *sprite) { u8 berryStage; ClearObjectEventMovement(objectEvent, sprite); objectEvent->invisible = TRUE; sprite->invisible = TRUE; berryStage = GetStageByBerryTreeId(objectEvent->trainerRange_berryTreeId); - if (berryStage == 0) + if (berryStage == BERRY_STAGE_NO_BERRY) { - if (!(sprite->data[7] & 4) && sprite->animNum == 4) + if (!(sprite->sBerryTreeFlags & BERRY_FLAG_JUST_PICKED) && sprite->animNum == BERRY_STAGE_FLOWERING) { gFieldEffectArguments[0] = objectEvent->currentCoords.x; gFieldEffectArguments[1] = objectEvent->currentCoords.y; @@ -3115,34 +3134,36 @@ bool8 MovementType_BerryTreeGrowth_Step0(struct ObjectEvent *objectEvent, struct } objectEvent->invisible = FALSE; sprite->invisible = FALSE; - berryStage --; + berryStage--; if (sprite->animNum != berryStage) { - sprite->data[1] = 2; + sprite->sFuncId = BERRYTREEFUNC_SPARKLE_START; return TRUE; } - get_berry_tree_graphics(objectEvent, sprite); + SetBerryTreeGraphics(objectEvent, sprite); ObjectEventSetSingleMovement(objectEvent, sprite, MOVEMENT_ACTION_START_ANIM_IN_DIRECTION); - sprite->data[1] = 1; + sprite->sFuncId = BERRYTREEFUNC_MOVE; return TRUE; } -bool8 MovementType_BerryTreeGrowth_Step1(struct ObjectEvent *objectEvent, struct Sprite *sprite) +// BERRYTREEFUNC_MOVE +bool8 MovementType_BerryTreeGrowth_Move(struct ObjectEvent *objectEvent, struct Sprite *sprite) { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - sprite->data[1] = 0; + sprite->sFuncId = BERRYTREEFUNC_NORMAL; return TRUE; } return FALSE; } -bool8 MovementType_BerryTreeGrowth_Step2(struct ObjectEvent *objectEvent, struct Sprite *sprite) +// BERRYTREEFUNC_SPARKLE_START +bool8 MovementType_BerryTreeGrowth_SparkleStart(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - objectEvent->singleMovementActive = 1; - sprite->data[1] = 3; - sprite->data[2] = 0; - sprite->data[7] |= 2; + objectEvent->singleMovementActive = TRUE; + sprite->sFuncId = BERRYTREEFUNC_SPARKLE; + sprite->sTimer = 0; + sprite->sBerryTreeFlags |= BERRY_FLAG_SPARKLING; gFieldEffectArguments[0] = objectEvent->currentCoords.x; gFieldEffectArguments[1] = objectEvent->currentCoords.y; gFieldEffectArguments[2] = sprite->subpriority - 1; @@ -3151,30 +3172,32 @@ bool8 MovementType_BerryTreeGrowth_Step2(struct ObjectEvent *objectEvent, struct return TRUE; } -bool8 MovementType_BerryTreeGrowth_Step3(struct ObjectEvent *objectEvent, struct Sprite *sprite) +// BERRYTREEFUNC_SPARKLE +bool8 MovementType_BerryTreeGrowth_Sparkle(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sprite->data[2]++; - objectEvent->invisible = (sprite->data[2] & 0x02) >> 1; + sprite->sTimer++; + objectEvent->invisible = (sprite->sTimer & 2) >> 1; sprite->animPaused = TRUE; - if (sprite->data[2] > 64) + if (sprite->sTimer > 64) { - get_berry_tree_graphics(objectEvent, sprite); - sprite->data[1] = 4; - sprite->data[2] = 0; + SetBerryTreeGraphics(objectEvent, sprite); + sprite->sFuncId = BERRYTREEFUNC_SPARKLE_END; + sprite->sTimer = 0; return TRUE; } return FALSE; } -bool8 MovementType_BerryTreeGrowth_Step4(struct ObjectEvent *objectEvent, struct Sprite *sprite) +// BERRYTREEFUNC_SPARKLE_END +bool8 MovementType_BerryTreeGrowth_SparkleEnd(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - sprite->data[2]++; - objectEvent->invisible = (sprite->data[2] & 0x02) >> 1; + sprite->sTimer++; + objectEvent->invisible = (sprite->sTimer & 2) >> 1; sprite->animPaused = TRUE; - if (sprite->data[2] > 64) + if (sprite->sTimer > 64) { - sprite->data[1] = 0; - sprite->data[7] &= ~0x0002; + sprite->sFuncId = BERRYTREEFUNC_NORMAL; + sprite->sBerryTreeFlags &= ~BERRY_FLAG_SPARKLING; return TRUE; } return FALSE; @@ -3201,7 +3224,7 @@ bool8 MovementType_FaceDownAndUp_Step2(struct ObjectEvent *objectEvent, struct S if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 3; } return FALSE; @@ -3253,7 +3276,7 @@ bool8 MovementType_FaceLeftAndRight_Step2(struct ObjectEvent *objectEvent, struc if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, gMovementDelaysMedium[Random() & 3]); - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 3; } return FALSE; @@ -3305,7 +3328,7 @@ bool8 MovementType_FaceUpAndLeft_Step2(struct ObjectEvent *objectEvent, struct S if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 3; } return FALSE; @@ -3357,7 +3380,7 @@ bool8 MovementType_FaceUpAndRight_Step2(struct ObjectEvent *objectEvent, struct if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 3; } return FALSE; @@ -3409,7 +3432,7 @@ bool8 MovementType_FaceDownAndLeft_Step2(struct ObjectEvent *objectEvent, struct if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 3; } return FALSE; @@ -3461,7 +3484,7 @@ bool8 MovementType_FaceDownAndRight_Step2(struct ObjectEvent *objectEvent, struc if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 3; } return FALSE; @@ -3513,7 +3536,7 @@ bool8 MovementType_FaceDownUpAndLeft_Step2(struct ObjectEvent *objectEvent, stru if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 3; } return FALSE; @@ -3565,7 +3588,7 @@ bool8 MovementType_FaceDownUpAndRight_Step2(struct ObjectEvent *objectEvent, str if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 3; } return FALSE; @@ -3617,7 +3640,7 @@ bool8 MovementType_FaceUpLeftAndRight_Step2(struct ObjectEvent *objectEvent, str if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 3; } return FALSE; @@ -3669,7 +3692,7 @@ bool8 MovementType_FaceDownLeftAndRight_Step2(struct ObjectEvent *objectEvent, s if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { SetMovementDelay(sprite, gMovementDelaysShort[Random() & 3]); - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 3; } return FALSE; @@ -3835,7 +3858,7 @@ bool8 MovementType_WalkBackAndForth_Step2(struct ObjectEvent *objectEvent, struc movementActionId = GetWalkInPlaceNormalMovementAction(objectEvent->facingDirection); ObjectEventSetSingleMovement(objectEvent, sprite, movementActionId); - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->data[1] = 3; return TRUE; } @@ -3844,7 +3867,7 @@ bool8 MovementType_WalkBackAndForth_Step3(struct ObjectEvent *objectEvent, struc { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 1; } return FALSE; @@ -3880,7 +3903,7 @@ bool8 MoveNextDirectionInSequence(struct ObjectEvent *objectEvent, struct Sprite movementActionId = GetWalkInPlaceNormalMovementAction(objectEvent->facingDirection); ObjectEventSetSingleMovement(objectEvent, sprite, movementActionId); - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->data[1] = 2; return TRUE; } @@ -3889,7 +3912,7 @@ bool8 MovementType_WalkSequence_Step2(struct ObjectEvent *objectEvent, struct Sp { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 1; } return FALSE; @@ -4233,7 +4256,7 @@ bool8 MovementType_CopyPlayer_Step2(struct ObjectEvent *objectEvent, struct Spri { if (ObjectEventExecSingleMovementAction(objectEvent, sprite)) { - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; sprite->data[1] = 1; } return FALSE; @@ -4247,7 +4270,7 @@ bool8 CopyablePlayerMovement_None(struct ObjectEvent *objectEvent, struct Sprite bool8 CopyablePlayerMovement_FaceDirection(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8)) { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(state_to_direction(gInitialMovementTypeFacingDirections[objectEvent->movementType], objectEvent->directionSequenceIndex, playerDirection))); - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->data[1] = 2; return TRUE; } @@ -4268,7 +4291,7 @@ bool8 CopyablePlayerMovement_GoSpeed0(struct ObjectEvent *objectEvent, struct Sp direction = state_to_direction(gInitialMovementTypeFacingDirections[objectEvent->movementType], objectEvent->directionSequenceIndex, direction); ObjectEventMoveDestCoords(objectEvent, direction, &x, &y); ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->data[1] = 2; return TRUE; } @@ -4283,7 +4306,7 @@ bool8 CopyablePlayerMovement_GoSpeed0(struct ObjectEvent *objectEvent, struct Sp { ObjectEventSetSingleMovement(objectEvent, sprite, GetFaceDirectionMovementAction(direction)); } - objectEvent->singleMovementActive = 1; + objectEvent->singleMovementActive = TRUE; sprite->data[1] = 2; return TRUE; } @@ -4538,13 +4561,13 @@ bool8 MovementType_Invisible_Step1(struct ObjectEvent *objectEvent, struct Sprit bool8 MovementType_Invisible_Step2(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; return FALSE; } static void ClearObjectEventMovement(struct ObjectEvent *objectEvent, struct Sprite *sprite) { - objectEvent->singleMovementActive = 0; + objectEvent->singleMovementActive = FALSE; objectEvent->heldMovementActive = FALSE; objectEvent->heldMovementFinished = FALSE; objectEvent->movementActionId = 0xFF; @@ -4824,7 +4847,7 @@ bool8 IsBerryTreeSparkling(u8 localId, u8 mapNum, u8 mapGroup) u8 objectEventId; if (!TryGetObjectEventIdByLocalIdAndMap(localId, mapNum, mapGroup, &objectEventId) - && gSprites[gObjectEvents[objectEventId].spriteId].data[7] & 2) + && gSprites[gObjectEvents[objectEventId].spriteId].sBerryTreeFlags & BERRY_FLAG_SPARKLING) { return TRUE; } @@ -4832,13 +4855,13 @@ bool8 IsBerryTreeSparkling(u8 localId, u8 mapNum, u8 mapGroup) return FALSE; } -void sub_8092EF0(u8 localId, u8 mapNum, u8 mapGroup) +void SetBerryTreeJustPicked(u8 localId, u8 mapNum, u8 mapGroup) { u8 objectEventId; if (!TryGetObjectEventIdByLocalIdAndMap(localId, mapNum, mapGroup, &objectEventId)) { - gSprites[gObjectEvents[objectEventId].spriteId].data[7] |= 0x04; + gSprites[gObjectEvents[objectEventId].spriteId].sBerryTreeFlags |= BERRY_FLAG_JUST_PICKED; } } @@ -6579,7 +6602,7 @@ bool8 MovementAction_RevealTrainer_Step0(struct ObjectEvent *objectEvent, struct { if (objectEvent->movementType == MOVEMENT_TYPE_HIDDEN) { - sub_80B4578(objectEvent); + SetHiddenTrainerMovement(objectEvent); return FALSE; } if (objectEvent->movementType != MOVEMENT_TYPE_TREE_DISGUISE && objectEvent->movementType != MOVEMENT_TYPE_MOUNTAIN_DISGUISE) @@ -8971,13 +8994,14 @@ void DestroyExtraMovementTask(u8 taskId) DestroyTask(taskId); } -void sub_8098074(u8 var1, u8 var2) +// Used to freeze other objects except two trainers approaching for battle +void FreezeObjectEventsExceptTwo(u8 objectEventId1, u8 objectEventId2) { u8 i; for(i = 0; i < OBJECT_EVENTS_COUNT; i++) { - if(i != var1 && i != var2 && + if(i != objectEventId1 && i != objectEventId2 && gObjectEvents[i].active && i != gPlayerAvatar.objectEventId) FreezeObjectEvent(&gObjectEvents[i]); } diff --git a/src/evolution_scene.c b/src/evolution_scene.c index a8de8a555..c8f910261 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -1522,8 +1522,8 @@ static void sub_8140174(void) gBattle_BG1_X = 0; gBattle_BG1_Y = 0; gBattle_BG2_X = 0; - SetBgAttribute(1, BG_ATTR_PRIORITY, sub_80391E0(1, 5)); - SetBgAttribute(2, BG_ATTR_PRIORITY, sub_80391E0(2, 5)); + SetBgAttribute(1, BG_ATTR_PRIORITY, GetBattleBgTemplateData(1, 5)); + SetBgAttribute(2, BG_ATTR_PRIORITY, GetBattleBgTemplateData(2, 5)); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_BG3_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP); Free(sEvoMovingBgPtr); } diff --git a/src/field_camera.c b/src/field_camera.c index 57be52221..699b984ac 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -417,7 +417,7 @@ void CameraUpdate(void) CameraMove(deltaX, deltaY); UpdateObjectEventsForCameraUpdate(deltaX, deltaY); RotatingGatePuzzleCameraUpdate(deltaX, deltaY); - ResetBerryTreeSparkleFlags(); + SetBerryTreesSeen(); AddCameraTileOffset(&sFieldCameraOffset, deltaX * 2, deltaY * 2); RedrawMapSlicesForCameraUpdate(&sFieldCameraOffset, deltaX * 2, deltaY * 2); } diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index cc4c03c9d..3d29e013f 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -96,7 +96,7 @@ static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8); static void PlayCollisionSoundIfNotFacingWarp(u8 a); -static void sub_808C280(struct ObjectEvent *); +static void HideShowWarpArrow(struct ObjectEvent *); static void StartStrengthAnim(u8, u8); static void Task_PushBoulder(u8 taskId); @@ -323,7 +323,7 @@ void PlayerStep(u8 direction, u16 newKeys, u16 heldKeys) { struct ObjectEvent *playerObjEvent = &gObjectEvents[gPlayerAvatar.objectEventId]; - sub_808C280(playerObjEvent); + HideShowWarpArrow(playerObjEvent); if (gPlayerAvatar.preventStep == FALSE) { Bike_TryAcroBikeHistoryUpdate(newKeys, heldKeys); @@ -940,9 +940,9 @@ u8 PlayerGetCopyableMovement(void) return gObjectEvents[gPlayerAvatar.objectEventId].playerCopyableMovement; } -static void sub_808B6BC(u8 a) +static void PlayerForceSetHeldMovement(u8 movementActionId) { - ObjectEventForceSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], a); + ObjectEventForceSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], movementActionId); } void PlayerSetAnimId(u8 movementActionId, u8 copyableMovement) @@ -1020,12 +1020,13 @@ void PlayerJumpLedge(u8 direction) PlayerSetAnimId(GetJump2MovementAction(direction), 8); } -void sub_808B864(void) +// Stop player on current facing direction once they're done moving and if they're not currently Acro Biking on bumpy slope +void PlayerFreeze(void) { if (gPlayerAvatar.tileTransitionState == T_TILE_CENTER || gPlayerAvatar.tileTransitionState == T_NOT_MOVING) { - if (player_should_look_direction_be_enforced_upon_movement()) - sub_808B6BC(GetFaceDirectionMovementAction(gObjectEvents[gPlayerAvatar.objectEventId].facingDirection)); + if (IsPlayerNotUsingAcroBikeOnBumpySlope()) + PlayerForceSetHeldMovement(GetFaceDirectionMovementAction(gObjectEvents[gPlayerAvatar.objectEventId].facingDirection)); } } @@ -1424,7 +1425,7 @@ void SetPlayerAvatarWatering(u8 direction) StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFaceDirectionAnimNum(direction)); } -static void sub_808C280(struct ObjectEvent *objectEvent) +static void HideShowWarpArrow(struct ObjectEvent *objectEvent) { s16 x; s16 y; @@ -1435,6 +1436,7 @@ static void sub_808C280(struct ObjectEvent *objectEvent) { if (sArrowWarpMetatileBehaviorChecks2[x](metatileBehavior) && direction == objectEvent->movementDirection) { + // Show warp arrow if applicable x = objectEvent->currentCoords.x; y = objectEvent->currentCoords.y; MoveCoords(direction, &x, &y); diff --git a/src/item_menu.c b/src/item_menu.c index 6d30038d0..375e15cab 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -86,7 +86,7 @@ u16 BagGetQuantityByPocketPosition(u8, u16); void BagDestroyPocketSwitchArrowPair(void); void TaskCloseBagMenu_2(u8); u8 AddItemMessageWindow(u8); -void BagMenu_RemoveBagItemMessageindow(u8); +void BagMenu_RemoveBagItemMessageWindow(u8); void set_callback3_to_bag(u8); void PrintItemDepositAmount(u8, s16); static u8 BagMenu_AddWindow(u8); @@ -1115,7 +1115,7 @@ void BagMenu_InitListsMenu(u8 taskId) s16* data = gTasks[taskId].data; u16* scrollPos = &gBagPositionStruct.scrollPosition[gBagPositionStruct.pocket]; u16* cursorPos = &gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]; - BagMenu_RemoveBagItemMessageindow(4); + BagMenu_RemoveBagItemMessageWindow(4); DestroyListMenuTask(data[0], scrollPos, cursorPos); UpdatePocketItemList(gBagPositionStruct.pocket); SetInitialScrollAndCursorPositions(gBagPositionStruct.pocket); @@ -1971,7 +1971,7 @@ bool8 UseRegisteredKeyItemOnField(void) { ScriptContext2_Enable(); FreezeObjectEvents(); - sub_808B864(); + PlayerFreeze(); sub_808BCF4(); gSpecialVar_ItemId = gSaveBlock1Ptr->registeredItem; taskId = CreateTask(ItemId_GetFieldFunc(gSaveBlock1Ptr->registeredItem), 8); @@ -2035,7 +2035,7 @@ void BagMenu_CancelSell(u8 taskId) s16* data = gTasks[taskId].data; RemoveMoneyWindow(); - BagMenu_RemoveBagItemMessageindow(4); + BagMenu_RemoveBagItemMessageWindow(4); BagMenu_PrintCursor_(data[0], 0); set_callback3_to_bag(taskId); } @@ -2070,7 +2070,7 @@ static void Task_SellHowManyDialogueHandleInput(u8 taskId) BagMenu_PrintCursor_(data[0], 0); RemoveMoneyWindow(); BagMenu_RemoveWindow(8); - BagMenu_RemoveBagItemMessageindow(4); + BagMenu_RemoveBagItemMessageWindow(4); set_callback3_to_bag(taskId); } } @@ -2420,7 +2420,7 @@ u8 AddItemMessageWindow(u8 which) return *ptr; } -void BagMenu_RemoveBagItemMessageindow(u8 which) +void BagMenu_RemoveBagItemMessageWindow(u8 which) { u8 *ptr = &gBagMenu->windowPointers[which]; if (*ptr != 0xFF) diff --git a/src/main.c b/src/main.c index f0ad4ce94..8d6bd94fa 100644 --- a/src/main.c +++ b/src/main.c @@ -298,7 +298,7 @@ void InitIntrHandlers(void) REG_IME = 1; - EnableInterrupts(0x1); + EnableInterrupts(INTR_FLAG_VBLANK); } void SetVBlankCallback(IntrCallback callback) @@ -350,7 +350,7 @@ static void VBlankIntr(void) gPcmDmaCounter = gSoundInfo.pcmDmaCounter; m4aSoundMain(); - sub_8033648(); + TryReceiveLinkBattleData(); if (!gMain.inBattle || !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_RECORDED))) Random(); diff --git a/src/match_call.c b/src/match_call.c index 7e8d0c38a..68b630d6b 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -1114,7 +1114,7 @@ static void StartMatchCall(void) { ScriptContext2_Enable(); FreezeObjectEvents(); - sub_808B864(); + PlayerFreeze(); sub_808BCF4(); } diff --git a/src/party_menu.c b/src/party_menu.c index 256558985..096f87dd2 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5697,14 +5697,14 @@ static u8 GetPartyLayoutFromBattleType(void) void OpenPartyMenuInBattle(u8 partyAction) { InitPartyMenu(PARTY_MENU_TYPE_IN_BATTLE, GetPartyLayoutFromBattleType(), partyAction, FALSE, PARTY_MSG_CHOOSE_MON, Task_HandleChooseMonInput, CB2_SetUpReshowBattleScreenAfterMenu); - nullsub_35(); + ReshowBattleScreenDummy(); UpdatePartyToBattleOrder(); } void ChooseMonForInBattleItem(void) { InitPartyMenu(PARTY_MENU_TYPE_IN_BATTLE, GetPartyLayoutFromBattleType(), PARTY_ACTION_USE_ITEM, FALSE, PARTY_MSG_USE_ON_WHICH_MON, Task_HandleChooseMonInput, CB2_ReturnToBagMenu); - nullsub_35(); + ReshowBattleScreenDummy(); UpdatePartyToBattleOrder(); } @@ -5753,7 +5753,7 @@ static bool8 TrySwitchInPokemon(void) StringExpandPlaceholders(gStringVar4, gText_EggCantBattle); return FALSE; } - if (GetPartyIdFromBattleSlot(slot) == gBattleStruct->field_8B) + if (GetPartyIdFromBattleSlot(slot) == gBattleStruct->prevSelectedPartySlot) { GetMonNickname(&gPlayerParty[slot], gStringVar1); StringExpandPlaceholders(gStringVar4, gText_PkmnAlreadySelected); diff --git a/src/pokeball.c b/src/pokeball.c index 916c86287..503bae2d2 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -34,13 +34,13 @@ static void sub_8075970(struct Sprite *sprite); static void HandleBallAnimEnd(struct Sprite *sprite); static void sub_8075FB4(struct Sprite *sprite); static void sub_80760F8(struct Sprite *sprite); -static void sub_8076524(struct Sprite *sprite); -static void sub_80765E0(struct Sprite *sprite); -static void sub_80767D4(struct Sprite *sprite); -static void sub_807687C(struct Sprite *sprite); -static void sub_80768F0(struct Sprite *sprite); -static void sub_80769A8(struct Sprite *sprite); -static void sub_80769CC(struct Sprite *sprite); +static void SpriteCB_PokeballReleaseMon(struct Sprite *sprite); +static void SpriteCB_ReleasedMonFlyOut(struct Sprite *sprite); +static void SpriteCB_TradePokeball(struct Sprite *sprite); +static void SpriteCB_TradePokeballSendOff(struct Sprite *sprite); +static void SpriteCB_TradePokeballEnd(struct Sprite *sprite); +static void SpriteCB_HealthboxSlideInDelayed(struct Sprite *sprite); +static void SpriteCB_HealthboxSlideIn(struct Sprite *sprite); static void SpriteCB_HitAnimHealthoxEffect(struct Sprite *sprite); static u16 GetBattlerPokeballItemId(u8 battlerId); @@ -61,34 +61,34 @@ static u16 GetBattlerPokeballItemId(u8 battlerId); const struct CompressedSpriteSheet gBallSpriteSheets[POKEBALL_COUNT] = { - {gInterfaceGfx_PokeBall, 384, GFX_TAG_POKEBALL}, - {gInterfaceGfx_GreatBall, 384, GFX_TAG_GREATBALL}, - {gInterfaceGfx_SafariBall, 384, GFX_TAG_SAFARIBALL}, - {gInterfaceGfx_UltraBall, 384, GFX_TAG_ULTRABALL}, - {gInterfaceGfx_MasterBall, 384, GFX_TAG_MASTERBALL}, - {gInterfaceGfx_NetBall, 384, GFX_TAG_NETBALL}, - {gInterfaceGfx_DiveBall, 384, GFX_TAG_DIVEBALL}, - {gInterfaceGfx_NestBall, 384, GFX_TAG_NESTBALL}, - {gInterfaceGfx_RepeatBall, 384, GFX_TAG_REPEATBALL}, - {gInterfaceGfx_TimerBall, 384, GFX_TAG_TIMERBALL}, - {gInterfaceGfx_LuxuryBall, 384, GFX_TAG_LUXURYBALL}, - {gInterfaceGfx_PremierBall, 384, GFX_TAG_PREMIERBALL}, + [BALL_POKE] = {gInterfaceGfx_PokeBall, 384, GFX_TAG_POKEBALL}, + [BALL_GREAT] = {gInterfaceGfx_GreatBall, 384, GFX_TAG_GREATBALL}, + [BALL_SAFARI] = {gInterfaceGfx_SafariBall, 384, GFX_TAG_SAFARIBALL}, + [BALL_ULTRA] = {gInterfaceGfx_UltraBall, 384, GFX_TAG_ULTRABALL}, + [BALL_MASTER] = {gInterfaceGfx_MasterBall, 384, GFX_TAG_MASTERBALL}, + [BALL_NET] = {gInterfaceGfx_NetBall, 384, GFX_TAG_NETBALL}, + [BALL_DIVE] = {gInterfaceGfx_DiveBall, 384, GFX_TAG_DIVEBALL}, + [BALL_NEST] = {gInterfaceGfx_NestBall, 384, GFX_TAG_NESTBALL}, + [BALL_REPEAT] = {gInterfaceGfx_RepeatBall, 384, GFX_TAG_REPEATBALL}, + [BALL_TIMER] = {gInterfaceGfx_TimerBall, 384, GFX_TAG_TIMERBALL}, + [BALL_LUXURY] = {gInterfaceGfx_LuxuryBall, 384, GFX_TAG_LUXURYBALL}, + [BALL_PREMIER] = {gInterfaceGfx_PremierBall, 384, GFX_TAG_PREMIERBALL}, }; const struct CompressedSpritePalette gBallSpritePalettes[POKEBALL_COUNT] = { - {gInterfacePal_PokeBall, GFX_TAG_POKEBALL}, - {gInterfacePal_GreatBall, GFX_TAG_GREATBALL}, - {gInterfacePal_SafariBall, GFX_TAG_SAFARIBALL}, - {gInterfacePal_UltraBall, GFX_TAG_ULTRABALL}, - {gInterfacePal_MasterBall, GFX_TAG_MASTERBALL}, - {gInterfacePal_NetBall, GFX_TAG_NETBALL}, - {gInterfacePal_DiveBall, GFX_TAG_DIVEBALL}, - {gInterfacePal_NestBall, GFX_TAG_NESTBALL}, - {gInterfacePal_RepeatBall, GFX_TAG_REPEATBALL}, - {gInterfacePal_TimerBall, GFX_TAG_TIMERBALL}, - {gInterfacePal_LuxuryBall, GFX_TAG_LUXURYBALL}, - {gInterfacePal_PremierBall, GFX_TAG_PREMIERBALL}, + [BALL_POKE] = {gInterfacePal_PokeBall, GFX_TAG_POKEBALL}, + [BALL_GREAT] = {gInterfacePal_GreatBall, GFX_TAG_GREATBALL}, + [BALL_SAFARI] = {gInterfacePal_SafariBall, GFX_TAG_SAFARIBALL}, + [BALL_ULTRA] = {gInterfacePal_UltraBall, GFX_TAG_ULTRABALL}, + [BALL_MASTER] = {gInterfacePal_MasterBall, GFX_TAG_MASTERBALL}, + [BALL_NET] = {gInterfacePal_NetBall, GFX_TAG_NETBALL}, + [BALL_DIVE] = {gInterfacePal_DiveBall, GFX_TAG_DIVEBALL}, + [BALL_NEST] = {gInterfacePal_NestBall, GFX_TAG_NESTBALL}, + [BALL_REPEAT] = {gInterfacePal_RepeatBall, GFX_TAG_REPEATBALL}, + [BALL_TIMER] = {gInterfacePal_TimerBall, GFX_TAG_TIMERBALL}, + [BALL_LUXURY] = {gInterfacePal_LuxuryBall, GFX_TAG_LUXURYBALL}, + [BALL_PREMIER] = {gInterfacePal_PremierBall, GFX_TAG_PREMIERBALL}, }; static const struct OamData sBallOamData = @@ -656,7 +656,7 @@ static void Task_PlayCryWhenReleasedFromBall(u8 taskId) u16 species = gTasks[taskId].tCryTaskSpecies; u8 battlerId = gTasks[taskId].tCryTaskBattler; u8 monSpriteId = gTasks[taskId].tCryTaskMonSpriteId; - struct Pokemon *mon = (void*)(u32)((gTasks[taskId].tCryTaskMonPtr1 << 0x10) | (u16)(gTasks[taskId].tCryTaskMonPtr2)); + struct Pokemon *mon = (void*)(u32)((gTasks[taskId].tCryTaskMonPtr1 << 16) | (u16)(gTasks[taskId].tCryTaskMonPtr2)); switch (gTasks[taskId].tCryTaskState) { @@ -670,7 +670,7 @@ static void Task_PlayCryWhenReleasedFromBall(u8 taskId) PlayCry3(species, pan, 0); else PlayCry3(species, pan, 11); - gBattleSpritesDataPtr->healthBoxesData[battlerId].field_1_x40 = 0; + gBattleSpritesDataPtr->healthBoxesData[battlerId].waitForCry = FALSE; DestroyTask(taskId); break; case 2: @@ -686,7 +686,7 @@ static void Task_PlayCryWhenReleasedFromBall(u8 taskId) else PlayCry4(species, pan, 12); - gBattleSpritesDataPtr->healthBoxesData[battlerId].field_1_x40 = 0; + gBattleSpritesDataPtr->healthBoxesData[battlerId].waitForCry = FALSE; DestroyTask(taskId); } else @@ -725,7 +725,7 @@ static void Task_PlayCryWhenReleasedFromBall(u8 taskId) else PlayCry4(species, pan, 11); - gBattleSpritesDataPtr->healthBoxesData[battlerId].field_1_x40 = 0; + gBattleSpritesDataPtr->healthBoxesData[battlerId].waitForCry = FALSE; DestroyTask(taskId); break; } @@ -763,7 +763,7 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite) species = GetMonData(mon, MON_DATA_SPECIES); if ((battlerId == GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) || battlerId == GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)) - && IsDoubleBattle() && gBattleSpritesDataPtr->animationData->field_9_x1) + && IsDoubleBattle() && gBattleSpritesDataPtr->animationData->introAnimActive) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) { @@ -776,14 +776,14 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite) } } - if (!IsDoubleBattle() || !gBattleSpritesDataPtr->animationData->field_9_x1) + if (!IsDoubleBattle() || !gBattleSpritesDataPtr->animationData->introAnimActive) wantedCryCase = 0; else if (battlerId == GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) || battlerId == GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)) wantedCryCase = 1; else wantedCryCase = 2; - gBattleSpritesDataPtr->healthBoxesData[battlerId].field_1_x40 = 1; + gBattleSpritesDataPtr->healthBoxesData[battlerId].waitForCry = TRUE; taskId = CreateTask(Task_PlayCryWhenReleasedFromBall, 3); gTasks[taskId].tCryTaskSpecies = species; @@ -950,7 +950,7 @@ static void SpriteCB_PlayerMonSendOut_2(struct Sprite *sprite) sprite->sBattler = sprite->oam.affineParam & 0xFF; sprite->data[0] = 0; - if (IsDoubleBattle() && gBattleSpritesDataPtr->animationData->field_9_x1 + if (IsDoubleBattle() && gBattleSpritesDataPtr->animationData->introAnimActive && sprite->sBattler == GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT)) sprite->callback = SpriteCB_ReleaseMon2FromBall; else @@ -976,7 +976,7 @@ static void SpriteCB_OpponentMonSendOut(struct Sprite *sprite) if (sprite->data[0] > 15) { sprite->data[0] = 0; - if (IsDoubleBattle() && gBattleSpritesDataPtr->animationData->field_9_x1 + if (IsDoubleBattle() && gBattleSpritesDataPtr->animationData->introAnimActive && sprite->sBattler == GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT)) sprite->callback = SpriteCB_ReleaseMon2FromBall; else @@ -996,6 +996,7 @@ static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 battlerId, u32 return LaunchBallFadeMonTask(unFadeLater, battlerId, arg2, BALL_POKE); } +// Pokeball in Birch intro, and when receiving via trade void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 battlerId, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 g, u32 h, u16 species) { u8 spriteId; @@ -1017,12 +1018,12 @@ void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 battlerId, u8 x, u8 y, gSprites[spriteId].data[3] = h; gSprites[spriteId].data[4] = h >> 0x10; gSprites[spriteId].oam.priority = oamPriority; - gSprites[spriteId].callback = sub_8076524; + gSprites[spriteId].callback = SpriteCB_PokeballReleaseMon; gSprites[monSpriteId].invisible = TRUE; } -static void sub_8076524(struct Sprite *sprite) +static void SpriteCB_PokeballReleaseMon(struct Sprite *sprite) { if (sprite->data[1] == 0) { @@ -1039,7 +1040,7 @@ static void sub_8076524(struct Sprite *sprite) StartSpriteAnim(sprite, 1); AnimateBallOpenParticlesForPokeball(sprite->pos1.x, sprite->pos1.y - 5, sprite->oam.priority, r5); sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, battlerId, r4); - sprite->callback = sub_80765E0; + sprite->callback = SpriteCB_ReleasedMonFlyOut; gSprites[r7].invisible = FALSE; StartSpriteAffineAnim(&gSprites[r7], 1); AnimateSprite(&gSprites[r7]); @@ -1052,7 +1053,7 @@ static void sub_8076524(struct Sprite *sprite) } } -static void sub_80765E0(struct Sprite *sprite) +static void SpriteCB_ReleasedMonFlyOut(struct Sprite *sprite) { bool8 r12 = FALSE; bool8 r6 = FALSE; @@ -1111,16 +1112,16 @@ u8 CreateTradePokeballSprite(u8 a, u8 b, u8 x, u8 y, u8 oamPriority, u8 subPrior gSprites[spriteId].data[3] = h; gSprites[spriteId].data[4] = h >> 16; gSprites[spriteId].oam.priority = oamPriority; - gSprites[spriteId].callback = sub_80767D4; + gSprites[spriteId].callback = SpriteCB_TradePokeball; return spriteId; } -static void sub_80767D4(struct Sprite *sprite) +static void SpriteCB_TradePokeball(struct Sprite *sprite) { if (sprite->data[1] == 0) { u8 r6; - u8 r7 = sprite->data[0]; + u8 monSpriteId = sprite->data[0]; u8 r8 = sprite->data[2]; u32 r5 = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16); @@ -1132,15 +1133,15 @@ static void sub_80767D4(struct Sprite *sprite) StartSpriteAnim(sprite, 1); AnimateBallOpenParticlesForPokeball(sprite->pos1.x, sprite->pos1.y - 5, sprite->oam.priority, r6); sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, r8, r5); - sprite->callback = sub_807687C; + sprite->callback = SpriteCB_TradePokeballSendOff; #ifdef BUGFIX // FIX: If this is used on a sprite that has previously had an affine animation, it will not // play the shrink anim properly due to being paused. Works together with the fix to `sub_817F77C`. - gSprites[r7].affineAnimPaused = FALSE; + gSprites[monSpriteId].affineAnimPaused = FALSE; #endif // BUGFIX - StartSpriteAffineAnim(&gSprites[r7], 2); - AnimateSprite(&gSprites[r7]); - gSprites[r7].data[1] = 0; + StartSpriteAffineAnim(&gSprites[monSpriteId], 2); + AnimateSprite(&gSprites[monSpriteId]); + gSprites[monSpriteId].data[1] = 0; } else { @@ -1148,29 +1149,29 @@ static void sub_80767D4(struct Sprite *sprite) } } -static void sub_807687C(struct Sprite *sprite) +static void SpriteCB_TradePokeballSendOff(struct Sprite *sprite) { - u8 r1; + u8 monSpriteId; sprite->data[5]++; if (sprite->data[5] == 11) PlaySE(SE_BALL_TRADE); - r1 = sprite->data[0]; - if (gSprites[r1].affineAnimEnded) + monSpriteId = sprite->data[0]; + if (gSprites[monSpriteId].affineAnimEnded) { StartSpriteAnim(sprite, 2); - gSprites[r1].invisible = TRUE; + gSprites[monSpriteId].invisible = TRUE; sprite->data[5] = 0; - sprite->callback = sub_80768F0; + sprite->callback = SpriteCB_TradePokeballEnd; } else { - gSprites[r1].data[1] += 96; - gSprites[r1].pos2.y = -gSprites[r1].data[1] >> 8; + gSprites[monSpriteId].data[1] += 96; + gSprites[monSpriteId].pos2.y = -gSprites[monSpriteId].data[1] >> 8; } } -static void sub_80768F0(struct Sprite *sprite) +static void SpriteCB_TradePokeballEnd(struct Sprite *sprite) { if (sprite->animEnded) sprite->callback = SpriteCallbackDummy; @@ -1181,45 +1182,54 @@ static void Unref_DestroySpriteAndFreeResources(struct Sprite *sprite) DestroySpriteAndFreeResources(sprite); } -void sub_8076918(u8 battlerId) +#define sSpeedX data[0] +#define sSpeedY data[1] + +#define sDelayTimer data[1] + +void StartHealthboxSlideIn(u8 battlerId) { struct Sprite *healthboxSprite = &gSprites[gHealthboxSpriteIds[battlerId]]; - healthboxSprite->data[0] = 5; - healthboxSprite->data[1] = 0; + healthboxSprite->sSpeedX = 5; + healthboxSprite->sSpeedY = 0; healthboxSprite->pos2.x = 0x73; healthboxSprite->pos2.y = 0; - healthboxSprite->callback = sub_80769CC; + healthboxSprite->callback = SpriteCB_HealthboxSlideIn; if (GetBattlerSide(battlerId) != B_SIDE_PLAYER) { - healthboxSprite->data[0] = -healthboxSprite->data[0]; - healthboxSprite->data[1] = -healthboxSprite->data[1]; + healthboxSprite->sSpeedX = -healthboxSprite->sSpeedX; + healthboxSprite->sSpeedY = -healthboxSprite->sSpeedY; healthboxSprite->pos2.x = -healthboxSprite->pos2.x; healthboxSprite->pos2.y = -healthboxSprite->pos2.y; } gSprites[healthboxSprite->data[5]].callback(&gSprites[healthboxSprite->data[5]]); if (GetBattlerPosition(battlerId) == B_POSITION_PLAYER_RIGHT) - healthboxSprite->callback = sub_80769A8; + healthboxSprite->callback = SpriteCB_HealthboxSlideInDelayed; } -static void sub_80769A8(struct Sprite *sprite) +static void SpriteCB_HealthboxSlideInDelayed(struct Sprite *sprite) { - sprite->data[1]++; - if (sprite->data[1] == 20) + sprite->sDelayTimer++; + if (sprite->sDelayTimer == 20) { - sprite->data[1] = 0; - sprite->callback = sub_80769CC; + sprite->sDelayTimer = 0; + sprite->callback = SpriteCB_HealthboxSlideIn; } } -static void sub_80769CC(struct Sprite *sprite) +static void SpriteCB_HealthboxSlideIn(struct Sprite *sprite) { - sprite->pos2.x -= sprite->data[0]; - sprite->pos2.y -= sprite->data[1]; + sprite->pos2.x -= sprite->sSpeedX; + sprite->pos2.y -= sprite->sSpeedY; if (sprite->pos2.x == 0 && sprite->pos2.y == 0) sprite->callback = SpriteCallbackDummy; } +#undef sSpeedX +#undef sSpeedY +#undef sDelayTimer + void DoHitAnimHealthboxEffect(u8 battlerId) { u8 spriteId; diff --git a/src/pokemon.c b/src/pokemon.c index 3a2e88aae..064e206a4 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1350,32 +1350,32 @@ const struct SpindaSpot gSpindaSpotGraphics[] = const s8 gNatureStatTable[NUM_NATURES][NUM_NATURE_STATS] = { - // Atk Def Spd Sp.Atk Sp.Def - { 0, 0, 0, 0, 0}, // Hardy - { +1, -1, 0, 0, 0}, // Lonely - { +1, 0, -1, 0, 0}, // Brave - { +1, 0, 0, -1, 0}, // Adamant - { +1, 0, 0, 0, -1}, // Naughty - { -1, +1, 0, 0, 0}, // Bold - { 0, 0, 0, 0, 0}, // Docile - { 0, +1, -1, 0, 0}, // Relaxed - { 0, +1, 0, -1, 0}, // Impish - { 0, +1, 0, 0, -1}, // Lax - { -1, 0, +1, 0, 0}, // Timid - { 0, -1, +1, 0, 0}, // Hasty - { 0, 0, 0, 0, 0}, // Serious - { 0, 0, +1, -1, 0}, // Jolly - { 0, 0, +1, 0, -1}, // Naive - { -1, 0, 0, +1, 0}, // Modest - { 0, -1, 0, +1, 0}, // Mild - { 0, 0, -1, +1, 0}, // Quiet - { 0, 0, 0, 0, 0}, // Bashful - { 0, 0, 0, +1, -1}, // Rash - { -1, 0, 0, 0, +1}, // Calm - { 0, -1, 0, 0, +1}, // Gentle - { 0, 0, -1, 0, +1}, // Sassy - { 0, 0, 0, -1, +1}, // Careful - { 0, 0, 0, 0, 0}, // Quirky + // Atk Def Spd Sp.Atk Sp.Def + [NATURE_HARDY] = { 0, 0, 0, 0, 0}, + [NATURE_LONELY] = { +1, -1, 0, 0, 0}, + [NATURE_BRAVE] = { +1, 0, -1, 0, 0}, + [NATURE_ADAMANT] = { +1, 0, 0, -1, 0}, + [NATURE_NAUGHTY] = { +1, 0, 0, 0, -1}, + [NATURE_BOLD] = { -1, +1, 0, 0, 0}, + [NATURE_DOCILE] = { 0, 0, 0, 0, 0}, + [NATURE_RELAXED] = { 0, +1, -1, 0, 0}, + [NATURE_IMPISH] = { 0, +1, 0, -1, 0}, + [NATURE_LAX] = { 0, +1, 0, 0, -1}, + [NATURE_TIMID] = { -1, 0, +1, 0, 0}, + [NATURE_HASTY] = { 0, -1, +1, 0, 0}, + [NATURE_SERIOUS] = { 0, 0, 0, 0, 0}, + [NATURE_JOLLY] = { 0, 0, +1, -1, 0}, + [NATURE_NAIVE] = { 0, 0, +1, 0, -1}, + [NATURE_MODEST] = { -1, 0, 0, +1, 0}, + [NATURE_MILD] = { 0, -1, 0, +1, 0}, + [NATURE_QUIET] = { 0, 0, -1, +1, 0}, + [NATURE_BASHFUL] = { 0, 0, 0, 0, 0}, + [NATURE_RASH] = { 0, 0, 0, +1, -1}, + [NATURE_CALM] = { -1, 0, 0, 0, +1}, + [NATURE_GENTLE] = { 0, -1, 0, 0, +1}, + [NATURE_SASSY] = { 0, 0, -1, 0, +1}, + [NATURE_CAREFUL] = { 0, 0, 0, -1, +1}, + [NATURE_QUIRKY] = { 0, 0, 0, 0, 0}, }; #include "data/pokemon/tmhm_learnsets.h" @@ -1937,119 +1937,119 @@ static const u8 sHoldEffectToType[][2] = {HOLD_EFFECT_NORMAL_POWER, TYPE_NORMAL}, }; -const struct SpriteTemplate gUnknown_08329D98[MAX_BATTLERS_COUNT] = +const struct SpriteTemplate gBattlerSpriteTemplates[MAX_BATTLERS_COUNT] = { - { // B_POSITION_PLAYER_LEFT + [B_POSITION_PLAYER_LEFT] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gOamData_831ACB0, + .oam = &gOamData_BattleSpritePlayerSide, .anims = NULL, - .images = gUnknown_082FF3A8, - .affineAnims = gUnknown_082FF618, - .callback = sub_8039BB4, + .images = gBattlerPicTable_PlayerLeft, + .affineAnims = gAffineAnims_BattleSpritePlayerSide, + .callback = SpriteCB_BattleSpriteStartSlideLeft, }, - { // B_POSITION_OPPONENT_LEFT + [B_POSITION_OPPONENT_LEFT] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gOamData_831ACA8, + .oam = &gOamData_BattleSpriteOpponentSide, .anims = NULL, - .images = gUnknown_082FF3C8, - .affineAnims = gUnknown_082FF694, + .images = gBattlerPicTable_OpponentLeft, + .affineAnims = gAffineAnims_BattleSpriteOpponentSide, .callback = SpriteCb_WildMon, }, - { // B_POSITION_PLAYER_RIGHT + [B_POSITION_PLAYER_RIGHT] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gOamData_831ACB0, + .oam = &gOamData_BattleSpritePlayerSide, .anims = NULL, - .images = gUnknown_082FF3E8, - .affineAnims = gUnknown_082FF618, - .callback = sub_8039BB4, + .images = gBattlerPicTable_PlayerRight, + .affineAnims = gAffineAnims_BattleSpritePlayerSide, + .callback = SpriteCB_BattleSpriteStartSlideLeft, }, - { // B_POSITION_OPPONENT_RIGHT + [B_POSITION_OPPONENT_RIGHT] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gOamData_831ACA8, + .oam = &gOamData_BattleSpriteOpponentSide, .anims = NULL, - .images = gUnknown_082FF408, - .affineAnims = gUnknown_082FF694, + .images = gBattlerPicTable_OpponentRight, + .affineAnims = gAffineAnims_BattleSpriteOpponentSide, .callback = SpriteCb_WildMon }, }; -static const struct SpriteTemplate gSpriteTemplateTable_TrainerBackSprites[] = +static const struct SpriteTemplate sTrainerBackSpriteTemplates[] = { - { + [TRAINER_BACK_PIC_BRENDAN] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gOamData_831ACB0, + .oam = &gOamData_BattleSpritePlayerSide, .anims = NULL, .images = gTrainerBackPicTable_Brendan, - .affineAnims = gUnknown_082FF618, - .callback = sub_8039BB4, + .affineAnims = gAffineAnims_BattleSpritePlayerSide, + .callback = SpriteCB_BattleSpriteStartSlideLeft, }, - { + [TRAINER_BACK_PIC_MAY] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gOamData_831ACB0, + .oam = &gOamData_BattleSpritePlayerSide, .anims = NULL, .images = gTrainerBackPicTable_May, - .affineAnims = gUnknown_082FF618, - .callback = sub_8039BB4, + .affineAnims = gAffineAnims_BattleSpritePlayerSide, + .callback = SpriteCB_BattleSpriteStartSlideLeft, }, - { + [TRAINER_BACK_PIC_RED] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gOamData_831ACB0, + .oam = &gOamData_BattleSpritePlayerSide, .anims = NULL, .images = gTrainerBackPicTable_Red, - .affineAnims = gUnknown_082FF618, - .callback = sub_8039BB4, + .affineAnims = gAffineAnims_BattleSpritePlayerSide, + .callback = SpriteCB_BattleSpriteStartSlideLeft, }, - { + [TRAINER_BACK_PIC_LEAF] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gOamData_831ACB0, + .oam = &gOamData_BattleSpritePlayerSide, .anims = NULL, .images = gTrainerBackPicTable_Leaf, - .affineAnims = gUnknown_082FF618, - .callback = sub_8039BB4, + .affineAnims = gAffineAnims_BattleSpritePlayerSide, + .callback = SpriteCB_BattleSpriteStartSlideLeft, }, - { + [TRAINER_BACK_PIC_RUBY_SAPPHIRE_BRENDAN] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gOamData_831ACB0, + .oam = &gOamData_BattleSpritePlayerSide, .anims = NULL, .images = gTrainerBackPicTable_RubySapphireBrendan, - .affineAnims = gUnknown_082FF618, - .callback = sub_8039BB4, + .affineAnims = gAffineAnims_BattleSpritePlayerSide, + .callback = SpriteCB_BattleSpriteStartSlideLeft, }, - { + [TRAINER_BACK_PIC_RUBY_SAPPHIRE_MAY] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gOamData_831ACB0, + .oam = &gOamData_BattleSpritePlayerSide, .anims = NULL, .images = gTrainerBackPicTable_RubySapphireMay, - .affineAnims = gUnknown_082FF618, - .callback = sub_8039BB4, + .affineAnims = gAffineAnims_BattleSpritePlayerSide, + .callback = SpriteCB_BattleSpriteStartSlideLeft, }, - { + [TRAINER_BACK_PIC_WALLY] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gOamData_831ACB0, + .oam = &gOamData_BattleSpritePlayerSide, .anims = NULL, .images = gTrainerBackPicTable_Wally, - .affineAnims = gUnknown_082FF618, - .callback = sub_8039BB4, + .affineAnims = gAffineAnims_BattleSpritePlayerSide, + .callback = SpriteCB_BattleSpriteStartSlideLeft, }, - { + [TRAINER_BACK_PIC_STEVEN] = { .tileTag = 0xFFFF, .paletteTag = 0, - .oam = &gOamData_831ACB0, + .oam = &gOamData_BattleSpritePlayerSide, .anims = NULL, .images = gTrainerBackPicTable_Steven, - .affineAnims = gUnknown_082FF618, - .callback = sub_8039BB4, + .affineAnims = gAffineAnims_BattleSpritePlayerSide, + .callback = SpriteCB_BattleSpriteStartSlideLeft, }, }; @@ -2623,14 +2623,15 @@ void CreateObedientMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u SetMonData(mon, MON_DATA_OBEDIENCE, &obedient); } -bool8 sub_80688F8(u8 caseId, u8 battlerId) +// If FALSE, should load this game's Deoxys form. If TRUE, should load normal Deoxys form +bool8 ShouldIgnoreDeoxysForm(u8 caseId, u8 battlerId) { switch (caseId) { case 0: default: return FALSE; - case 1: + case 1: // Player's side in battle if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) return FALSE; if (!gMain.inBattle) @@ -2640,7 +2641,7 @@ bool8 sub_80688F8(u8 caseId, u8 battlerId) break; case 2: break; - case 3: + case 3: // Summary Screen if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) return FALSE; if (!gMain.inBattle) @@ -2650,7 +2651,7 @@ bool8 sub_80688F8(u8 caseId, u8 battlerId) return FALSE; case 4: break; - case 5: + case 5: // In move animation, e.g. in Role Play or Snatch if (gBattleTypeFlags & BATTLE_TYPE_LINK) { if (!gMain.inBattle) @@ -3454,7 +3455,7 @@ void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition) else if (gUnknown_020249B4[1]) gMultiuseSpriteTemplate = gUnknown_020249B4[1]->templates[battlerPosition]; else - gMultiuseSpriteTemplate = gUnknown_08329D98[battlerPosition]; + gMultiuseSpriteTemplate = gBattlerSpriteTemplates[battlerPosition]; gMultiuseSpriteTemplate.paletteTag = speciesTag; if (battlerPosition == B_POSITION_PLAYER_LEFT || battlerPosition == B_POSITION_PLAYER_RIGHT) @@ -3470,7 +3471,7 @@ void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosit gMultiuseSpriteTemplate.paletteTag = trainerSpriteId; if (battlerPosition == B_POSITION_PLAYER_LEFT || battlerPosition == B_POSITION_PLAYER_RIGHT) { - gMultiuseSpriteTemplate = gSpriteTemplateTable_TrainerBackSprites[trainerSpriteId]; + gMultiuseSpriteTemplate = sTrainerBackSpriteTemplates[trainerSpriteId]; gMultiuseSpriteTemplate.anims = gTrainerBackAnimsPtrTable[trainerSpriteId]; } else @@ -3478,7 +3479,7 @@ void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosit if (gMonSpritesGfxPtr != NULL) gMultiuseSpriteTemplate = gMonSpritesGfxPtr->templates[battlerPosition]; else - gMultiuseSpriteTemplate = gUnknown_08329D98[battlerPosition]; + gMultiuseSpriteTemplate = gBattlerSpriteTemplates[battlerPosition]; gMultiuseSpriteTemplate.anims = gTrainerFrontAnimsPtrTable[trainerSpriteId]; } } @@ -3488,7 +3489,7 @@ void SetMultiuseSpriteTemplateToTrainerFront(u16 arg0, u8 battlerPosition) if (gMonSpritesGfxPtr != NULL) gMultiuseSpriteTemplate = gMonSpritesGfxPtr->templates[battlerPosition]; else - gMultiuseSpriteTemplate = gUnknown_08329D98[battlerPosition]; + gMultiuseSpriteTemplate = gBattlerSpriteTemplates[battlerPosition]; gMultiuseSpriteTemplate.paletteTag = arg0; gMultiuseSpriteTemplate.anims = gTrainerFrontAnimsPtrTable[arg0]; @@ -5594,96 +5595,63 @@ u16 SpeciesToCryId(u16 species) return gSpeciesIdToCryId[species - (SPECIES_TREECKO - 1)]; } -void sub_806D544(u16 species, u32 personality, u8 *dest) +#define DRAW_SPINDA_SPOTS \ +{ \ + int i; \ + for (i = 0; i < 4; i++) \ + { \ + int j; \ + u8 x = gSpindaSpotGraphics[i].x + ((personality & 0x0F) - 8); \ + u8 y = gSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) - 8); \ + \ + for (j = 0; j < 16; j++) \ + { \ + int k; \ + s32 row = gSpindaSpotGraphics[i].image[j]; \ + \ + for (k = x; k < x + 16; k++) \ + { \ + u8 *val = dest + ((k / 8) * 32) + \ + ((k % 8) / 2) + \ + ((y >> 3) << 8) + \ + ((y & 7) << 2); \ + \ + if (row & 1) \ + { \ + if (k & 1) \ + { \ + if ((u8)((*val & 0xF0) - 0x10) <= 0x20) \ + *val += 0x40; \ + } \ + else \ + { \ + if ((u8)((*val & 0xF) - 0x01) <= 0x02) \ + *val += 0x04; \ + } \ + } \ + \ + row >>= 1; \ + } \ + \ + y++; \ + } \ + \ + personality >>= 8; \ + } \ +} + +static void DrawSpindaSpotsUnused(u16 species, u32 personality, u8 *dest) { if (species == SPECIES_SPINDA && dest != gMonSpritesGfxPtr->sprites.ptr[0] && dest != gMonSpritesGfxPtr->sprites.ptr[2]) - { - int i; - for (i = 0; i < 4; i++) - { - int j; - u8 x = gSpindaSpotGraphics[i].x + ((personality & 0x0F) - 8); - u8 y = gSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) - 8); - - for (j = 0; j < 16; j++) - { - int k; - s32 row = gSpindaSpotGraphics[i].image[j]; - - for (k = x; k < x + 16; k++) - { - u8 *val = dest + ((k / 8) * 32) + ((k % 8) / 2) + ((y >> 3) << 8) + ((y & 7) << 2); - - if (row & 1) - { - if (k & 1) - { - if ((u8)((*val & 0xF0) - 0x10) <= 0x20) - *val += 0x40; - } - else - { - if ((u8)((*val & 0xF) - 0x01) <= 0x02) - *val += 0x04; - } - } - - row >>= 1; - } - - y++; - } - - personality >>= 8; - } - } + DRAW_SPINDA_SPOTS; } -void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, u8 a4) +void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, bool8 isFrontPic) { - if (species == SPECIES_SPINDA && a4) - { - int i; - for (i = 0; i < 4; i++) - { - int j; - u8 x = gSpindaSpotGraphics[i].x + ((personality & 0x0F) - 8); - u8 y = gSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) - 8); - - for (j = 0; j < 16; j++) - { - int k; - s32 row = gSpindaSpotGraphics[i].image[j]; - - for (k = x; k < x + 16; k++) - { - u8 *val = dest + ((k / 8) * 32) + ((k % 8) / 2) + ((y >> 3) << 8) + ((y & 7) << 2); - - if (row & 1) - { - if (k & 1) - { - if ((u8)((*val & 0xF0) - 0x10) <= 0x20) - *val += 0x40; - } - else - { - if ((u8)((*val & 0xF) - 0x01) <= 0x02) - *val += 0x04; - } - } - - row >>= 1; - } - - y++; - } - - personality >>= 8; - } - } + if (species == SPECIES_SPINDA && isFrontPic) + DRAW_SPINDA_SPOTS; } void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies) @@ -6824,7 +6792,7 @@ static void sub_806F160(struct Unknown_806F160_Struct* structPtr) u16 i, j; for (i = 0; i < structPtr->field_0_0; i++) { - structPtr->templates[i] = gUnknown_08329D98[i]; + structPtr->templates[i] = gBattlerSpriteTemplates[i]; for (j = 0; j < structPtr->field_1; j++) { structPtr->frameImages[i * structPtr->field_1 + j].data = &structPtr->byteArrays[i][j * 0x800]; diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index 9c8eaca9a..da30963b5 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -1047,7 +1047,7 @@ static void sub_817F77C(struct Sprite *sprite) { // FIX: Reset these back to normal after they were changed so Poké Ball catch/release // animations without a screen transition in between don't break - sprite->affineAnims = gUnknown_082FF694; + sprite->affineAnims = gAffineAnims_BattleSpriteOpponentSide; } #endif // BUGFIX } diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c index 914752eb4..af40c2c18 100755 --- a/src/pokemon_jump.c +++ b/src/pokemon_jump.c @@ -3426,8 +3426,8 @@ static void sub_802DB8C(void) static const u8 gUnknown_082FE1DF[] = {2, 2, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0}; -static const struct CompressedSpriteSheet gUnknown_082FE1EC = {gUnknown_082FF1F8, 0, 0x320}; -static const struct SpritePalette gUnknown_082FE1F4 = {gUnknown_082FF1D8, 0x320}; +static const struct CompressedSpriteSheet sSpriteSheet_Digits = {gMinigameDigits_Gfx, 0, 0x320}; +static const struct SpritePalette sSpritePalette_Digits = {gMinigameDigits_Pal, 0x320}; static const u16 gUnknown_082FE1FC[] = {0x06, 0x08, 0x10, 0x08}; static const u16 gUnknown_082FE204[] = {0x06, 0x08, 0x0b, 0x06, 0x10, 0x08}; @@ -3513,8 +3513,8 @@ static void sub_802DD08(void) ptr->xDelta = 8; ptr->x = 108; ptr->y = 6; - ptr->spriteSheet = (void*) &gUnknown_082FE1EC; - ptr->spritePal = &gUnknown_082FE1F4; + ptr->spriteSheet = (void*) &sSpriteSheet_Digits; + ptr->spritePal = &sSpritePalette_Digits; DigitObjUtil_Init(2); DigitObjUtil_CreatePrinter(0, 0, ptr); diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 50fc04372..eaa9416cf 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -5898,12 +5898,12 @@ static bool8 sub_80CD554(void) return TRUE; } -static void sub_80CD6AC(u8 newCurosrArea, u8 newCursorPosition) +static void sub_80CD6AC(u8 newCursorArea, u8 newCursorPosition) { u16 x, y; - sub_80CD444(newCurosrArea, newCursorPosition, &x, &y); - sPSSData->field_CD4 = newCurosrArea; + sub_80CD444(newCursorArea, newCursorPosition, &x, &y); + sPSSData->field_CD4 = newCursorArea; sPSSData->field_CD5 = newCursorPosition; sPSSData->field_CCC = x; sPSSData->field_CCE = y; @@ -5955,9 +5955,9 @@ static void sub_80CD70C(void) sPSSData->field_CC0 = sPSSData->field_CB4->pos1.y << 8; } -static void sub_80CD894(u8 newCurosrArea, u8 newCursorPosition) +static void sub_80CD894(u8 newCursorArea, u8 newCursorPosition) { - sub_80CD6AC(newCurosrArea, newCursorPosition); + sub_80CD6AC(newCursorArea, newCursorPosition); sub_80CD70C(); if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) { @@ -5977,19 +5977,19 @@ static void sub_80CD894(u8 newCurosrArea, u8 newCursorPosition) else if (sBoxCursorArea == CURSOR_AREA_IN_PARTY) sub_80D0E50(CURSOR_AREA_IN_PARTY, sBoxCursorPosition); - if (newCurosrArea == CURSOR_AREA_IN_BOX) - sub_80D0D8C(newCurosrArea, newCursorPosition); - else if (newCurosrArea == CURSOR_AREA_IN_PARTY) - sub_80D0D8C(newCurosrArea, newCursorPosition); + if (newCursorArea == CURSOR_AREA_IN_BOX) + sub_80D0D8C(newCursorArea, newCursorPosition); + else if (newCursorArea == CURSOR_AREA_IN_PARTY) + sub_80D0D8C(newCursorArea, newCursorPosition); } - if (newCurosrArea == CURSOR_AREA_IN_PARTY && sBoxCursorArea != CURSOR_AREA_IN_PARTY) + if (newCursorArea == CURSOR_AREA_IN_PARTY && sBoxCursorArea != CURSOR_AREA_IN_PARTY) { - sPSSData->field_CD6 = newCurosrArea; + sPSSData->field_CD6 = newCursorArea; sPSSData->field_CB8->invisible = TRUE; } - switch (newCurosrArea) + switch (newCursorArea) { case CURSOR_AREA_IN_PARTY: case CURSOR_AREA_BOX: diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index fce2a893c..b3cc1e516 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -3857,7 +3857,7 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state) case 0: if (gMain.inBattle) { - if (sub_80688F8(3, sMonSummaryScreen->curMonIndex)) + if (ShouldIgnoreDeoxysForm(3, sMonSummaryScreen->curMonIndex)) HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid); else HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid); diff --git a/src/recorded_battle.c b/src/recorded_battle.c index 6fcbe04f1..fa30c9863 100644 --- a/src/recorded_battle.c +++ b/src/recorded_battle.c @@ -75,10 +75,10 @@ struct RecordedBattleSave EWRAM_DATA u32 gRecordedBattleRngSeed = 0; EWRAM_DATA u32 gBattlePalaceMoveSelectionRngValue = 0; EWRAM_DATA static u8 sBattleRecords[MAX_BATTLERS_COUNT][BATTLER_RECORD_SIZE] = {0}; -EWRAM_DATA static u16 sRecordedBytesNo[MAX_BATTLERS_COUNT] = {0}; -EWRAM_DATA static u16 sUnknown_0203C79C[4] = {0}; -EWRAM_DATA static u16 sUnknown_0203C7A4[4] = {0}; -EWRAM_DATA static u8 sUnknown_0203C7AC = 0; +EWRAM_DATA static u16 sBattlerRecordSizes[MAX_BATTLERS_COUNT] = {0}; +EWRAM_DATA static u16 sBattlerPrevRecordSizes[MAX_BATTLERS_COUNT] = {0}; +EWRAM_DATA static u16 sBattlerSavedRecordSizes[MAX_BATTLERS_COUNT] = {0}; +EWRAM_DATA static u8 sRecordMode = 0; EWRAM_DATA static u8 sLvlMode = 0; EWRAM_DATA static u8 sFrontierFacility = 0; EWRAM_DATA static u8 sFrontierBrainSymbol = 0; @@ -93,7 +93,7 @@ EWRAM_DATA static struct Pokemon sSavedPlayerParty[PARTY_SIZE] = {0}; EWRAM_DATA static struct Pokemon sSavedOpponentParty[PARTY_SIZE] = {0}; EWRAM_DATA static u16 sPlayerMonMoves[2][MAX_MON_MOVES] = {0}; EWRAM_DATA static struct PlayerInfo sPlayers[MAX_BATTLERS_COUNT] = {0}; -EWRAM_DATA static u8 sUnknown_0203CCD0 = 0; +EWRAM_DATA static bool8 sUnknown_0203CCD0 = 0; EWRAM_DATA static u8 sRecordMixFriendName[PLAYER_NAME_LENGTH + 1] = {0}; EWRAM_DATA static u8 sRecordMixFriendClass = 0; EWRAM_DATA static u8 sApprenticeId = 0; @@ -103,26 +103,25 @@ EWRAM_DATA static u8 sBattleOutcome = 0; static u8 sRecordMixFriendLanguage; static u8 sApprenticeLanguage; -// this file's functions -static u8 sub_8185278(u8 *arg0, u8 *arg1, u8 *arg2); -static bool32 CopyRecordedBattleFromSave(struct RecordedBattleSave *dst); +static u8 GetNextRecordedDataByte(u8 *, u8 *, u8 *); +static bool32 CopyRecordedBattleFromSave(struct RecordedBattleSave *); static void RecordedBattle_RestoreSavedParties(void); static void CB2_RecordedBattle(void); -void sub_8184DA4(u8 arg0) +void RecordedBattle_Init(u8 mode) { s32 i, j; - sUnknown_0203C7AC = arg0; - sUnknown_0203CCD0 = 0; + sRecordMode = mode; + sUnknown_0203CCD0 = FALSE; for (i = 0; i < MAX_BATTLERS_COUNT; i++) { - sRecordedBytesNo[i] = 0; - sUnknown_0203C79C[i] = 0; - sUnknown_0203C7A4[i] = 0; + sBattlerRecordSizes[i] = 0; + sBattlerPrevRecordSizes[i] = 0; + sBattlerSavedRecordSizes[i] = 0; - if (arg0 == 1) + if (mode == B_RECORD_MODE_RECORDING) { for (j = 0; j < BATTLER_RECORD_SIZE; j++) { @@ -138,13 +137,13 @@ void sub_8184E58(void) { s32 i, j; - if (sUnknown_0203C7AC == 1) + if (sRecordMode == B_RECORD_MODE_RECORDING) { gRecordedBattleRngSeed = gRngValue; sFrontierFacility = VarGet(VAR_FRONTIER_FACILITY); sFrontierBrainSymbol = GetFronterBrainSymbol(); } - else if (sUnknown_0203C7AC == 2) + else if (sRecordMode == B_RECORD_MODE_PLAYBACK) { gRngValue = gRecordedBattleRngSeed; } @@ -195,9 +194,9 @@ void sub_8184E58(void) void RecordedBattle_SetBattlerAction(u8 battlerId, u8 action) { - if (sRecordedBytesNo[battlerId] < BATTLER_RECORD_SIZE && sUnknown_0203C7AC != 2) + if (sBattlerRecordSizes[battlerId] < BATTLER_RECORD_SIZE && sRecordMode != B_RECORD_MODE_PLAYBACK) { - sBattleRecords[battlerId][sRecordedBytesNo[battlerId]++] = action; + sBattleRecords[battlerId][sBattlerRecordSizes[battlerId]++] = action; } } @@ -207,9 +206,9 @@ void RecordedBattle_ClearBattlerAction(u8 battlerId, u8 bytesToClear) for (i = 0; i < bytesToClear; i++) { - sRecordedBytesNo[battlerId]--; - sBattleRecords[battlerId][sRecordedBytesNo[battlerId]] = 0xFF; - if (sRecordedBytesNo[battlerId] == 0) + sBattlerRecordSizes[battlerId]--; + sBattleRecords[battlerId][sBattlerRecordSizes[battlerId]] = 0xFF; + if (sBattlerRecordSizes[battlerId] == 0) break; } } @@ -217,7 +216,7 @@ void RecordedBattle_ClearBattlerAction(u8 battlerId, u8 bytesToClear) u8 RecordedBattle_GetBattlerAction(u8 battlerId) { // Trying to read past array or invalid action byte, battle is over. - if (sRecordedBytesNo[battlerId] >= BATTLER_RECORD_SIZE || sBattleRecords[battlerId][sRecordedBytesNo[battlerId]] == 0xFF) + if (sBattlerRecordSizes[battlerId] >= BATTLER_RECORD_SIZE || sBattleRecords[battlerId][sBattlerRecordSizes[battlerId]] == 0xFF) { gSpecialVar_Result = gBattleOutcome = B_OUTCOME_PLAYER_TELEPORTED; // hah ResetPaletteFadeControl(); @@ -227,44 +226,45 @@ u8 RecordedBattle_GetBattlerAction(u8 battlerId) } else { - return sBattleRecords[battlerId][sRecordedBytesNo[battlerId]++]; + return sBattleRecords[battlerId][sBattlerRecordSizes[battlerId]++]; } } -u8 sub_81850D0(void) +// Unused +static u8 GetRecordedBattleMode(void) { - return sUnknown_0203C7AC; + return sRecordMode; } -u8 sub_81850DC(u8 *arg0) +u8 RecordedBattle_BufferNewBattlerData(u8 *dst) { u8 i, j; - u8 ret = 0; + u8 idx = 0; for (i = 0; i < MAX_BATTLERS_COUNT; i++) { - if (sRecordedBytesNo[i] != sUnknown_0203C79C[i]) + if (sBattlerRecordSizes[i] != sBattlerPrevRecordSizes[i]) { - arg0[ret++] = i; - arg0[ret++] = sRecordedBytesNo[i] - sUnknown_0203C79C[i]; + dst[idx++] = i; + dst[idx++] = sBattlerRecordSizes[i] - sBattlerPrevRecordSizes[i]; - for (j = 0; j < sRecordedBytesNo[i] - sUnknown_0203C79C[i]; j++) + for (j = 0; j < sBattlerRecordSizes[i] - sBattlerPrevRecordSizes[i]; j++) { - arg0[ret++] = sBattleRecords[i][sUnknown_0203C79C[i] + j]; + dst[idx++] = sBattleRecords[i][sBattlerPrevRecordSizes[i] + j]; } - sUnknown_0203C79C[i] = sRecordedBytesNo[i]; + sBattlerPrevRecordSizes[i] = sBattlerRecordSizes[i]; } } - return ret; + return idx; } -void sub_81851A8(u8 *arg0) +void RecordedBattle_RecordAllBattlerData(u8 *src) { s32 i; - u8 var1 = 2; - u8 var2; + u8 idx = 2; + u8 size; if (!(gBattleTypeFlags & BATTLE_TYPE_LINK)) return; @@ -277,23 +277,23 @@ void sub_81851A8(u8 *arg0) if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)) { - for (var2 = *arg0; var2 != 0;) + for (size = *src; size != 0;) { - u8 unkVar = sub_8185278(arg0, &var1, &var2); - u8 unkVar2 = sub_8185278(arg0, &var1, &var2); + u8 battlerId = GetNextRecordedDataByte(src, &idx, &size); + u8 numActions = GetNextRecordedDataByte(src, &idx, &size); - for (i = 0; i < unkVar2; i++) + for (i = 0; i < numActions; i++) { - sBattleRecords[unkVar][sUnknown_0203C7A4[unkVar]++] = sub_8185278(arg0, &var1, &var2); + sBattleRecords[battlerId][sBattlerSavedRecordSizes[battlerId]++] = GetNextRecordedDataByte(src, &idx, &size); } } } } -static u8 sub_8185278(u8 *arg0, u8 *arg1, u8 *arg2) +static u8 GetNextRecordedDataByte(u8 *data, u8 *idx, u8 *size) { - (*arg2)--; - return arg0[(*arg1)++]; + (*size)--; + return data[(*idx)++]; } bool32 CanCopyRecordedBattleSaveData(void) @@ -720,7 +720,7 @@ void RecordedBattle_CopyBattlerMoves(void) return; if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)) return; - if (sUnknown_0203C7AC == 2) + if (sRecordMode == B_RECORD_MODE_PLAYBACK) return; for (i = 0; i < MAX_MON_MOVES; i++) @@ -767,7 +767,7 @@ void sub_818603C(u8 arg0) } else { - if (sBattleRecords[battlerId][sRecordedBytesNo[battlerId]] == ACTION_MOVE_CHANGE) + if (sBattleRecords[battlerId][sBattlerRecordSizes[battlerId]] == ACTION_MOVE_CHANGE) { u8 ppBonuses[MAX_MON_MOVES]; u8 array1[MAX_MON_MOVES]; @@ -841,12 +841,12 @@ u32 GetAiScriptsInRecordedBattle(void) void sub_8186444(void) { - sUnknown_0203CCD0 = 1; + sUnknown_0203CCD0 = TRUE; } bool8 sub_8186450(void) { - return (sUnknown_0203CCD0 == 0); + return (sUnknown_0203CCD0 == FALSE); } void GetRecordedBattleRecordMixFriendName(u8 *dst) diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index d8d75a0e0..58de22f05 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -23,7 +23,7 @@ static void CreateBattlerSprite(u8 battlerId); static void CreateHealthboxSprite(u8 battlerId); static void sub_80A95F4(void); -void nullsub_35(void) +void ReshowBattleScreenDummy(void) { } diff --git a/src/scrcmd.c b/src/scrcmd.c index f36a44187..f599a0004 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -53,8 +53,8 @@ typedef u16 (*SpecialFunc)(void); typedef void (*NativeFunc)(void); -EWRAM_DATA const u8 *gUnknown_020375C0 = NULL; -static EWRAM_DATA u32 gUnknown_020375C4 = 0; +EWRAM_DATA const u8 *gRamScriptRetAddr = NULL; +static EWRAM_DATA u32 sAddressOffset = 0; // For relative addressing in vgoto etc., used by saved scripts (e.g. Mystery Event) static EWRAM_DATA u16 sPauseCounter = 0; static EWRAM_DATA u16 sMovingNpcId = 0; static EWRAM_DATA u16 sMovingNpcMapBank = 0; @@ -192,7 +192,7 @@ bool8 ScrCmd_setvaddress(struct ScriptContext *ctx) u32 addr1 = (u32)ctx->scriptPtr - 1; u32 addr2 = ScriptReadWord(ctx); - gUnknown_020375C4 = addr2 - addr1; + sAddressOffset = addr2 - addr1; return FALSE; } @@ -200,7 +200,7 @@ bool8 ScrCmd_vgoto(struct ScriptContext *ctx) { u32 addr = ScriptReadWord(ctx); - ScriptJump(ctx, (u8 *)(addr - gUnknown_020375C4)); + ScriptJump(ctx, (u8 *)(addr - sAddressOffset)); return FALSE; } @@ -208,14 +208,14 @@ bool8 ScrCmd_vcall(struct ScriptContext *ctx) { u32 addr = ScriptReadWord(ctx); - ScriptCall(ctx, (u8 *)(addr - gUnknown_020375C4)); + ScriptCall(ctx, (u8 *)(addr - sAddressOffset)); return FALSE; } bool8 ScrCmd_vgoto_if(struct ScriptContext *ctx) { u8 condition = ScriptReadByte(ctx); - const u8 *ptr = (const u8 *)(ScriptReadWord(ctx) - gUnknown_020375C4); + const u8 *ptr = (const u8 *)(ScriptReadWord(ctx) - sAddressOffset); if (sScriptConditionTable[condition][ctx->comparisonResult] == 1) ScriptJump(ctx, ptr); @@ -225,7 +225,7 @@ bool8 ScrCmd_vgoto_if(struct ScriptContext *ctx) bool8 ScrCmd_vcall_if(struct ScriptContext *ctx) { u8 condition = ScriptReadByte(ctx); - const u8 *ptr = (const u8 *)(ScriptReadWord(ctx) - gUnknown_020375C4); + const u8 *ptr = (const u8 *)(ScriptReadWord(ctx) - sAddressOffset); if (sScriptConditionTable[condition][ctx->comparisonResult] == 1) ScriptCall(ctx, ptr); @@ -282,7 +282,7 @@ bool8 ScrCmd_callstd_if(struct ScriptContext *ctx) bool8 ScrCmd_returnram(struct ScriptContext *ctx) { - ScriptJump(ctx, gUnknown_020375C0); + ScriptJump(ctx, gRamScriptRetAddr); return FALSE; } @@ -378,32 +378,30 @@ bool8 ScrCmd_setorcopyvar(struct ScriptContext *ctx) return FALSE; } -u8 compare_012(u16 a1, u16 a2) +u8 Compare(u16 a, u16 b) { - if (a1 < a2) + if (a < b) return 0; - if (a1 == a2) + if (a == b) return 1; return 2; } -// comparelocaltolocal bool8 ScrCmd_compare_local_to_local(struct ScriptContext *ctx) { const u8 value1 = ctx->data[ScriptReadByte(ctx)]; const u8 value2 = ctx->data[ScriptReadByte(ctx)]; - ctx->comparisonResult = compare_012(value1, value2); + ctx->comparisonResult = Compare(value1, value2); return FALSE; } -// comparelocaltoimm bool8 ScrCmd_compare_local_to_value(struct ScriptContext *ctx) { const u8 value1 = ctx->data[ScriptReadByte(ctx)]; const u8 value2 = ScriptReadByte(ctx); - ctx->comparisonResult = compare_012(value1, value2); + ctx->comparisonResult = Compare(value1, value2); return FALSE; } @@ -412,7 +410,7 @@ bool8 ScrCmd_compare_local_to_addr(struct ScriptContext *ctx) const u8 value1 = ctx->data[ScriptReadByte(ctx)]; const u8 value2 = *(const u8 *)ScriptReadWord(ctx); - ctx->comparisonResult = compare_012(value1, value2); + ctx->comparisonResult = Compare(value1, value2); return FALSE; } @@ -421,7 +419,7 @@ bool8 ScrCmd_compare_addr_to_local(struct ScriptContext *ctx) const u8 value1 = *(const u8 *)ScriptReadWord(ctx); const u8 value2 = ctx->data[ScriptReadByte(ctx)]; - ctx->comparisonResult = compare_012(value1, value2); + ctx->comparisonResult = Compare(value1, value2); return FALSE; } @@ -430,7 +428,7 @@ bool8 ScrCmd_compare_addr_to_value(struct ScriptContext *ctx) const u8 value1 = *(const u8 *)ScriptReadWord(ctx); const u8 value2 = ScriptReadByte(ctx); - ctx->comparisonResult = compare_012(value1, value2); + ctx->comparisonResult = Compare(value1, value2); return FALSE; } @@ -439,7 +437,7 @@ bool8 ScrCmd_compare_addr_to_addr(struct ScriptContext *ctx) const u8 value1 = *(const u8 *)ScriptReadWord(ctx); const u8 value2 = *(const u8 *)ScriptReadWord(ctx); - ctx->comparisonResult = compare_012(value1, value2); + ctx->comparisonResult = Compare(value1, value2); return FALSE; } @@ -448,7 +446,7 @@ bool8 ScrCmd_compare_var_to_value(struct ScriptContext *ctx) const u16 value1 = *GetVarPointer(ScriptReadHalfword(ctx)); const u16 value2 = ScriptReadHalfword(ctx); - ctx->comparisonResult = compare_012(value1, value2); + ctx->comparisonResult = Compare(value1, value2); return FALSE; } @@ -457,7 +455,7 @@ bool8 ScrCmd_compare_var_to_var(struct ScriptContext *ctx) const u16 *ptr1 = GetVarPointer(ScriptReadHalfword(ctx)); const u16 *ptr2 = GetVarPointer(ScriptReadHalfword(ctx)); - ctx->comparisonResult = compare_012(*ptr1, *ptr2); + ctx->comparisonResult = Compare(*ptr1, *ptr2); return FALSE; } @@ -1120,7 +1118,7 @@ bool8 ScrCmd_showobject_at(struct ScriptContext *ctx) u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); - npc_by_local_id_and_map_set_field_1_bit_x20(localId, mapNum, mapGroup, 0); + SetObjectInvisibility(localId, mapNum, mapGroup, FALSE); return FALSE; } @@ -1130,7 +1128,7 @@ bool8 ScrCmd_hideobject_at(struct ScriptContext *ctx) u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); - npc_by_local_id_and_map_set_field_1_bit_x20(localId, mapNum, mapGroup, 1); + SetObjectInvisibility(localId, mapNum, mapGroup, TRUE); return FALSE; } @@ -1141,7 +1139,7 @@ bool8 ScrCmd_setobjectpriority(struct ScriptContext *ctx) u8 mapNum = ScriptReadByte(ctx); u8 priority = ScriptReadByte(ctx); - sub_808E78C(localId, mapNum, mapGroup, priority + 83); + SetObjectPriority(localId, mapNum, mapGroup, priority + 83); return FALSE; } @@ -1151,7 +1149,7 @@ bool8 ScrCmd_resetobjectpriority(struct ScriptContext *ctx) u8 mapGroup = ScriptReadByte(ctx); u8 mapNum = ScriptReadByte(ctx); - sub_808E7E4(localId, mapNum, mapGroup); + ResetObjectPriority(localId, mapNum, mapGroup); return FALSE; } @@ -1214,7 +1212,7 @@ bool8 ScrCmd_lockall(struct ScriptContext *ctx) else { ScriptFreezeObjectEvents(); - SetupNativeScript(ctx, sub_80983C4); + SetupNativeScript(ctx, IsFreezePlayerFinished); return TRUE; } } @@ -1230,12 +1228,12 @@ bool8 ScrCmd_lock(struct ScriptContext *ctx) if (gObjectEvents[gSelectedObjectEvent].active) { LockSelectedObjectEvent(); - SetupNativeScript(ctx, sub_809847C); + SetupNativeScript(ctx, IsFreezeSelectedObjectAndPlayerFinished); } else { ScriptFreezeObjectEvents(); - SetupNativeScript(ctx, sub_80983C4); + SetupNativeScript(ctx, IsFreezePlayerFinished); } return TRUE; } @@ -1299,7 +1297,8 @@ bool8 ScrCmd_messageautoscroll(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_cmdDB(struct ScriptContext *ctx) +// Prints all at once. Skips waiting for player input. Only used by link contests +bool8 ScrCmd_messageinstant(struct ScriptContext *ctx) { const u8 *msg = (const u8 *)ScriptReadWord(ctx); @@ -1489,27 +1488,30 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) u8 xWindow, yWindow, xText, yText; u8 temp; + // + 6 for the 6 bytes at the start of a braille message (brailleformat macro) + // In RS these bytes are used to position the text and window, but + // in Emerald they are unused and position is calculated below instead StringExpandPlaceholders(gStringVar4, ptr + 6); width = GetStringWidth(6, gStringVar4, -1) / 8u; - if (width > 0x1C) - width = 0x1C; + if (width > 28) + width = 28; - for (i = 0, height = 4; gStringVar4[i] != 0xFF;) + for (i = 0, height = 4; gStringVar4[i] != EOS;) { - if (gStringVar4[i++] == 0xFE) + if (gStringVar4[i++] == CHAR_NEWLINE) height += 3; } - if (height > 0x12) - height = 0x12; + if (height > 18) + height = 18; temp = width + 2; - xWindow = (0x1E - temp) / 2; + xWindow = (30 - temp) / 2; temp = height + 2; - yText = (0x14 - temp) / 2; + yText = (20 - temp) / 2; xText = xWindow; xWindow += 1; @@ -1539,9 +1541,9 @@ bool8 ScrCmd_closebraillemessage(struct ScriptContext *ctx) bool8 ScrCmd_vmessage(struct ScriptContext *ctx) { - u32 v1 = ScriptReadWord(ctx); + u32 msg = ScriptReadWord(ctx); - ShowFieldMessage((u8 *)(v1 - gUnknown_020375C4)); + ShowFieldMessage((u8 *)(msg - sAddressOffset)); return FALSE; } @@ -1651,7 +1653,7 @@ bool8 ScrCmd_bufferstring(struct ScriptContext *ctx) bool8 ScrCmd_vloadword(struct ScriptContext *ctx) { - const u8 *ptr = (u8 *)(ScriptReadWord(ctx) - gUnknown_020375C4); + const u8 *ptr = (u8 *)(ScriptReadWord(ctx) - sAddressOffset); StringExpandPlaceholders(gStringVar4, ptr); return FALSE; @@ -1662,7 +1664,7 @@ bool8 ScrCmd_vbufferstring(struct ScriptContext *ctx) u8 stringVarIndex = ScriptReadByte(ctx); u32 addr = ScriptReadWord(ctx); - const u8 *src = (u8 *)(addr - gUnknown_020375C4); + const u8 *src = (u8 *)(addr - sAddressOffset); u8 *dest = sScriptStringVars[stringVarIndex]; StringCopy(dest, src); return FALSE; @@ -1900,6 +1902,7 @@ bool8 ScrCmd_pokemartdecoration(struct ScriptContext *ctx) return TRUE; } +// Changes clerk dialogue slightly from above. See MART_TYPE_DECOR2 bool8 ScrCmd_pokemartdecoration2(struct ScriptContext *ctx) { const void *ptr = (void *)ScriptReadWord(ctx); @@ -2104,6 +2107,7 @@ bool8 ScrCmd_setdoorclosed(struct ScriptContext *ctx) return FALSE; } +// Below two are functions for elevators in RS, do nothing in Emerald bool8 ScrCmd_addelevmenuitem(struct ScriptContext *ctx) { u8 v3 = ScriptReadByte(ctx); @@ -2135,9 +2139,9 @@ bool8 ScrCmd_addcoins(struct ScriptContext *ctx) u16 coins = VarGet(ScriptReadHalfword(ctx)); if (AddCoins(coins) == TRUE) - gSpecialVar_Result = 0; + gSpecialVar_Result = FALSE; else - gSpecialVar_Result = 1; + gSpecialVar_Result = TRUE; return FALSE; } @@ -2146,9 +2150,9 @@ bool8 ScrCmd_removecoins(struct ScriptContext *ctx) u16 coins = VarGet(ScriptReadHalfword(ctx)); if (RemoveCoins(coins) == TRUE) - gSpecialVar_Result = 0; + gSpecialVar_Result = FALSE; else - gSpecialVar_Result = 1; + gSpecialVar_Result = TRUE; return FALSE; } @@ -2180,13 +2184,13 @@ bool8 ScrCmd_freerotatingtilepuzzle(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_cmdD8(struct ScriptContext *ctx) +bool8 ScrCmd_selectapproachingtrainer(struct ScriptContext *ctx) { gSelectedObjectEvent = GetCurrentApproachingTrainerObjectEventId(); return FALSE; } -bool8 ScrCmd_cmdD9(struct ScriptContext *ctx) +bool8 ScrCmd_lockfortrainer(struct ScriptContext *ctx) { if (IsUpdateLinkStateCBActive()) { @@ -2196,8 +2200,8 @@ bool8 ScrCmd_cmdD9(struct ScriptContext *ctx) { if (gObjectEvents[gSelectedObjectEvent].active) { - sub_8098630(); - SetupNativeScript(ctx, sub_8098734); + FreezeForApproachingTrainers(); + SetupNativeScript(ctx, IsFreezeObjectAndPlayerFinished); } return TRUE; } @@ -2225,12 +2229,12 @@ bool8 ScrCmd_checkmonobedience(struct ScriptContext *ctx) // See GetSavedRamScriptIfValid, which is NULL if ValidateReceivedWonderCard returns FALSE bool8 ScrCmd_gotoram(struct ScriptContext *ctx) { - const u8* v1 = GetSavedRamScriptIfValid(); + const u8* script = GetSavedRamScriptIfValid(); - if (v1) + if (script) { - gUnknown_020375C0 = ctx->scriptPtr; - ScriptJump(ctx, v1); + gRamScriptRetAddr = ctx->scriptPtr; + ScriptJump(ctx, script); } return FALSE; } diff --git a/src/script.c b/src/script.c index e6557aa75..69899fdb3 100644 --- a/src/script.c +++ b/src/script.c @@ -7,7 +7,7 @@ #define RAM_SCRIPT_MAGIC 51 -extern const u8* gUnknown_020375C0; +extern const u8* gRamScriptRetAddr; // ewram bss static u8 sScriptContext1Status; @@ -363,7 +363,7 @@ bool8 InitRamScript(const u8 *script, u16 scriptSize, u8 mapGroup, u8 mapNum, u8 const u8 *GetRamScript(u8 objectId, const u8 *script) { struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data; - gUnknown_020375C0 = NULL; + gRamScriptRetAddr = NULL; if (scriptData->magic != RAM_SCRIPT_MAGIC) return script; if (scriptData->mapGroup != gSaveBlock1Ptr->location.mapGroup) @@ -379,7 +379,7 @@ const u8 *GetRamScript(u8 objectId, const u8 *script) } else { - gUnknown_020375C0 = script; + gRamScriptRetAddr = script; return scriptData->script; } } diff --git a/src/shop.c b/src/shop.c index a447982fc..04afc7d0b 100755 --- a/src/shop.c +++ b/src/shop.c @@ -965,8 +965,9 @@ static void Task_BuyMenu(u8 taskId) if (gMartInfo.martType == MART_TYPE_DECOR) StringExpandPlaceholders(gStringVar4, gText_Var1IsItThatllBeVar2); - else + else // MART_TYPE_DECOR2 StringExpandPlaceholders(gStringVar4, gText_YouWantedVar1ThatllBeVar2); + BuyMenuDisplayMessage(taskId, gStringVar4, BuyMenuConfirmPurchase); } } @@ -1069,13 +1070,9 @@ static void BuyMenuTryMakePurchase(u8 taskId) if (DecorationAdd(tItemId)) { if (gMartInfo.martType == MART_TYPE_DECOR) - { BuyMenuDisplayMessage(taskId, gText_ThankYouIllSendItHome, BuyMenuSubtractMoney); - } - else - { + else // MART_TYPE_DECOR2 BuyMenuDisplayMessage(taskId, gText_ThanksIllSendItHome, BuyMenuSubtractMoney); - } } else { diff --git a/src/start_menu.c b/src/start_menu.c index bfced1858..8e165b3be 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -541,7 +541,7 @@ void ShowStartMenu(void) if (!IsUpdateLinkStateCBActive()) { FreezeObjectEvents(); - sub_808B864(); + PlayerFreeze(); sub_808BCF4(); } CreateStartMenuTask(Task_ShowStartMenu); diff --git a/src/task.c b/src/task.c index a97496009..3a3ddadfd 100644 --- a/src/task.c +++ b/src/task.c @@ -136,32 +136,20 @@ void TaskDummy(u8 taskId) { } -#define TASK_DATA_OP(taskId, offset, op) \ -{ \ - u32 tasksAddr = (u32)gTasks; \ - u32 addr = taskId * sizeof(struct Task) + offset; \ - u32 dataAddr = tasksAddr + offsetof(struct Task, data); \ - addr += dataAddr; \ - op; \ -} - void SetTaskFuncWithFollowupFunc(u8 taskId, TaskFunc func, TaskFunc followupFunc) { - TASK_DATA_OP(taskId, 28, *((u16 *)addr) = (u32)followupFunc) - TASK_DATA_OP(taskId, 30, *((u16 *)addr) = (u32)followupFunc >> 16) + u8 followupFuncIndex = NUM_TASK_DATA - 2; // Should be const. + + gTasks[taskId].data[followupFuncIndex] = (s16)((u32)followupFunc); + gTasks[taskId].data[followupFuncIndex + 1] = (s16)((u32)followupFunc >> 16); // Store followupFunc as two half-words in the data array. gTasks[taskId].func = func; } void SwitchTaskToFollowupFunc(u8 taskId) { - s32 func; - - gTasks[taskId].func = NULL; - - TASK_DATA_OP(taskId, 28, func = *((u16 *)addr)) - TASK_DATA_OP(taskId, 30, func |= *((s16 *)addr) << 16) + u8 followupFuncIndex = NUM_TASK_DATA - 2; // Should be const. - gTasks[taskId].func = (TaskFunc)func; + gTasks[taskId].func = (TaskFunc)((u16)(gTasks[taskId].data[followupFuncIndex]) | (gTasks[taskId].data[followupFuncIndex + 1] << 16)); } bool8 FuncIsActiveTask(TaskFunc func) @@ -183,7 +171,7 @@ u8 FindTaskIdByFunc(TaskFunc func) if (gTasks[i].isActive == TRUE && gTasks[i].func == func) return (u8)i; - return 0xFF; + return TAIL_SENTINEL; // No task was found. } u8 GetTaskCount(void) diff --git a/src/trainer_pokemon_sprites.c b/src/trainer_pokemon_sprites.c index c23047b01..aab4142db 100644 --- a/src/trainer_pokemon_sprites.c +++ b/src/trainer_pokemon_sprites.c @@ -262,12 +262,12 @@ u16 CreatePicSprite2(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s1 sCreatingSpriteTemplate.images = images; if (flags2 == 0x01) { - sCreatingSpriteTemplate.affineAnims = gUnknown_082FF694; + sCreatingSpriteTemplate.affineAnims = gAffineAnims_BattleSpriteOpponentSide; sCreatingSpriteTemplate.oam = &gUnknown_0860B06C; } else if (flags2 == 0x00) { - sCreatingSpriteTemplate.affineAnims = gUnknown_082FF618; + sCreatingSpriteTemplate.affineAnims = gAffineAnims_BattleSpritePlayerSide; sCreatingSpriteTemplate.oam = &gUnknown_0860B06C; } else diff --git a/src/trainer_see.c b/src/trainer_see.c index 46fafa7e3..8a7d2a5f9 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -23,9 +23,9 @@ static u8 CheckTrainer(u8 objectEventId); static u8 GetTrainerApproachDistance(struct ObjectEvent *trainerObj); static u8 CheckPathBetweenTrainerAndPlayer(struct ObjectEvent *trainerObj, u8 approachDistance, u8 direction); -static void TrainerApproachPlayer(struct ObjectEvent *trainerObj, u8 range); +static void InitTrainerApproachTask(struct ObjectEvent *trainerObj, u8 range); static void Task_RunTrainerSeeFuncList(u8 taskId); -static void Task_DestroyTrainerApproachTask(u8 taskId); +static void Task_EndTrainerApproach(u8 taskId); static void SetIconSpriteData(struct Sprite *sprite, u16 fldEffId, u8 spriteAnimNum); static u8 GetTrainerApproachDistanceSouth(struct ObjectEvent *trainerObj, s16 range, s16 x, s16 y); @@ -33,7 +33,7 @@ static u8 GetTrainerApproachDistanceNorth(struct ObjectEvent *trainerObj, s16 ra static u8 GetTrainerApproachDistanceWest(struct ObjectEvent *trainerObj, s16 range, s16 x, s16 y); static u8 GetTrainerApproachDistanceEast(struct ObjectEvent *trainerObj, s16 range, s16 x, s16 y); -static bool8 sub_80B4178(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj); +static bool8 TrainerSeeIdle(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj); static bool8 TrainerExclamationMark(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj); static bool8 WaitTrainerExclamationMark(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj); static bool8 TrainerMoveToPlayer(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj); @@ -71,20 +71,35 @@ static u8 (*const sDirectionalApproachDistanceFuncs[])(struct ObjectEvent *train GetTrainerApproachDistanceEast, }; +enum { + TRSEE_NONE, + TRSEE_EXCLAMATION, + TRSEE_EXCLAMATION_WAIT, + TRSEE_MOVE_TO_PLAYER, + TRSEE_PLAYER_FACE, + TRSEE_PLAYER_FACE_WAIT, + TRSEE_REVEAL_DISGUISE, + TRSEE_REVEAL_DISGUISE_WAIT, + TRSEE_REVEAL_HIDDEN, + TRSEE_HIDDEN_POP_OUT, + TRSEE_HIDDEN_JUMP, + TRSEE_REVEAL_HIDDEN_WAIT, +}; + static bool8 (*const sTrainerSeeFuncList[])(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) = { - sub_80B4178, - TrainerExclamationMark, - WaitTrainerExclamationMark, - TrainerMoveToPlayer, - PlayerFaceApproachingTrainer, - WaitPlayerFaceApproachingTrainer, - RevealDisguisedTrainer, - WaitRevealDisguisedTrainer, - RevealHiddenTrainer, - PopOutOfAshHiddenTrainer, - JumpInPlaceHiddenTrainer, - WaitRevealHiddenTrainer, + [TRSEE_NONE] = TrainerSeeIdle, + [TRSEE_EXCLAMATION] = TrainerExclamationMark, + [TRSEE_EXCLAMATION_WAIT] = WaitTrainerExclamationMark, + [TRSEE_MOVE_TO_PLAYER] = TrainerMoveToPlayer, + [TRSEE_PLAYER_FACE] = PlayerFaceApproachingTrainer, + [TRSEE_PLAYER_FACE_WAIT] = WaitPlayerFaceApproachingTrainer, + [TRSEE_REVEAL_DISGUISE] = RevealDisguisedTrainer, + [TRSEE_REVEAL_DISGUISE_WAIT] = WaitRevealDisguisedTrainer, + [TRSEE_REVEAL_HIDDEN] = RevealHiddenTrainer, + [TRSEE_HIDDEN_POP_OUT] = PopOutOfAshHiddenTrainer, + [TRSEE_HIDDEN_JUMP] = JumpInPlaceHiddenTrainer, + [TRSEE_REVEAL_HIDDEN_WAIT] = WaitRevealHiddenTrainer, }; static bool8 (*const sTrainerSeeFuncList2[])(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) = @@ -233,7 +248,7 @@ bool8 CheckForTrainersWantingBattle(void) static u8 CheckTrainer(u8 objectEventId) { const u8 *scriptPtr; - u8 ret = 1; + u8 numTrainers = 1; u8 approachDistance; if (InTrainerHill() == TRUE) @@ -268,16 +283,16 @@ static u8 CheckTrainer(u8 objectEventId) if (GetMonsStateToDoubles_2() != 0) return 0; - ret = 2; + numTrainers = 2; } gApproachingTrainers[gNoOfApproachingTrainers].objectEventId = objectEventId; gApproachingTrainers[gNoOfApproachingTrainers].trainerScriptPtr = scriptPtr; gApproachingTrainers[gNoOfApproachingTrainers].radius = approachDistance; - TrainerApproachPlayer(&gObjectEvents[objectEventId], approachDistance - 1); + InitTrainerApproachTask(&gObjectEvents[objectEventId], approachDistance - 1); gNoOfApproachingTrainers++; - return ret; + return numTrainers; } return 0; @@ -357,8 +372,7 @@ static u8 GetTrainerApproachDistanceEast(struct ObjectEvent *trainerObj, s16 ran static u8 CheckPathBetweenTrainerAndPlayer(struct ObjectEvent *trainerObj, u8 approachDistance, u8 direction) { s16 x, y; - u8 unk19_temp; - u8 unk19b_temp; + u8 rangeX, rangeY; u8 i; u8 collision; @@ -376,17 +390,16 @@ static u8 CheckPathBetweenTrainerAndPlayer(struct ObjectEvent *trainerObj, u8 ap return 0; } - // preserve mapobj_unk_19 before clearing. - unk19_temp = trainerObj->rangeX; - unk19b_temp = trainerObj->rangeY; + rangeX = trainerObj->rangeX; + rangeY = trainerObj->rangeY; trainerObj->rangeX = 0; trainerObj->rangeY = 0; collision = GetCollisionAtCoords(trainerObj, x, y, direction); - trainerObj->rangeX = unk19_temp; - trainerObj->rangeY = unk19b_temp; - if (collision == 4) + trainerObj->rangeX = rangeX; + trainerObj->rangeY = rangeY; + if (collision == COLLISION_OBJECT_EVENT) return approachDistance; return 0; @@ -397,7 +410,7 @@ static u8 CheckPathBetweenTrainerAndPlayer(struct ObjectEvent *trainerObj, u8 ap #define tOutOfAshSpriteId data[4] #define tTrainerObjectEventId data[7] -static void TrainerApproachPlayer(struct ObjectEvent *trainerObj, u8 range) +static void InitTrainerApproachTask(struct ObjectEvent *trainerObj, u8 range) { struct Task *task; @@ -407,7 +420,7 @@ static void TrainerApproachPlayer(struct ObjectEvent *trainerObj, u8 range) task->tTrainerObjectEventId = gApproachingTrainers[gNoOfApproachingTrainers].objectEventId; } -static void sub_80B40C8(TaskFunc followupFunc) +static void StartTrainerApproach(TaskFunc followupFunc) { u8 taskId; TaskFunc taskFunc; @@ -419,7 +432,7 @@ static void sub_80B40C8(TaskFunc followupFunc) taskFunc = Task_RunTrainerSeeFuncList; SetTaskFuncWithFollowupFunc(taskId, taskFunc, followupFunc); - gTasks[taskId].tFuncId = 1; + gTasks[taskId].tFuncId = TRSEE_EXCLAMATION; taskFunc(taskId); } @@ -438,11 +451,12 @@ static void Task_RunTrainerSeeFuncList(u8 taskId) } } -static bool8 sub_80B4178(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) +static bool8 TrainerSeeIdle(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) { return FALSE; } +// TRSEE_EXCLAMATION static bool8 TrainerExclamationMark(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) { u8 direction; @@ -451,10 +465,11 @@ static bool8 TrainerExclamationMark(u8 taskId, struct Task *task, struct ObjectE FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON); direction = GetFaceDirectionMovementAction(trainerObj->facingDirection); ObjectEventSetHeldMovement(trainerObj, direction); - task->tFuncId++; + task->tFuncId++; // TRSEE_EXCLAMATION_WAIT return TRUE; } +// TRSEE_EXCLAMATION_WAIT static bool8 WaitTrainerExclamationMark(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) { if (FieldEffectActiveListContains(FLDEFF_EXCLAMATION_MARK_ICON)) @@ -463,15 +478,16 @@ static bool8 WaitTrainerExclamationMark(u8 taskId, struct Task *task, struct Obj } else { - task->tFuncId++; + task->tFuncId++; // TRSEE_MOVE_TO_PLAYER if (trainerObj->movementType == MOVEMENT_TYPE_TREE_DISGUISE || trainerObj->movementType == MOVEMENT_TYPE_MOUNTAIN_DISGUISE) - task->tFuncId = 6; + task->tFuncId = TRSEE_REVEAL_DISGUISE; if (trainerObj->movementType == MOVEMENT_TYPE_HIDDEN) - task->tFuncId = 8; + task->tFuncId = TRSEE_REVEAL_HIDDEN; return TRUE; } } +// TRSEE_MOVE_TO_PLAYER static bool8 TrainerMoveToPlayer(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) { if (!ObjectEventIsMovementOverridden(trainerObj) || ObjectEventClearHeldMovementIfFinished(trainerObj)) @@ -484,12 +500,13 @@ static bool8 TrainerMoveToPlayer(u8 taskId, struct Task *task, struct ObjectEven else { ObjectEventSetHeldMovement(trainerObj, MOVEMENT_ACTION_FACE_PLAYER); - task->tFuncId++; + task->tFuncId++; // TRSEE_PLAYER_FACE } } return FALSE; } +// TRSEE_PLAYER_FACE static bool8 PlayerFaceApproachingTrainer(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) { struct ObjectEvent *playerObj; @@ -497,6 +514,7 @@ static bool8 PlayerFaceApproachingTrainer(u8 taskId, struct Task *task, struct O if (ObjectEventIsMovementOverridden(trainerObj) && !ObjectEventClearHeldMovementIfFinished(trainerObj)) return FALSE; + // Set trainer's movement type so they stop and remain facing that direction SetTrainerMovementType(trainerObj, GetTrainerFacingDirectionMovementType(trainerObj->facingDirection)); TryOverrideTemplateCoordsForObjectEvent(trainerObj, GetTrainerFacingDirectionMovementType(trainerObj->facingDirection)); OverrideTemplateCoordsForObjectEvent(trainerObj); @@ -507,10 +525,11 @@ static bool8 PlayerFaceApproachingTrainer(u8 taskId, struct Task *task, struct O sub_808BCE8(); ObjectEventSetHeldMovement(&gObjectEvents[gPlayerAvatar.objectEventId], GetFaceDirectionMovementAction(GetOppositeDirection(trainerObj->facingDirection))); - task->tFuncId++; + task->tFuncId++; // TRSEE_PLAYER_FACE_WAIT return FALSE; } +// TRSEE_PLAYER_FACE_WAIT static bool8 WaitPlayerFaceApproachingTrainer(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) { struct ObjectEvent *playerObj = &gObjectEvents[gPlayerAvatar.objectEventId]; @@ -521,25 +540,28 @@ static bool8 WaitPlayerFaceApproachingTrainer(u8 taskId, struct Task *task, stru return FALSE; } +// TRSEE_REVEAL_DISGUISE static bool8 RevealDisguisedTrainer(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) { if (!ObjectEventIsMovementOverridden(trainerObj) || ObjectEventClearHeldMovementIfFinished(trainerObj)) { ObjectEventSetHeldMovement(trainerObj, MOVEMENT_ACTION_REVEAL_TRAINER); - task->tFuncId++; + task->tFuncId++; // TRSEE_REVEAL_DISGUISE_WAIT } return FALSE; } +// TRSEE_REVEAL_DISGUISE_WAIT static bool8 WaitRevealDisguisedTrainer(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) { if (ObjectEventClearHeldMovementIfFinished(trainerObj)) - task->tFuncId = 3; + task->tFuncId = TRSEE_MOVE_TO_PLAYER; return FALSE; } +// TRSEE_REVEAL_HIDDEN static bool8 RevealHiddenTrainer(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) { if (!ObjectEventIsMovementOverridden(trainerObj) @@ -551,6 +573,7 @@ static bool8 RevealHiddenTrainer(u8 taskId, struct Task *task, struct ObjectEven return FALSE; } +// TRSEE_HIDDEN_POP_OUT static bool8 PopOutOfAshHiddenTrainer(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) { if (ObjectEventCheckHeldMovementStatus(trainerObj)) @@ -565,6 +588,7 @@ static bool8 PopOutOfAshHiddenTrainer(u8 taskId, struct Task *task, struct Objec return FALSE; } +// TRSEE_HIDDEN_JUMP static bool8 JumpInPlaceHiddenTrainer(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) { struct Sprite *sprite; @@ -584,33 +608,34 @@ static bool8 JumpInPlaceHiddenTrainer(u8 taskId, struct Task *task, struct Objec return FALSE; } +// TRSEE_REVEAL_HIDDEN_WAIT static bool8 WaitRevealHiddenTrainer(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj) { if (!FieldEffectActiveListContains(FLDEFF_ASH_PUFF)) - task->tFuncId = 3; + task->tFuncId = TRSEE_MOVE_TO_PLAYER; return FALSE; } -#undef tFuncId #undef tTrainerRange #undef tOutOfAshSpriteId #undef tTrainerObjectEventId -static void sub_80B44C8(u8 taskId) +#define tObjEvent data[1] + +static void Task_SetHiddenTrainerMovement(u8 taskId) { struct Task *task = &gTasks[taskId]; struct ObjectEvent *objEvent; - // another objEvent loaded into by loadword? - LoadWordFromTwoHalfwords(&task->data[1], (u32 *)&objEvent); + LoadWordFromTwoHalfwords(&task->tObjEvent, (u32 *)&objEvent); if (!task->data[7]) { ObjectEventClearHeldMovement(objEvent); task->data[7]++; } - sTrainerSeeFuncList2[task->data[0]](taskId, task, objEvent); - if (task->data[0] == 3 && !FieldEffectActiveListContains(FLDEFF_ASH_PUFF)) + sTrainerSeeFuncList2[task->tFuncId](taskId, task, objEvent); + if (task->tFuncId == ((int)ARRAY_COUNT(sTrainerSeeFuncList2) - 1) && !FieldEffectActiveListContains(FLDEFF_ASH_PUFF)) { SetTrainerMovementType(objEvent, GetTrainerFacingDirectionMovementType(objEvent->facingDirection)); TryOverrideTemplateCoordsForObjectEvent(objEvent, GetTrainerFacingDirectionMovementType(objEvent->facingDirection)); @@ -622,17 +647,18 @@ static void sub_80B44C8(u8 taskId) } } -void sub_80B4578(struct ObjectEvent *var) +// Called when a "buried" trainer has the reveal_trainer movement applied, from direct interaction +void SetHiddenTrainerMovement(struct ObjectEvent *objEvent) { - StoreWordInTwoHalfwords(&gTasks[CreateTask(sub_80B44C8, 0)].data[1], (u32)var); + StoreWordInTwoHalfwords(&gTasks[CreateTask(Task_SetHiddenTrainerMovement, 0)].tObjEvent, (u32)objEvent); } -void EndTrainerApproach(void) +void DoTrainerApproach(void) { - sub_80B40C8(Task_DestroyTrainerApproachTask); + StartTrainerApproach(Task_EndTrainerApproach); } -static void Task_DestroyTrainerApproachTask(u8 taskId) +static void Task_EndTrainerApproach(u8 taskId) { DestroyTask(taskId); EnableBothScriptContexts(); |